/** * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. * SPDX-License-Identifier: Apache-2.0. */ #pragma once #include #include #include #include #include #include #include #include #include namespace Aws { namespace Utils { namespace Json { class JsonValue; class JsonView; } // namespace Json } // namespace Utils namespace AccessAnalyzer { namespace Model { /** *

Contains information about a finding.

See Also:

AWS * API Reference

*/ class Finding { public: AWS_ACCESSANALYZER_API Finding(); AWS_ACCESSANALYZER_API Finding(Aws::Utils::Json::JsonView jsonValue); AWS_ACCESSANALYZER_API Finding& operator=(Aws::Utils::Json::JsonView jsonValue); AWS_ACCESSANALYZER_API Aws::Utils::Json::JsonValue Jsonize() const; /** *

The ID of the finding.

*/ inline const Aws::String& GetId() const{ return m_id; } /** *

The ID of the finding.

*/ inline bool IdHasBeenSet() const { return m_idHasBeenSet; } /** *

The ID of the finding.

*/ inline void SetId(const Aws::String& value) { m_idHasBeenSet = true; m_id = value; } /** *

The ID of the finding.

*/ inline void SetId(Aws::String&& value) { m_idHasBeenSet = true; m_id = std::move(value); } /** *

The ID of the finding.

*/ inline void SetId(const char* value) { m_idHasBeenSet = true; m_id.assign(value); } /** *

The ID of the finding.

*/ inline Finding& WithId(const Aws::String& value) { SetId(value); return *this;} /** *

The ID of the finding.

*/ inline Finding& WithId(Aws::String&& value) { SetId(std::move(value)); return *this;} /** *

The ID of the finding.

*/ inline Finding& WithId(const char* value) { SetId(value); return *this;} /** *

The external principal that access to a resource within the zone of * trust.

*/ inline const Aws::Map& GetPrincipal() const{ return m_principal; } /** *

The external principal that access to a resource within the zone of * trust.

*/ inline bool PrincipalHasBeenSet() const { return m_principalHasBeenSet; } /** *

The external principal that access to a resource within the zone of * trust.

*/ inline void SetPrincipal(const Aws::Map& value) { m_principalHasBeenSet = true; m_principal = value; } /** *

The external principal that access to a resource within the zone of * trust.

*/ inline void SetPrincipal(Aws::Map&& value) { m_principalHasBeenSet = true; m_principal = std::move(value); } /** *

The external principal that access to a resource within the zone of * trust.

*/ inline Finding& WithPrincipal(const Aws::Map& value) { SetPrincipal(value); return *this;} /** *

The external principal that access to a resource within the zone of * trust.

*/ inline Finding& WithPrincipal(Aws::Map&& value) { SetPrincipal(std::move(value)); return *this;} /** *

The external principal that access to a resource within the zone of * trust.

*/ inline Finding& AddPrincipal(const Aws::String& key, const Aws::String& value) { m_principalHasBeenSet = true; m_principal.emplace(key, value); return *this; } /** *

The external principal that access to a resource within the zone of * trust.

*/ inline Finding& AddPrincipal(Aws::String&& key, const Aws::String& value) { m_principalHasBeenSet = true; m_principal.emplace(std::move(key), value); return *this; } /** *

The external principal that access to a resource within the zone of * trust.

*/ inline Finding& AddPrincipal(const Aws::String& key, Aws::String&& value) { m_principalHasBeenSet = true; m_principal.emplace(key, std::move(value)); return *this; } /** *

The external principal that access to a resource within the zone of * trust.

*/ inline Finding& AddPrincipal(Aws::String&& key, Aws::String&& value) { m_principalHasBeenSet = true; m_principal.emplace(std::move(key), std::move(value)); return *this; } /** *

The external principal that access to a resource within the zone of * trust.

*/ inline Finding& AddPrincipal(const char* key, Aws::String&& value) { m_principalHasBeenSet = true; m_principal.emplace(key, std::move(value)); return *this; } /** *

The external principal that access to a resource within the zone of * trust.

*/ inline Finding& AddPrincipal(Aws::String&& key, const char* value) { m_principalHasBeenSet = true; m_principal.emplace(std::move(key), value); return *this; } /** *

The external principal that access to a resource within the zone of * trust.

*/ inline Finding& AddPrincipal(const char* key, const char* value) { m_principalHasBeenSet = true; m_principal.emplace(key, value); return *this; } /** *

The action in the analyzed policy statement that an external principal has * permission to use.

*/ inline const Aws::Vector& GetAction() const{ return m_action; } /** *

The action in the analyzed policy statement that an external principal has * permission to use.

*/ inline bool ActionHasBeenSet() const { return m_actionHasBeenSet; } /** *

The action in the analyzed policy statement that an external principal has * permission to use.

*/ inline void SetAction(const Aws::Vector& value) { m_actionHasBeenSet = true; m_action = value; } /** *

The action in the analyzed policy statement that an external principal has * permission to use.

*/ inline void SetAction(Aws::Vector&& value) { m_actionHasBeenSet = true; m_action = std::move(value); } /** *

The action in the analyzed policy statement that an external principal has * permission to use.

*/ inline Finding& WithAction(const Aws::Vector& value) { SetAction(value); return *this;} /** *

The action in the analyzed policy statement that an external principal has * permission to use.

*/ inline Finding& WithAction(Aws::Vector&& value) { SetAction(std::move(value)); return *this;} /** *

The action in the analyzed policy statement that an external principal has * permission to use.

*/ inline Finding& AddAction(const Aws::String& value) { m_actionHasBeenSet = true; m_action.push_back(value); return *this; } /** *

The action in the analyzed policy statement that an external principal has * permission to use.

*/ inline Finding& AddAction(Aws::String&& value) { m_actionHasBeenSet = true; m_action.push_back(std::move(value)); return *this; } /** *

The action in the analyzed policy statement that an external principal has * permission to use.

*/ inline Finding& AddAction(const char* value) { m_actionHasBeenSet = true; m_action.push_back(value); return *this; } /** *

The resource that an external principal has access to.

*/ inline const Aws::String& GetResource() const{ return m_resource; } /** *

The resource that an external principal has access to.

*/ inline bool ResourceHasBeenSet() const { return m_resourceHasBeenSet; } /** *

The resource that an external principal has access to.

*/ inline void SetResource(const Aws::String& value) { m_resourceHasBeenSet = true; m_resource = value; } /** *

The resource that an external principal has access to.

*/ inline void SetResource(Aws::String&& value) { m_resourceHasBeenSet = true; m_resource = std::move(value); } /** *

The resource that an external principal has access to.

*/ inline void SetResource(const char* value) { m_resourceHasBeenSet = true; m_resource.assign(value); } /** *

The resource that an external principal has access to.

*/ inline Finding& WithResource(const Aws::String& value) { SetResource(value); return *this;} /** *

The resource that an external principal has access to.

*/ inline Finding& WithResource(Aws::String&& value) { SetResource(std::move(value)); return *this;} /** *

The resource that an external principal has access to.

*/ inline Finding& WithResource(const char* value) { SetResource(value); return *this;} /** *

Indicates whether the policy that generated the finding allows public access * to the resource.

*/ inline bool GetIsPublic() const{ return m_isPublic; } /** *

Indicates whether the policy that generated the finding allows public access * to the resource.

*/ inline bool IsPublicHasBeenSet() const { return m_isPublicHasBeenSet; } /** *

Indicates whether the policy that generated the finding allows public access * to the resource.

*/ inline void SetIsPublic(bool value) { m_isPublicHasBeenSet = true; m_isPublic = value; } /** *

Indicates whether the policy that generated the finding allows public access * to the resource.

*/ inline Finding& WithIsPublic(bool value) { SetIsPublic(value); return *this;} /** *

The type of the resource identified in the finding.

*/ inline const ResourceType& GetResourceType() const{ return m_resourceType; } /** *

The type of the resource identified in the finding.

*/ inline bool ResourceTypeHasBeenSet() const { return m_resourceTypeHasBeenSet; } /** *

The type of the resource identified in the finding.

*/ inline void SetResourceType(const ResourceType& value) { m_resourceTypeHasBeenSet = true; m_resourceType = value; } /** *

The type of the resource identified in the finding.

*/ inline void SetResourceType(ResourceType&& value) { m_resourceTypeHasBeenSet = true; m_resourceType = std::move(value); } /** *

The type of the resource identified in the finding.

*/ inline Finding& WithResourceType(const ResourceType& value) { SetResourceType(value); return *this;} /** *

The type of the resource identified in the finding.

*/ inline Finding& WithResourceType(ResourceType&& value) { SetResourceType(std::move(value)); return *this;} /** *

The condition in the analyzed policy statement that resulted in a * finding.

*/ inline const Aws::Map& GetCondition() const{ return m_condition; } /** *

The condition in the analyzed policy statement that resulted in a * finding.

*/ inline bool ConditionHasBeenSet() const { return m_conditionHasBeenSet; } /** *

The condition in the analyzed policy statement that resulted in a * finding.

*/ inline void SetCondition(const Aws::Map& value) { m_conditionHasBeenSet = true; m_condition = value; } /** *

The condition in the analyzed policy statement that resulted in a * finding.

*/ inline void SetCondition(Aws::Map&& value) { m_conditionHasBeenSet = true; m_condition = std::move(value); } /** *

The condition in the analyzed policy statement that resulted in a * finding.

*/ inline Finding& WithCondition(const Aws::Map& value) { SetCondition(value); return *this;} /** *

The condition in the analyzed policy statement that resulted in a * finding.

*/ inline Finding& WithCondition(Aws::Map&& value) { SetCondition(std::move(value)); return *this;} /** *

The condition in the analyzed policy statement that resulted in a * finding.

*/ inline Finding& AddCondition(const Aws::String& key, const Aws::String& value) { m_conditionHasBeenSet = true; m_condition.emplace(key, value); return *this; } /** *

The condition in the analyzed policy statement that resulted in a * finding.

*/ inline Finding& AddCondition(Aws::String&& key, const Aws::String& value) { m_conditionHasBeenSet = true; m_condition.emplace(std::move(key), value); return *this; } /** *

The condition in the analyzed policy statement that resulted in a * finding.

*/ inline Finding& AddCondition(const Aws::String& key, Aws::String&& value) { m_conditionHasBeenSet = true; m_condition.emplace(key, std::move(value)); return *this; } /** *

The condition in the analyzed policy statement that resulted in a * finding.

*/ inline Finding& AddCondition(Aws::String&& key, Aws::String&& value) { m_conditionHasBeenSet = true; m_condition.emplace(std::move(key), std::move(value)); return *this; } /** *

The condition in the analyzed policy statement that resulted in a * finding.

*/ inline Finding& AddCondition(const char* key, Aws::String&& value) { m_conditionHasBeenSet = true; m_condition.emplace(key, std::move(value)); return *this; } /** *

The condition in the analyzed policy statement that resulted in a * finding.

*/ inline Finding& AddCondition(Aws::String&& key, const char* value) { m_conditionHasBeenSet = true; m_condition.emplace(std::move(key), value); return *this; } /** *

The condition in the analyzed policy statement that resulted in a * finding.

*/ inline Finding& AddCondition(const char* key, const char* value) { m_conditionHasBeenSet = true; m_condition.emplace(key, value); return *this; } /** *

The time at which the finding was generated.

*/ inline const Aws::Utils::DateTime& GetCreatedAt() const{ return m_createdAt; } /** *

The time at which the finding was generated.

*/ inline bool CreatedAtHasBeenSet() const { return m_createdAtHasBeenSet; } /** *

The time at which the finding was generated.

*/ inline void SetCreatedAt(const Aws::Utils::DateTime& value) { m_createdAtHasBeenSet = true; m_createdAt = value; } /** *

The time at which the finding was generated.

*/ inline void SetCreatedAt(Aws::Utils::DateTime&& value) { m_createdAtHasBeenSet = true; m_createdAt = std::move(value); } /** *

The time at which the finding was generated.

*/ inline Finding& WithCreatedAt(const Aws::Utils::DateTime& value) { SetCreatedAt(value); return *this;} /** *

The time at which the finding was generated.

*/ inline Finding& WithCreatedAt(Aws::Utils::DateTime&& value) { SetCreatedAt(std::move(value)); return *this;} /** *

The time at which the resource was analyzed.

*/ inline const Aws::Utils::DateTime& GetAnalyzedAt() const{ return m_analyzedAt; } /** *

The time at which the resource was analyzed.

*/ inline bool AnalyzedAtHasBeenSet() const { return m_analyzedAtHasBeenSet; } /** *

The time at which the resource was analyzed.

*/ inline void SetAnalyzedAt(const Aws::Utils::DateTime& value) { m_analyzedAtHasBeenSet = true; m_analyzedAt = value; } /** *

The time at which the resource was analyzed.

*/ inline void SetAnalyzedAt(Aws::Utils::DateTime&& value) { m_analyzedAtHasBeenSet = true; m_analyzedAt = std::move(value); } /** *

The time at which the resource was analyzed.

*/ inline Finding& WithAnalyzedAt(const Aws::Utils::DateTime& value) { SetAnalyzedAt(value); return *this;} /** *

The time at which the resource was analyzed.

*/ inline Finding& WithAnalyzedAt(Aws::Utils::DateTime&& value) { SetAnalyzedAt(std::move(value)); return *this;} /** *

The time at which the finding was updated.

*/ inline const Aws::Utils::DateTime& GetUpdatedAt() const{ return m_updatedAt; } /** *

The time at which the finding was updated.

*/ inline bool UpdatedAtHasBeenSet() const { return m_updatedAtHasBeenSet; } /** *

The time at which the finding was updated.

*/ inline void SetUpdatedAt(const Aws::Utils::DateTime& value) { m_updatedAtHasBeenSet = true; m_updatedAt = value; } /** *

The time at which the finding was updated.

*/ inline void SetUpdatedAt(Aws::Utils::DateTime&& value) { m_updatedAtHasBeenSet = true; m_updatedAt = std::move(value); } /** *

The time at which the finding was updated.

*/ inline Finding& WithUpdatedAt(const Aws::Utils::DateTime& value) { SetUpdatedAt(value); return *this;} /** *

The time at which the finding was updated.

*/ inline Finding& WithUpdatedAt(Aws::Utils::DateTime&& value) { SetUpdatedAt(std::move(value)); return *this;} /** *

The current status of the finding.

*/ inline const FindingStatus& GetStatus() const{ return m_status; } /** *

The current status of the finding.

*/ inline bool StatusHasBeenSet() const { return m_statusHasBeenSet; } /** *

The current status of the finding.

*/ inline void SetStatus(const FindingStatus& value) { m_statusHasBeenSet = true; m_status = value; } /** *

The current status of the finding.

*/ inline void SetStatus(FindingStatus&& value) { m_statusHasBeenSet = true; m_status = std::move(value); } /** *

The current status of the finding.

*/ inline Finding& WithStatus(const FindingStatus& value) { SetStatus(value); return *this;} /** *

The current status of the finding.

*/ inline Finding& WithStatus(FindingStatus&& value) { SetStatus(std::move(value)); return *this;} /** *

The Amazon Web Services account ID that owns the resource.

*/ inline const Aws::String& GetResourceOwnerAccount() const{ return m_resourceOwnerAccount; } /** *

The Amazon Web Services account ID that owns the resource.

*/ inline bool ResourceOwnerAccountHasBeenSet() const { return m_resourceOwnerAccountHasBeenSet; } /** *

The Amazon Web Services account ID that owns the resource.

*/ inline void SetResourceOwnerAccount(const Aws::String& value) { m_resourceOwnerAccountHasBeenSet = true; m_resourceOwnerAccount = value; } /** *

The Amazon Web Services account ID that owns the resource.

*/ inline void SetResourceOwnerAccount(Aws::String&& value) { m_resourceOwnerAccountHasBeenSet = true; m_resourceOwnerAccount = std::move(value); } /** *

The Amazon Web Services account ID that owns the resource.

*/ inline void SetResourceOwnerAccount(const char* value) { m_resourceOwnerAccountHasBeenSet = true; m_resourceOwnerAccount.assign(value); } /** *

The Amazon Web Services account ID that owns the resource.

*/ inline Finding& WithResourceOwnerAccount(const Aws::String& value) { SetResourceOwnerAccount(value); return *this;} /** *

The Amazon Web Services account ID that owns the resource.

*/ inline Finding& WithResourceOwnerAccount(Aws::String&& value) { SetResourceOwnerAccount(std::move(value)); return *this;} /** *

The Amazon Web Services account ID that owns the resource.

*/ inline Finding& WithResourceOwnerAccount(const char* value) { SetResourceOwnerAccount(value); return *this;} /** *

An error.

*/ inline const Aws::String& GetError() const{ return m_error; } /** *

An error.

*/ inline bool ErrorHasBeenSet() const { return m_errorHasBeenSet; } /** *

An error.

*/ inline void SetError(const Aws::String& value) { m_errorHasBeenSet = true; m_error = value; } /** *

An error.

*/ inline void SetError(Aws::String&& value) { m_errorHasBeenSet = true; m_error = std::move(value); } /** *

An error.

*/ inline void SetError(const char* value) { m_errorHasBeenSet = true; m_error.assign(value); } /** *

An error.

*/ inline Finding& WithError(const Aws::String& value) { SetError(value); return *this;} /** *

An error.

*/ inline Finding& WithError(Aws::String&& value) { SetError(std::move(value)); return *this;} /** *

An error.

*/ inline Finding& WithError(const char* value) { SetError(value); 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.

*/ inline const Aws::Vector& GetSources() const{ return m_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.

*/ inline bool SourcesHasBeenSet() const { return m_sourcesHasBeenSet; } /** *

The sources of the finding. This indicates how the access that generated the * finding is granted. It is populated for Amazon S3 bucket findings.

*/ inline void SetSources(const Aws::Vector& value) { m_sourcesHasBeenSet = true; m_sources = value; } /** *

The sources of the finding. This indicates how the access that generated the * finding is granted. It is populated for Amazon S3 bucket findings.

*/ inline void SetSources(Aws::Vector&& value) { m_sourcesHasBeenSet = true; m_sources = std::move(value); } /** *

The sources of the finding. This indicates how the access that generated the * finding is granted. It is populated for Amazon S3 bucket findings.

*/ inline Finding& WithSources(const Aws::Vector& value) { SetSources(value); 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.

*/ inline Finding& WithSources(Aws::Vector&& value) { SetSources(std::move(value)); 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.

*/ inline Finding& AddSources(const FindingSource& value) { m_sourcesHasBeenSet = true; m_sources.push_back(value); 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.

*/ inline Finding& AddSources(FindingSource&& value) { m_sourcesHasBeenSet = true; m_sources.push_back(std::move(value)); return *this; } private: Aws::String m_id; bool m_idHasBeenSet = false; Aws::Map m_principal; bool m_principalHasBeenSet = false; Aws::Vector m_action; bool m_actionHasBeenSet = false; Aws::String m_resource; bool m_resourceHasBeenSet = false; bool m_isPublic; bool m_isPublicHasBeenSet = false; ResourceType m_resourceType; bool m_resourceTypeHasBeenSet = false; Aws::Map m_condition; bool m_conditionHasBeenSet = false; Aws::Utils::DateTime m_createdAt; bool m_createdAtHasBeenSet = false; Aws::Utils::DateTime m_analyzedAt; bool m_analyzedAtHasBeenSet = false; Aws::Utils::DateTime m_updatedAt; bool m_updatedAtHasBeenSet = false; FindingStatus m_status; bool m_statusHasBeenSet = false; Aws::String m_resourceOwnerAccount; bool m_resourceOwnerAccountHasBeenSet = false; Aws::String m_error; bool m_errorHasBeenSet = false; Aws::Vector m_sources; bool m_sourcesHasBeenSet = false; }; } // namespace Model } // namespace AccessAnalyzer } // namespace Aws