Class Policy
- All Implemented Interfaces:
Serializable
,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.
- See Also:
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionclone()
boolean
getArn()
The number of entities (users, groups, and roles) that the policy is attached to.The date and time, in ISO 8601 date-time format, when the policy was created.The identifier for the version of the policy that is set as the default version.A friendly description of the policy.Specifies whether the policy can be attached to an IAM user, group, or role.getPath()
The path to the policy.The stable and unique string identifying the policy.The friendly name (not ARN) identifying the policy.The date and time, in ISO 8601 date-time format, when the policy was last updated.int
hashCode()
Specifies whether the policy can be attached to an IAM user, group, or role.void
void
setAttachmentCount
(Integer attachmentCount) The number of entities (users, groups, and roles) that the policy is attached to.void
setCreateDate
(Date createDate) The date and time, in ISO 8601 date-time format, when the policy was created.void
setDefaultVersionId
(String defaultVersionId) The identifier for the version of the policy that is set as the default version.void
setDescription
(String description) A friendly description of the policy.void
setIsAttachable
(Boolean isAttachable) Specifies whether the policy can be attached to an IAM user, group, or role.void
The path to the policy.void
setPolicyId
(String policyId) The stable and unique string identifying the policy.void
setPolicyName
(String policyName) The friendly name (not ARN) identifying the policy.void
setUpdateDate
(Date updateDate) The date and time, in ISO 8601 date-time format, when the policy was last updated.toString()
Returns a string representation of this object; useful for testing and debugging.withAttachmentCount
(Integer attachmentCount) The number of entities (users, groups, and roles) that the policy is attached to.withCreateDate
(Date createDate) The date and time, in ISO 8601 date-time format, when the policy was created.withDefaultVersionId
(String defaultVersionId) The identifier for the version of the policy that is set as the default version.withDescription
(String description) A friendly description of the policy.withIsAttachable
(Boolean isAttachable) Specifies whether the policy can be attached to an IAM user, group, or role.The path to the policy.withPolicyId
(String policyId) The stable and unique string identifying the policy.withPolicyName
(String policyName) The friendly name (not ARN) identifying the policy.withUpdateDate
(Date updateDate) The date and time, in ISO 8601 date-time format, when the policy was last updated.
-
Constructor Details
-
Policy
public Policy()
-
-
Method Details
-
setPolicyName
The friendly name (not ARN) identifying the policy.
- Parameters:
policyName
- The friendly name (not ARN) identifying the policy.
-
getPolicyName
The friendly name (not ARN) identifying the policy.
- Returns:
- The friendly name (not ARN) identifying the policy.
-
withPolicyName
The friendly name (not ARN) identifying the policy.
- Parameters:
policyName
- The friendly name (not ARN) identifying the policy.- Returns:
- Returns a reference to this object so that method calls can be chained together.
-
setPolicyId
The stable and unique string identifying the policy.
For more information about IDs, see IAM Identifiers in the Using IAM guide.
- Parameters:
policyId
- The stable and unique string identifying the policy.For more information about IDs, see IAM Identifiers in the Using IAM guide.
-
getPolicyId
The stable and unique string identifying the policy.
For more information about IDs, see IAM Identifiers in the Using IAM guide.
- Returns:
- The stable and unique string identifying the policy.
For more information about IDs, see IAM Identifiers in the Using IAM guide.
-
withPolicyId
The stable and unique string identifying the policy.
For more information about IDs, see IAM Identifiers in the Using IAM guide.
- Parameters:
policyId
- The stable and unique string identifying the policy.For more information about IDs, see IAM Identifiers in the Using IAM guide.
- Returns:
- Returns a reference to this object so that method calls can be chained together.
-
setArn
- Parameters:
arn
-
-
getArn
- Returns:
-
withArn
- Parameters:
arn
-- Returns:
- Returns a reference to this object so that method calls can be chained together.
-
setPath
The path to the policy.
For more information about paths, see IAM Identifiers in the Using IAM guide.
- Parameters:
path
- The path to the policy.For more information about paths, see IAM Identifiers in the Using IAM guide.
-
getPath
The path to the policy.
For more information about paths, see IAM Identifiers in the Using IAM guide.
- Returns:
- The path to the policy.
For more information about paths, see IAM Identifiers in the Using IAM guide.
-
withPath
The path to the policy.
For more information about paths, see IAM Identifiers in the Using IAM guide.
- Parameters:
path
- The path to the policy.For more information about paths, see IAM Identifiers in the Using IAM guide.
- Returns:
- Returns a reference to this object so that method calls can be chained together.
-
setDefaultVersionId
The identifier for the version of the policy that is set as the default version.
- Parameters:
defaultVersionId
- The identifier for the version of the policy that is set as the default version.
-
getDefaultVersionId
The identifier for the version of the policy that is set as the default version.
- Returns:
- The identifier for the version of the policy that is set as the default version.
-
withDefaultVersionId
The identifier for the version of the policy that is set as the default version.
- Parameters:
defaultVersionId
- The identifier for the version of the policy that is set as the default version.- Returns:
- Returns a reference to this object so that method calls can be chained together.
-
setAttachmentCount
The number of entities (users, groups, and roles) that the policy is attached to.
- Parameters:
attachmentCount
- The number of entities (users, groups, and roles) that the policy is attached to.
-
getAttachmentCount
The number of entities (users, groups, and roles) that the policy is attached to.
- Returns:
- The number of entities (users, groups, and roles) that the policy is attached to.
-
withAttachmentCount
The number of entities (users, groups, and roles) that the policy is attached to.
- Parameters:
attachmentCount
- The number of entities (users, groups, and roles) that the policy is attached to.- Returns:
- Returns a reference to this object so that method calls can be chained together.
-
setIsAttachable
Specifies whether the policy can be attached to an IAM user, group, or role.
- Parameters:
isAttachable
- Specifies whether the policy can be attached to an IAM user, group, or role.
-
getIsAttachable
Specifies whether the policy can be attached to an IAM user, group, or role.
- Returns:
- Specifies whether the policy can be attached to an IAM user, group, or role.
-
withIsAttachable
Specifies whether the policy can be attached to an IAM user, group, or role.
- Parameters:
isAttachable
- Specifies whether the policy can be attached to an IAM user, group, or role.- Returns:
- Returns a reference to this object so that method calls can be chained together.
-
isAttachable
Specifies whether the policy can be attached to an IAM user, group, or role.
- Returns:
- Specifies whether the policy can be attached to an IAM user, group, or role.
-
setDescription
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.
- Parameters:
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.
-
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.
- Returns:
- 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.
-
withDescription
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.
- Parameters:
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.
- Returns:
- Returns a reference to this object so that method calls can be chained together.
-
setCreateDate
The date and time, in ISO 8601 date-time format, when the policy was created.
- Parameters:
createDate
- The date and time, in ISO 8601 date-time format, when the policy was created.
-
getCreateDate
The date and time, in ISO 8601 date-time format, when the policy was created.
- Returns:
- The date and time, in ISO 8601 date-time format, when the policy was created.
-
withCreateDate
The date and time, in ISO 8601 date-time format, when the policy was created.
- Parameters:
createDate
- The date and time, in ISO 8601 date-time format, when the policy was created.- Returns:
- Returns a reference to this object so that method calls can be chained together.
-
setUpdateDate
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.
- Parameters:
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.
-
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.
- Returns:
- 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.
-
withUpdateDate
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.
- Parameters:
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.
- Returns:
- Returns a reference to this object so that method calls can be chained together.
-
toString
Returns a string representation of this object; useful for testing and debugging. -
equals
-
hashCode
public int hashCode() -
clone
-