public class Policy
extends java.lang.Object
implements java.io.Serializable, java.lang.Cloneable
Contains information about a managed policy.
This data type is used as a response element in the CreatePolicy, GetPolicy, and ListPolicies actions.
For more information about managed policies, refer to Managed Policies and Inline Policies in the Using IAM guide.
Modifier and Type | Field and Description |
---|---|
private java.lang.String |
arn |
private java.lang.Integer |
attachmentCount
The number of entities (users, groups, and roles) that the policy is
attached to.
|
private java.util.Date |
createDate
The date and time, in ISO 8601
date-time format, when the policy was created.
|
private java.lang.String |
defaultVersionId
The identifier for the version of the policy that is set as the default
version.
|
private java.lang.String |
description
A friendly description of the policy.
|
private java.lang.Boolean |
isAttachable
Specifies whether the policy can be attached to an IAM user, group, or
role.
|
private java.lang.String |
path
The path to the policy.
|
private java.lang.String |
policyId
The stable and unique string identifying the policy.
|
private java.lang.String |
policyName
The friendly name (not ARN) identifying the policy.
|
private java.util.Date |
updateDate
The date and time, in ISO 8601
date-time format, when the policy was last updated.
|
Constructor and Description |
---|
Policy() |
Modifier and Type | Method and Description |
---|---|
Policy |
clone() |
boolean |
equals(java.lang.Object obj) |
java.lang.String |
getArn() |
java.lang.Integer |
getAttachmentCount()
The number of entities (users, groups, and roles) that the policy is
attached to.
|
java.util.Date |
getCreateDate()
The date and time, in ISO 8601
date-time format, when the policy was created.
|
java.lang.String |
getDefaultVersionId()
The identifier for the version of the policy that is set as the default
version.
|
java.lang.String |
getDescription()
A friendly description of the policy.
|
java.lang.Boolean |
getIsAttachable()
Specifies whether the policy can be attached to an IAM user, group, or
role.
|
java.lang.String |
getPath()
The path to the policy.
|
java.lang.String |
getPolicyId()
The stable and unique string identifying the policy.
|
java.lang.String |
getPolicyName()
The friendly name (not ARN) identifying the policy.
|
java.util.Date |
getUpdateDate()
The date and time, in ISO 8601
date-time format, when the policy was last updated.
|
int |
hashCode() |
java.lang.Boolean |
isAttachable()
Specifies whether the policy can be attached to an IAM user, group, or
role.
|
void |
setArn(java.lang.String arn) |
void |
setAttachmentCount(java.lang.Integer attachmentCount)
The number of entities (users, groups, and roles) that the policy is
attached to.
|
void |
setCreateDate(java.util.Date createDate)
The date and time, in ISO 8601
date-time format, when the policy was created.
|
void |
setDefaultVersionId(java.lang.String defaultVersionId)
The identifier for the version of the policy that is set as the default
version.
|
void |
setDescription(java.lang.String description)
A friendly description of the policy.
|
void |
setIsAttachable(java.lang.Boolean isAttachable)
Specifies whether the policy can be attached to an IAM user, group, or
role.
|
void |
setPath(java.lang.String path)
The path to the policy.
|
void |
setPolicyId(java.lang.String policyId)
The stable and unique string identifying the policy.
|
void |
setPolicyName(java.lang.String policyName)
The friendly name (not ARN) identifying the policy.
|
void |
setUpdateDate(java.util.Date updateDate)
The date and time, in ISO 8601
date-time format, when the policy was last updated.
|
java.lang.String |
toString()
Returns a string representation of this object; useful for testing and
debugging.
|
Policy |
withArn(java.lang.String arn) |
Policy |
withAttachmentCount(java.lang.Integer attachmentCount)
The number of entities (users, groups, and roles) that the policy is
attached to.
|
Policy |
withCreateDate(java.util.Date createDate)
The date and time, in ISO 8601
date-time format, when the policy was created.
|
Policy |
withDefaultVersionId(java.lang.String defaultVersionId)
The identifier for the version of the policy that is set as the default
version.
|
Policy |
withDescription(java.lang.String description)
A friendly description of the policy.
|
Policy |
withIsAttachable(java.lang.Boolean isAttachable)
Specifies whether the policy can be attached to an IAM user, group, or
role.
|
Policy |
withPath(java.lang.String path)
The path to the policy.
|
Policy |
withPolicyId(java.lang.String policyId)
The stable and unique string identifying the policy.
|
Policy |
withPolicyName(java.lang.String policyName)
The friendly name (not ARN) identifying the policy.
|
Policy |
withUpdateDate(java.util.Date updateDate)
The date and time, in ISO 8601
date-time format, when the policy was last updated.
|
private java.lang.String policyName
The friendly name (not ARN) identifying the policy.
private java.lang.String policyId
The stable and unique string identifying the policy.
For more information about IDs, see IAM Identifiers in the Using IAM guide.
private java.lang.String arn
private java.lang.String path
The path to the policy.
For more information about paths, see IAM Identifiers in the Using IAM guide.
private java.lang.String defaultVersionId
The identifier for the version of the policy that is set as the default version.
private java.lang.Integer attachmentCount
The number of entities (users, groups, and roles) that the policy is attached to.
private java.lang.Boolean isAttachable
Specifies whether the policy can be attached to an IAM user, group, or role.
private java.lang.String 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.
private java.util.Date createDate
The date and time, in ISO 8601 date-time format, when the policy was created.
private java.util.Date 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 setPolicyName(java.lang.String policyName)
The friendly name (not ARN) identifying the policy.
policyName
- The friendly name (not ARN) identifying the policy.public java.lang.String getPolicyName()
The friendly name (not ARN) identifying the policy.
public Policy withPolicyName(java.lang.String policyName)
The friendly name (not ARN) identifying the policy.
policyName
- The friendly name (not ARN) identifying the policy.public void setPolicyId(java.lang.String policyId)
The stable and unique string identifying the policy.
For more information about IDs, see IAM Identifiers in the Using IAM guide.
policyId
- The stable and unique string identifying the policy.
For more information about IDs, see IAM Identifiers in the Using IAM guide.
public java.lang.String getPolicyId()
The stable and unique string identifying the policy.
For more information about IDs, see IAM Identifiers in the Using IAM guide.
For more information about IDs, see IAM Identifiers in the Using IAM guide.
public Policy withPolicyId(java.lang.String policyId)
The stable and unique string identifying the policy.
For more information about IDs, see IAM Identifiers in the Using IAM guide.
policyId
- The stable and unique string identifying the policy.
For more information about IDs, see IAM Identifiers in the Using IAM guide.
public void setArn(java.lang.String arn)
arn
- public java.lang.String getArn()
public Policy withArn(java.lang.String arn)
arn
- public void setPath(java.lang.String path)
The path to the policy.
For more information about paths, see IAM Identifiers in the Using IAM guide.
path
- The path to the policy.
For more information about paths, see IAM Identifiers in the Using IAM guide.
public java.lang.String getPath()
The path to the policy.
For more information about paths, see IAM Identifiers in the Using IAM guide.
For more information about paths, see IAM Identifiers in the Using IAM guide.
public Policy withPath(java.lang.String path)
The path to the policy.
For more information about paths, see IAM Identifiers in the Using IAM guide.
path
- The path to the policy.
For more information about paths, see IAM Identifiers in the Using IAM guide.
public void setDefaultVersionId(java.lang.String defaultVersionId)
The identifier for the version of the policy that is set as the default version.
defaultVersionId
- The identifier for the version of the policy that is set as the
default version.public java.lang.String getDefaultVersionId()
The identifier for the version of the policy that is set as the default version.
public Policy withDefaultVersionId(java.lang.String defaultVersionId)
The identifier for the version of the policy that is set as the default version.
defaultVersionId
- The identifier for the version of the policy that is set as the
default version.public void setAttachmentCount(java.lang.Integer attachmentCount)
The number of entities (users, groups, and roles) that the policy is attached to.
attachmentCount
- The number of entities (users, groups, and roles) that the policy
is attached to.public java.lang.Integer getAttachmentCount()
The number of entities (users, groups, and roles) that the policy is attached to.
public Policy withAttachmentCount(java.lang.Integer attachmentCount)
The number of entities (users, groups, and roles) that the policy is attached to.
attachmentCount
- The number of entities (users, groups, and roles) that the policy
is attached to.public void setIsAttachable(java.lang.Boolean isAttachable)
Specifies whether the policy can be attached to an IAM user, group, or role.
isAttachable
- Specifies whether the policy can be attached to an IAM user,
group, or role.public java.lang.Boolean getIsAttachable()
Specifies whether the policy can be attached to an IAM user, group, or role.
public Policy withIsAttachable(java.lang.Boolean isAttachable)
Specifies whether the policy can be attached to an IAM user, group, or role.
isAttachable
- Specifies whether the policy can be attached to an IAM user,
group, or role.public java.lang.Boolean isAttachable()
Specifies whether the policy can be attached to an IAM user, group, or role.
public void setDescription(java.lang.String 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.
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 java.lang.String getDescription()
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.
This element is included in the response to the GetPolicy operation. It is not included in the response to the ListPolicies operation.
public Policy withDescription(java.lang.String 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.
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 setCreateDate(java.util.Date createDate)
The date and time, in ISO 8601 date-time format, when the policy was created.
createDate
- The date and time, in ISO
8601 date-time format, when the policy was created.public java.util.Date getCreateDate()
The date and time, in ISO 8601 date-time format, when the policy was created.
public Policy withCreateDate(java.util.Date createDate)
The date and time, in ISO 8601 date-time format, when the policy was created.
createDate
- The date and time, in ISO
8601 date-time format, when the policy was created.public void setUpdateDate(java.util.Date 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.
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 java.util.Date getUpdateDate()
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.
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 Policy withUpdateDate(java.util.Date 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.
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 java.lang.String toString()
toString
in class java.lang.Object
Object.toString()
public boolean equals(java.lang.Object obj)
equals
in class java.lang.Object
public int hashCode()
hashCode
in class java.lang.Object
public Policy clone()
clone
in class java.lang.Object