/* * Copyright 2010-2023 Amazon.com, Inc. or its affiliates. All Rights Reserved. * * Licensed under the Apache License, Version 2.0 (the "License"). * You may not use this file except in compliance with the License. * A copy of the License is located at * * http://aws.amazon.com/apache2.0 * * or in the "license" file accompanying this file. This file is distributed * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either * express or implied. See the License for the specific language governing * permissions and limitations under the License. */ package com.amazonaws.services.geo.model; import java.io.Serializable; import com.amazonaws.AmazonWebServiceRequest; /** *
* Updates the specified properties of a given API key resource. *
** The API keys feature is in preview. We may add, change, or remove features * before announcing general availability. For more information, see Using API keys. *
** Updates the description for the API key resource. *
*
* Constraints:
* Length: 0 - 1000
*/
private String description;
/**
*
* Updates the timestamp for when the API key resource will expire in ISO
* 8601 format: YYYY-MM-DDThh:mm:ss.sssZ
.
*
* The boolean flag to be included for updating ExpireTime
or
* Restrictions
details.
*
* Must be set to true
to update an API key resource that has
* been used in the past 7 days.
*
* False
if force update is not preferred
*
* Default value: False
*
* The name of the API key resource to update. *
*
* Constraints:
* Length: 1 - 100
* Pattern: ^[-._\w]+$
*/
private String keyName;
/**
*
* Whether the API key should expire. Set to true
to set the
* API key to have no expiration time.
*
* Updates the API key restrictions for the API key resource. *
*/ private ApiKeyRestrictions restrictions; /** ** Updates the description for the API key resource. *
*
* Constraints:
* Length: 0 - 1000
*
* @return
* Updates the description for the API key resource. *
*/ public String getDescription() { return description; } /** ** Updates the description for the API key resource. *
*
* Constraints:
* Length: 0 - 1000
*
* @param description
* Updates the description for the API key resource. *
*/ public void setDescription(String description) { this.description = description; } /** ** Updates the description for the API key resource. *
** Returns a reference to this object so that method calls can be chained * together. *
* Constraints:
* Length: 0 - 1000
*
* @param description
* Updates the description for the API key resource. *
* @return A reference to this updated object so that method calls can be * chained together. */ public UpdateKeyRequest withDescription(String description) { this.description = description; return this; } /** *
* Updates the timestamp for when the API key resource will expire in ISO
* 8601 format: YYYY-MM-DDThh:mm:ss.sssZ
.
*
* Updates the timestamp for when the API key resource will expire
* in
* ISO 8601 format: YYYY-MM-DDThh:mm:ss.sssZ
.
*
* Updates the timestamp for when the API key resource will expire in ISO
* 8601 format: YYYY-MM-DDThh:mm:ss.sssZ
.
*
* Updates the timestamp for when the API key resource will
* expire in ISO
* 8601 format: YYYY-MM-DDThh:mm:ss.sssZ
.
*
* Updates the timestamp for when the API key resource will expire in ISO
* 8601 format: YYYY-MM-DDThh:mm:ss.sssZ
.
*
* Returns a reference to this object so that method calls can be chained * together. * * @param expireTime
* Updates the timestamp for when the API key resource will
* expire in ISO
* 8601 format: YYYY-MM-DDThh:mm:ss.sssZ
.
*
* The boolean flag to be included for updating ExpireTime
or
* Restrictions
details.
*
* Must be set to true
to update an API key resource that has
* been used in the past 7 days.
*
* False
if force update is not preferred
*
* Default value: False
*
* The boolean flag to be included for updating
* ExpireTime
or Restrictions
details.
*
* Must be set to true
to update an API key resource
* that has been used in the past 7 days.
*
* False
if force update is not preferred
*
* Default value: False
*
* The boolean flag to be included for updating ExpireTime
or
* Restrictions
details.
*
* Must be set to true
to update an API key resource that has
* been used in the past 7 days.
*
* False
if force update is not preferred
*
* Default value: False
*
* The boolean flag to be included for updating
* ExpireTime
or Restrictions
details.
*
* Must be set to true
to update an API key resource
* that has been used in the past 7 days.
*
* False
if force update is not preferred
*
* Default value: False
*
* The boolean flag to be included for updating ExpireTime
or
* Restrictions
details.
*
* Must be set to true
to update an API key resource that has
* been used in the past 7 days.
*
* False
if force update is not preferred
*
* Default value: False
*
* The boolean flag to be included for updating
* ExpireTime
or Restrictions
details.
*
* Must be set to true
to update an API key resource
* that has been used in the past 7 days.
*
* False
if force update is not preferred
*
* Default value: False
*
* The boolean flag to be included for updating ExpireTime
or
* Restrictions
details.
*
* Must be set to true
to update an API key resource that has
* been used in the past 7 days.
*
* False
if force update is not preferred
*
* Default value: False
*
* Returns a reference to this object so that method calls can be chained * together. * * @param forceUpdate
* The boolean flag to be included for updating
* ExpireTime
or Restrictions
details.
*
* Must be set to true
to update an API key resource
* that has been used in the past 7 days.
*
* False
if force update is not preferred
*
* Default value: False
*
* The name of the API key resource to update. *
*
* Constraints:
* Length: 1 - 100
* Pattern: ^[-._\w]+$
*
* @return
* The name of the API key resource to update. *
*/ public String getKeyName() { return keyName; } /** ** The name of the API key resource to update. *
*
* Constraints:
* Length: 1 - 100
* Pattern: ^[-._\w]+$
*
* @param keyName
* The name of the API key resource to update. *
*/ public void setKeyName(String keyName) { this.keyName = keyName; } /** ** The name of the API key resource to update. *
** Returns a reference to this object so that method calls can be chained * together. *
* Constraints:
* Length: 1 - 100
* Pattern: ^[-._\w]+$
*
* @param keyName
* The name of the API key resource to update. *
* @return A reference to this updated object so that method calls can be * chained together. */ public UpdateKeyRequest withKeyName(String keyName) { this.keyName = keyName; return this; } /** *
* Whether the API key should expire. Set to true
to set the
* API key to have no expiration time.
*
* Whether the API key should expire. Set to true
to
* set the API key to have no expiration time.
*
* Whether the API key should expire. Set to true
to set the
* API key to have no expiration time.
*
* Whether the API key should expire. Set to true
to
* set the API key to have no expiration time.
*
* Whether the API key should expire. Set to true
to set the
* API key to have no expiration time.
*
* Whether the API key should expire. Set to true
to
* set the API key to have no expiration time.
*
* Whether the API key should expire. Set to true
to set the
* API key to have no expiration time.
*
* Returns a reference to this object so that method calls can be chained * together. * * @param noExpiry
* Whether the API key should expire. Set to true
to
* set the API key to have no expiration time.
*
* Updates the API key restrictions for the API key resource. *
* * @return* Updates the API key restrictions for the API key resource. *
*/ public ApiKeyRestrictions getRestrictions() { return restrictions; } /** ** Updates the API key restrictions for the API key resource. *
* * @param restrictions* Updates the API key restrictions for the API key resource. *
*/ public void setRestrictions(ApiKeyRestrictions restrictions) { this.restrictions = restrictions; } /** ** Updates the API key restrictions for the API key resource. *
** Returns a reference to this object so that method calls can be chained * together. * * @param restrictions
* Updates the API key restrictions for the API key resource. *
* @return A reference to this updated object so that method calls can be * chained together. */ public UpdateKeyRequest withRestrictions(ApiKeyRestrictions restrictions) { this.restrictions = restrictions; return this; } /** * Returns a string representation of this object; useful for testing and * debugging. * * @return A string representation of this object. * @see java.lang.Object#toString() */ @Override public String toString() { StringBuilder sb = new StringBuilder(); sb.append("{"); if (getDescription() != null) sb.append("Description: " + getDescription() + ","); if (getExpireTime() != null) sb.append("ExpireTime: " + getExpireTime() + ","); if (getForceUpdate() != null) sb.append("ForceUpdate: " + getForceUpdate() + ","); if (getKeyName() != null) sb.append("KeyName: " + getKeyName() + ","); if (getNoExpiry() != null) sb.append("NoExpiry: " + getNoExpiry() + ","); if (getRestrictions() != null) sb.append("Restrictions: " + getRestrictions()); sb.append("}"); return sb.toString(); } @Override public int hashCode() { final int prime = 31; int hashCode = 1; hashCode = prime * hashCode + ((getDescription() == null) ? 0 : getDescription().hashCode()); hashCode = prime * hashCode + ((getExpireTime() == null) ? 0 : getExpireTime().hashCode()); hashCode = prime * hashCode + ((getForceUpdate() == null) ? 0 : getForceUpdate().hashCode()); hashCode = prime * hashCode + ((getKeyName() == null) ? 0 : getKeyName().hashCode()); hashCode = prime * hashCode + ((getNoExpiry() == null) ? 0 : getNoExpiry().hashCode()); hashCode = prime * hashCode + ((getRestrictions() == null) ? 0 : getRestrictions().hashCode()); return hashCode; } @Override public boolean equals(Object obj) { if (this == obj) return true; if (obj == null) return false; if (obj instanceof UpdateKeyRequest == false) return false; UpdateKeyRequest other = (UpdateKeyRequest) obj; if (other.getDescription() == null ^ this.getDescription() == null) return false; if (other.getDescription() != null && other.getDescription().equals(this.getDescription()) == false) return false; if (other.getExpireTime() == null ^ this.getExpireTime() == null) return false; if (other.getExpireTime() != null && other.getExpireTime().equals(this.getExpireTime()) == false) return false; if (other.getForceUpdate() == null ^ this.getForceUpdate() == null) return false; if (other.getForceUpdate() != null && other.getForceUpdate().equals(this.getForceUpdate()) == false) return false; if (other.getKeyName() == null ^ this.getKeyName() == null) return false; if (other.getKeyName() != null && other.getKeyName().equals(this.getKeyName()) == false) return false; if (other.getNoExpiry() == null ^ this.getNoExpiry() == null) return false; if (other.getNoExpiry() != null && other.getNoExpiry().equals(this.getNoExpiry()) == false) return false; if (other.getRestrictions() == null ^ this.getRestrictions() == null) return false; if (other.getRestrictions() != null && other.getRestrictions().equals(this.getRestrictions()) == false) return false; return true; } }