/* * 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.config.model; import java.io.Serializable; import javax.annotation.Generated; import com.amazonaws.protocol.StructuredPojo; import com.amazonaws.protocol.ProtocolMarshaller; /** *

* The detailed configuration of a specified resource. *

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

* The version number of the resource configuration. *

*/ private String version; /** *

* The 12-digit Amazon Web Services account ID associated with the resource. *

*/ private String accountId; /** *

* The time when the configuration recording was initiated. *

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

* The configuration item status. The valid values are: *

* * *

* The CIs do not incur any cost. *

*
*/ private String configurationItemStatus; /** *

* An identifier that indicates the ordering of the configuration items of a resource. *

*/ private String configurationStateId; /** *

* The Amazon Resource Name (ARN) of the resource. *

*/ private String arn; /** *

* The type of Amazon Web Services resource. *

*/ private String resourceType; /** *

* The ID of the resource (for example., sg-xxxxxx). *

*/ private String resourceId; /** *

* The custom name of the resource, if available. *

*/ private String resourceName; /** *

* The region where the resource resides. *

*/ private String awsRegion; /** *

* The Availability Zone associated with the resource. *

*/ private String availabilityZone; /** *

* The time stamp when the resource was created. *

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

* The description of the resource configuration. *

*/ private String configuration; /** *

* Configuration attributes that Config returns for certain resource types to supplement the information returned * for the configuration parameter. *

*/ private java.util.Map supplementaryConfiguration; /** *

* The version number of the resource configuration. *

* * @param version * The version number of the resource configuration. */ public void setVersion(String version) { this.version = version; } /** *

* The version number of the resource configuration. *

* * @return The version number of the resource configuration. */ public String getVersion() { return this.version; } /** *

* The version number of the resource configuration. *

* * @param version * The version number of the resource configuration. * @return Returns a reference to this object so that method calls can be chained together. */ public BaseConfigurationItem withVersion(String version) { setVersion(version); return this; } /** *

* The 12-digit Amazon Web Services account ID associated with the resource. *

* * @param accountId * The 12-digit Amazon Web Services account ID associated with the resource. */ public void setAccountId(String accountId) { this.accountId = accountId; } /** *

* The 12-digit Amazon Web Services account ID associated with the resource. *

* * @return The 12-digit Amazon Web Services account ID associated with the resource. */ public String getAccountId() { return this.accountId; } /** *

* The 12-digit Amazon Web Services account ID associated with the resource. *

* * @param accountId * The 12-digit Amazon Web Services account ID associated with the resource. * @return Returns a reference to this object so that method calls can be chained together. */ public BaseConfigurationItem withAccountId(String accountId) { setAccountId(accountId); return this; } /** *

* The time when the configuration recording was initiated. *

* * @param configurationItemCaptureTime * The time when the configuration recording was initiated. */ public void setConfigurationItemCaptureTime(java.util.Date configurationItemCaptureTime) { this.configurationItemCaptureTime = configurationItemCaptureTime; } /** *

* The time when the configuration recording was initiated. *

* * @return The time when the configuration recording was initiated. */ public java.util.Date getConfigurationItemCaptureTime() { return this.configurationItemCaptureTime; } /** *

* The time when the configuration recording was initiated. *

* * @param configurationItemCaptureTime * The time when the configuration recording was initiated. * @return Returns a reference to this object so that method calls can be chained together. */ public BaseConfigurationItem withConfigurationItemCaptureTime(java.util.Date configurationItemCaptureTime) { setConfigurationItemCaptureTime(configurationItemCaptureTime); return this; } /** *

* The configuration item status. The valid values are: *

* * *

* The CIs do not incur any cost. *

*
* * @param configurationItemStatus * The configuration item status. The valid values are:

* * *

* The CIs do not incur any cost. *

* @see ConfigurationItemStatus */ public void setConfigurationItemStatus(String configurationItemStatus) { this.configurationItemStatus = configurationItemStatus; } /** *

* The configuration item status. The valid values are: *

* * *

* The CIs do not incur any cost. *

*
* * @return The configuration item status. The valid values are:

* * *

* The CIs do not incur any cost. *

* @see ConfigurationItemStatus */ public String getConfigurationItemStatus() { return this.configurationItemStatus; } /** *

* The configuration item status. The valid values are: *

*
    *
  • *

    * OK – The resource configuration has been updated *

    *
  • *
  • *

    * ResourceDiscovered – The resource was newly discovered *

    *
  • *
  • *

    * ResourceNotRecorded – The resource was discovered but its configuration was not recorded since the recorder * excludes the recording of resources of this type *

    *
  • *
  • *

    * ResourceDeleted – The resource was deleted *

    *
  • *
  • *

    * ResourceDeletedNotRecorded – The resource was deleted but its configuration was not recorded since the recorder * excludes the recording of resources of this type *

    *
  • *
* *

* The CIs do not incur any cost. *

*
* * @param configurationItemStatus * The configuration item status. The valid values are:

*
    *
  • *

    * OK – The resource configuration has been updated *

    *
  • *
  • *

    * ResourceDiscovered – The resource was newly discovered *

    *
  • *
  • *

    * ResourceNotRecorded – The resource was discovered but its configuration was not recorded since the * recorder excludes the recording of resources of this type *

    *
  • *
  • *

    * ResourceDeleted – The resource was deleted *

    *
  • *
  • *

    * ResourceDeletedNotRecorded – The resource was deleted but its configuration was not recorded since the * recorder excludes the recording of resources of this type *

    *
  • *
* *

* The CIs do not incur any cost. *

* @return Returns a reference to this object so that method calls can be chained together. * @see ConfigurationItemStatus */ public BaseConfigurationItem withConfigurationItemStatus(String configurationItemStatus) { setConfigurationItemStatus(configurationItemStatus); return this; } /** *

* The configuration item status. The valid values are: *

*
    *
  • *

    * OK – The resource configuration has been updated *

    *
  • *
  • *

    * ResourceDiscovered – The resource was newly discovered *

    *
  • *
  • *

    * ResourceNotRecorded – The resource was discovered but its configuration was not recorded since the recorder * excludes the recording of resources of this type *

    *
  • *
  • *

    * ResourceDeleted – The resource was deleted *

    *
  • *
  • *

    * ResourceDeletedNotRecorded – The resource was deleted but its configuration was not recorded since the recorder * excludes the recording of resources of this type *

    *
  • *
* *

* The CIs do not incur any cost. *

*
* * @param configurationItemStatus * The configuration item status. The valid values are:

*
    *
  • *

    * OK – The resource configuration has been updated *

    *
  • *
  • *

    * ResourceDiscovered – The resource was newly discovered *

    *
  • *
  • *

    * ResourceNotRecorded – The resource was discovered but its configuration was not recorded since the * recorder excludes the recording of resources of this type *

    *
  • *
  • *

    * ResourceDeleted – The resource was deleted *

    *
  • *
  • *

    * ResourceDeletedNotRecorded – The resource was deleted but its configuration was not recorded since the * recorder excludes the recording of resources of this type *

    *
  • *
* *

* The CIs do not incur any cost. *

* @return Returns a reference to this object so that method calls can be chained together. * @see ConfigurationItemStatus */ public BaseConfigurationItem withConfigurationItemStatus(ConfigurationItemStatus configurationItemStatus) { this.configurationItemStatus = configurationItemStatus.toString(); return this; } /** *

* An identifier that indicates the ordering of the configuration items of a resource. *

* * @param configurationStateId * An identifier that indicates the ordering of the configuration items of a resource. */ public void setConfigurationStateId(String configurationStateId) { this.configurationStateId = configurationStateId; } /** *

* An identifier that indicates the ordering of the configuration items of a resource. *

* * @return An identifier that indicates the ordering of the configuration items of a resource. */ public String getConfigurationStateId() { return this.configurationStateId; } /** *

* An identifier that indicates the ordering of the configuration items of a resource. *

* * @param configurationStateId * An identifier that indicates the ordering of the configuration items of a resource. * @return Returns a reference to this object so that method calls can be chained together. */ public BaseConfigurationItem withConfigurationStateId(String configurationStateId) { setConfigurationStateId(configurationStateId); return this; } /** *

* The Amazon Resource Name (ARN) of the resource. *

* * @param arn * The Amazon Resource Name (ARN) of the resource. */ public void setArn(String arn) { this.arn = arn; } /** *

* The Amazon Resource Name (ARN) of the resource. *

* * @return The Amazon Resource Name (ARN) of the resource. */ public String getArn() { return this.arn; } /** *

* The Amazon Resource Name (ARN) of the resource. *

* * @param arn * The Amazon Resource Name (ARN) of the resource. * @return Returns a reference to this object so that method calls can be chained together. */ public BaseConfigurationItem withArn(String arn) { setArn(arn); return this; } /** *

* The type of Amazon Web Services resource. *

* * @param resourceType * The type of Amazon Web Services resource. * @see ResourceType */ public void setResourceType(String resourceType) { this.resourceType = resourceType; } /** *

* The type of Amazon Web Services resource. *

* * @return The type of Amazon Web Services resource. * @see ResourceType */ public String getResourceType() { return this.resourceType; } /** *

* The type of Amazon Web Services resource. *

* * @param resourceType * The type of Amazon Web Services resource. * @return Returns a reference to this object so that method calls can be chained together. * @see ResourceType */ public BaseConfigurationItem withResourceType(String resourceType) { setResourceType(resourceType); return this; } /** *

* The type of Amazon Web Services resource. *

* * @param resourceType * The type of Amazon Web Services resource. * @return Returns a reference to this object so that method calls can be chained together. * @see ResourceType */ public BaseConfigurationItem withResourceType(ResourceType resourceType) { this.resourceType = resourceType.toString(); return this; } /** *

* The ID of the resource (for example., sg-xxxxxx). *

* * @param resourceId * The ID of the resource (for example., sg-xxxxxx). */ public void setResourceId(String resourceId) { this.resourceId = resourceId; } /** *

* The ID of the resource (for example., sg-xxxxxx). *

* * @return The ID of the resource (for example., sg-xxxxxx). */ public String getResourceId() { return this.resourceId; } /** *

* The ID of the resource (for example., sg-xxxxxx). *

* * @param resourceId * The ID of the resource (for example., sg-xxxxxx). * @return Returns a reference to this object so that method calls can be chained together. */ public BaseConfigurationItem withResourceId(String resourceId) { setResourceId(resourceId); return this; } /** *

* The custom name of the resource, if available. *

* * @param resourceName * The custom name of the resource, if available. */ public void setResourceName(String resourceName) { this.resourceName = resourceName; } /** *

* The custom name of the resource, if available. *

* * @return The custom name of the resource, if available. */ public String getResourceName() { return this.resourceName; } /** *

* The custom name of the resource, if available. *

* * @param resourceName * The custom name of the resource, if available. * @return Returns a reference to this object so that method calls can be chained together. */ public BaseConfigurationItem withResourceName(String resourceName) { setResourceName(resourceName); return this; } /** *

* The region where the resource resides. *

* * @param awsRegion * The region where the resource resides. */ public void setAwsRegion(String awsRegion) { this.awsRegion = awsRegion; } /** *

* The region where the resource resides. *

* * @return The region where the resource resides. */ public String getAwsRegion() { return this.awsRegion; } /** *

* The region where the resource resides. *

* * @param awsRegion * The region where the resource resides. * @return Returns a reference to this object so that method calls can be chained together. */ public BaseConfigurationItem withAwsRegion(String awsRegion) { setAwsRegion(awsRegion); return this; } /** *

* The Availability Zone associated with the resource. *

* * @param availabilityZone * The Availability Zone associated with the resource. */ public void setAvailabilityZone(String availabilityZone) { this.availabilityZone = availabilityZone; } /** *

* The Availability Zone associated with the resource. *

* * @return The Availability Zone associated with the resource. */ public String getAvailabilityZone() { return this.availabilityZone; } /** *

* The Availability Zone associated with the resource. *

* * @param availabilityZone * The Availability Zone associated with the resource. * @return Returns a reference to this object so that method calls can be chained together. */ public BaseConfigurationItem withAvailabilityZone(String availabilityZone) { setAvailabilityZone(availabilityZone); return this; } /** *

* The time stamp when the resource was created. *

* * @param resourceCreationTime * The time stamp when the resource was created. */ public void setResourceCreationTime(java.util.Date resourceCreationTime) { this.resourceCreationTime = resourceCreationTime; } /** *

* The time stamp when the resource was created. *

* * @return The time stamp when the resource was created. */ public java.util.Date getResourceCreationTime() { return this.resourceCreationTime; } /** *

* The time stamp when the resource was created. *

* * @param resourceCreationTime * The time stamp when the resource was created. * @return Returns a reference to this object so that method calls can be chained together. */ public BaseConfigurationItem withResourceCreationTime(java.util.Date resourceCreationTime) { setResourceCreationTime(resourceCreationTime); return this; } /** *

* The description of the resource configuration. *

* * @param configuration * The description of the resource configuration. */ public void setConfiguration(String configuration) { this.configuration = configuration; } /** *

* The description of the resource configuration. *

* * @return The description of the resource configuration. */ public String getConfiguration() { return this.configuration; } /** *

* The description of the resource configuration. *

* * @param configuration * The description of the resource configuration. * @return Returns a reference to this object so that method calls can be chained together. */ public BaseConfigurationItem withConfiguration(String configuration) { setConfiguration(configuration); return this; } /** *

* Configuration attributes that Config returns for certain resource types to supplement the information returned * for the configuration parameter. *

* * @return Configuration attributes that Config returns for certain resource types to supplement the information * returned for the configuration parameter. */ public java.util.Map getSupplementaryConfiguration() { return supplementaryConfiguration; } /** *

* Configuration attributes that Config returns for certain resource types to supplement the information returned * for the configuration parameter. *

* * @param supplementaryConfiguration * Configuration attributes that Config returns for certain resource types to supplement the information * returned for the configuration parameter. */ public void setSupplementaryConfiguration(java.util.Map supplementaryConfiguration) { this.supplementaryConfiguration = supplementaryConfiguration; } /** *

* Configuration attributes that Config returns for certain resource types to supplement the information returned * for the configuration parameter. *

* * @param supplementaryConfiguration * Configuration attributes that Config returns for certain resource types to supplement the information * returned for the configuration parameter. * @return Returns a reference to this object so that method calls can be chained together. */ public BaseConfigurationItem withSupplementaryConfiguration(java.util.Map supplementaryConfiguration) { setSupplementaryConfiguration(supplementaryConfiguration); return this; } /** * Add a single SupplementaryConfiguration entry * * @see BaseConfigurationItem#withSupplementaryConfiguration * @returns a reference to this object so that method calls can be chained together. */ public BaseConfigurationItem addSupplementaryConfigurationEntry(String key, String value) { if (null == this.supplementaryConfiguration) { this.supplementaryConfiguration = new java.util.HashMap(); } if (this.supplementaryConfiguration.containsKey(key)) throw new IllegalArgumentException("Duplicated keys (" + key.toString() + ") are provided."); this.supplementaryConfiguration.put(key, value); return this; } /** * Removes all the entries added into SupplementaryConfiguration. * * @return Returns a reference to this object so that method calls can be chained together. */ public BaseConfigurationItem clearSupplementaryConfigurationEntries() { this.supplementaryConfiguration = 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 (getVersion() != null) sb.append("Version: ").append(getVersion()).append(","); if (getAccountId() != null) sb.append("AccountId: ").append(getAccountId()).append(","); if (getConfigurationItemCaptureTime() != null) sb.append("ConfigurationItemCaptureTime: ").append(getConfigurationItemCaptureTime()).append(","); if (getConfigurationItemStatus() != null) sb.append("ConfigurationItemStatus: ").append(getConfigurationItemStatus()).append(","); if (getConfigurationStateId() != null) sb.append("ConfigurationStateId: ").append(getConfigurationStateId()).append(","); if (getArn() != null) sb.append("Arn: ").append(getArn()).append(","); if (getResourceType() != null) sb.append("ResourceType: ").append(getResourceType()).append(","); if (getResourceId() != null) sb.append("ResourceId: ").append(getResourceId()).append(","); if (getResourceName() != null) sb.append("ResourceName: ").append(getResourceName()).append(","); if (getAwsRegion() != null) sb.append("AwsRegion: ").append(getAwsRegion()).append(","); if (getAvailabilityZone() != null) sb.append("AvailabilityZone: ").append(getAvailabilityZone()).append(","); if (getResourceCreationTime() != null) sb.append("ResourceCreationTime: ").append(getResourceCreationTime()).append(","); if (getConfiguration() != null) sb.append("Configuration: ").append(getConfiguration()).append(","); if (getSupplementaryConfiguration() != null) sb.append("SupplementaryConfiguration: ").append(getSupplementaryConfiguration()); sb.append("}"); return sb.toString(); } @Override public boolean equals(Object obj) { if (this == obj) return true; if (obj == null) return false; if (obj instanceof BaseConfigurationItem == false) return false; BaseConfigurationItem other = (BaseConfigurationItem) obj; if (other.getVersion() == null ^ this.getVersion() == null) return false; if (other.getVersion() != null && other.getVersion().equals(this.getVersion()) == false) return false; if (other.getAccountId() == null ^ this.getAccountId() == null) return false; if (other.getAccountId() != null && other.getAccountId().equals(this.getAccountId()) == false) return false; if (other.getConfigurationItemCaptureTime() == null ^ this.getConfigurationItemCaptureTime() == null) return false; if (other.getConfigurationItemCaptureTime() != null && other.getConfigurationItemCaptureTime().equals(this.getConfigurationItemCaptureTime()) == false) return false; if (other.getConfigurationItemStatus() == null ^ this.getConfigurationItemStatus() == null) return false; if (other.getConfigurationItemStatus() != null && other.getConfigurationItemStatus().equals(this.getConfigurationItemStatus()) == false) return false; if (other.getConfigurationStateId() == null ^ this.getConfigurationStateId() == null) return false; if (other.getConfigurationStateId() != null && other.getConfigurationStateId().equals(this.getConfigurationStateId()) == false) return false; if (other.getArn() == null ^ this.getArn() == null) return false; if (other.getArn() != null && other.getArn().equals(this.getArn()) == false) return false; if (other.getResourceType() == null ^ this.getResourceType() == null) return false; if (other.getResourceType() != null && other.getResourceType().equals(this.getResourceType()) == false) return false; if (other.getResourceId() == null ^ this.getResourceId() == null) return false; if (other.getResourceId() != null && other.getResourceId().equals(this.getResourceId()) == false) return false; if (other.getResourceName() == null ^ this.getResourceName() == null) return false; if (other.getResourceName() != null && other.getResourceName().equals(this.getResourceName()) == false) return false; if (other.getAwsRegion() == null ^ this.getAwsRegion() == null) return false; if (other.getAwsRegion() != null && other.getAwsRegion().equals(this.getAwsRegion()) == false) return false; if (other.getAvailabilityZone() == null ^ this.getAvailabilityZone() == null) return false; if (other.getAvailabilityZone() != null && other.getAvailabilityZone().equals(this.getAvailabilityZone()) == false) return false; if (other.getResourceCreationTime() == null ^ this.getResourceCreationTime() == null) return false; if (other.getResourceCreationTime() != null && other.getResourceCreationTime().equals(this.getResourceCreationTime()) == false) return false; if (other.getConfiguration() == null ^ this.getConfiguration() == null) return false; if (other.getConfiguration() != null && other.getConfiguration().equals(this.getConfiguration()) == false) return false; if (other.getSupplementaryConfiguration() == null ^ this.getSupplementaryConfiguration() == null) return false; if (other.getSupplementaryConfiguration() != null && other.getSupplementaryConfiguration().equals(this.getSupplementaryConfiguration()) == false) return false; return true; } @Override public int hashCode() { final int prime = 31; int hashCode = 1; hashCode = prime * hashCode + ((getVersion() == null) ? 0 : getVersion().hashCode()); hashCode = prime * hashCode + ((getAccountId() == null) ? 0 : getAccountId().hashCode()); hashCode = prime * hashCode + ((getConfigurationItemCaptureTime() == null) ? 0 : getConfigurationItemCaptureTime().hashCode()); hashCode = prime * hashCode + ((getConfigurationItemStatus() == null) ? 0 : getConfigurationItemStatus().hashCode()); hashCode = prime * hashCode + ((getConfigurationStateId() == null) ? 0 : getConfigurationStateId().hashCode()); hashCode = prime * hashCode + ((getArn() == null) ? 0 : getArn().hashCode()); hashCode = prime * hashCode + ((getResourceType() == null) ? 0 : getResourceType().hashCode()); hashCode = prime * hashCode + ((getResourceId() == null) ? 0 : getResourceId().hashCode()); hashCode = prime * hashCode + ((getResourceName() == null) ? 0 : getResourceName().hashCode()); hashCode = prime * hashCode + ((getAwsRegion() == null) ? 0 : getAwsRegion().hashCode()); hashCode = prime * hashCode + ((getAvailabilityZone() == null) ? 0 : getAvailabilityZone().hashCode()); hashCode = prime * hashCode + ((getResourceCreationTime() == null) ? 0 : getResourceCreationTime().hashCode()); hashCode = prime * hashCode + ((getConfiguration() == null) ? 0 : getConfiguration().hashCode()); hashCode = prime * hashCode + ((getSupplementaryConfiguration() == null) ? 0 : getSupplementaryConfiguration().hashCode()); return hashCode; } @Override public BaseConfigurationItem clone() { try { return (BaseConfigurationItem) 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.config.model.transform.BaseConfigurationItemMarshaller.getInstance().marshall(this, protocolMarshaller); } }