public class AccessKey
extends java.lang.Object
implements java.io.Serializable, java.lang.Cloneable
Contains information about an AWS access key.
This data type is used as a response element in the CreateAccessKey and ListAccessKeys actions.
The SecretAccessKey
value is returned only in response to
CreateAccessKey. You can get a secret access key only when you first
create an access key; you cannot recover the secret access key later. If you
lose a secret access key, you must create a new access key.
Modifier and Type | Field and Description |
---|---|
private java.lang.String |
accessKeyId
The ID for this access key.
|
private java.util.Date |
createDate
The date when the access key was created.
|
private java.lang.String |
secretAccessKey
The secret key used to sign requests.
|
private java.lang.String |
status
The status of the access key.
|
private java.lang.String |
userName
The name of the IAM user that the access key is associated with.
|
Constructor and Description |
---|
AccessKey()
Default constructor for AccessKey object.
|
AccessKey(java.lang.String userName,
java.lang.String accessKeyId,
StatusType status,
java.lang.String secretAccessKey)
Constructs a new AccessKey object.
|
AccessKey(java.lang.String userName,
java.lang.String accessKeyId,
java.lang.String status,
java.lang.String secretAccessKey)
Constructs a new AccessKey object.
|
Modifier and Type | Method and Description |
---|---|
AccessKey |
clone() |
boolean |
equals(java.lang.Object obj) |
java.lang.String |
getAccessKeyId()
The ID for this access key.
|
java.util.Date |
getCreateDate()
The date when the access key was created.
|
java.lang.String |
getSecretAccessKey()
The secret key used to sign requests.
|
java.lang.String |
getStatus()
The status of the access key.
|
java.lang.String |
getUserName()
The name of the IAM user that the access key is associated with.
|
int |
hashCode() |
void |
setAccessKeyId(java.lang.String accessKeyId)
The ID for this access key.
|
void |
setCreateDate(java.util.Date createDate)
The date when the access key was created.
|
void |
setSecretAccessKey(java.lang.String secretAccessKey)
The secret key used to sign requests.
|
void |
setStatus(StatusType status)
The status of the access key.
|
void |
setStatus(java.lang.String status)
The status of the access key.
|
void |
setUserName(java.lang.String userName)
The name of the IAM user that the access key is associated with.
|
java.lang.String |
toString()
Returns a string representation of this object; useful for testing and
debugging.
|
AccessKey |
withAccessKeyId(java.lang.String accessKeyId)
The ID for this access key.
|
AccessKey |
withCreateDate(java.util.Date createDate)
The date when the access key was created.
|
AccessKey |
withSecretAccessKey(java.lang.String secretAccessKey)
The secret key used to sign requests.
|
AccessKey |
withStatus(StatusType status)
The status of the access key.
|
AccessKey |
withStatus(java.lang.String status)
The status of the access key.
|
AccessKey |
withUserName(java.lang.String userName)
The name of the IAM user that the access key is associated with.
|
private java.lang.String userName
The name of the IAM user that the access key is associated with.
private java.lang.String accessKeyId
The ID for this access key.
private java.lang.String status
The status of the access key. Active
means the key is valid
for API calls, while Inactive
means it is not.
private java.lang.String secretAccessKey
The secret key used to sign requests.
private java.util.Date createDate
The date when the access key was created.
public AccessKey()
public AccessKey(java.lang.String userName, java.lang.String accessKeyId, java.lang.String status, java.lang.String secretAccessKey)
userName
- The name of the IAM user that the access key is associated with.accessKeyId
- The ID for this access key.status
- The status of the access key. Active
means the key is
valid for API calls, while Inactive
means it is not.secretAccessKey
- The secret key used to sign requests.public AccessKey(java.lang.String userName, java.lang.String accessKeyId, StatusType status, java.lang.String secretAccessKey)
userName
- The name of the IAM user that the access key is associated with.accessKeyId
- The ID for this access key.status
- The status of the access key. Active
means the key is
valid for API calls, while Inactive
means it is not.secretAccessKey
- The secret key used to sign requests.public void setUserName(java.lang.String userName)
The name of the IAM user that the access key is associated with.
userName
- The name of the IAM user that the access key is associated with.public java.lang.String getUserName()
The name of the IAM user that the access key is associated with.
public AccessKey withUserName(java.lang.String userName)
The name of the IAM user that the access key is associated with.
userName
- The name of the IAM user that the access key is associated with.public void setAccessKeyId(java.lang.String accessKeyId)
The ID for this access key.
accessKeyId
- The ID for this access key.public java.lang.String getAccessKeyId()
The ID for this access key.
public AccessKey withAccessKeyId(java.lang.String accessKeyId)
The ID for this access key.
accessKeyId
- The ID for this access key.public void setStatus(java.lang.String status)
The status of the access key. Active
means the key is valid
for API calls, while Inactive
means it is not.
status
- The status of the access key. Active
means the key is
valid for API calls, while Inactive
means it is not.StatusType
public java.lang.String getStatus()
The status of the access key. Active
means the key is valid
for API calls, while Inactive
means it is not.
Active
means the key
is valid for API calls, while Inactive
means it is
not.StatusType
public AccessKey withStatus(java.lang.String status)
The status of the access key. Active
means the key is valid
for API calls, while Inactive
means it is not.
status
- The status of the access key. Active
means the key is
valid for API calls, while Inactive
means it is not.StatusType
public void setStatus(StatusType status)
The status of the access key. Active
means the key is valid
for API calls, while Inactive
means it is not.
status
- The status of the access key. Active
means the key is
valid for API calls, while Inactive
means it is not.StatusType
public AccessKey withStatus(StatusType status)
The status of the access key. Active
means the key is valid
for API calls, while Inactive
means it is not.
status
- The status of the access key. Active
means the key is
valid for API calls, while Inactive
means it is not.StatusType
public void setSecretAccessKey(java.lang.String secretAccessKey)
The secret key used to sign requests.
secretAccessKey
- The secret key used to sign requests.public java.lang.String getSecretAccessKey()
The secret key used to sign requests.
public AccessKey withSecretAccessKey(java.lang.String secretAccessKey)
The secret key used to sign requests.
secretAccessKey
- The secret key used to sign requests.public void setCreateDate(java.util.Date createDate)
The date when the access key was created.
createDate
- The date when the access key was created.public java.util.Date getCreateDate()
The date when the access key was created.
public AccessKey withCreateDate(java.util.Date createDate)
The date when the access key was created.
createDate
- The date when the access key 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 AccessKey clone()
clone
in class java.lang.Object