/* * Copyright 2018-2023 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; import java.io.Serializable; import javax.annotation.Generated; import com.amazonaws.AmazonWebServiceRequest; /** * * @see AWS API * Documentation */ @Generated("com.amazonaws:aws-java-sdk-code-generator") public class CreatePolicyVersionRequest extends com.amazonaws.AmazonWebServiceRequest implements Serializable, Cloneable { /** *

* The Amazon Resource Name (ARN) of the IAM policy to which you want to add a new version. *

*

* For more information about ARNs, see Amazon Resource Names * (ARNs) in the Amazon Web Services General Reference. *

*/ private String policyArn; /** *

* The JSON policy document that you want to use as the content for this new version of the policy. *

*

* You must provide policies in JSON format in IAM. However, for CloudFormation templates formatted in YAML, you can * provide the policy in JSON or YAML format. CloudFormation always converts a YAML policy to JSON format before * submitting it to IAM. *

*

* The maximum length of the policy document that you can pass in this operation, including whitespace, is listed * below. To view the maximum character counts of a managed policy with no whitespaces, see IAM and STS character quotas. *

*

* The regex pattern used to validate this parameter is a string of * characters consisting of the following: *

* */ 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, it * becomes 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 IAM User Guide. *

*/ private Boolean setAsDefault; /** *

* The Amazon Resource Name (ARN) of the IAM policy to which you want to add a new version. *

*

* For more information about ARNs, see Amazon Resource Names * (ARNs) in the Amazon Web Services General Reference. *

* * @param policyArn * The Amazon Resource Name (ARN) of the IAM policy to which you want to add a new version.

*

* For more information about ARNs, see Amazon Resource Names * (ARNs) in the Amazon Web Services General Reference. */ public void setPolicyArn(String policyArn) { this.policyArn = policyArn; } /** *

* The Amazon Resource Name (ARN) of the IAM policy to which you want to add a new version. *

*

* For more information about ARNs, see Amazon Resource Names * (ARNs) in the Amazon Web Services General Reference. *

* * @return The Amazon Resource Name (ARN) of the IAM policy to which you want to add a new version.

*

* For more information about ARNs, see Amazon Resource Names * (ARNs) in the Amazon Web Services General Reference. */ public String getPolicyArn() { return this.policyArn; } /** *

* The Amazon Resource Name (ARN) of the IAM policy to which you want to add a new version. *

*

* For more information about ARNs, see Amazon Resource Names * (ARNs) in the Amazon Web Services General Reference. *

* * @param policyArn * The Amazon Resource Name (ARN) of the IAM policy to which you want to add a new version.

*

* For more information about ARNs, see Amazon Resource Names * (ARNs) in the Amazon Web Services General Reference. * @return Returns a reference to this object so that method calls can be chained together. */ public CreatePolicyVersionRequest withPolicyArn(String policyArn) { setPolicyArn(policyArn); return this; } /** *

* The JSON policy document that you want to use as the content for this new version of the policy. *

*

* You must provide policies in JSON format in IAM. However, for CloudFormation templates formatted in YAML, you can * provide the policy in JSON or YAML format. CloudFormation always converts a YAML policy to JSON format before * submitting it to IAM. *

*

* The maximum length of the policy document that you can pass in this operation, including whitespace, is listed * below. To view the maximum character counts of a managed policy with no whitespaces, see IAM and STS character quotas. *

*

* The regex pattern used to validate this parameter is a string of * characters consisting of the following: *

* * * @param policyDocument * The JSON policy document that you want to use as the content for this new version of the policy.

*

* You must provide policies in JSON format in IAM. However, for CloudFormation templates formatted in YAML, * you can provide the policy in JSON or YAML format. CloudFormation always converts a YAML policy to JSON * format before submitting it to IAM. *

*

* The maximum length of the policy document that you can pass in this operation, including whitespace, is * listed below. To view the maximum character counts of a managed policy with no whitespaces, see IAM and STS character quotas. *

*

* The regex pattern used to validate this parameter is a * string of characters consisting of the following: *

*