/* * Copyright 2018-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.iot.model; import java.io.Serializable; import javax.annotation.Generated; import com.amazonaws.AmazonWebServiceRequest; @Generated("com.amazonaws:aws-java-sdk-code-generator") public class UpdateAuthorizerRequest extends com.amazonaws.AmazonWebServiceRequest implements Serializable, Cloneable { /** *

* The authorizer name. *

*/ private String authorizerName; /** *

* The ARN of the authorizer's Lambda function. *

*/ private String authorizerFunctionArn; /** *

* The key used to extract the token from the HTTP headers. *

*/ private String tokenKeyName; /** *

* The public keys used to verify the token signature. *

*/ private java.util.Map tokenSigningPublicKeys; /** *

* The status of the update authorizer request. *

*/ private String status; /** *

* When true, the result from the authorizer’s Lambda function is cached for the time specified in * refreshAfterInSeconds. The cached result is used while the device reuses the same HTTP connection. *

*/ private Boolean enableCachingForHttp; /** *

* The authorizer name. *

* * @param authorizerName * The authorizer name. */ public void setAuthorizerName(String authorizerName) { this.authorizerName = authorizerName; } /** *

* The authorizer name. *

* * @return The authorizer name. */ public String getAuthorizerName() { return this.authorizerName; } /** *

* The authorizer name. *

* * @param authorizerName * The authorizer name. * @return Returns a reference to this object so that method calls can be chained together. */ public UpdateAuthorizerRequest withAuthorizerName(String authorizerName) { setAuthorizerName(authorizerName); return this; } /** *

* The ARN of the authorizer's Lambda function. *

* * @param authorizerFunctionArn * The ARN of the authorizer's Lambda function. */ public void setAuthorizerFunctionArn(String authorizerFunctionArn) { this.authorizerFunctionArn = authorizerFunctionArn; } /** *

* The ARN of the authorizer's Lambda function. *

* * @return The ARN of the authorizer's Lambda function. */ public String getAuthorizerFunctionArn() { return this.authorizerFunctionArn; } /** *

* The ARN of the authorizer's Lambda function. *

* * @param authorizerFunctionArn * The ARN of the authorizer's Lambda function. * @return Returns a reference to this object so that method calls can be chained together. */ public UpdateAuthorizerRequest withAuthorizerFunctionArn(String authorizerFunctionArn) { setAuthorizerFunctionArn(authorizerFunctionArn); return this; } /** *

* The key used to extract the token from the HTTP headers. *

* * @param tokenKeyName * The key used to extract the token from the HTTP headers. */ public void setTokenKeyName(String tokenKeyName) { this.tokenKeyName = tokenKeyName; } /** *

* The key used to extract the token from the HTTP headers. *

* * @return The key used to extract the token from the HTTP headers. */ public String getTokenKeyName() { return this.tokenKeyName; } /** *

* The key used to extract the token from the HTTP headers. *

* * @param tokenKeyName * The key used to extract the token from the HTTP headers. * @return Returns a reference to this object so that method calls can be chained together. */ public UpdateAuthorizerRequest withTokenKeyName(String tokenKeyName) { setTokenKeyName(tokenKeyName); return this; } /** *

* The public keys used to verify the token signature. *

* * @return The public keys used to verify the token signature. */ public java.util.Map getTokenSigningPublicKeys() { return tokenSigningPublicKeys; } /** *

* The public keys used to verify the token signature. *

* * @param tokenSigningPublicKeys * The public keys used to verify the token signature. */ public void setTokenSigningPublicKeys(java.util.Map tokenSigningPublicKeys) { this.tokenSigningPublicKeys = tokenSigningPublicKeys; } /** *

* The public keys used to verify the token signature. *

* * @param tokenSigningPublicKeys * The public keys used to verify the token signature. * @return Returns a reference to this object so that method calls can be chained together. */ public UpdateAuthorizerRequest withTokenSigningPublicKeys(java.util.Map tokenSigningPublicKeys) { setTokenSigningPublicKeys(tokenSigningPublicKeys); return this; } /** * Add a single TokenSigningPublicKeys entry * * @see UpdateAuthorizerRequest#withTokenSigningPublicKeys * @returns a reference to this object so that method calls can be chained together. */ public UpdateAuthorizerRequest addTokenSigningPublicKeysEntry(String key, String value) { if (null == this.tokenSigningPublicKeys) { this.tokenSigningPublicKeys = new java.util.HashMap(); } if (this.tokenSigningPublicKeys.containsKey(key)) throw new IllegalArgumentException("Duplicated keys (" + key.toString() + ") are provided."); this.tokenSigningPublicKeys.put(key, value); return this; } /** * Removes all the entries added into TokenSigningPublicKeys. * * @return Returns a reference to this object so that method calls can be chained together. */ public UpdateAuthorizerRequest clearTokenSigningPublicKeysEntries() { this.tokenSigningPublicKeys = null; return this; } /** *

* The status of the update authorizer request. *

* * @param status * The status of the update authorizer request. * @see AuthorizerStatus */ public void setStatus(String status) { this.status = status; } /** *

* The status of the update authorizer request. *

* * @return The status of the update authorizer request. * @see AuthorizerStatus */ public String getStatus() { return this.status; } /** *

* The status of the update authorizer request. *

* * @param status * The status of the update authorizer request. * @return Returns a reference to this object so that method calls can be chained together. * @see AuthorizerStatus */ public UpdateAuthorizerRequest withStatus(String status) { setStatus(status); return this; } /** *

* The status of the update authorizer request. *

* * @param status * The status of the update authorizer request. * @return Returns a reference to this object so that method calls can be chained together. * @see AuthorizerStatus */ public UpdateAuthorizerRequest withStatus(AuthorizerStatus status) { this.status = status.toString(); return this; } /** *

* When true, the result from the authorizer’s Lambda function is cached for the time specified in * refreshAfterInSeconds. The cached result is used while the device reuses the same HTTP connection. *

* * @param enableCachingForHttp * When true, the result from the authorizer’s Lambda function is cached for the time specified * in refreshAfterInSeconds. The cached result is used while the device reuses the same HTTP * connection. */ public void setEnableCachingForHttp(Boolean enableCachingForHttp) { this.enableCachingForHttp = enableCachingForHttp; } /** *

* When true, the result from the authorizer’s Lambda function is cached for the time specified in * refreshAfterInSeconds. The cached result is used while the device reuses the same HTTP connection. *

* * @return When true, the result from the authorizer’s Lambda function is cached for the time specified * in refreshAfterInSeconds. The cached result is used while the device reuses the same HTTP * connection. */ public Boolean getEnableCachingForHttp() { return this.enableCachingForHttp; } /** *

* When true, the result from the authorizer’s Lambda function is cached for the time specified in * refreshAfterInSeconds. The cached result is used while the device reuses the same HTTP connection. *

* * @param enableCachingForHttp * When true, the result from the authorizer’s Lambda function is cached for the time specified * in refreshAfterInSeconds. The cached result is used while the device reuses the same HTTP * connection. * @return Returns a reference to this object so that method calls can be chained together. */ public UpdateAuthorizerRequest withEnableCachingForHttp(Boolean enableCachingForHttp) { setEnableCachingForHttp(enableCachingForHttp); return this; } /** *

* When true, the result from the authorizer’s Lambda function is cached for the time specified in * refreshAfterInSeconds. The cached result is used while the device reuses the same HTTP connection. *

* * @return When true, the result from the authorizer’s Lambda function is cached for the time specified * in refreshAfterInSeconds. The cached result is used while the device reuses the same HTTP * connection. */ public Boolean isEnableCachingForHttp() { return this.enableCachingForHttp; } /** * Returns a string representation of this object. This is useful for testing and debugging. Sensitive data will be * redacted from this string using a placeholder value. * * @return A string representation of this object. * * @see java.lang.Object#toString() */ @Override public String toString() { StringBuilder sb = new StringBuilder(); sb.append("{"); if (getAuthorizerName() != null) sb.append("AuthorizerName: ").append(getAuthorizerName()).append(","); if (getAuthorizerFunctionArn() != null) sb.append("AuthorizerFunctionArn: ").append(getAuthorizerFunctionArn()).append(","); if (getTokenKeyName() != null) sb.append("TokenKeyName: ").append(getTokenKeyName()).append(","); if (getTokenSigningPublicKeys() != null) sb.append("TokenSigningPublicKeys: ").append(getTokenSigningPublicKeys()).append(","); if (getStatus() != null) sb.append("Status: ").append(getStatus()).append(","); if (getEnableCachingForHttp() != null) sb.append("EnableCachingForHttp: ").append(getEnableCachingForHttp()); sb.append("}"); return sb.toString(); } @Override public boolean equals(Object obj) { if (this == obj) return true; if (obj == null) return false; if (obj instanceof UpdateAuthorizerRequest == false) return false; UpdateAuthorizerRequest other = (UpdateAuthorizerRequest) obj; if (other.getAuthorizerName() == null ^ this.getAuthorizerName() == null) return false; if (other.getAuthorizerName() != null && other.getAuthorizerName().equals(this.getAuthorizerName()) == false) return false; if (other.getAuthorizerFunctionArn() == null ^ this.getAuthorizerFunctionArn() == null) return false; if (other.getAuthorizerFunctionArn() != null && other.getAuthorizerFunctionArn().equals(this.getAuthorizerFunctionArn()) == false) return false; if (other.getTokenKeyName() == null ^ this.getTokenKeyName() == null) return false; if (other.getTokenKeyName() != null && other.getTokenKeyName().equals(this.getTokenKeyName()) == false) return false; if (other.getTokenSigningPublicKeys() == null ^ this.getTokenSigningPublicKeys() == null) return false; if (other.getTokenSigningPublicKeys() != null && other.getTokenSigningPublicKeys().equals(this.getTokenSigningPublicKeys()) == false) return false; if (other.getStatus() == null ^ this.getStatus() == null) return false; if (other.getStatus() != null && other.getStatus().equals(this.getStatus()) == false) return false; if (other.getEnableCachingForHttp() == null ^ this.getEnableCachingForHttp() == null) return false; if (other.getEnableCachingForHttp() != null && other.getEnableCachingForHttp().equals(this.getEnableCachingForHttp()) == false) return false; return true; } @Override public int hashCode() { final int prime = 31; int hashCode = 1; hashCode = prime * hashCode + ((getAuthorizerName() == null) ? 0 : getAuthorizerName().hashCode()); hashCode = prime * hashCode + ((getAuthorizerFunctionArn() == null) ? 0 : getAuthorizerFunctionArn().hashCode()); hashCode = prime * hashCode + ((getTokenKeyName() == null) ? 0 : getTokenKeyName().hashCode()); hashCode = prime * hashCode + ((getTokenSigningPublicKeys() == null) ? 0 : getTokenSigningPublicKeys().hashCode()); hashCode = prime * hashCode + ((getStatus() == null) ? 0 : getStatus().hashCode()); hashCode = prime * hashCode + ((getEnableCachingForHttp() == null) ? 0 : getEnableCachingForHttp().hashCode()); return hashCode; } @Override public UpdateAuthorizerRequest clone() { return (UpdateAuthorizerRequest) super.clone(); } }