com.amazonaws.services.resourceexplorer2.model.Resource Maven / Gradle / Ivy
Show all versions of aws-java-sdk-resourceexplorer2 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.resourceexplorer2.model;
import java.io.Serializable;
import javax.annotation.Generated;
import com.amazonaws.protocol.StructuredPojo;
import com.amazonaws.protocol.ProtocolMarshaller;
/**
*
* A resource in Amazon Web Services that Amazon Web Services Resource Explorer has discovered, and for which it has
* stored information in the index of the Amazon Web Services Region that contains the resource.
*
*
* @see AWS API
* Documentation
*/
@Generated("com.amazonaws:aws-java-sdk-code-generator")
public class Resource implements Serializable, Cloneable, StructuredPojo {
/**
*
* The Amazon resource name
* (ARN) of the resource.
*
*/
private String arn;
/**
*
* The date and time that Resource Explorer last queried this resource and updated the index with the latest
* information about the resource.
*
*/
private java.util.Date lastReportedAt;
/**
*
* The Amazon Web Services account that owns the resource.
*
*/
private String owningAccountId;
/**
*
* A structure with additional type-specific details about the resource. These properties can be added by turning on
* integration between Resource Explorer and other Amazon Web Services services.
*
*/
private java.util.List properties;
/**
*
* The Amazon Web Services Region in which the resource was created and exists.
*
*/
private String region;
/**
*
* The type of the resource.
*
*/
private String resourceType;
/**
*
* The Amazon Web Service that owns the resource and is responsible for creating and updating it.
*
*/
private String service;
/**
*
* 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 Resource withArn(String arn) {
setArn(arn);
return this;
}
/**
*
* The date and time that Resource Explorer last queried this resource and updated the index with the latest
* information about the resource.
*
*
* @param lastReportedAt
* The date and time that Resource Explorer last queried this resource and updated the index with the latest
* information about the resource.
*/
public void setLastReportedAt(java.util.Date lastReportedAt) {
this.lastReportedAt = lastReportedAt;
}
/**
*
* The date and time that Resource Explorer last queried this resource and updated the index with the latest
* information about the resource.
*
*
* @return The date and time that Resource Explorer last queried this resource and updated the index with the latest
* information about the resource.
*/
public java.util.Date getLastReportedAt() {
return this.lastReportedAt;
}
/**
*
* The date and time that Resource Explorer last queried this resource and updated the index with the latest
* information about the resource.
*
*
* @param lastReportedAt
* The date and time that Resource Explorer last queried this resource and updated the index with the latest
* information about the resource.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public Resource withLastReportedAt(java.util.Date lastReportedAt) {
setLastReportedAt(lastReportedAt);
return this;
}
/**
*
* The Amazon Web Services account that owns the resource.
*
*
* @param owningAccountId
* The Amazon Web Services account that owns the resource.
*/
public void setOwningAccountId(String owningAccountId) {
this.owningAccountId = owningAccountId;
}
/**
*
* The Amazon Web Services account that owns the resource.
*
*
* @return The Amazon Web Services account that owns the resource.
*/
public String getOwningAccountId() {
return this.owningAccountId;
}
/**
*
* The Amazon Web Services account that owns the resource.
*
*
* @param owningAccountId
* The Amazon Web Services account that owns the resource.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public Resource withOwningAccountId(String owningAccountId) {
setOwningAccountId(owningAccountId);
return this;
}
/**
*
* A structure with additional type-specific details about the resource. These properties can be added by turning on
* integration between Resource Explorer and other Amazon Web Services services.
*
*
* @return A structure with additional type-specific details about the resource. These properties can be added by
* turning on integration between Resource Explorer and other Amazon Web Services services.
*/
public java.util.List getProperties() {
return properties;
}
/**
*
* A structure with additional type-specific details about the resource. These properties can be added by turning on
* integration between Resource Explorer and other Amazon Web Services services.
*
*
* @param properties
* A structure with additional type-specific details about the resource. These properties can be added by
* turning on integration between Resource Explorer and other Amazon Web Services services.
*/
public void setProperties(java.util.Collection properties) {
if (properties == null) {
this.properties = null;
return;
}
this.properties = new java.util.ArrayList(properties);
}
/**
*
* A structure with additional type-specific details about the resource. These properties can be added by turning on
* integration between Resource Explorer and other Amazon Web Services services.
*
*
* NOTE: This method appends the values to the existing list (if any). Use
* {@link #setProperties(java.util.Collection)} or {@link #withProperties(java.util.Collection)} if you want to
* override the existing values.
*
*
* @param properties
* A structure with additional type-specific details about the resource. These properties can be added by
* turning on integration between Resource Explorer and other Amazon Web Services services.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public Resource withProperties(ResourceProperty... properties) {
if (this.properties == null) {
setProperties(new java.util.ArrayList(properties.length));
}
for (ResourceProperty ele : properties) {
this.properties.add(ele);
}
return this;
}
/**
*
* A structure with additional type-specific details about the resource. These properties can be added by turning on
* integration between Resource Explorer and other Amazon Web Services services.
*
*
* @param properties
* A structure with additional type-specific details about the resource. These properties can be added by
* turning on integration between Resource Explorer and other Amazon Web Services services.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public Resource withProperties(java.util.Collection properties) {
setProperties(properties);
return this;
}
/**
*
* The Amazon Web Services Region in which the resource was created and exists.
*
*
* @param region
* The Amazon Web Services Region in which the resource was created and exists.
*/
public void setRegion(String region) {
this.region = region;
}
/**
*
* The Amazon Web Services Region in which the resource was created and exists.
*
*
* @return The Amazon Web Services Region in which the resource was created and exists.
*/
public String getRegion() {
return this.region;
}
/**
*
* The Amazon Web Services Region in which the resource was created and exists.
*
*
* @param region
* The Amazon Web Services Region in which the resource was created and exists.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public Resource withRegion(String region) {
setRegion(region);
return this;
}
/**
*
* The type of the resource.
*
*
* @param resourceType
* The type of the resource.
*/
public void setResourceType(String resourceType) {
this.resourceType = resourceType;
}
/**
*
* The type of the resource.
*
*
* @return The type of the resource.
*/
public String getResourceType() {
return this.resourceType;
}
/**
*
* The type of the resource.
*
*
* @param resourceType
* The type of the resource.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public Resource withResourceType(String resourceType) {
setResourceType(resourceType);
return this;
}
/**
*
* The Amazon Web Service that owns the resource and is responsible for creating and updating it.
*
*
* @param service
* The Amazon Web Service that owns the resource and is responsible for creating and updating it.
*/
public void setService(String service) {
this.service = service;
}
/**
*
* The Amazon Web Service that owns the resource and is responsible for creating and updating it.
*
*
* @return The Amazon Web Service that owns the resource and is responsible for creating and updating it.
*/
public String getService() {
return this.service;
}
/**
*
* The Amazon Web Service that owns the resource and is responsible for creating and updating it.
*
*
* @param service
* The Amazon Web Service that owns the resource and is responsible for creating and updating it.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public Resource withService(String service) {
setService(service);
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 (getArn() != null)
sb.append("Arn: ").append(getArn()).append(",");
if (getLastReportedAt() != null)
sb.append("LastReportedAt: ").append(getLastReportedAt()).append(",");
if (getOwningAccountId() != null)
sb.append("OwningAccountId: ").append(getOwningAccountId()).append(",");
if (getProperties() != null)
sb.append("Properties: ").append(getProperties()).append(",");
if (getRegion() != null)
sb.append("Region: ").append(getRegion()).append(",");
if (getResourceType() != null)
sb.append("ResourceType: ").append(getResourceType()).append(",");
if (getService() != null)
sb.append("Service: ").append(getService());
sb.append("}");
return sb.toString();
}
@Override
public boolean equals(Object obj) {
if (this == obj)
return true;
if (obj == null)
return false;
if (obj instanceof Resource == false)
return false;
Resource other = (Resource) obj;
if (other.getArn() == null ^ this.getArn() == null)
return false;
if (other.getArn() != null && other.getArn().equals(this.getArn()) == false)
return false;
if (other.getLastReportedAt() == null ^ this.getLastReportedAt() == null)
return false;
if (other.getLastReportedAt() != null && other.getLastReportedAt().equals(this.getLastReportedAt()) == false)
return false;
if (other.getOwningAccountId() == null ^ this.getOwningAccountId() == null)
return false;
if (other.getOwningAccountId() != null && other.getOwningAccountId().equals(this.getOwningAccountId()) == false)
return false;
if (other.getProperties() == null ^ this.getProperties() == null)
return false;
if (other.getProperties() != null && other.getProperties().equals(this.getProperties()) == false)
return false;
if (other.getRegion() == null ^ this.getRegion() == null)
return false;
if (other.getRegion() != null && other.getRegion().equals(this.getRegion()) == 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.getService() == null ^ this.getService() == null)
return false;
if (other.getService() != null && other.getService().equals(this.getService()) == false)
return false;
return true;
}
@Override
public int hashCode() {
final int prime = 31;
int hashCode = 1;
hashCode = prime * hashCode + ((getArn() == null) ? 0 : getArn().hashCode());
hashCode = prime * hashCode + ((getLastReportedAt() == null) ? 0 : getLastReportedAt().hashCode());
hashCode = prime * hashCode + ((getOwningAccountId() == null) ? 0 : getOwningAccountId().hashCode());
hashCode = prime * hashCode + ((getProperties() == null) ? 0 : getProperties().hashCode());
hashCode = prime * hashCode + ((getRegion() == null) ? 0 : getRegion().hashCode());
hashCode = prime * hashCode + ((getResourceType() == null) ? 0 : getResourceType().hashCode());
hashCode = prime * hashCode + ((getService() == null) ? 0 : getService().hashCode());
return hashCode;
}
@Override
public Resource clone() {
try {
return (Resource) 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.resourceexplorer2.model.transform.ResourceMarshaller.getInstance().marshall(this, protocolMarshaller);
}
}