/* * 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.accessanalyzer.model; import java.io.Serializable; import javax.annotation.Generated; import com.amazonaws.protocol.StructuredPojo; import com.amazonaws.protocol.ProtocolMarshaller; /** *
* Contains information about a finding. *
* * @see AWS API * Documentation */ @Generated("com.amazonaws:aws-java-sdk-code-generator") public class Finding implements Serializable, Cloneable, StructuredPojo { /** ** The ID of the finding. *
*/ private String id; /** ** The external principal that access to a resource within the zone of trust. *
*/ private java.util.Map* The action in the analyzed policy statement that an external principal has permission to use. *
*/ private java.util.List* The resource that an external principal has access to. *
*/ private String resource; /** ** Indicates whether the policy that generated the finding allows public access to the resource. *
*/ private Boolean isPublic; /** ** The type of the resource identified in the finding. *
*/ private String resourceType; /** ** The condition in the analyzed policy statement that resulted in a finding. *
*/ private java.util.Map* The time at which the finding was generated. *
*/ private java.util.Date createdAt; /** ** The time at which the resource was analyzed. *
*/ private java.util.Date analyzedAt; /** ** The time at which the finding was updated. *
*/ private java.util.Date updatedAt; /** ** The current status of the finding. *
*/ private String status; /** ** The Amazon Web Services account ID that owns the resource. *
*/ private String resourceOwnerAccount; /** ** An error. *
*/ private String error; /** ** The sources of the finding. This indicates how the access that generated the finding is granted. It is populated * for Amazon S3 bucket findings. *
*/ private java.util.List* The ID of the finding. *
* * @param id * The ID of the finding. */ public void setId(String id) { this.id = id; } /** ** The ID of the finding. *
* * @return The ID of the finding. */ public String getId() { return this.id; } /** ** The ID of the finding. *
* * @param id * The ID of the finding. * @return Returns a reference to this object so that method calls can be chained together. */ public Finding withId(String id) { setId(id); return this; } /** ** The external principal that access to a resource within the zone of trust. *
* * @return The external principal that access to a resource within the zone of trust. */ public java.util.Map* The external principal that access to a resource within the zone of trust. *
* * @param principal * The external principal that access to a resource within the zone of trust. */ public void setPrincipal(java.util.Map* The external principal that access to a resource within the zone of trust. *
* * @param principal * The external principal that access to a resource within the zone of trust. * @return Returns a reference to this object so that method calls can be chained together. */ public Finding withPrincipal(java.util.Map* The action in the analyzed policy statement that an external principal has permission to use. *
* * @return The action in the analyzed policy statement that an external principal has permission to use. */ public java.util.List* The action in the analyzed policy statement that an external principal has permission to use. *
* * @param action * The action in the analyzed policy statement that an external principal has permission to use. */ public void setAction(java.util.Collection* The action in the analyzed policy statement that an external principal has permission to use. *
** NOTE: This method appends the values to the existing list (if any). Use * {@link #setAction(java.util.Collection)} or {@link #withAction(java.util.Collection)} if you want to override the * existing values. *
* * @param action * The action in the analyzed policy statement that an external principal has permission to use. * @return Returns a reference to this object so that method calls can be chained together. */ public Finding withAction(String... action) { if (this.action == null) { setAction(new java.util.ArrayList* The action in the analyzed policy statement that an external principal has permission to use. *
* * @param action * The action in the analyzed policy statement that an external principal has permission to use. * @return Returns a reference to this object so that method calls can be chained together. */ public Finding withAction(java.util.Collection* The resource that an external principal has access to. *
* * @param resource * The resource that an external principal has access to. */ public void setResource(String resource) { this.resource = resource; } /** ** The resource that an external principal has access to. *
* * @return The resource that an external principal has access to. */ public String getResource() { return this.resource; } /** ** The resource that an external principal has access to. *
* * @param resource * The resource that an external principal has access to. * @return Returns a reference to this object so that method calls can be chained together. */ public Finding withResource(String resource) { setResource(resource); return this; } /** ** Indicates whether the policy that generated the finding allows public access to the resource. *
* * @param isPublic * Indicates whether the policy that generated the finding allows public access to the resource. */ public void setIsPublic(Boolean isPublic) { this.isPublic = isPublic; } /** ** Indicates whether the policy that generated the finding allows public access to the resource. *
* * @return Indicates whether the policy that generated the finding allows public access to the resource. */ public Boolean getIsPublic() { return this.isPublic; } /** ** Indicates whether the policy that generated the finding allows public access to the resource. *
* * @param isPublic * Indicates whether the policy that generated the finding allows public access to the resource. * @return Returns a reference to this object so that method calls can be chained together. */ public Finding withIsPublic(Boolean isPublic) { setIsPublic(isPublic); return this; } /** ** Indicates whether the policy that generated the finding allows public access to the resource. *
* * @return Indicates whether the policy that generated the finding allows public access to the resource. */ public Boolean isPublic() { return this.isPublic; } /** ** The type of the resource identified in the finding. *
* * @param resourceType * The type of the resource identified in the finding. * @see ResourceType */ public void setResourceType(String resourceType) { this.resourceType = resourceType; } /** ** The type of the resource identified in the finding. *
* * @return The type of the resource identified in the finding. * @see ResourceType */ public String getResourceType() { return this.resourceType; } /** ** The type of the resource identified in the finding. *
* * @param resourceType * The type of the resource identified in the finding. * @return Returns a reference to this object so that method calls can be chained together. * @see ResourceType */ public Finding withResourceType(String resourceType) { setResourceType(resourceType); return this; } /** ** The type of the resource identified in the finding. *
* * @param resourceType * The type of the resource identified in the finding. * @return Returns a reference to this object so that method calls can be chained together. * @see ResourceType */ public Finding withResourceType(ResourceType resourceType) { this.resourceType = resourceType.toString(); return this; } /** ** The condition in the analyzed policy statement that resulted in a finding. *
* * @return The condition in the analyzed policy statement that resulted in a finding. */ public java.util.Map* The condition in the analyzed policy statement that resulted in a finding. *
* * @param condition * The condition in the analyzed policy statement that resulted in a finding. */ public void setCondition(java.util.Map* The condition in the analyzed policy statement that resulted in a finding. *
* * @param condition * The condition in the analyzed policy statement that resulted in a finding. * @return Returns a reference to this object so that method calls can be chained together. */ public Finding withCondition(java.util.Map* The time at which the finding was generated. *
* * @param createdAt * The time at which the finding was generated. */ public void setCreatedAt(java.util.Date createdAt) { this.createdAt = createdAt; } /** ** The time at which the finding was generated. *
* * @return The time at which the finding was generated. */ public java.util.Date getCreatedAt() { return this.createdAt; } /** ** The time at which the finding was generated. *
* * @param createdAt * The time at which the finding was generated. * @return Returns a reference to this object so that method calls can be chained together. */ public Finding withCreatedAt(java.util.Date createdAt) { setCreatedAt(createdAt); return this; } /** ** The time at which the resource was analyzed. *
* * @param analyzedAt * The time at which the resource was analyzed. */ public void setAnalyzedAt(java.util.Date analyzedAt) { this.analyzedAt = analyzedAt; } /** ** The time at which the resource was analyzed. *
* * @return The time at which the resource was analyzed. */ public java.util.Date getAnalyzedAt() { return this.analyzedAt; } /** ** The time at which the resource was analyzed. *
* * @param analyzedAt * The time at which the resource was analyzed. * @return Returns a reference to this object so that method calls can be chained together. */ public Finding withAnalyzedAt(java.util.Date analyzedAt) { setAnalyzedAt(analyzedAt); return this; } /** ** The time at which the finding was updated. *
* * @param updatedAt * The time at which the finding was updated. */ public void setUpdatedAt(java.util.Date updatedAt) { this.updatedAt = updatedAt; } /** ** The time at which the finding was updated. *
* * @return The time at which the finding was updated. */ public java.util.Date getUpdatedAt() { return this.updatedAt; } /** ** The time at which the finding was updated. *
* * @param updatedAt * The time at which the finding was updated. * @return Returns a reference to this object so that method calls can be chained together. */ public Finding withUpdatedAt(java.util.Date updatedAt) { setUpdatedAt(updatedAt); return this; } /** ** The current status of the finding. *
* * @param status * The current status of the finding. * @see FindingStatus */ public void setStatus(String status) { this.status = status; } /** ** The current status of the finding. *
* * @return The current status of the finding. * @see FindingStatus */ public String getStatus() { return this.status; } /** ** The current status of the finding. *
* * @param status * The current status of the finding. * @return Returns a reference to this object so that method calls can be chained together. * @see FindingStatus */ public Finding withStatus(String status) { setStatus(status); return this; } /** ** The current status of the finding. *
* * @param status * The current status of the finding. * @return Returns a reference to this object so that method calls can be chained together. * @see FindingStatus */ public Finding withStatus(FindingStatus status) { this.status = status.toString(); return this; } /** ** The Amazon Web Services account ID that owns the resource. *
* * @param resourceOwnerAccount * The Amazon Web Services account ID that owns the resource. */ public void setResourceOwnerAccount(String resourceOwnerAccount) { this.resourceOwnerAccount = resourceOwnerAccount; } /** ** The Amazon Web Services account ID that owns the resource. *
* * @return The Amazon Web Services account ID that owns the resource. */ public String getResourceOwnerAccount() { return this.resourceOwnerAccount; } /** ** The Amazon Web Services account ID that owns the resource. *
* * @param resourceOwnerAccount * The Amazon Web Services account ID that owns the resource. * @return Returns a reference to this object so that method calls can be chained together. */ public Finding withResourceOwnerAccount(String resourceOwnerAccount) { setResourceOwnerAccount(resourceOwnerAccount); return this; } /** ** An error. *
* * @param error * An error. */ public void setError(String error) { this.error = error; } /** ** An error. *
* * @return An error. */ public String getError() { return this.error; } /** ** An error. *
* * @param error * An error. * @return Returns a reference to this object so that method calls can be chained together. */ public Finding withError(String error) { setError(error); return this; } /** ** The sources of the finding. This indicates how the access that generated the finding is granted. It is populated * for Amazon S3 bucket findings. *
* * @return The sources of the finding. This indicates how the access that generated the finding is granted. It is * populated for Amazon S3 bucket findings. */ public java.util.List* The sources of the finding. This indicates how the access that generated the finding is granted. It is populated * for Amazon S3 bucket findings. *
* * @param sources * The sources of the finding. This indicates how the access that generated the finding is granted. It is * populated for Amazon S3 bucket findings. */ public void setSources(java.util.Collection* The sources of the finding. This indicates how the access that generated the finding is granted. It is populated * for Amazon S3 bucket findings. *
** NOTE: This method appends the values to the existing list (if any). Use * {@link #setSources(java.util.Collection)} or {@link #withSources(java.util.Collection)} if you want to override * the existing values. *
* * @param sources * The sources of the finding. This indicates how the access that generated the finding is granted. It is * populated for Amazon S3 bucket findings. * @return Returns a reference to this object so that method calls can be chained together. */ public Finding withSources(FindingSource... sources) { if (this.sources == null) { setSources(new java.util.ArrayList* The sources of the finding. This indicates how the access that generated the finding is granted. It is populated * for Amazon S3 bucket findings. *
* * @param sources * The sources of the finding. This indicates how the access that generated the finding is granted. It is * populated for Amazon S3 bucket findings. * @return Returns a reference to this object so that method calls can be chained together. */ public Finding withSources(java.util.Collection