@Generated(value="com.amazonaws:aws-java-sdk-code-generator") public class AccessKey extends Object implements Serializable, Cloneable, StructuredPojo
Describes an access key for an Amazon Lightsail bucket.
Access keys grant full programmatic access to the specified bucket and its objects. You can have a maximum of two access keys per bucket. Use the CreateBucketAccessKey action to create an access key for a specific bucket. For more information about access keys, see Creating access keys for a bucket in Amazon Lightsail in the Amazon Lightsail Developer Guide.
The secretAccessKey
value is returned only in response to the CreateBucketAccessKey
action.
You can get a secret access key only when you first create an access key; you cannot get the secret access key later.
If you lose the secret access key, you must create a new access key.
Constructor and Description |
---|
AccessKey() |
Modifier and Type | Method and Description |
---|---|
AccessKey |
clone() |
boolean |
equals(Object obj) |
String |
getAccessKeyId()
The ID of the access key.
|
Date |
getCreatedAt()
The timestamp when the access key was created.
|
AccessKeyLastUsed |
getLastUsed()
An object that describes the last time the access key was used.
|
String |
getSecretAccessKey()
The secret access key used to sign requests.
|
String |
getStatus()
The status of the access key.
|
int |
hashCode() |
void |
marshall(ProtocolMarshaller protocolMarshaller)
Marshalls this structured data using the given
ProtocolMarshaller . |
void |
setAccessKeyId(String accessKeyId)
The ID of the access key.
|
void |
setCreatedAt(Date createdAt)
The timestamp when the access key was created.
|
void |
setLastUsed(AccessKeyLastUsed lastUsed)
An object that describes the last time the access key was used.
|
void |
setSecretAccessKey(String secretAccessKey)
The secret access key used to sign requests.
|
void |
setStatus(String status)
The status of the access key.
|
String |
toString()
Returns a string representation of this object.
|
AccessKey |
withAccessKeyId(String accessKeyId)
The ID of the access key.
|
AccessKey |
withCreatedAt(Date createdAt)
The timestamp when the access key was created.
|
AccessKey |
withLastUsed(AccessKeyLastUsed lastUsed)
An object that describes the last time the access key was used.
|
AccessKey |
withSecretAccessKey(String secretAccessKey)
The secret access key used to sign requests.
|
AccessKey |
withStatus(StatusType status)
The status of the access key.
|
AccessKey |
withStatus(String status)
The status of the access key.
|
public void setAccessKeyId(String accessKeyId)
The ID of the access key.
accessKeyId
- The ID of the access key.public String getAccessKeyId()
The ID of the access key.
public AccessKey withAccessKeyId(String accessKeyId)
The ID of the access key.
accessKeyId
- The ID of the access key.public void setSecretAccessKey(String secretAccessKey)
The secret access key used to sign requests.
You should store the secret access key in a safe location. We recommend that you delete the access key if the secret access key is compromised.
secretAccessKey
- The secret access key used to sign requests.
You should store the secret access key in a safe location. We recommend that you delete the access key if the secret access key is compromised.
public String getSecretAccessKey()
The secret access key used to sign requests.
You should store the secret access key in a safe location. We recommend that you delete the access key if the secret access key is compromised.
You should store the secret access key in a safe location. We recommend that you delete the access key if the secret access key is compromised.
public AccessKey withSecretAccessKey(String secretAccessKey)
The secret access key used to sign requests.
You should store the secret access key in a safe location. We recommend that you delete the access key if the secret access key is compromised.
secretAccessKey
- The secret access key used to sign requests.
You should store the secret access key in a safe location. We recommend that you delete the access key if the secret access key is compromised.
public void setStatus(String status)
The status of the access key.
A status of Active
means that the key is valid, while Inactive
means it is not.
status
- The status of the access key.
A status of Active
means that the key is valid, while Inactive
means it is not.
StatusType
public String getStatus()
The status of the access key.
A status of Active
means that the key is valid, while Inactive
means it is not.
A status of Active
means that the key is valid, while Inactive
means it is not.
StatusType
public AccessKey withStatus(String status)
The status of the access key.
A status of Active
means that the key is valid, while Inactive
means it is not.
status
- The status of the access key.
A status of Active
means that the key is valid, while Inactive
means it is not.
StatusType
public AccessKey withStatus(StatusType status)
The status of the access key.
A status of Active
means that the key is valid, while Inactive
means it is not.
status
- The status of the access key.
A status of Active
means that the key is valid, while Inactive
means it is not.
StatusType
public void setCreatedAt(Date createdAt)
The timestamp when the access key was created.
createdAt
- The timestamp when the access key was created.public Date getCreatedAt()
The timestamp when the access key was created.
public AccessKey withCreatedAt(Date createdAt)
The timestamp when the access key was created.
createdAt
- The timestamp when the access key was created.public void setLastUsed(AccessKeyLastUsed lastUsed)
An object that describes the last time the access key was used.
This object does not include data in the response of a CreateBucketAccessKey action. If the access key has not been used, the region
and
serviceName
values are N/A
, and the lastUsedDate
value is null.
lastUsed
- An object that describes the last time the access key was used.
This object does not include data in the response of a CreateBucketAccessKey action. If the access key has not been used, the region
and
serviceName
values are N/A
, and the lastUsedDate
value is null.
public AccessKeyLastUsed getLastUsed()
An object that describes the last time the access key was used.
This object does not include data in the response of a CreateBucketAccessKey action. If the access key has not been used, the region
and
serviceName
values are N/A
, and the lastUsedDate
value is null.
This object does not include data in the response of a CreateBucketAccessKey action. If the access key has not been used, the region
and
serviceName
values are N/A
, and the lastUsedDate
value is null.
public AccessKey withLastUsed(AccessKeyLastUsed lastUsed)
An object that describes the last time the access key was used.
This object does not include data in the response of a CreateBucketAccessKey action. If the access key has not been used, the region
and
serviceName
values are N/A
, and the lastUsedDate
value is null.
lastUsed
- An object that describes the last time the access key was used.
This object does not include data in the response of a CreateBucketAccessKey action. If the access key has not been used, the region
and
serviceName
values are N/A
, and the lastUsedDate
value is null.
public String toString()
toString
in class Object
Object.toString()
public void marshall(ProtocolMarshaller protocolMarshaller)
StructuredPojo
ProtocolMarshaller
.marshall
in interface StructuredPojo
protocolMarshaller
- Implementation of ProtocolMarshaller
used to marshall this object's data.