/* * 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.identitymanagement.model; import java.io.Serializable; import javax.annotation.Generated; /** * * @see AWS API * Documentation */ @Generated("com.amazonaws:aws-java-sdk-code-generator") public class GetMFADeviceResult extends com.amazonaws.AmazonWebServiceResult implements Serializable, Cloneable { /** *

* The friendly name identifying the user. *

*/ private String userName; /** *

* Serial number that uniquely identifies the MFA device. For this API, we only accept FIDO security key ARNs. *

*/ private String serialNumber; /** *

* The date that a specified user's MFA device was first enabled. *

*/ private java.util.Date enableDate; /** *

* The certifications of a specified user's MFA device. We currently provide FIPS-140-2, FIPS-140-3, and FIDO * certification levels obtained from FIDO Alliance Metadata Service * (MDS). *

*/ private com.amazonaws.internal.SdkInternalMap certifications; /** *

* The friendly name identifying the user. *

* * @param userName * The friendly name identifying the user. */ public void setUserName(String userName) { this.userName = userName; } /** *

* The friendly name identifying the user. *

* * @return The friendly name identifying the user. */ public String getUserName() { return this.userName; } /** *

* The friendly name identifying the user. *

* * @param userName * The friendly name identifying the user. * @return Returns a reference to this object so that method calls can be chained together. */ public GetMFADeviceResult withUserName(String userName) { setUserName(userName); return this; } /** *

* Serial number that uniquely identifies the MFA device. For this API, we only accept FIDO security key ARNs. *

* * @param serialNumber * Serial number that uniquely identifies the MFA device. For this API, we only accept FIDO security key ARNs. */ public void setSerialNumber(String serialNumber) { this.serialNumber = serialNumber; } /** *

* Serial number that uniquely identifies the MFA device. For this API, we only accept FIDO security key ARNs. *

* * @return Serial number that uniquely identifies the MFA device. For this API, we only accept FIDO security key ARNs. */ public String getSerialNumber() { return this.serialNumber; } /** *

* Serial number that uniquely identifies the MFA device. For this API, we only accept FIDO security key ARNs. *

* * @param serialNumber * Serial number that uniquely identifies the MFA device. For this API, we only accept FIDO security key ARNs. * @return Returns a reference to this object so that method calls can be chained together. */ public GetMFADeviceResult withSerialNumber(String serialNumber) { setSerialNumber(serialNumber); return this; } /** *

* The date that a specified user's MFA device was first enabled. *

* * @param enableDate * The date that a specified user's MFA device was first enabled. */ public void setEnableDate(java.util.Date enableDate) { this.enableDate = enableDate; } /** *

* The date that a specified user's MFA device was first enabled. *

* * @return The date that a specified user's MFA device was first enabled. */ public java.util.Date getEnableDate() { return this.enableDate; } /** *

* The date that a specified user's MFA device was first enabled. *

* * @param enableDate * The date that a specified user's MFA device was first enabled. * @return Returns a reference to this object so that method calls can be chained together. */ public GetMFADeviceResult withEnableDate(java.util.Date enableDate) { setEnableDate(enableDate); return this; } /** *

* The certifications of a specified user's MFA device. We currently provide FIPS-140-2, FIPS-140-3, and FIDO * certification levels obtained from FIDO Alliance Metadata Service * (MDS). *

* * @return The certifications of a specified user's MFA device. We currently provide FIPS-140-2, FIPS-140-3, and * FIDO certification levels obtained from FIDO Alliance * Metadata Service (MDS). */ public java.util.Map getCertifications() { if (certifications == null) { certifications = new com.amazonaws.internal.SdkInternalMap(); } return certifications; } /** *

* The certifications of a specified user's MFA device. We currently provide FIPS-140-2, FIPS-140-3, and FIDO * certification levels obtained from FIDO Alliance Metadata Service * (MDS). *

* * @param certifications * The certifications of a specified user's MFA device. We currently provide FIPS-140-2, FIPS-140-3, and FIDO * certification levels obtained from FIDO Alliance Metadata * Service (MDS). */ public void setCertifications(java.util.Map certifications) { this.certifications = certifications == null ? null : new com.amazonaws.internal.SdkInternalMap(certifications); } /** *

* The certifications of a specified user's MFA device. We currently provide FIPS-140-2, FIPS-140-3, and FIDO * certification levels obtained from FIDO Alliance Metadata Service * (MDS). *

* * @param certifications * The certifications of a specified user's MFA device. We currently provide FIPS-140-2, FIPS-140-3, and FIDO * certification levels obtained from FIDO Alliance Metadata * Service (MDS). * @return Returns a reference to this object so that method calls can be chained together. */ public GetMFADeviceResult withCertifications(java.util.Map certifications) { setCertifications(certifications); return this; } /** * Add a single Certifications entry * * @see GetMFADeviceResult#withCertifications * @returns a reference to this object so that method calls can be chained together. */ public GetMFADeviceResult addCertificationsEntry(String key, String value) { if (null == this.certifications) { this.certifications = new com.amazonaws.internal.SdkInternalMap(); } if (this.certifications.containsKey(key)) throw new IllegalArgumentException("Duplicated keys (" + key.toString() + ") are provided."); this.certifications.put(key, value); return this; } /** * Removes all the entries added into Certifications. * * @return Returns a reference to this object so that method calls can be chained together. */ public GetMFADeviceResult clearCertificationsEntries() { this.certifications = null; 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 (getUserName() != null) sb.append("UserName: ").append(getUserName()).append(","); if (getSerialNumber() != null) sb.append("SerialNumber: ").append(getSerialNumber()).append(","); if (getEnableDate() != null) sb.append("EnableDate: ").append(getEnableDate()).append(","); if (getCertifications() != null) sb.append("Certifications: ").append(getCertifications()); sb.append("}"); return sb.toString(); } @Override public boolean equals(Object obj) { if (this == obj) return true; if (obj == null) return false; if (obj instanceof GetMFADeviceResult == false) return false; GetMFADeviceResult other = (GetMFADeviceResult) obj; if (other.getUserName() == null ^ this.getUserName() == null) return false; if (other.getUserName() != null && other.getUserName().equals(this.getUserName()) == false) return false; if (other.getSerialNumber() == null ^ this.getSerialNumber() == null) return false; if (other.getSerialNumber() != null && other.getSerialNumber().equals(this.getSerialNumber()) == false) return false; if (other.getEnableDate() == null ^ this.getEnableDate() == null) return false; if (other.getEnableDate() != null && other.getEnableDate().equals(this.getEnableDate()) == false) return false; if (other.getCertifications() == null ^ this.getCertifications() == null) return false; if (other.getCertifications() != null && other.getCertifications().equals(this.getCertifications()) == false) return false; return true; } @Override public int hashCode() { final int prime = 31; int hashCode = 1; hashCode = prime * hashCode + ((getUserName() == null) ? 0 : getUserName().hashCode()); hashCode = prime * hashCode + ((getSerialNumber() == null) ? 0 : getSerialNumber().hashCode()); hashCode = prime * hashCode + ((getEnableDate() == null) ? 0 : getEnableDate().hashCode()); hashCode = prime * hashCode + ((getCertifications() == null) ? 0 : getCertifications().hashCode()); return hashCode; } @Override public GetMFADeviceResult clone() { try { return (GetMFADeviceResult) super.clone(); } catch (CloneNotSupportedException e) { throw new IllegalStateException("Got a CloneNotSupportedException from Object.clone() " + "even though we're Cloneable!", e); } } }