public class PutUserPolicyRequest extends AmazonWebServiceRequest implements Serializable, Cloneable
PutUserPolicy operation
.
Adds (or updates) an inline policy document that is embedded in the specified user.
A user can also have a managed policy attached to it. To attach a managed policy to a user, use AttachUserPolicy. To create a new managed policy, use CreatePolicy. For information about policies, refer to Managed Policies and Inline Policies in the Using IAM guide.
For information about limits on the number of inline policies that you can embed in a user, see Limitations on IAM Entities in the Using IAM guide.
NOTE:Because policy documents can be large, you should use POST rather than GET when calling PutUserPolicy. For general information about using the Query API with IAM, go to Making Query Requests in the Using IAM guide.
NOOP
Constructor and Description |
---|
PutUserPolicyRequest()
Default constructor for a new PutUserPolicyRequest object.
|
PutUserPolicyRequest(String userName,
String policyName,
String policyDocument)
Constructs a new PutUserPolicyRequest object.
|
Modifier and Type | Method and Description |
---|---|
PutUserPolicyRequest |
clone()
Creates a shallow clone of this request.
|
boolean |
equals(Object obj) |
String |
getPolicyDocument()
The policy document.
|
String |
getPolicyName()
The name of the policy document.
|
String |
getUserName()
The name of the user to associate the policy with.
|
int |
hashCode() |
void |
setPolicyDocument(String policyDocument)
The policy document.
|
void |
setPolicyName(String policyName)
The name of the policy document.
|
void |
setUserName(String userName)
The name of the user to associate the policy with.
|
String |
toString()
Returns a string representation of this object; useful for testing and
debugging.
|
PutUserPolicyRequest |
withPolicyDocument(String policyDocument)
The policy document.
|
PutUserPolicyRequest |
withPolicyName(String policyName)
The name of the policy document.
|
PutUserPolicyRequest |
withUserName(String userName)
The name of the user to associate the policy with.
|
copyBaseTo, getCustomQueryParameters, getCustomRequestHeaders, getGeneralProgressListener, getReadLimit, getRequestClientOptions, getRequestCredentials, getRequestMetricCollector, putCustomQueryParameter, putCustomRequestHeader, setGeneralProgressListener, setRequestCredentials, setRequestMetricCollector, withGeneralProgressListener, withRequestMetricCollector
public PutUserPolicyRequest()
public PutUserPolicyRequest(String userName, String policyName, String policyDocument)
userName
- The name of the user to associate the policy with.policyName
- The name of the policy document.policyDocument
- The policy document.public String getUserName()
Constraints:
Length: 1 - 128
Pattern: [\w+=,.@-]+
public void setUserName(String userName)
Constraints:
Length: 1 - 128
Pattern: [\w+=,.@-]+
userName
- The name of the user to associate the policy with.public PutUserPolicyRequest withUserName(String userName)
Returns a reference to this object so that method calls can be chained together.
Constraints:
Length: 1 - 128
Pattern: [\w+=,.@-]+
userName
- The name of the user to associate the policy with.public String getPolicyName()
Constraints:
Length: 1 - 128
Pattern: [\w+=,.@-]+
public void setPolicyName(String policyName)
Constraints:
Length: 1 - 128
Pattern: [\w+=,.@-]+
policyName
- The name of the policy document.public PutUserPolicyRequest withPolicyName(String policyName)
Returns a reference to this object so that method calls can be chained together.
Constraints:
Length: 1 - 128
Pattern: [\w+=,.@-]+
policyName
- The name of the policy document.public String getPolicyDocument()
Constraints:
Length: 1 - 131072
Pattern: [\u0009\u000A\u000D\u0020-\u00FF]+
public void setPolicyDocument(String policyDocument)
Constraints:
Length: 1 - 131072
Pattern: [\u0009\u000A\u000D\u0020-\u00FF]+
policyDocument
- The policy document.public PutUserPolicyRequest withPolicyDocument(String policyDocument)
Returns a reference to this object so that method calls can be chained together.
Constraints:
Length: 1 - 131072
Pattern: [\u0009\u000A\u000D\u0020-\u00FF]+
policyDocument
- The policy document.public String toString()
toString
in class Object
Object.toString()
public PutUserPolicyRequest clone()
AmazonWebServiceRequest
clone
in class AmazonWebServiceRequest
Object.clone()
Copyright © 2015. All rights reserved.