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

Creates a new version of the specified managed policy. To update a managed policy, you create a new policy version. A managed policy can have up to five versions. If the policy has five versions, you must delete an existing version using DeletePolicyVersion before you create a new version.

Optionally, you can set the new version as the policy's default version. The default version is the operative version; that is, the version that is in effect for the IAM users, groups, and roles that the policy is attached to.

For more information about managed policy versions, see Versioning for Managed Policies in the Using IAM guide.

 
 public class CreatePolicyVersionRequest extends AmazonWebServiceRequest implements SerializableCloneable {

    
The Amazon Resource Name (ARN). ARNs are unique identifiers for AWS resources.

For more information about ARNs, go to Amazon Resource Names (ARNs) and AWS Service Namespaces in the AWS General Reference.

Constraints:
Length: 20 - 2048

 
     private String policyArn;

    
The policy document.

Constraints:
Length: 1 - 131072
Pattern: [\u0009\u000A\u000D\u0020-\u00FF]+

 
     private String policyDocument;

    
Specifies whether to set this version as the policy's default version.

When this parameter is true, the new policy version becomes the operative version; that is, the version that is in effect for the IAM users, groups, and roles that the policy is attached to.

For more information about managed policy versions, see Versioning for Managed Policies in the Using IAM guide.

 
     private Boolean setAsDefault;

    
The Amazon Resource Name (ARN). ARNs are unique identifiers for AWS resources.

For more information about ARNs, go to Amazon Resource Names (ARNs) and AWS Service Namespaces in the AWS General Reference.

Constraints:
Length: 20 - 2048

Returns:
The Amazon Resource Name (ARN). ARNs are unique identifiers for AWS resources.

For more information about ARNs, go to Amazon Resource Names (ARNs) and AWS Service Namespaces in the AWS General Reference.

 
     public String getPolicyArn() {
         return ;
     }
    
    
The Amazon Resource Name (ARN). ARNs are unique identifiers for AWS resources.

For more information about ARNs, go to Amazon Resource Names (ARNs) and AWS Service Namespaces in the AWS General Reference.

Constraints:
Length: 20 - 2048

Parameters:
policyArn The Amazon Resource Name (ARN). ARNs are unique identifiers for AWS resources.

For more information about ARNs, go to Amazon Resource Names (ARNs) and AWS Service Namespaces in the AWS General Reference.

    public void setPolicyArn(String policyArn) {
        this. = policyArn;
    }
    
    
The Amazon Resource Name (ARN). ARNs are unique identifiers for AWS resources.

For more information about ARNs, go to Amazon Resource Names (ARNs) and AWS Service Namespaces in the AWS General Reference.

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

Constraints:
Length: 20 - 2048

Parameters:
policyArn The Amazon Resource Name (ARN). ARNs are unique identifiers for AWS resources.

For more information about ARNs, go to Amazon Resource Names (ARNs) and AWS Service Namespaces in the AWS General Reference.

Returns:
A reference to this updated object so that method calls can be chained together.
    public CreatePolicyVersionRequest withPolicyArn(String policyArn) {
        this. = policyArn;
        return this;
    }

    
The policy document.

Constraints:
Length: 1 - 131072
Pattern: [\u0009\u000A\u000D\u0020-\u00FF]+

Returns:
The policy document.
    public String getPolicyDocument() {
        return ;
    }
    
    
The policy document.

Constraints:
Length: 1 - 131072
Pattern: [\u0009\u000A\u000D\u0020-\u00FF]+

Parameters:
policyDocument The policy document.
    public void setPolicyDocument(String policyDocument) {
        this. = policyDocument;
    }
    
    
The policy document.

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

Constraints:
Length: 1 - 131072
Pattern: [\u0009\u000A\u000D\u0020-\u00FF]+

Parameters:
policyDocument The policy document.
Returns:
A reference to this updated object so that method calls can be chained together.
    public CreatePolicyVersionRequest withPolicyDocument(String policyDocument) {
        this. = policyDocument;
        return this;
    }

    
Specifies whether to set this version as the policy's default version.

When this parameter is true, the new policy version becomes the operative version; that is, the version that is in effect for the IAM users, groups, and roles that the policy is attached to.

For more information about managed policy versions, see Versioning for Managed Policies in the Using IAM guide.

Returns:
Specifies whether to set this version as the policy's default version.

When this parameter is true, the new policy version becomes the operative version; that is, the version that is in effect for the IAM users, groups, and roles that the policy is attached to.

For more information about managed policy versions, see Versioning for Managed Policies in the Using IAM guide.

    public Boolean isSetAsDefault() {
        return ;
    }
    
    
Specifies whether to set this version as the policy's default version.

When this parameter is true, the new policy version becomes the operative version; that is, the version that is in effect for the IAM users, groups, and roles that the policy is attached to.

For more information about managed policy versions, see Versioning for Managed Policies in the Using IAM guide.

Parameters:
setAsDefault Specifies whether to set this version as the policy's default version.

When this parameter is true, the new policy version becomes the operative version; that is, the version that is in effect for the IAM users, groups, and roles that the policy is attached to.

For more information about managed policy versions, see Versioning for Managed Policies in the Using IAM guide.

    public void setSetAsDefault(Boolean setAsDefault) {
        this. = setAsDefault;
    }
    
    
Specifies whether to set this version as the policy's default version.

When this parameter is true, the new policy version becomes the operative version; that is, the version that is in effect for the IAM users, groups, and roles that the policy is attached to.

For more information about managed policy versions, see Versioning for Managed Policies in the Using IAM guide.

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

Parameters:
setAsDefault Specifies whether to set this version as the policy's default version.

When this parameter is true, the new policy version becomes the operative version; that is, the version that is in effect for the IAM users, groups, and roles that the policy is attached to.

For more information about managed policy versions, see Versioning for Managed Policies in the Using IAM guide.

Returns:
A reference to this updated object so that method calls can be chained together.
    public CreatePolicyVersionRequest withSetAsDefault(Boolean setAsDefault) {
        this. = setAsDefault;
        return this;
    }

    
Specifies whether to set this version as the policy's default version.

When this parameter is true, the new policy version becomes the operative version; that is, the version that is in effect for the IAM users, groups, and roles that the policy is attached to.

For more information about managed policy versions, see Versioning for Managed Policies in the Using IAM guide.

Returns:
Specifies whether to set this version as the policy's default version.

When this parameter is true, the new policy version becomes the operative version; that is, the version that is in effect for the IAM users, groups, and roles that the policy is attached to.

For more information about managed policy versions, see Versioning for Managed Policies in the Using IAM guide.

    public Boolean getSetAsDefault() {
        return ;
    }

    
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 (getPolicyArn() != nullsb.append("PolicyArn: " + getPolicyArn() + ",");
        if (getPolicyDocument() != nullsb.append("PolicyDocument: " + getPolicyDocument() + ",");
        if (isSetAsDefault() != nullsb.append("SetAsDefault: " + isSetAsDefault() );
        sb.append("}");
        return sb.toString();
    }
    
    @Override
    public int hashCode() {
        final int prime = 31;
        int hashCode = 1;
        
        hashCode = prime * hashCode + ((getPolicyArn() == null) ? 0 : getPolicyArn().hashCode()); 
        hashCode = prime * hashCode + ((getPolicyDocument() == null) ? 0 : getPolicyDocument().hashCode()); 
        hashCode = prime * hashCode + ((isSetAsDefault() == null) ? 0 : isSetAsDefault().hashCode()); 
        return hashCode;
    }
    
    @Override
    public boolean equals(Object obj) {
        if (this == objreturn true;
        if (obj == nullreturn false;
        if (obj instanceof CreatePolicyVersionRequest == falsereturn false;
        
        if (other.getPolicyArn() == null ^ this.getPolicyArn() == nullreturn false;
        if (other.getPolicyArn() != null && other.getPolicyArn().equals(this.getPolicyArn()) == falsereturn false
        if (other.getPolicyDocument() == null ^ this.getPolicyDocument() == nullreturn false;
        if (other.getPolicyDocument() != null && other.getPolicyDocument().equals(this.getPolicyDocument()) == falsereturn false
        if (other.isSetAsDefault() == null ^ this.isSetAsDefault() == nullreturn false;
        if (other.isSetAsDefault() != null && other.isSetAsDefault().equals(this.isSetAsDefault()) == falsereturn false
        return true;
    }
    
    @Override
    public CreatePolicyVersionRequest clone() {
        
            return (CreatePolicyVersionRequestsuper.clone();
    }
}
    
New to GrepCode? Check out our FAQ X