/* * 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; /** *
* An access preview finding generated by the access preview. *
* * @see AWS API Documentation */ @Generated("com.amazonaws:aws-java-sdk-code-generator") public class AccessPreviewFinding implements Serializable, Cloneable, StructuredPojo { /** ** The ID of the access preview finding. This ID uniquely identifies the element in the list of access preview * findings and is not related to the finding ID in Access Analyzer. *
*/ private String id; /** ** The existing ID of the finding in IAM Access Analyzer, provided only for existing findings. *
*/ private String existingFindingId; /** ** The existing status of the finding, provided only for existing findings. *
*/ private String existingFindingStatus; /** ** The external principal that has 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 perform. *
*/ private java.util.List* The condition in the analyzed policy statement that resulted in a finding. *
*/ private java.util.Map* The resource that an external principal has access to. This is the resource associated with the access preview. *
*/ 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 that can be accessed in the finding. *
*/ private String resourceType; /** ** The time at which the access preview finding was created. *
*/ private java.util.Date createdAt; /** ** Provides context on how the access preview finding compares to existing access identified in IAM Access Analyzer. *
*
* New
- The finding is for newly-introduced access.
*
* Unchanged
- The preview finding is an existing finding that would remain unchanged.
*
* Changed
- The preview finding is an existing finding with a change in status.
*
* For example, a Changed
finding with preview status Resolved
and existing status
* Active
indicates the existing Active
finding would become Resolved
as a
* result of the proposed permissions change.
*
* The preview status of the finding. This is what the status of the finding would be after permissions deployment.
* For example, a Changed
finding with preview status Resolved
and existing status
* Active
indicates the existing Active
finding would become Resolved
as a
* result of the proposed permissions change.
*
* The Amazon Web Services account ID that owns the resource. For most Amazon Web Services resources, the owning * account is the account in which the resource was created. *
*/ 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 access preview finding. This ID uniquely identifies the element in the list of access preview * findings and is not related to the finding ID in Access Analyzer. *
* * @param id * The ID of the access preview finding. This ID uniquely identifies the element in the list of access * preview findings and is not related to the finding ID in Access Analyzer. */ public void setId(String id) { this.id = id; } /** ** The ID of the access preview finding. This ID uniquely identifies the element in the list of access preview * findings and is not related to the finding ID in Access Analyzer. *
* * @return The ID of the access preview finding. This ID uniquely identifies the element in the list of access * preview findings and is not related to the finding ID in Access Analyzer. */ public String getId() { return this.id; } /** ** The ID of the access preview finding. This ID uniquely identifies the element in the list of access preview * findings and is not related to the finding ID in Access Analyzer. *
* * @param id * The ID of the access preview finding. This ID uniquely identifies the element in the list of access * preview findings and is not related to the finding ID in Access Analyzer. * @return Returns a reference to this object so that method calls can be chained together. */ public AccessPreviewFinding withId(String id) { setId(id); return this; } /** ** The existing ID of the finding in IAM Access Analyzer, provided only for existing findings. *
* * @param existingFindingId * The existing ID of the finding in IAM Access Analyzer, provided only for existing findings. */ public void setExistingFindingId(String existingFindingId) { this.existingFindingId = existingFindingId; } /** ** The existing ID of the finding in IAM Access Analyzer, provided only for existing findings. *
* * @return The existing ID of the finding in IAM Access Analyzer, provided only for existing findings. */ public String getExistingFindingId() { return this.existingFindingId; } /** ** The existing ID of the finding in IAM Access Analyzer, provided only for existing findings. *
* * @param existingFindingId * The existing ID of the finding in IAM Access Analyzer, provided only for existing findings. * @return Returns a reference to this object so that method calls can be chained together. */ public AccessPreviewFinding withExistingFindingId(String existingFindingId) { setExistingFindingId(existingFindingId); return this; } /** ** The existing status of the finding, provided only for existing findings. *
* * @param existingFindingStatus * The existing status of the finding, provided only for existing findings. * @see FindingStatus */ public void setExistingFindingStatus(String existingFindingStatus) { this.existingFindingStatus = existingFindingStatus; } /** ** The existing status of the finding, provided only for existing findings. *
* * @return The existing status of the finding, provided only for existing findings. * @see FindingStatus */ public String getExistingFindingStatus() { return this.existingFindingStatus; } /** ** The existing status of the finding, provided only for existing findings. *
* * @param existingFindingStatus * The existing status of the finding, provided only for existing findings. * @return Returns a reference to this object so that method calls can be chained together. * @see FindingStatus */ public AccessPreviewFinding withExistingFindingStatus(String existingFindingStatus) { setExistingFindingStatus(existingFindingStatus); return this; } /** ** The existing status of the finding, provided only for existing findings. *
* * @param existingFindingStatus * The existing status of the finding, provided only for existing findings. * @return Returns a reference to this object so that method calls can be chained together. * @see FindingStatus */ public AccessPreviewFinding withExistingFindingStatus(FindingStatus existingFindingStatus) { this.existingFindingStatus = existingFindingStatus.toString(); return this; } /** ** The external principal that has access to a resource within the zone of trust. *
* * @return The external principal that has access to a resource within the zone of trust. */ public java.util.Map* The external principal that has access to a resource within the zone of trust. *
* * @param principal * The external principal that has access to a resource within the zone of trust. */ public void setPrincipal(java.util.Map* The external principal that has access to a resource within the zone of trust. *
* * @param principal * The external principal that has 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 AccessPreviewFinding withPrincipal(java.util.Map* The action in the analyzed policy statement that an external principal has permission to perform. *
* * @return The action in the analyzed policy statement that an external principal has permission to perform. */ public java.util.List* The action in the analyzed policy statement that an external principal has permission to perform. *
* * @param action * The action in the analyzed policy statement that an external principal has permission to perform. */ public void setAction(java.util.Collection* The action in the analyzed policy statement that an external principal has permission to perform. *
** 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 perform. * @return Returns a reference to this object so that method calls can be chained together. */ public AccessPreviewFinding 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 perform. *
* * @param action * The action in the analyzed policy statement that an external principal has permission to perform. * @return Returns a reference to this object so that method calls can be chained together. */ public AccessPreviewFinding withAction(java.util.Collection* 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 AccessPreviewFinding withCondition(java.util.Map* The resource that an external principal has access to. This is the resource associated with the access preview. *
* * @param resource * The resource that an external principal has access to. This is the resource associated with the access * preview. */ public void setResource(String resource) { this.resource = resource; } /** ** The resource that an external principal has access to. This is the resource associated with the access preview. *
* * @return The resource that an external principal has access to. This is the resource associated with the access * preview. */ public String getResource() { return this.resource; } /** ** The resource that an external principal has access to. This is the resource associated with the access preview. *
* * @param resource * The resource that an external principal has access to. This is the resource associated with the access * preview. * @return Returns a reference to this object so that method calls can be chained together. */ public AccessPreviewFinding 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 AccessPreviewFinding 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 that can be accessed in the finding. *
* * @param resourceType * The type of the resource that can be accessed in the finding. * @see ResourceType */ public void setResourceType(String resourceType) { this.resourceType = resourceType; } /** ** The type of the resource that can be accessed in the finding. *
* * @return The type of the resource that can be accessed in the finding. * @see ResourceType */ public String getResourceType() { return this.resourceType; } /** ** The type of the resource that can be accessed in the finding. *
* * @param resourceType * The type of the resource that can be accessed in the finding. * @return Returns a reference to this object so that method calls can be chained together. * @see ResourceType */ public AccessPreviewFinding withResourceType(String resourceType) { setResourceType(resourceType); return this; } /** ** The type of the resource that can be accessed in the finding. *
* * @param resourceType * The type of the resource that can be accessed in the finding. * @return Returns a reference to this object so that method calls can be chained together. * @see ResourceType */ public AccessPreviewFinding withResourceType(ResourceType resourceType) { this.resourceType = resourceType.toString(); return this; } /** ** The time at which the access preview finding was created. *
* * @param createdAt * The time at which the access preview finding was created. */ public void setCreatedAt(java.util.Date createdAt) { this.createdAt = createdAt; } /** ** The time at which the access preview finding was created. *
* * @return The time at which the access preview finding was created. */ public java.util.Date getCreatedAt() { return this.createdAt; } /** ** The time at which the access preview finding was created. *
* * @param createdAt * The time at which the access preview finding was created. * @return Returns a reference to this object so that method calls can be chained together. */ public AccessPreviewFinding withCreatedAt(java.util.Date createdAt) { setCreatedAt(createdAt); return this; } /** ** Provides context on how the access preview finding compares to existing access identified in IAM Access Analyzer. *
*
* New
- The finding is for newly-introduced access.
*
* Unchanged
- The preview finding is an existing finding that would remain unchanged.
*
* Changed
- The preview finding is an existing finding with a change in status.
*
* For example, a Changed
finding with preview status Resolved
and existing status
* Active
indicates the existing Active
finding would become Resolved
as a
* result of the proposed permissions change.
*
* New
- The finding is for newly-introduced access.
*
* Unchanged
- The preview finding is an existing finding that would remain unchanged.
*
* Changed
- The preview finding is an existing finding with a change in status.
*
* For example, a Changed
finding with preview status Resolved
and existing status
* Active
indicates the existing Active
finding would become Resolved
* as a result of the proposed permissions change.
* @see FindingChangeType
*/
public void setChangeType(String changeType) {
this.changeType = changeType;
}
/**
*
* Provides context on how the access preview finding compares to existing access identified in IAM Access Analyzer. *
*
* New
- The finding is for newly-introduced access.
*
* Unchanged
- The preview finding is an existing finding that would remain unchanged.
*
* Changed
- The preview finding is an existing finding with a change in status.
*
* For example, a Changed
finding with preview status Resolved
and existing status
* Active
indicates the existing Active
finding would become Resolved
as a
* result of the proposed permissions change.
*
* New
- The finding is for newly-introduced access.
*
* Unchanged
- The preview finding is an existing finding that would remain unchanged.
*
* Changed
- The preview finding is an existing finding with a change in status.
*
* For example, a Changed
finding with preview status Resolved
and existing status
* Active
indicates the existing Active
finding would become Resolved
* as a result of the proposed permissions change.
* @see FindingChangeType
*/
public String getChangeType() {
return this.changeType;
}
/**
*
* Provides context on how the access preview finding compares to existing access identified in IAM Access Analyzer. *
*
* New
- The finding is for newly-introduced access.
*
* Unchanged
- The preview finding is an existing finding that would remain unchanged.
*
* Changed
- The preview finding is an existing finding with a change in status.
*
* For example, a Changed
finding with preview status Resolved
and existing status
* Active
indicates the existing Active
finding would become Resolved
as a
* result of the proposed permissions change.
*
* New
- The finding is for newly-introduced access.
*
* Unchanged
- The preview finding is an existing finding that would remain unchanged.
*
* Changed
- The preview finding is an existing finding with a change in status.
*
* For example, a Changed
finding with preview status Resolved
and existing status
* Active
indicates the existing Active
finding would become Resolved
* as a result of the proposed permissions change.
* @return Returns a reference to this object so that method calls can be chained together.
* @see FindingChangeType
*/
public AccessPreviewFinding withChangeType(String changeType) {
setChangeType(changeType);
return this;
}
/**
*
* Provides context on how the access preview finding compares to existing access identified in IAM Access Analyzer. *
*
* New
- The finding is for newly-introduced access.
*
* Unchanged
- The preview finding is an existing finding that would remain unchanged.
*
* Changed
- The preview finding is an existing finding with a change in status.
*
* For example, a Changed
finding with preview status Resolved
and existing status
* Active
indicates the existing Active
finding would become Resolved
as a
* result of the proposed permissions change.
*
* New
- The finding is for newly-introduced access.
*
* Unchanged
- The preview finding is an existing finding that would remain unchanged.
*
* Changed
- The preview finding is an existing finding with a change in status.
*
* For example, a Changed
finding with preview status Resolved
and existing status
* Active
indicates the existing Active
finding would become Resolved
* as a result of the proposed permissions change.
* @return Returns a reference to this object so that method calls can be chained together.
* @see FindingChangeType
*/
public AccessPreviewFinding withChangeType(FindingChangeType changeType) {
this.changeType = changeType.toString();
return this;
}
/**
*
* The preview status of the finding. This is what the status of the finding would be after permissions deployment.
* For example, a Changed
finding with preview status Resolved
and existing status
* Active
indicates the existing Active
finding would become Resolved
as a
* result of the proposed permissions change.
*
Changed
finding with preview status Resolved
and
* existing status Active
indicates the existing Active
finding would become
* Resolved
as a result of the proposed permissions change.
* @see FindingStatus
*/
public void setStatus(String status) {
this.status = status;
}
/**
*
* The preview status of the finding. This is what the status of the finding would be after permissions deployment.
* For example, a Changed
finding with preview status Resolved
and existing status
* Active
indicates the existing Active
finding would become Resolved
as a
* result of the proposed permissions change.
*
Changed
finding with preview status Resolved
and
* existing status Active
indicates the existing Active
finding would become
* Resolved
as a result of the proposed permissions change.
* @see FindingStatus
*/
public String getStatus() {
return this.status;
}
/**
*
* The preview status of the finding. This is what the status of the finding would be after permissions deployment.
* For example, a Changed
finding with preview status Resolved
and existing status
* Active
indicates the existing Active
finding would become Resolved
as a
* result of the proposed permissions change.
*
Changed
finding with preview status Resolved
and
* existing status Active
indicates the existing Active
finding would become
* Resolved
as a result of the proposed permissions change.
* @return Returns a reference to this object so that method calls can be chained together.
* @see FindingStatus
*/
public AccessPreviewFinding withStatus(String status) {
setStatus(status);
return this;
}
/**
*
* The preview status of the finding. This is what the status of the finding would be after permissions deployment.
* For example, a Changed
finding with preview status Resolved
and existing status
* Active
indicates the existing Active
finding would become Resolved
as a
* result of the proposed permissions change.
*
Changed
finding with preview status Resolved
and
* existing status Active
indicates the existing Active
finding would become
* Resolved
as a result of the proposed permissions change.
* @return Returns a reference to this object so that method calls can be chained together.
* @see FindingStatus
*/
public AccessPreviewFinding withStatus(FindingStatus status) {
this.status = status.toString();
return this;
}
/**
* * The Amazon Web Services account ID that owns the resource. For most Amazon Web Services resources, the owning * account is the account in which the resource was created. *
* * @param resourceOwnerAccount * The Amazon Web Services account ID that owns the resource. For most Amazon Web Services resources, the * owning account is the account in which the resource was created. */ public void setResourceOwnerAccount(String resourceOwnerAccount) { this.resourceOwnerAccount = resourceOwnerAccount; } /** ** The Amazon Web Services account ID that owns the resource. For most Amazon Web Services resources, the owning * account is the account in which the resource was created. *
* * @return The Amazon Web Services account ID that owns the resource. For most Amazon Web Services resources, the * owning account is the account in which the resource was created. */ public String getResourceOwnerAccount() { return this.resourceOwnerAccount; } /** ** The Amazon Web Services account ID that owns the resource. For most Amazon Web Services resources, the owning * account is the account in which the resource was created. *
* * @param resourceOwnerAccount * The Amazon Web Services account ID that owns the resource. For most Amazon Web Services resources, the * owning account is the account in which the resource was created. * @return Returns a reference to this object so that method calls can be chained together. */ public AccessPreviewFinding 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 AccessPreviewFinding 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 AccessPreviewFinding 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 AccessPreviewFinding withSources(java.util.Collection