/* * Copyright 2012-2017 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.cognitoidp.model; import java.io.Serializable; import javax.annotation.Generated; import com.amazonaws.AmazonWebServiceRequest; /** * <p> * The request to respond to the authentication challenge, as an administrator. * </p> * * @see <a href="http://docs.aws.amazon.com/goto/WebAPI/cognito-idp-2016-04-18/AdminRespondToAuthChallenge" * target="_top">AWS API Documentation</a> */ @Generated("com.amazonaws:aws-java-sdk-code-generator") public class AdminRespondToAuthChallengeRequest extends com.amazonaws.AmazonWebServiceRequest implements Serializable, Cloneable { /** * <p> * The ID of the Amazon Cognito user pool. * </p> */ private String userPoolId; /** * <p> * The client ID. * </p> */ private String clientId; /** * <p> * The name of the challenge. * </p> */ private String challengeName; /** * <p> * The challenge response. * </p> */ private java.util.Map<String, String> challengeResponses; /** * <p> * The session. * </p> */ private String session; /** * <p> * The ID of the Amazon Cognito user pool. * </p> * * @param userPoolId * The ID of the Amazon Cognito user pool. */ public void setUserPoolId(String userPoolId) { this.userPoolId = userPoolId; } /** * <p> * The ID of the Amazon Cognito user pool. * </p> * * @return The ID of the Amazon Cognito user pool. */ public String getUserPoolId() { return this.userPoolId; } /** * <p> * The ID of the Amazon Cognito user pool. * </p> * * @param userPoolId * The ID of the Amazon Cognito user pool. * @return Returns a reference to this object so that method calls can be chained together. */ public AdminRespondToAuthChallengeRequest withUserPoolId(String userPoolId) { setUserPoolId(userPoolId); return this; } /** * <p> * The client ID. * </p> * * @param clientId * The client ID. */ public void setClientId(String clientId) { this.clientId = clientId; } /** * <p> * The client ID. * </p> * * @return The client ID. */ public String getClientId() { return this.clientId; } /** * <p> * The client ID. * </p> * * @param clientId * The client ID. * @return Returns a reference to this object so that method calls can be chained together. */ public AdminRespondToAuthChallengeRequest withClientId(String clientId) { setClientId(clientId); return this; } /** * <p> * The name of the challenge. * </p> * * @param challengeName * The name of the challenge. * @see ChallengeNameType */ public void setChallengeName(String challengeName) { this.challengeName = challengeName; } /** * <p> * The name of the challenge. * </p> * * @return The name of the challenge. * @see ChallengeNameType */ public String getChallengeName() { return this.challengeName; } /** * <p> * The name of the challenge. * </p> * * @param challengeName * The name of the challenge. * @return Returns a reference to this object so that method calls can be chained together. * @see ChallengeNameType */ public AdminRespondToAuthChallengeRequest withChallengeName(String challengeName) { setChallengeName(challengeName); return this; } /** * <p> * The name of the challenge. * </p> * * @param challengeName * The name of the challenge. * @see ChallengeNameType */ public void setChallengeName(ChallengeNameType challengeName) { this.challengeName = challengeName.toString(); } /** * <p> * The name of the challenge. * </p> * * @param challengeName * The name of the challenge. * @return Returns a reference to this object so that method calls can be chained together. * @see ChallengeNameType */ public AdminRespondToAuthChallengeRequest withChallengeName(ChallengeNameType challengeName) { setChallengeName(challengeName); return this; } /** * <p> * The challenge response. * </p> * * @return The challenge response. */ public java.util.Map<String, String> getChallengeResponses() { return challengeResponses; } /** * <p> * The challenge response. * </p> * * @param challengeResponses * The challenge response. */ public void setChallengeResponses(java.util.Map<String, String> challengeResponses) { this.challengeResponses = challengeResponses; } /** * <p> * The challenge response. * </p> * * @param challengeResponses * The challenge response. * @return Returns a reference to this object so that method calls can be chained together. */ public AdminRespondToAuthChallengeRequest withChallengeResponses(java.util.Map<String, String> challengeResponses) { setChallengeResponses(challengeResponses); return this; } public AdminRespondToAuthChallengeRequest addChallengeResponsesEntry(String key, String value) { if (null == this.challengeResponses) { this.challengeResponses = new java.util.HashMap<String, String>(); } if (this.challengeResponses.containsKey(key)) throw new IllegalArgumentException("Duplicated keys (" + key.toString() + ") are provided."); this.challengeResponses.put(key, value); return this; } /** * Removes all the entries added into ChallengeResponses. * * @return Returns a reference to this object so that method calls can be chained together. */ public AdminRespondToAuthChallengeRequest clearChallengeResponsesEntries() { this.challengeResponses = null; return this; } /** * <p> * The session. * </p> * * @param session * The session. */ public void setSession(String session) { this.session = session; } /** * <p> * The session. * </p> * * @return The session. */ public String getSession() { return this.session; } /** * <p> * The session. * </p> * * @param session * The session. * @return Returns a reference to this object so that method calls can be chained together. */ public AdminRespondToAuthChallengeRequest withSession(String session) { setSession(session); 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 (getUserPoolId() != null) sb.append("UserPoolId: ").append(getUserPoolId()).append(","); if (getClientId() != null) sb.append("ClientId: ").append(getClientId()).append(","); if (getChallengeName() != null) sb.append("ChallengeName: ").append(getChallengeName()).append(","); if (getChallengeResponses() != null) sb.append("ChallengeResponses: ").append(getChallengeResponses()).append(","); if (getSession() != null) sb.append("Session: ").append(getSession()); sb.append("}"); return sb.toString(); } @Override public boolean equals(Object obj) { if (this == obj) return true; if (obj == null) return false; if (obj instanceof AdminRespondToAuthChallengeRequest == false) return false; AdminRespondToAuthChallengeRequest other = (AdminRespondToAuthChallengeRequest) obj; if (other.getUserPoolId() == null ^ this.getUserPoolId() == null) return false; if (other.getUserPoolId() != null && other.getUserPoolId().equals(this.getUserPoolId()) == false) return false; if (other.getClientId() == null ^ this.getClientId() == null) return false; if (other.getClientId() != null && other.getClientId().equals(this.getClientId()) == false) return false; if (other.getChallengeName() == null ^ this.getChallengeName() == null) return false; if (other.getChallengeName() != null && other.getChallengeName().equals(this.getChallengeName()) == false) return false; if (other.getChallengeResponses() == null ^ this.getChallengeResponses() == null) return false; if (other.getChallengeResponses() != null && other.getChallengeResponses().equals(this.getChallengeResponses()) == false) return false; if (other.getSession() == null ^ this.getSession() == null) return false; if (other.getSession() != null && other.getSession().equals(this.getSession()) == false) return false; return true; } @Override public int hashCode() { final int prime = 31; int hashCode = 1; hashCode = prime * hashCode + ((getUserPoolId() == null) ? 0 : getUserPoolId().hashCode()); hashCode = prime * hashCode + ((getClientId() == null) ? 0 : getClientId().hashCode()); hashCode = prime * hashCode + ((getChallengeName() == null) ? 0 : getChallengeName().hashCode()); hashCode = prime * hashCode + ((getChallengeResponses() == null) ? 0 : getChallengeResponses().hashCode()); hashCode = prime * hashCode + ((getSession() == null) ? 0 : getSession().hashCode()); return hashCode; } @Override public AdminRespondToAuthChallengeRequest clone() { return (AdminRespondToAuthChallengeRequest) super.clone(); } }