com.amazonaws.services.securityhub.model.AwsIamAccessKeySessionContextAttributes Maven / Gradle / Ivy
Show all versions of aws-java-sdk-securityhub 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.securityhub.model;
import java.io.Serializable;
import javax.annotation.Generated;
import com.amazonaws.protocol.StructuredPojo;
import com.amazonaws.protocol.ProtocolMarshaller;
/**
*
* Attributes of the session that the key was used for.
*
*
* @see AWS API Documentation
*/
@Generated("com.amazonaws:aws-java-sdk-code-generator")
public class AwsIamAccessKeySessionContextAttributes implements Serializable, Cloneable, StructuredPojo {
/**
*
* Indicates whether the session used multi-factor authentication (MFA).
*
*/
private Boolean mfaAuthenticated;
/**
*
* Indicates when the session was created.
*
*
* This field accepts only the specified formats. Timestamps can end with Z
or
* ("+" / "-") time-hour [":" time-minute]
. The time-secfrac after seconds is limited to a maximum of 9
* digits. The offset is bounded by +/-18:00. Here are valid timestamp formats with examples:
*
*
* -
*
* YYYY-MM-DDTHH:MM:SSZ
(for example, 2019-01-31T23:00:00Z
)
*
*
* -
*
* YYYY-MM-DDTHH:MM:SS.mmmmmmmmmZ
(for example, 2019-01-31T23:00:00.123456789Z
)
*
*
* -
*
* YYYY-MM-DDTHH:MM:SS+HH:MM
(for example, 2024-01-04T15:25:10+17:59
)
*
*
* -
*
* YYYY-MM-DDTHH:MM:SS-HHMM
(for example, 2024-01-04T15:25:10-1759
)
*
*
* -
*
* YYYY-MM-DDTHH:MM:SS.mmmmmmmmm+HH:MM
(for example, 2024-01-04T15:25:10.123456789+17:59
)
*
*
*
*/
private String creationDate;
/**
*
* Indicates whether the session used multi-factor authentication (MFA).
*
*
* @param mfaAuthenticated
* Indicates whether the session used multi-factor authentication (MFA).
*/
public void setMfaAuthenticated(Boolean mfaAuthenticated) {
this.mfaAuthenticated = mfaAuthenticated;
}
/**
*
* Indicates whether the session used multi-factor authentication (MFA).
*
*
* @return Indicates whether the session used multi-factor authentication (MFA).
*/
public Boolean getMfaAuthenticated() {
return this.mfaAuthenticated;
}
/**
*
* Indicates whether the session used multi-factor authentication (MFA).
*
*
* @param mfaAuthenticated
* Indicates whether the session used multi-factor authentication (MFA).
* @return Returns a reference to this object so that method calls can be chained together.
*/
public AwsIamAccessKeySessionContextAttributes withMfaAuthenticated(Boolean mfaAuthenticated) {
setMfaAuthenticated(mfaAuthenticated);
return this;
}
/**
*
* Indicates whether the session used multi-factor authentication (MFA).
*
*
* @return Indicates whether the session used multi-factor authentication (MFA).
*/
public Boolean isMfaAuthenticated() {
return this.mfaAuthenticated;
}
/**
*
* Indicates when the session was created.
*
*
* This field accepts only the specified formats. Timestamps can end with Z
or
* ("+" / "-") time-hour [":" time-minute]
. The time-secfrac after seconds is limited to a maximum of 9
* digits. The offset is bounded by +/-18:00. Here are valid timestamp formats with examples:
*
*
* -
*
* YYYY-MM-DDTHH:MM:SSZ
(for example, 2019-01-31T23:00:00Z
)
*
*
* -
*
* YYYY-MM-DDTHH:MM:SS.mmmmmmmmmZ
(for example, 2019-01-31T23:00:00.123456789Z
)
*
*
* -
*
* YYYY-MM-DDTHH:MM:SS+HH:MM
(for example, 2024-01-04T15:25:10+17:59
)
*
*
* -
*
* YYYY-MM-DDTHH:MM:SS-HHMM
(for example, 2024-01-04T15:25:10-1759
)
*
*
* -
*
* YYYY-MM-DDTHH:MM:SS.mmmmmmmmm+HH:MM
(for example, 2024-01-04T15:25:10.123456789+17:59
)
*
*
*
*
* @param creationDate
* Indicates when the session was created.
*
* This field accepts only the specified formats. Timestamps can end with Z
or
* ("+" / "-") time-hour [":" time-minute]
. The time-secfrac after seconds is limited to a
* maximum of 9 digits. The offset is bounded by +/-18:00. Here are valid timestamp formats with examples:
*
*
* -
*
* YYYY-MM-DDTHH:MM:SSZ
(for example, 2019-01-31T23:00:00Z
)
*
*
* -
*
* YYYY-MM-DDTHH:MM:SS.mmmmmmmmmZ
(for example, 2019-01-31T23:00:00.123456789Z
)
*
*
* -
*
* YYYY-MM-DDTHH:MM:SS+HH:MM
(for example, 2024-01-04T15:25:10+17:59
)
*
*
* -
*
* YYYY-MM-DDTHH:MM:SS-HHMM
(for example, 2024-01-04T15:25:10-1759
)
*
*
* -
*
* YYYY-MM-DDTHH:MM:SS.mmmmmmmmm+HH:MM
(for example,
* 2024-01-04T15:25:10.123456789+17:59
)
*
*
*/
public void setCreationDate(String creationDate) {
this.creationDate = creationDate;
}
/**
*
* Indicates when the session was created.
*
*
* This field accepts only the specified formats. Timestamps can end with Z
or
* ("+" / "-") time-hour [":" time-minute]
. The time-secfrac after seconds is limited to a maximum of 9
* digits. The offset is bounded by +/-18:00. Here are valid timestamp formats with examples:
*
*
* -
*
* YYYY-MM-DDTHH:MM:SSZ
(for example, 2019-01-31T23:00:00Z
)
*
*
* -
*
* YYYY-MM-DDTHH:MM:SS.mmmmmmmmmZ
(for example, 2019-01-31T23:00:00.123456789Z
)
*
*
* -
*
* YYYY-MM-DDTHH:MM:SS+HH:MM
(for example, 2024-01-04T15:25:10+17:59
)
*
*
* -
*
* YYYY-MM-DDTHH:MM:SS-HHMM
(for example, 2024-01-04T15:25:10-1759
)
*
*
* -
*
* YYYY-MM-DDTHH:MM:SS.mmmmmmmmm+HH:MM
(for example, 2024-01-04T15:25:10.123456789+17:59
)
*
*
*
*
* @return Indicates when the session was created.
*
* This field accepts only the specified formats. Timestamps can end with Z
or
* ("+" / "-") time-hour [":" time-minute]
. The time-secfrac after seconds is limited to a
* maximum of 9 digits. The offset is bounded by +/-18:00. Here are valid timestamp formats with examples:
*
*
* -
*
* YYYY-MM-DDTHH:MM:SSZ
(for example, 2019-01-31T23:00:00Z
)
*
*
* -
*
* YYYY-MM-DDTHH:MM:SS.mmmmmmmmmZ
(for example, 2019-01-31T23:00:00.123456789Z
)
*
*
* -
*
* YYYY-MM-DDTHH:MM:SS+HH:MM
(for example, 2024-01-04T15:25:10+17:59
)
*
*
* -
*
* YYYY-MM-DDTHH:MM:SS-HHMM
(for example, 2024-01-04T15:25:10-1759
)
*
*
* -
*
* YYYY-MM-DDTHH:MM:SS.mmmmmmmmm+HH:MM
(for example,
* 2024-01-04T15:25:10.123456789+17:59
)
*
*
*/
public String getCreationDate() {
return this.creationDate;
}
/**
*
* Indicates when the session was created.
*
*
* This field accepts only the specified formats. Timestamps can end with Z
or
* ("+" / "-") time-hour [":" time-minute]
. The time-secfrac after seconds is limited to a maximum of 9
* digits. The offset is bounded by +/-18:00. Here are valid timestamp formats with examples:
*
*
* -
*
* YYYY-MM-DDTHH:MM:SSZ
(for example, 2019-01-31T23:00:00Z
)
*
*
* -
*
* YYYY-MM-DDTHH:MM:SS.mmmmmmmmmZ
(for example, 2019-01-31T23:00:00.123456789Z
)
*
*
* -
*
* YYYY-MM-DDTHH:MM:SS+HH:MM
(for example, 2024-01-04T15:25:10+17:59
)
*
*
* -
*
* YYYY-MM-DDTHH:MM:SS-HHMM
(for example, 2024-01-04T15:25:10-1759
)
*
*
* -
*
* YYYY-MM-DDTHH:MM:SS.mmmmmmmmm+HH:MM
(for example, 2024-01-04T15:25:10.123456789+17:59
)
*
*
*
*
* @param creationDate
* Indicates when the session was created.
*
* This field accepts only the specified formats. Timestamps can end with Z
or
* ("+" / "-") time-hour [":" time-minute]
. The time-secfrac after seconds is limited to a
* maximum of 9 digits. The offset is bounded by +/-18:00. Here are valid timestamp formats with examples:
*
*
* -
*
* YYYY-MM-DDTHH:MM:SSZ
(for example, 2019-01-31T23:00:00Z
)
*
*
* -
*
* YYYY-MM-DDTHH:MM:SS.mmmmmmmmmZ
(for example, 2019-01-31T23:00:00.123456789Z
)
*
*
* -
*
* YYYY-MM-DDTHH:MM:SS+HH:MM
(for example, 2024-01-04T15:25:10+17:59
)
*
*
* -
*
* YYYY-MM-DDTHH:MM:SS-HHMM
(for example, 2024-01-04T15:25:10-1759
)
*
*
* -
*
* YYYY-MM-DDTHH:MM:SS.mmmmmmmmm+HH:MM
(for example,
* 2024-01-04T15:25:10.123456789+17:59
)
*
*
* @return Returns a reference to this object so that method calls can be chained together.
*/
public AwsIamAccessKeySessionContextAttributes withCreationDate(String creationDate) {
setCreationDate(creationDate);
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 (getMfaAuthenticated() != null)
sb.append("MfaAuthenticated: ").append(getMfaAuthenticated()).append(",");
if (getCreationDate() != null)
sb.append("CreationDate: ").append(getCreationDate());
sb.append("}");
return sb.toString();
}
@Override
public boolean equals(Object obj) {
if (this == obj)
return true;
if (obj == null)
return false;
if (obj instanceof AwsIamAccessKeySessionContextAttributes == false)
return false;
AwsIamAccessKeySessionContextAttributes other = (AwsIamAccessKeySessionContextAttributes) obj;
if (other.getMfaAuthenticated() == null ^ this.getMfaAuthenticated() == null)
return false;
if (other.getMfaAuthenticated() != null && other.getMfaAuthenticated().equals(this.getMfaAuthenticated()) == false)
return false;
if (other.getCreationDate() == null ^ this.getCreationDate() == null)
return false;
if (other.getCreationDate() != null && other.getCreationDate().equals(this.getCreationDate()) == false)
return false;
return true;
}
@Override
public int hashCode() {
final int prime = 31;
int hashCode = 1;
hashCode = prime * hashCode + ((getMfaAuthenticated() == null) ? 0 : getMfaAuthenticated().hashCode());
hashCode = prime * hashCode + ((getCreationDate() == null) ? 0 : getCreationDate().hashCode());
return hashCode;
}
@Override
public AwsIamAccessKeySessionContextAttributes clone() {
try {
return (AwsIamAccessKeySessionContextAttributes) super.clone();
} catch (CloneNotSupportedException e) {
throw new IllegalStateException("Got a CloneNotSupportedException from Object.clone() " + "even though we're Cloneable!", e);
}
}
@com.amazonaws.annotation.SdkInternalApi
@Override
public void marshall(ProtocolMarshaller protocolMarshaller) {
com.amazonaws.services.securityhub.model.transform.AwsIamAccessKeySessionContextAttributesMarshaller.getInstance().marshall(this, protocolMarshaller);
}
}