/* * 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; /** *
* Contains information about a managed policy. *
** This data type is used as a response element in the CreatePolicy, GetPolicy, and ListPolicies * operations. *
** For more information about managed policies, refer to Managed policies and inline * policies in the IAM User Guide. *
* * @see AWS API Documentation */ @Generated("com.amazonaws:aws-java-sdk-code-generator") public class Policy implements Serializable, Cloneable { /** ** The friendly name (not ARN) identifying the policy. *
*/ private String policyName; /** ** The stable and unique string identifying the policy. *
** For more information about IDs, see IAM identifiers in the IAM * User Guide. *
*/ private String policyId; private String arn; /** ** The path to the policy. *
** For more information about paths, see IAM identifiers in the IAM * User Guide. *
*/ private String path; /** ** The identifier for the version of the policy that is set as the default version. *
*/ private String defaultVersionId; /** ** The number of entities (users, groups, and roles) that the policy is attached to. *
*/ private Integer attachmentCount; /** ** The number of entities (users and roles) for which the policy is used to set the permissions boundary. *
** For more information about permissions boundaries, see Permissions boundaries * for IAM identities in the IAM User Guide. *
*/ private Integer permissionsBoundaryUsageCount; /** ** Specifies whether the policy can be attached to an IAM user, group, or role. *
*/ private Boolean isAttachable; /** ** A friendly description of the policy. *
** This element is included in the response to the GetPolicy operation. It is not included in the response to * the ListPolicies operation. *
*/ private String description; /** ** The date and time, in ISO 8601 date-time format, when the policy was * created. *
*/ private java.util.Date createDate; /** ** The date and time, in ISO 8601 date-time format, when the policy was * last updated. *
** When a policy has only one version, this field contains the date and time when the policy was created. When a * policy has more than one version, this field contains the date and time when the most recent policy version was * created. *
*/ private java.util.Date updateDate; /** ** A list of tags that are attached to the instance profile. For more information about tagging, see Tagging IAM resources in the IAM User * Guide. *
*/ private com.amazonaws.internal.SdkInternalList* The friendly name (not ARN) identifying the policy. *
* * @param policyName * The friendly name (not ARN) identifying the policy. */ public void setPolicyName(String policyName) { this.policyName = policyName; } /** ** The friendly name (not ARN) identifying the policy. *
* * @return The friendly name (not ARN) identifying the policy. */ public String getPolicyName() { return this.policyName; } /** ** The friendly name (not ARN) identifying the policy. *
* * @param policyName * The friendly name (not ARN) identifying the policy. * @return Returns a reference to this object so that method calls can be chained together. */ public Policy withPolicyName(String policyName) { setPolicyName(policyName); return this; } /** ** The stable and unique string identifying the policy. *
** For more information about IDs, see IAM identifiers in the IAM * User Guide. *
* * @param policyId * The stable and unique string identifying the policy. ** For more information about IDs, see IAM identifiers in the * IAM User Guide. */ public void setPolicyId(String policyId) { this.policyId = policyId; } /** *
* The stable and unique string identifying the policy. *
** For more information about IDs, see IAM identifiers in the IAM * User Guide. *
* * @return The stable and unique string identifying the policy. ** For more information about IDs, see IAM identifiers in the * IAM User Guide. */ public String getPolicyId() { return this.policyId; } /** *
* The stable and unique string identifying the policy. *
** For more information about IDs, see IAM identifiers in the IAM * User Guide. *
* * @param policyId * The stable and unique string identifying the policy. ** For more information about IDs, see IAM identifiers in the * IAM User Guide. * @return Returns a reference to this object so that method calls can be chained together. */ public Policy withPolicyId(String policyId) { setPolicyId(policyId); return this; } /** * @param arn */ public void setArn(String arn) { this.arn = arn; } /** * @return */ public String getArn() { return this.arn; } /** * @param arn * @return Returns a reference to this object so that method calls can be chained together. */ public Policy withArn(String arn) { setArn(arn); return this; } /** *
* The path to the policy. *
** For more information about paths, see IAM identifiers in the IAM * User Guide. *
* * @param path * The path to the policy. ** For more information about paths, see IAM identifiers in the * IAM User Guide. */ public void setPath(String path) { this.path = path; } /** *
* The path to the policy. *
** For more information about paths, see IAM identifiers in the IAM * User Guide. *
* * @return The path to the policy. ** For more information about paths, see IAM identifiers in the * IAM User Guide. */ public String getPath() { return this.path; } /** *
* The path to the policy. *
** For more information about paths, see IAM identifiers in the IAM * User Guide. *
* * @param path * The path to the policy. ** For more information about paths, see IAM identifiers in the * IAM User Guide. * @return Returns a reference to this object so that method calls can be chained together. */ public Policy withPath(String path) { setPath(path); return this; } /** *
* The identifier for the version of the policy that is set as the default version. *
* * @param defaultVersionId * The identifier for the version of the policy that is set as the default version. */ public void setDefaultVersionId(String defaultVersionId) { this.defaultVersionId = defaultVersionId; } /** ** The identifier for the version of the policy that is set as the default version. *
* * @return The identifier for the version of the policy that is set as the default version. */ public String getDefaultVersionId() { return this.defaultVersionId; } /** ** The identifier for the version of the policy that is set as the default version. *
* * @param defaultVersionId * The identifier for the version of the policy that is set as the default version. * @return Returns a reference to this object so that method calls can be chained together. */ public Policy withDefaultVersionId(String defaultVersionId) { setDefaultVersionId(defaultVersionId); return this; } /** ** The number of entities (users, groups, and roles) that the policy is attached to. *
* * @param attachmentCount * The number of entities (users, groups, and roles) that the policy is attached to. */ public void setAttachmentCount(Integer attachmentCount) { this.attachmentCount = attachmentCount; } /** ** The number of entities (users, groups, and roles) that the policy is attached to. *
* * @return The number of entities (users, groups, and roles) that the policy is attached to. */ public Integer getAttachmentCount() { return this.attachmentCount; } /** ** The number of entities (users, groups, and roles) that the policy is attached to. *
* * @param attachmentCount * The number of entities (users, groups, and roles) that the policy is attached to. * @return Returns a reference to this object so that method calls can be chained together. */ public Policy withAttachmentCount(Integer attachmentCount) { setAttachmentCount(attachmentCount); return this; } /** ** The number of entities (users and roles) for which the policy is used to set the permissions boundary. *
** For more information about permissions boundaries, see Permissions boundaries * for IAM identities in the IAM User Guide. *
* * @param permissionsBoundaryUsageCount * The number of entities (users and roles) for which the policy is used to set the permissions boundary. * ** For more information about permissions boundaries, see Permissions * boundaries for IAM identities in the IAM User Guide. */ public void setPermissionsBoundaryUsageCount(Integer permissionsBoundaryUsageCount) { this.permissionsBoundaryUsageCount = permissionsBoundaryUsageCount; } /** *
* The number of entities (users and roles) for which the policy is used to set the permissions boundary. *
** For more information about permissions boundaries, see Permissions boundaries * for IAM identities in the IAM User Guide. *
* * @return The number of entities (users and roles) for which the policy is used to set the permissions boundary. * ** For more information about permissions boundaries, see Permissions * boundaries for IAM identities in the IAM User Guide. */ public Integer getPermissionsBoundaryUsageCount() { return this.permissionsBoundaryUsageCount; } /** *
* The number of entities (users and roles) for which the policy is used to set the permissions boundary. *
** For more information about permissions boundaries, see Permissions boundaries * for IAM identities in the IAM User Guide. *
* * @param permissionsBoundaryUsageCount * The number of entities (users and roles) for which the policy is used to set the permissions boundary. * ** For more information about permissions boundaries, see Permissions * boundaries for IAM identities in the IAM User Guide. * @return Returns a reference to this object so that method calls can be chained together. */ public Policy withPermissionsBoundaryUsageCount(Integer permissionsBoundaryUsageCount) { setPermissionsBoundaryUsageCount(permissionsBoundaryUsageCount); return this; } /** *
* Specifies whether the policy can be attached to an IAM user, group, or role. *
* * @param isAttachable * Specifies whether the policy can be attached to an IAM user, group, or role. */ public void setIsAttachable(Boolean isAttachable) { this.isAttachable = isAttachable; } /** ** Specifies whether the policy can be attached to an IAM user, group, or role. *
* * @return Specifies whether the policy can be attached to an IAM user, group, or role. */ public Boolean getIsAttachable() { return this.isAttachable; } /** ** Specifies whether the policy can be attached to an IAM user, group, or role. *
* * @param isAttachable * Specifies whether the policy can be attached to an IAM user, group, or role. * @return Returns a reference to this object so that method calls can be chained together. */ public Policy withIsAttachable(Boolean isAttachable) { setIsAttachable(isAttachable); return this; } /** ** Specifies whether the policy can be attached to an IAM user, group, or role. *
* * @return Specifies whether the policy can be attached to an IAM user, group, or role. */ public Boolean isAttachable() { return this.isAttachable; } /** ** A friendly description of the policy. *
** This element is included in the response to the GetPolicy operation. It is not included in the response to * the ListPolicies operation. *
* * @param description * A friendly description of the policy. ** This element is included in the response to the GetPolicy operation. It is not included in the * response to the ListPolicies operation. */ public void setDescription(String description) { this.description = description; } /** *
* A friendly description of the policy. *
** This element is included in the response to the GetPolicy operation. It is not included in the response to * the ListPolicies operation. *
* * @return A friendly description of the policy. ** This element is included in the response to the GetPolicy operation. It is not included in the * response to the ListPolicies operation. */ public String getDescription() { return this.description; } /** *
* A friendly description of the policy. *
** This element is included in the response to the GetPolicy operation. It is not included in the response to * the ListPolicies operation. *
* * @param description * A friendly description of the policy. ** This element is included in the response to the GetPolicy operation. It is not included in the * response to the ListPolicies operation. * @return Returns a reference to this object so that method calls can be chained together. */ public Policy withDescription(String description) { setDescription(description); return this; } /** *
* The date and time, in ISO 8601 date-time format, when the policy was * created. *
* * @param createDate * The date and time, in ISO 8601 date-time format, when the * policy was created. */ public void setCreateDate(java.util.Date createDate) { this.createDate = createDate; } /** ** The date and time, in ISO 8601 date-time format, when the policy was * created. *
* * @return The date and time, in ISO 8601 date-time format, when the * policy was created. */ public java.util.Date getCreateDate() { return this.createDate; } /** ** The date and time, in ISO 8601 date-time format, when the policy was * created. *
* * @param createDate * The date and time, in ISO 8601 date-time format, when the * policy was created. * @return Returns a reference to this object so that method calls can be chained together. */ public Policy withCreateDate(java.util.Date createDate) { setCreateDate(createDate); return this; } /** ** The date and time, in ISO 8601 date-time format, when the policy was * last updated. *
** When a policy has only one version, this field contains the date and time when the policy was created. When a * policy has more than one version, this field contains the date and time when the most recent policy version was * created. *
* * @param updateDate * The date and time, in ISO 8601 date-time format, when the * policy was last updated. ** When a policy has only one version, this field contains the date and time when the policy was created. * When a policy has more than one version, this field contains the date and time when the most recent policy * version was created. */ public void setUpdateDate(java.util.Date updateDate) { this.updateDate = updateDate; } /** *
* The date and time, in ISO 8601 date-time format, when the policy was * last updated. *
** When a policy has only one version, this field contains the date and time when the policy was created. When a * policy has more than one version, this field contains the date and time when the most recent policy version was * created. *
* * @return The date and time, in ISO 8601 date-time format, when the * policy was last updated. ** When a policy has only one version, this field contains the date and time when the policy was created. * When a policy has more than one version, this field contains the date and time when the most recent * policy version was created. */ public java.util.Date getUpdateDate() { return this.updateDate; } /** *
* The date and time, in ISO 8601 date-time format, when the policy was * last updated. *
** When a policy has only one version, this field contains the date and time when the policy was created. When a * policy has more than one version, this field contains the date and time when the most recent policy version was * created. *
* * @param updateDate * The date and time, in ISO 8601 date-time format, when the * policy was last updated. ** When a policy has only one version, this field contains the date and time when the policy was created. * When a policy has more than one version, this field contains the date and time when the most recent policy * version was created. * @return Returns a reference to this object so that method calls can be chained together. */ public Policy withUpdateDate(java.util.Date updateDate) { setUpdateDate(updateDate); return this; } /** *
* A list of tags that are attached to the instance profile. For more information about tagging, see Tagging IAM resources in the IAM User * Guide. *
* * @return A list of tags that are attached to the instance profile. For more information about tagging, see Tagging IAM resources in the * IAM User Guide. */ public java.util.List* A list of tags that are attached to the instance profile. For more information about tagging, see Tagging IAM resources in the IAM User * Guide. *
* * @param tags * A list of tags that are attached to the instance profile. For more information about tagging, see Tagging IAM resources in the * IAM User Guide. */ public void setTags(java.util.Collection* A list of tags that are attached to the instance profile. For more information about tagging, see Tagging IAM resources in the IAM User * Guide. *
** NOTE: This method appends the values to the existing list (if any). Use * {@link #setTags(java.util.Collection)} or {@link #withTags(java.util.Collection)} if you want to override the * existing values. *
* * @param tags * A list of tags that are attached to the instance profile. For more information about tagging, see Tagging IAM resources in the * IAM User Guide. * @return Returns a reference to this object so that method calls can be chained together. */ public Policy withTags(Tag... tags) { if (this.tags == null) { setTags(new com.amazonaws.internal.SdkInternalList* A list of tags that are attached to the instance profile. For more information about tagging, see Tagging IAM resources in the IAM User * Guide. *
* * @param tags * A list of tags that are attached to the instance profile. For more information about tagging, see Tagging IAM resources in the * IAM User Guide. * @return Returns a reference to this object so that method calls can be chained together. */ public Policy withTags(java.util.Collection