All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.amazonaws.services.identitymanagement.model.AccessKeyLastUsed Maven / Gradle / Ivy

Go to download

The AWS Java SDK for AWS IAM module holds the client classes that are used for communicating with AWS Identity and Access Management Service

The newest version!
/*
 * Copyright 2020-2025 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;

/**
 * 

* Contains information about the last time an Amazon Web Services access key was used since IAM began tracking this * information on April 22, 2015. *

*

* This data type is used as a response element in the GetAccessKeyLastUsed operation. *

* * @see AWS API * Documentation */ @Generated("com.amazonaws:aws-java-sdk-code-generator") public class AccessKeyLastUsed implements Serializable, Cloneable { /** *

* The date and time, in ISO 8601 date-time format, when the access key * was most recently used. This field is null in the following situations: *

*
    *
  • *

    * The user does not have an access key. *

    *
  • *
  • *

    * An access key exists but has not been used since IAM began tracking this information. *

    *
  • *
  • *

    * There is no sign-in data associated with the user. *

    *
  • *
*/ private java.util.Date lastUsedDate; /** *

* The name of the Amazon Web Services service with which this access key was most recently used. The value of this * field is "N/A" in the following situations: *

*
    *
  • *

    * The user does not have an access key. *

    *
  • *
  • *

    * An access key exists but has not been used since IAM started tracking this information. *

    *
  • *
  • *

    * There is no sign-in data associated with the user. *

    *
  • *
*/ private String serviceName; /** *

* The Amazon Web Services Region where this access key was most recently used. The value for this field is "N/A" in * the following situations: *

*
    *
  • *

    * The user does not have an access key. *

    *
  • *
  • *

    * An access key exists but has not been used since IAM began tracking this information. *

    *
  • *
  • *

    * There is no sign-in data associated with the user. *

    *
  • *
*

* For more information about Amazon Web Services Regions, see Regions and endpoints in the Amazon Web * Services General Reference. *

*/ private String region; /** *

* The date and time, in ISO 8601 date-time format, when the access key * was most recently used. This field is null in the following situations: *

*
    *
  • *

    * The user does not have an access key. *

    *
  • *
  • *

    * An access key exists but has not been used since IAM began tracking this information. *

    *
  • *
  • *

    * There is no sign-in data associated with the user. *

    *
  • *
* * @param lastUsedDate * The date and time, in ISO 8601 date-time format, when the * access key was most recently used. This field is null in the following situations:

*
    *
  • *

    * The user does not have an access key. *

    *
  • *
  • *

    * An access key exists but has not been used since IAM began tracking this information. *

    *
  • *
  • *

    * There is no sign-in data associated with the user. *

    *
  • */ public void setLastUsedDate(java.util.Date lastUsedDate) { this.lastUsedDate = lastUsedDate; } /** *

    * The date and time, in ISO 8601 date-time format, when the access key * was most recently used. This field is null in the following situations: *

    *
      *
    • *

      * The user does not have an access key. *

      *
    • *
    • *

      * An access key exists but has not been used since IAM began tracking this information. *

      *
    • *
    • *

      * There is no sign-in data associated with the user. *

      *
    • *
    * * @return The date and time, in ISO 8601 date-time format, when the * access key was most recently used. This field is null in the following situations:

    *
      *
    • *

      * The user does not have an access key. *

      *
    • *
    • *

      * An access key exists but has not been used since IAM began tracking this information. *

      *
    • *
    • *

      * There is no sign-in data associated with the user. *

      *
    • */ public java.util.Date getLastUsedDate() { return this.lastUsedDate; } /** *

      * The date and time, in ISO 8601 date-time format, when the access key * was most recently used. This field is null in the following situations: *

      *
        *
      • *

        * The user does not have an access key. *

        *
      • *
      • *

        * An access key exists but has not been used since IAM began tracking this information. *

        *
      • *
      • *

        * There is no sign-in data associated with the user. *

        *
      • *
      * * @param lastUsedDate * The date and time, in ISO 8601 date-time format, when the * access key was most recently used. This field is null in the following situations:

      *
        *
      • *

        * The user does not have an access key. *

        *
      • *
      • *

        * An access key exists but has not been used since IAM began tracking this information. *

        *
      • *
      • *

        * There is no sign-in data associated with the user. *

        *
      • * @return Returns a reference to this object so that method calls can be chained together. */ public AccessKeyLastUsed withLastUsedDate(java.util.Date lastUsedDate) { setLastUsedDate(lastUsedDate); return this; } /** *

        * The name of the Amazon Web Services service with which this access key was most recently used. The value of this * field is "N/A" in the following situations: *

        *
          *
        • *

          * The user does not have an access key. *

          *
        • *
        • *

          * An access key exists but has not been used since IAM started tracking this information. *

          *
        • *
        • *

          * There is no sign-in data associated with the user. *

          *
        • *
        * * @param serviceName * The name of the Amazon Web Services service with which this access key was most recently used. The value * of this field is "N/A" in the following situations:

        *
          *
        • *

          * The user does not have an access key. *

          *
        • *
        • *

          * An access key exists but has not been used since IAM started tracking this information. *

          *
        • *
        • *

          * There is no sign-in data associated with the user. *

          *
        • */ public void setServiceName(String serviceName) { this.serviceName = serviceName; } /** *

          * The name of the Amazon Web Services service with which this access key was most recently used. The value of this * field is "N/A" in the following situations: *

          *
            *
          • *

            * The user does not have an access key. *

            *
          • *
          • *

            * An access key exists but has not been used since IAM started tracking this information. *

            *
          • *
          • *

            * There is no sign-in data associated with the user. *

            *
          • *
          * * @return The name of the Amazon Web Services service with which this access key was most recently used. The value * of this field is "N/A" in the following situations:

          *
            *
          • *

            * The user does not have an access key. *

            *
          • *
          • *

            * An access key exists but has not been used since IAM started tracking this information. *

            *
          • *
          • *

            * There is no sign-in data associated with the user. *

            *
          • */ public String getServiceName() { return this.serviceName; } /** *

            * The name of the Amazon Web Services service with which this access key was most recently used. The value of this * field is "N/A" in the following situations: *

            *
              *
            • *

              * The user does not have an access key. *

              *
            • *
            • *

              * An access key exists but has not been used since IAM started tracking this information. *

              *
            • *
            • *

              * There is no sign-in data associated with the user. *

              *
            • *
            * * @param serviceName * The name of the Amazon Web Services service with which this access key was most recently used. The value * of this field is "N/A" in the following situations:

            *
              *
            • *

              * The user does not have an access key. *

              *
            • *
            • *

              * An access key exists but has not been used since IAM started tracking this information. *

              *
            • *
            • *

              * There is no sign-in data associated with the user. *

              *
            • * @return Returns a reference to this object so that method calls can be chained together. */ public AccessKeyLastUsed withServiceName(String serviceName) { setServiceName(serviceName); return this; } /** *

              * The Amazon Web Services Region where this access key was most recently used. The value for this field is "N/A" in * the following situations: *

              *
                *
              • *

                * The user does not have an access key. *

                *
              • *
              • *

                * An access key exists but has not been used since IAM began tracking this information. *

                *
              • *
              • *

                * There is no sign-in data associated with the user. *

                *
              • *
              *

              * For more information about Amazon Web Services Regions, see Regions and endpoints in the Amazon Web * Services General Reference. *

              * * @param region * The Amazon Web Services Region where this access key was most recently used. The value for this field is * "N/A" in the following situations:

              *
                *
              • *

                * The user does not have an access key. *

                *
              • *
              • *

                * An access key exists but has not been used since IAM began tracking this information. *

                *
              • *
              • *

                * There is no sign-in data associated with the user. *

                *
              • *
              *

              * For more information about Amazon Web Services Regions, see Regions and endpoints in the Amazon * Web Services General Reference. */ public void setRegion(String region) { this.region = region; } /** *

              * The Amazon Web Services Region where this access key was most recently used. The value for this field is "N/A" in * the following situations: *

              *
                *
              • *

                * The user does not have an access key. *

                *
              • *
              • *

                * An access key exists but has not been used since IAM began tracking this information. *

                *
              • *
              • *

                * There is no sign-in data associated with the user. *

                *
              • *
              *

              * For more information about Amazon Web Services Regions, see Regions and endpoints in the Amazon Web * Services General Reference. *

              * * @return The Amazon Web Services Region where this access key was most recently used. The value for this field is * "N/A" in the following situations:

              *
                *
              • *

                * The user does not have an access key. *

                *
              • *
              • *

                * An access key exists but has not been used since IAM began tracking this information. *

                *
              • *
              • *

                * There is no sign-in data associated with the user. *

                *
              • *
              *

              * For more information about Amazon Web Services Regions, see Regions and endpoints in the Amazon * Web Services General Reference. */ public String getRegion() { return this.region; } /** *

              * The Amazon Web Services Region where this access key was most recently used. The value for this field is "N/A" in * the following situations: *

              *
                *
              • *

                * The user does not have an access key. *

                *
              • *
              • *

                * An access key exists but has not been used since IAM began tracking this information. *

                *
              • *
              • *

                * There is no sign-in data associated with the user. *

                *
              • *
              *

              * For more information about Amazon Web Services Regions, see Regions and endpoints in the Amazon Web * Services General Reference. *

              * * @param region * The Amazon Web Services Region where this access key was most recently used. The value for this field is * "N/A" in the following situations:

              *
                *
              • *

                * The user does not have an access key. *

                *
              • *
              • *

                * An access key exists but has not been used since IAM began tracking this information. *

                *
              • *
              • *

                * There is no sign-in data associated with the user. *

                *
              • *
              *

              * For more information about Amazon Web Services Regions, see Regions and endpoints in the Amazon * Web Services General Reference. * @return Returns a reference to this object so that method calls can be chained together. */ public AccessKeyLastUsed withRegion(String region) { setRegion(region); 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 (getLastUsedDate() != null) sb.append("LastUsedDate: ").append(getLastUsedDate()).append(","); if (getServiceName() != null) sb.append("ServiceName: ").append(getServiceName()).append(","); if (getRegion() != null) sb.append("Region: ").append(getRegion()); sb.append("}"); return sb.toString(); } @Override public boolean equals(Object obj) { if (this == obj) return true; if (obj == null) return false; if (obj instanceof AccessKeyLastUsed == false) return false; AccessKeyLastUsed other = (AccessKeyLastUsed) obj; if (other.getLastUsedDate() == null ^ this.getLastUsedDate() == null) return false; if (other.getLastUsedDate() != null && other.getLastUsedDate().equals(this.getLastUsedDate()) == false) return false; if (other.getServiceName() == null ^ this.getServiceName() == null) return false; if (other.getServiceName() != null && other.getServiceName().equals(this.getServiceName()) == false) return false; if (other.getRegion() == null ^ this.getRegion() == null) return false; if (other.getRegion() != null && other.getRegion().equals(this.getRegion()) == false) return false; return true; } @Override public int hashCode() { final int prime = 31; int hashCode = 1; hashCode = prime * hashCode + ((getLastUsedDate() == null) ? 0 : getLastUsedDate().hashCode()); hashCode = prime * hashCode + ((getServiceName() == null) ? 0 : getServiceName().hashCode()); hashCode = prime * hashCode + ((getRegion() == null) ? 0 : getRegion().hashCode()); return hashCode; } @Override public AccessKeyLastUsed clone() { try { return (AccessKeyLastUsed) super.clone(); } catch (CloneNotSupportedException e) { throw new IllegalStateException("Got a CloneNotSupportedException from Object.clone() " + "even though we're Cloneable!", e); } } }





© 2015 - 2025 Weber Informatics LLC | Privacy Policy