![JAR search and dependency download from the Maven repository](/logo.png)
com.amazonaws.services.cognitoidp.model.VerifySoftwareTokenRequest Maven / Gradle / Ivy
Show all versions of aws-java-sdk-cognitoidp Show documentation
/*
* Copyright 2019-2024 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;
/**
*
* @see AWS
* API Documentation
*/
@Generated("com.amazonaws:aws-java-sdk-code-generator")
public class VerifySoftwareTokenRequest extends com.amazonaws.AmazonWebServiceRequest implements Serializable, Cloneable {
/**
*
* A valid access token that Amazon Cognito issued to the user whose software token you want to verify.
*
*/
private String accessToken;
/**
*
* The session that should be passed both ways in challenge-response calls to the service.
*
*/
private String session;
/**
*
* The one- time password computed using the secret code returned by AssociateSoftwareToken.
*
*/
private String userCode;
/**
*
* The friendly device name.
*
*/
private String friendlyDeviceName;
/**
*
* A valid access token that Amazon Cognito issued to the user whose software token you want to verify.
*
*
* @param accessToken
* A valid access token that Amazon Cognito issued to the user whose software token you want to verify.
*/
public void setAccessToken(String accessToken) {
this.accessToken = accessToken;
}
/**
*
* A valid access token that Amazon Cognito issued to the user whose software token you want to verify.
*
*
* @return A valid access token that Amazon Cognito issued to the user whose software token you want to verify.
*/
public String getAccessToken() {
return this.accessToken;
}
/**
*
* A valid access token that Amazon Cognito issued to the user whose software token you want to verify.
*
*
* @param accessToken
* A valid access token that Amazon Cognito issued to the user whose software token you want to verify.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public VerifySoftwareTokenRequest withAccessToken(String accessToken) {
setAccessToken(accessToken);
return this;
}
/**
*
* The session that should be passed both ways in challenge-response calls to the service.
*
*
* @param session
* The session that should be passed both ways in challenge-response calls to the service.
*/
public void setSession(String session) {
this.session = session;
}
/**
*
* The session that should be passed both ways in challenge-response calls to the service.
*
*
* @return The session that should be passed both ways in challenge-response calls to the service.
*/
public String getSession() {
return this.session;
}
/**
*
* The session that should be passed both ways in challenge-response calls to the service.
*
*
* @param session
* The session that should be passed both ways in challenge-response calls to the service.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public VerifySoftwareTokenRequest withSession(String session) {
setSession(session);
return this;
}
/**
*
* The one- time password computed using the secret code returned by AssociateSoftwareToken.
*
*
* @param userCode
* The one- time password computed using the secret code returned by AssociateSoftwareToken.
*/
public void setUserCode(String userCode) {
this.userCode = userCode;
}
/**
*
* The one- time password computed using the secret code returned by AssociateSoftwareToken.
*
*
* @return The one- time password computed using the secret code returned by AssociateSoftwareToken.
*/
public String getUserCode() {
return this.userCode;
}
/**
*
* The one- time password computed using the secret code returned by AssociateSoftwareToken.
*
*
* @param userCode
* The one- time password computed using the secret code returned by AssociateSoftwareToken.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public VerifySoftwareTokenRequest withUserCode(String userCode) {
setUserCode(userCode);
return this;
}
/**
*
* The friendly device name.
*
*
* @param friendlyDeviceName
* The friendly device name.
*/
public void setFriendlyDeviceName(String friendlyDeviceName) {
this.friendlyDeviceName = friendlyDeviceName;
}
/**
*
* The friendly device name.
*
*
* @return The friendly device name.
*/
public String getFriendlyDeviceName() {
return this.friendlyDeviceName;
}
/**
*
* The friendly device name.
*
*
* @param friendlyDeviceName
* The friendly device name.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public VerifySoftwareTokenRequest withFriendlyDeviceName(String friendlyDeviceName) {
setFriendlyDeviceName(friendlyDeviceName);
return this;
}
/**
* 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 (getAccessToken() != null)
sb.append("AccessToken: ").append("***Sensitive Data Redacted***").append(",");
if (getSession() != null)
sb.append("Session: ").append("***Sensitive Data Redacted***").append(",");
if (getUserCode() != null)
sb.append("UserCode: ").append("***Sensitive Data Redacted***").append(",");
if (getFriendlyDeviceName() != null)
sb.append("FriendlyDeviceName: ").append(getFriendlyDeviceName());
sb.append("}");
return sb.toString();
}
@Override
public boolean equals(Object obj) {
if (this == obj)
return true;
if (obj == null)
return false;
if (obj instanceof VerifySoftwareTokenRequest == false)
return false;
VerifySoftwareTokenRequest other = (VerifySoftwareTokenRequest) obj;
if (other.getAccessToken() == null ^ this.getAccessToken() == null)
return false;
if (other.getAccessToken() != null && other.getAccessToken().equals(this.getAccessToken()) == false)
return false;
if (other.getSession() == null ^ this.getSession() == null)
return false;
if (other.getSession() != null && other.getSession().equals(this.getSession()) == false)
return false;
if (other.getUserCode() == null ^ this.getUserCode() == null)
return false;
if (other.getUserCode() != null && other.getUserCode().equals(this.getUserCode()) == false)
return false;
if (other.getFriendlyDeviceName() == null ^ this.getFriendlyDeviceName() == null)
return false;
if (other.getFriendlyDeviceName() != null && other.getFriendlyDeviceName().equals(this.getFriendlyDeviceName()) == false)
return false;
return true;
}
@Override
public int hashCode() {
final int prime = 31;
int hashCode = 1;
hashCode = prime * hashCode + ((getAccessToken() == null) ? 0 : getAccessToken().hashCode());
hashCode = prime * hashCode + ((getSession() == null) ? 0 : getSession().hashCode());
hashCode = prime * hashCode + ((getUserCode() == null) ? 0 : getUserCode().hashCode());
hashCode = prime * hashCode + ((getFriendlyDeviceName() == null) ? 0 : getFriendlyDeviceName().hashCode());
return hashCode;
}
@Override
public VerifySoftwareTokenRequest clone() {
return (VerifySoftwareTokenRequest) super.clone();
}
}