{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE DuplicateRecordFields #-}
{-# LANGUAGE NamedFieldPuns #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE RecordWildCards #-}
{-# LANGUAGE StrictData #-}
{-# LANGUAGE NoImplicitPrelude #-}
{-# OPTIONS_GHC -fno-warn-unused-imports #-}
{-# OPTIONS_GHC -fno-warn-unused-matches #-}

-- Derived from AWS service descriptions, licensed under Apache 2.0.

-- |
-- Module      : Amazonka.AccessAnalyzer.Types.AccessPreviewFinding
-- Copyright   : (c) 2013-2021 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay <brendan.g.hay+amazonka@gmail.com>
-- Stability   : auto-generated
-- Portability : non-portable (GHC extensions)
module Amazonka.AccessAnalyzer.Types.AccessPreviewFinding where

import Amazonka.AccessAnalyzer.Types.FindingChangeType
import Amazonka.AccessAnalyzer.Types.FindingSource
import Amazonka.AccessAnalyzer.Types.FindingStatus
import Amazonka.AccessAnalyzer.Types.ResourceType
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude

-- | An access preview finding generated by the access preview.
--
-- /See:/ 'newAccessPreviewFinding' smart constructor.
data AccessPreviewFinding = AccessPreviewFinding'
  { -- | The existing status of the finding, provided only for existing findings.
    AccessPreviewFinding -> Maybe FindingStatus
existingFindingStatus :: Prelude.Maybe FindingStatus,
    -- | An error.
    AccessPreviewFinding -> Maybe Text
error :: Prelude.Maybe Prelude.Text,
    -- | Indicates whether the policy that generated the finding allows public
    -- access to the resource.
    AccessPreviewFinding -> Maybe Bool
isPublic :: Prelude.Maybe Prelude.Bool,
    -- | The action in the analyzed policy statement that an external principal
    -- has permission to perform.
    AccessPreviewFinding -> Maybe [Text]
action :: Prelude.Maybe [Prelude.Text],
    -- | The sources of the finding. This indicates how the access that generated
    -- the finding is granted. It is populated for Amazon S3 bucket findings.
    AccessPreviewFinding -> Maybe [FindingSource]
sources :: Prelude.Maybe [FindingSource],
    -- | The resource that an external principal has access to. This is the
    -- resource associated with the access preview.
    AccessPreviewFinding -> Maybe Text
resource :: Prelude.Maybe Prelude.Text,
    -- | The external principal that has access to a resource within the zone of
    -- trust.
    AccessPreviewFinding -> Maybe (HashMap Text Text)
principal :: Prelude.Maybe (Prelude.HashMap Prelude.Text Prelude.Text),
    -- | The existing ID of the finding in IAM Access Analyzer, provided only for
    -- existing findings.
    AccessPreviewFinding -> Maybe Text
existingFindingId :: Prelude.Maybe Prelude.Text,
    -- | The condition in the analyzed policy statement that resulted in a
    -- finding.
    AccessPreviewFinding -> Maybe (HashMap Text Text)
condition :: Prelude.Maybe (Prelude.HashMap Prelude.Text Prelude.Text),
    -- | 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.
    AccessPreviewFinding -> FindingChangeType
changeType :: FindingChangeType,
    -- | The time at which the access preview finding was created.
    AccessPreviewFinding -> POSIX
createdAt :: Core.POSIX,
    -- | 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.
    AccessPreviewFinding -> Text
id :: Prelude.Text,
    -- | 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.
    AccessPreviewFinding -> Text
resourceOwnerAccount :: Prelude.Text,
    -- | The type of the resource that can be accessed in the finding.
    AccessPreviewFinding -> ResourceType
resourceType :: ResourceType,
    -- | 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.
    AccessPreviewFinding -> FindingStatus
status :: FindingStatus
  }
  deriving (AccessPreviewFinding -> AccessPreviewFinding -> Bool
(AccessPreviewFinding -> AccessPreviewFinding -> Bool)
-> (AccessPreviewFinding -> AccessPreviewFinding -> Bool)
-> Eq AccessPreviewFinding
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: AccessPreviewFinding -> AccessPreviewFinding -> Bool
$c/= :: AccessPreviewFinding -> AccessPreviewFinding -> Bool
== :: AccessPreviewFinding -> AccessPreviewFinding -> Bool
$c== :: AccessPreviewFinding -> AccessPreviewFinding -> Bool
Prelude.Eq, ReadPrec [AccessPreviewFinding]
ReadPrec AccessPreviewFinding
Int -> ReadS AccessPreviewFinding
ReadS [AccessPreviewFinding]
(Int -> ReadS AccessPreviewFinding)
-> ReadS [AccessPreviewFinding]
-> ReadPrec AccessPreviewFinding
-> ReadPrec [AccessPreviewFinding]
-> Read AccessPreviewFinding
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [AccessPreviewFinding]
$creadListPrec :: ReadPrec [AccessPreviewFinding]
readPrec :: ReadPrec AccessPreviewFinding
$creadPrec :: ReadPrec AccessPreviewFinding
readList :: ReadS [AccessPreviewFinding]
$creadList :: ReadS [AccessPreviewFinding]
readsPrec :: Int -> ReadS AccessPreviewFinding
$creadsPrec :: Int -> ReadS AccessPreviewFinding
Prelude.Read, Int -> AccessPreviewFinding -> ShowS
[AccessPreviewFinding] -> ShowS
AccessPreviewFinding -> String
(Int -> AccessPreviewFinding -> ShowS)
-> (AccessPreviewFinding -> String)
-> ([AccessPreviewFinding] -> ShowS)
-> Show AccessPreviewFinding
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [AccessPreviewFinding] -> ShowS
$cshowList :: [AccessPreviewFinding] -> ShowS
show :: AccessPreviewFinding -> String
$cshow :: AccessPreviewFinding -> String
showsPrec :: Int -> AccessPreviewFinding -> ShowS
$cshowsPrec :: Int -> AccessPreviewFinding -> ShowS
Prelude.Show, (forall x. AccessPreviewFinding -> Rep AccessPreviewFinding x)
-> (forall x. Rep AccessPreviewFinding x -> AccessPreviewFinding)
-> Generic AccessPreviewFinding
forall x. Rep AccessPreviewFinding x -> AccessPreviewFinding
forall x. AccessPreviewFinding -> Rep AccessPreviewFinding x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep AccessPreviewFinding x -> AccessPreviewFinding
$cfrom :: forall x. AccessPreviewFinding -> Rep AccessPreviewFinding x
Prelude.Generic)

-- |
-- Create a value of 'AccessPreviewFinding' with all optional fields omitted.
--
-- Use <https://hackage.haskell.org/package/generic-lens generic-lens> or <https://hackage.haskell.org/package/optics optics> to modify other optional fields.
--
-- The following record fields are available, with the corresponding lenses provided
-- for backwards compatibility:
--
-- 'existingFindingStatus', 'accessPreviewFinding_existingFindingStatus' - The existing status of the finding, provided only for existing findings.
--
-- 'error', 'accessPreviewFinding_error' - An error.
--
-- 'isPublic', 'accessPreviewFinding_isPublic' - Indicates whether the policy that generated the finding allows public
-- access to the resource.
--
-- 'action', 'accessPreviewFinding_action' - The action in the analyzed policy statement that an external principal
-- has permission to perform.
--
-- 'sources', 'accessPreviewFinding_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.
--
-- 'resource', 'accessPreviewFinding_resource' - The resource that an external principal has access to. This is the
-- resource associated with the access preview.
--
-- 'principal', 'accessPreviewFinding_principal' - The external principal that has access to a resource within the zone of
-- trust.
--
-- 'existingFindingId', 'accessPreviewFinding_existingFindingId' - The existing ID of the finding in IAM Access Analyzer, provided only for
-- existing findings.
--
-- 'condition', 'accessPreviewFinding_condition' - The condition in the analyzed policy statement that resulted in a
-- finding.
--
-- 'changeType', 'accessPreviewFinding_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.
--
-- 'createdAt', 'accessPreviewFinding_createdAt' - The time at which the access preview finding was created.
--
-- 'id', 'accessPreviewFinding_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.
--
-- 'resourceOwnerAccount', 'accessPreviewFinding_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.
--
-- 'resourceType', 'accessPreviewFinding_resourceType' - The type of the resource that can be accessed in the finding.
--
-- 'status', 'accessPreviewFinding_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.
newAccessPreviewFinding ::
  -- | 'changeType'
  FindingChangeType ->
  -- | 'createdAt'
  Prelude.UTCTime ->
  -- | 'id'
  Prelude.Text ->
  -- | 'resourceOwnerAccount'
  Prelude.Text ->
  -- | 'resourceType'
  ResourceType ->
  -- | 'status'
  FindingStatus ->
  AccessPreviewFinding
newAccessPreviewFinding :: FindingChangeType
-> UTCTime
-> Text
-> Text
-> ResourceType
-> FindingStatus
-> AccessPreviewFinding
newAccessPreviewFinding
  FindingChangeType
pChangeType_
  UTCTime
pCreatedAt_
  Text
pId_
  Text
pResourceOwnerAccount_
  ResourceType
pResourceType_
  FindingStatus
pStatus_ =
    AccessPreviewFinding' :: Maybe FindingStatus
-> Maybe Text
-> Maybe Bool
-> Maybe [Text]
-> Maybe [FindingSource]
-> Maybe Text
-> Maybe (HashMap Text Text)
-> Maybe Text
-> Maybe (HashMap Text Text)
-> FindingChangeType
-> POSIX
-> Text
-> Text
-> ResourceType
-> FindingStatus
-> AccessPreviewFinding
AccessPreviewFinding'
      { $sel:existingFindingStatus:AccessPreviewFinding' :: Maybe FindingStatus
existingFindingStatus =
          Maybe FindingStatus
forall a. Maybe a
Prelude.Nothing,
        $sel:error:AccessPreviewFinding' :: Maybe Text
error = Maybe Text
forall a. Maybe a
Prelude.Nothing,
        $sel:isPublic:AccessPreviewFinding' :: Maybe Bool
isPublic = Maybe Bool
forall a. Maybe a
Prelude.Nothing,
        $sel:action:AccessPreviewFinding' :: Maybe [Text]
action = Maybe [Text]
forall a. Maybe a
Prelude.Nothing,
        $sel:sources:AccessPreviewFinding' :: Maybe [FindingSource]
sources = Maybe [FindingSource]
forall a. Maybe a
Prelude.Nothing,
        $sel:resource:AccessPreviewFinding' :: Maybe Text
resource = Maybe Text
forall a. Maybe a
Prelude.Nothing,
        $sel:principal:AccessPreviewFinding' :: Maybe (HashMap Text Text)
principal = Maybe (HashMap Text Text)
forall a. Maybe a
Prelude.Nothing,
        $sel:existingFindingId:AccessPreviewFinding' :: Maybe Text
existingFindingId = Maybe Text
forall a. Maybe a
Prelude.Nothing,
        $sel:condition:AccessPreviewFinding' :: Maybe (HashMap Text Text)
condition = Maybe (HashMap Text Text)
forall a. Maybe a
Prelude.Nothing,
        $sel:changeType:AccessPreviewFinding' :: FindingChangeType
changeType = FindingChangeType
pChangeType_,
        $sel:createdAt:AccessPreviewFinding' :: POSIX
createdAt = Tagged UTCTime (Identity UTCTime) -> Tagged POSIX (Identity POSIX)
forall (a :: Format). Iso' (Time a) UTCTime
Core._Time (Tagged UTCTime (Identity UTCTime)
 -> Tagged POSIX (Identity POSIX))
-> UTCTime -> POSIX
forall t b. AReview t b -> b -> t
Lens.# UTCTime
pCreatedAt_,
        $sel:id:AccessPreviewFinding' :: Text
id = Text
pId_,
        $sel:resourceOwnerAccount:AccessPreviewFinding' :: Text
resourceOwnerAccount = Text
pResourceOwnerAccount_,
        $sel:resourceType:AccessPreviewFinding' :: ResourceType
resourceType = ResourceType
pResourceType_,
        $sel:status:AccessPreviewFinding' :: FindingStatus
status = FindingStatus
pStatus_
      }

-- | The existing status of the finding, provided only for existing findings.
accessPreviewFinding_existingFindingStatus :: Lens.Lens' AccessPreviewFinding (Prelude.Maybe FindingStatus)
accessPreviewFinding_existingFindingStatus :: (Maybe FindingStatus -> f (Maybe FindingStatus))
-> AccessPreviewFinding -> f AccessPreviewFinding
accessPreviewFinding_existingFindingStatus = (AccessPreviewFinding -> Maybe FindingStatus)
-> (AccessPreviewFinding
    -> Maybe FindingStatus -> AccessPreviewFinding)
-> Lens
     AccessPreviewFinding
     AccessPreviewFinding
     (Maybe FindingStatus)
     (Maybe FindingStatus)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AccessPreviewFinding' {Maybe FindingStatus
existingFindingStatus :: Maybe FindingStatus
$sel:existingFindingStatus:AccessPreviewFinding' :: AccessPreviewFinding -> Maybe FindingStatus
existingFindingStatus} -> Maybe FindingStatus
existingFindingStatus) (\s :: AccessPreviewFinding
s@AccessPreviewFinding' {} Maybe FindingStatus
a -> AccessPreviewFinding
s {$sel:existingFindingStatus:AccessPreviewFinding' :: Maybe FindingStatus
existingFindingStatus = Maybe FindingStatus
a} :: AccessPreviewFinding)

-- | An error.
accessPreviewFinding_error :: Lens.Lens' AccessPreviewFinding (Prelude.Maybe Prelude.Text)
accessPreviewFinding_error :: (Maybe Text -> f (Maybe Text))
-> AccessPreviewFinding -> f AccessPreviewFinding
accessPreviewFinding_error = (AccessPreviewFinding -> Maybe Text)
-> (AccessPreviewFinding -> Maybe Text -> AccessPreviewFinding)
-> Lens
     AccessPreviewFinding AccessPreviewFinding (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AccessPreviewFinding' {Maybe Text
error :: Maybe Text
$sel:error:AccessPreviewFinding' :: AccessPreviewFinding -> Maybe Text
error} -> Maybe Text
error) (\s :: AccessPreviewFinding
s@AccessPreviewFinding' {} Maybe Text
a -> AccessPreviewFinding
s {$sel:error:AccessPreviewFinding' :: Maybe Text
error = Maybe Text
a} :: AccessPreviewFinding)

-- | Indicates whether the policy that generated the finding allows public
-- access to the resource.
accessPreviewFinding_isPublic :: Lens.Lens' AccessPreviewFinding (Prelude.Maybe Prelude.Bool)
accessPreviewFinding_isPublic :: (Maybe Bool -> f (Maybe Bool))
-> AccessPreviewFinding -> f AccessPreviewFinding
accessPreviewFinding_isPublic = (AccessPreviewFinding -> Maybe Bool)
-> (AccessPreviewFinding -> Maybe Bool -> AccessPreviewFinding)
-> Lens
     AccessPreviewFinding AccessPreviewFinding (Maybe Bool) (Maybe Bool)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AccessPreviewFinding' {Maybe Bool
isPublic :: Maybe Bool
$sel:isPublic:AccessPreviewFinding' :: AccessPreviewFinding -> Maybe Bool
isPublic} -> Maybe Bool
isPublic) (\s :: AccessPreviewFinding
s@AccessPreviewFinding' {} Maybe Bool
a -> AccessPreviewFinding
s {$sel:isPublic:AccessPreviewFinding' :: Maybe Bool
isPublic = Maybe Bool
a} :: AccessPreviewFinding)

-- | The action in the analyzed policy statement that an external principal
-- has permission to perform.
accessPreviewFinding_action :: Lens.Lens' AccessPreviewFinding (Prelude.Maybe [Prelude.Text])
accessPreviewFinding_action :: (Maybe [Text] -> f (Maybe [Text]))
-> AccessPreviewFinding -> f AccessPreviewFinding
accessPreviewFinding_action = (AccessPreviewFinding -> Maybe [Text])
-> (AccessPreviewFinding -> Maybe [Text] -> AccessPreviewFinding)
-> Lens
     AccessPreviewFinding
     AccessPreviewFinding
     (Maybe [Text])
     (Maybe [Text])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AccessPreviewFinding' {Maybe [Text]
action :: Maybe [Text]
$sel:action:AccessPreviewFinding' :: AccessPreviewFinding -> Maybe [Text]
action} -> Maybe [Text]
action) (\s :: AccessPreviewFinding
s@AccessPreviewFinding' {} Maybe [Text]
a -> AccessPreviewFinding
s {$sel:action:AccessPreviewFinding' :: Maybe [Text]
action = Maybe [Text]
a} :: AccessPreviewFinding) ((Maybe [Text] -> f (Maybe [Text]))
 -> AccessPreviewFinding -> f AccessPreviewFinding)
-> ((Maybe [Text] -> f (Maybe [Text]))
    -> Maybe [Text] -> f (Maybe [Text]))
-> (Maybe [Text] -> f (Maybe [Text]))
-> AccessPreviewFinding
-> f AccessPreviewFinding
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso [Text] [Text] [Text] [Text]
-> Iso (Maybe [Text]) (Maybe [Text]) (Maybe [Text]) (Maybe [Text])
forall (f :: * -> *) (g :: * -> *) s t a b.
(Functor f, Functor g) =>
AnIso s t a b -> Iso (f s) (g t) (f a) (g b)
Lens.mapping AnIso [Text] [Text] [Text] [Text]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | The sources of the finding. This indicates how the access that generated
-- the finding is granted. It is populated for Amazon S3 bucket findings.
accessPreviewFinding_sources :: Lens.Lens' AccessPreviewFinding (Prelude.Maybe [FindingSource])
accessPreviewFinding_sources :: (Maybe [FindingSource] -> f (Maybe [FindingSource]))
-> AccessPreviewFinding -> f AccessPreviewFinding
accessPreviewFinding_sources = (AccessPreviewFinding -> Maybe [FindingSource])
-> (AccessPreviewFinding
    -> Maybe [FindingSource] -> AccessPreviewFinding)
-> Lens
     AccessPreviewFinding
     AccessPreviewFinding
     (Maybe [FindingSource])
     (Maybe [FindingSource])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AccessPreviewFinding' {Maybe [FindingSource]
sources :: Maybe [FindingSource]
$sel:sources:AccessPreviewFinding' :: AccessPreviewFinding -> Maybe [FindingSource]
sources} -> Maybe [FindingSource]
sources) (\s :: AccessPreviewFinding
s@AccessPreviewFinding' {} Maybe [FindingSource]
a -> AccessPreviewFinding
s {$sel:sources:AccessPreviewFinding' :: Maybe [FindingSource]
sources = Maybe [FindingSource]
a} :: AccessPreviewFinding) ((Maybe [FindingSource] -> f (Maybe [FindingSource]))
 -> AccessPreviewFinding -> f AccessPreviewFinding)
-> ((Maybe [FindingSource] -> f (Maybe [FindingSource]))
    -> Maybe [FindingSource] -> f (Maybe [FindingSource]))
-> (Maybe [FindingSource] -> f (Maybe [FindingSource]))
-> AccessPreviewFinding
-> f AccessPreviewFinding
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
  [FindingSource] [FindingSource] [FindingSource] [FindingSource]
-> Iso
     (Maybe [FindingSource])
     (Maybe [FindingSource])
     (Maybe [FindingSource])
     (Maybe [FindingSource])
forall (f :: * -> *) (g :: * -> *) s t a b.
(Functor f, Functor g) =>
AnIso s t a b -> Iso (f s) (g t) (f a) (g b)
Lens.mapping AnIso
  [FindingSource] [FindingSource] [FindingSource] [FindingSource]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | The resource that an external principal has access to. This is the
-- resource associated with the access preview.
accessPreviewFinding_resource :: Lens.Lens' AccessPreviewFinding (Prelude.Maybe Prelude.Text)
accessPreviewFinding_resource :: (Maybe Text -> f (Maybe Text))
-> AccessPreviewFinding -> f AccessPreviewFinding
accessPreviewFinding_resource = (AccessPreviewFinding -> Maybe Text)
-> (AccessPreviewFinding -> Maybe Text -> AccessPreviewFinding)
-> Lens
     AccessPreviewFinding AccessPreviewFinding (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AccessPreviewFinding' {Maybe Text
resource :: Maybe Text
$sel:resource:AccessPreviewFinding' :: AccessPreviewFinding -> Maybe Text
resource} -> Maybe Text
resource) (\s :: AccessPreviewFinding
s@AccessPreviewFinding' {} Maybe Text
a -> AccessPreviewFinding
s {$sel:resource:AccessPreviewFinding' :: Maybe Text
resource = Maybe Text
a} :: AccessPreviewFinding)

-- | The external principal that has access to a resource within the zone of
-- trust.
accessPreviewFinding_principal :: Lens.Lens' AccessPreviewFinding (Prelude.Maybe (Prelude.HashMap Prelude.Text Prelude.Text))
accessPreviewFinding_principal :: (Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
-> AccessPreviewFinding -> f AccessPreviewFinding
accessPreviewFinding_principal = (AccessPreviewFinding -> Maybe (HashMap Text Text))
-> (AccessPreviewFinding
    -> Maybe (HashMap Text Text) -> AccessPreviewFinding)
-> Lens
     AccessPreviewFinding
     AccessPreviewFinding
     (Maybe (HashMap Text Text))
     (Maybe (HashMap Text Text))
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AccessPreviewFinding' {Maybe (HashMap Text Text)
principal :: Maybe (HashMap Text Text)
$sel:principal:AccessPreviewFinding' :: AccessPreviewFinding -> Maybe (HashMap Text Text)
principal} -> Maybe (HashMap Text Text)
principal) (\s :: AccessPreviewFinding
s@AccessPreviewFinding' {} Maybe (HashMap Text Text)
a -> AccessPreviewFinding
s {$sel:principal:AccessPreviewFinding' :: Maybe (HashMap Text Text)
principal = Maybe (HashMap Text Text)
a} :: AccessPreviewFinding) ((Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
 -> AccessPreviewFinding -> f AccessPreviewFinding)
-> ((Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
    -> Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
-> (Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
-> AccessPreviewFinding
-> f AccessPreviewFinding
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
  (HashMap Text Text)
  (HashMap Text Text)
  (HashMap Text Text)
  (HashMap Text Text)
-> Iso
     (Maybe (HashMap Text Text))
     (Maybe (HashMap Text Text))
     (Maybe (HashMap Text Text))
     (Maybe (HashMap Text Text))
forall (f :: * -> *) (g :: * -> *) s t a b.
(Functor f, Functor g) =>
AnIso s t a b -> Iso (f s) (g t) (f a) (g b)
Lens.mapping AnIso
  (HashMap Text Text)
  (HashMap Text Text)
  (HashMap Text Text)
  (HashMap Text Text)
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | The existing ID of the finding in IAM Access Analyzer, provided only for
-- existing findings.
accessPreviewFinding_existingFindingId :: Lens.Lens' AccessPreviewFinding (Prelude.Maybe Prelude.Text)
accessPreviewFinding_existingFindingId :: (Maybe Text -> f (Maybe Text))
-> AccessPreviewFinding -> f AccessPreviewFinding
accessPreviewFinding_existingFindingId = (AccessPreviewFinding -> Maybe Text)
-> (AccessPreviewFinding -> Maybe Text -> AccessPreviewFinding)
-> Lens
     AccessPreviewFinding AccessPreviewFinding (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AccessPreviewFinding' {Maybe Text
existingFindingId :: Maybe Text
$sel:existingFindingId:AccessPreviewFinding' :: AccessPreviewFinding -> Maybe Text
existingFindingId} -> Maybe Text
existingFindingId) (\s :: AccessPreviewFinding
s@AccessPreviewFinding' {} Maybe Text
a -> AccessPreviewFinding
s {$sel:existingFindingId:AccessPreviewFinding' :: Maybe Text
existingFindingId = Maybe Text
a} :: AccessPreviewFinding)

-- | The condition in the analyzed policy statement that resulted in a
-- finding.
accessPreviewFinding_condition :: Lens.Lens' AccessPreviewFinding (Prelude.Maybe (Prelude.HashMap Prelude.Text Prelude.Text))
accessPreviewFinding_condition :: (Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
-> AccessPreviewFinding -> f AccessPreviewFinding
accessPreviewFinding_condition = (AccessPreviewFinding -> Maybe (HashMap Text Text))
-> (AccessPreviewFinding
    -> Maybe (HashMap Text Text) -> AccessPreviewFinding)
-> Lens
     AccessPreviewFinding
     AccessPreviewFinding
     (Maybe (HashMap Text Text))
     (Maybe (HashMap Text Text))
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AccessPreviewFinding' {Maybe (HashMap Text Text)
condition :: Maybe (HashMap Text Text)
$sel:condition:AccessPreviewFinding' :: AccessPreviewFinding -> Maybe (HashMap Text Text)
condition} -> Maybe (HashMap Text Text)
condition) (\s :: AccessPreviewFinding
s@AccessPreviewFinding' {} Maybe (HashMap Text Text)
a -> AccessPreviewFinding
s {$sel:condition:AccessPreviewFinding' :: Maybe (HashMap Text Text)
condition = Maybe (HashMap Text Text)
a} :: AccessPreviewFinding) ((Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
 -> AccessPreviewFinding -> f AccessPreviewFinding)
-> ((Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
    -> Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
-> (Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
-> AccessPreviewFinding
-> f AccessPreviewFinding
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
  (HashMap Text Text)
  (HashMap Text Text)
  (HashMap Text Text)
  (HashMap Text Text)
-> Iso
     (Maybe (HashMap Text Text))
     (Maybe (HashMap Text Text))
     (Maybe (HashMap Text Text))
     (Maybe (HashMap Text Text))
forall (f :: * -> *) (g :: * -> *) s t a b.
(Functor f, Functor g) =>
AnIso s t a b -> Iso (f s) (g t) (f a) (g b)
Lens.mapping AnIso
  (HashMap Text Text)
  (HashMap Text Text)
  (HashMap Text Text)
  (HashMap Text Text)
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | 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.
accessPreviewFinding_changeType :: Lens.Lens' AccessPreviewFinding FindingChangeType
accessPreviewFinding_changeType :: (FindingChangeType -> f FindingChangeType)
-> AccessPreviewFinding -> f AccessPreviewFinding
accessPreviewFinding_changeType = (AccessPreviewFinding -> FindingChangeType)
-> (AccessPreviewFinding
    -> FindingChangeType -> AccessPreviewFinding)
-> Lens
     AccessPreviewFinding
     AccessPreviewFinding
     FindingChangeType
     FindingChangeType
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AccessPreviewFinding' {FindingChangeType
changeType :: FindingChangeType
$sel:changeType:AccessPreviewFinding' :: AccessPreviewFinding -> FindingChangeType
changeType} -> FindingChangeType
changeType) (\s :: AccessPreviewFinding
s@AccessPreviewFinding' {} FindingChangeType
a -> AccessPreviewFinding
s {$sel:changeType:AccessPreviewFinding' :: FindingChangeType
changeType = FindingChangeType
a} :: AccessPreviewFinding)

-- | The time at which the access preview finding was created.
accessPreviewFinding_createdAt :: Lens.Lens' AccessPreviewFinding Prelude.UTCTime
accessPreviewFinding_createdAt :: (UTCTime -> f UTCTime)
-> AccessPreviewFinding -> f AccessPreviewFinding
accessPreviewFinding_createdAt = (AccessPreviewFinding -> POSIX)
-> (AccessPreviewFinding -> POSIX -> AccessPreviewFinding)
-> Lens AccessPreviewFinding AccessPreviewFinding POSIX POSIX
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AccessPreviewFinding' {POSIX
createdAt :: POSIX
$sel:createdAt:AccessPreviewFinding' :: AccessPreviewFinding -> POSIX
createdAt} -> POSIX
createdAt) (\s :: AccessPreviewFinding
s@AccessPreviewFinding' {} POSIX
a -> AccessPreviewFinding
s {$sel:createdAt:AccessPreviewFinding' :: POSIX
createdAt = POSIX
a} :: AccessPreviewFinding) ((POSIX -> f POSIX)
 -> AccessPreviewFinding -> f AccessPreviewFinding)
-> ((UTCTime -> f UTCTime) -> POSIX -> f POSIX)
-> (UTCTime -> f UTCTime)
-> AccessPreviewFinding
-> f AccessPreviewFinding
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. (UTCTime -> f UTCTime) -> POSIX -> f POSIX
forall (a :: Format). Iso' (Time a) UTCTime
Core._Time

-- | 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.
accessPreviewFinding_id :: Lens.Lens' AccessPreviewFinding Prelude.Text
accessPreviewFinding_id :: (Text -> f Text) -> AccessPreviewFinding -> f AccessPreviewFinding
accessPreviewFinding_id = (AccessPreviewFinding -> Text)
-> (AccessPreviewFinding -> Text -> AccessPreviewFinding)
-> Lens AccessPreviewFinding AccessPreviewFinding Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AccessPreviewFinding' {Text
id :: Text
$sel:id:AccessPreviewFinding' :: AccessPreviewFinding -> Text
id} -> Text
id) (\s :: AccessPreviewFinding
s@AccessPreviewFinding' {} Text
a -> AccessPreviewFinding
s {$sel:id:AccessPreviewFinding' :: Text
id = Text
a} :: AccessPreviewFinding)

-- | 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.
accessPreviewFinding_resourceOwnerAccount :: Lens.Lens' AccessPreviewFinding Prelude.Text
accessPreviewFinding_resourceOwnerAccount :: (Text -> f Text) -> AccessPreviewFinding -> f AccessPreviewFinding
accessPreviewFinding_resourceOwnerAccount = (AccessPreviewFinding -> Text)
-> (AccessPreviewFinding -> Text -> AccessPreviewFinding)
-> Lens AccessPreviewFinding AccessPreviewFinding Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AccessPreviewFinding' {Text
resourceOwnerAccount :: Text
$sel:resourceOwnerAccount:AccessPreviewFinding' :: AccessPreviewFinding -> Text
resourceOwnerAccount} -> Text
resourceOwnerAccount) (\s :: AccessPreviewFinding
s@AccessPreviewFinding' {} Text
a -> AccessPreviewFinding
s {$sel:resourceOwnerAccount:AccessPreviewFinding' :: Text
resourceOwnerAccount = Text
a} :: AccessPreviewFinding)

-- | The type of the resource that can be accessed in the finding.
accessPreviewFinding_resourceType :: Lens.Lens' AccessPreviewFinding ResourceType
accessPreviewFinding_resourceType :: (ResourceType -> f ResourceType)
-> AccessPreviewFinding -> f AccessPreviewFinding
accessPreviewFinding_resourceType = (AccessPreviewFinding -> ResourceType)
-> (AccessPreviewFinding -> ResourceType -> AccessPreviewFinding)
-> Lens
     AccessPreviewFinding AccessPreviewFinding ResourceType ResourceType
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AccessPreviewFinding' {ResourceType
resourceType :: ResourceType
$sel:resourceType:AccessPreviewFinding' :: AccessPreviewFinding -> ResourceType
resourceType} -> ResourceType
resourceType) (\s :: AccessPreviewFinding
s@AccessPreviewFinding' {} ResourceType
a -> AccessPreviewFinding
s {$sel:resourceType:AccessPreviewFinding' :: ResourceType
resourceType = ResourceType
a} :: AccessPreviewFinding)

-- | 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.
accessPreviewFinding_status :: Lens.Lens' AccessPreviewFinding FindingStatus
accessPreviewFinding_status :: (FindingStatus -> f FindingStatus)
-> AccessPreviewFinding -> f AccessPreviewFinding
accessPreviewFinding_status = (AccessPreviewFinding -> FindingStatus)
-> (AccessPreviewFinding -> FindingStatus -> AccessPreviewFinding)
-> Lens
     AccessPreviewFinding
     AccessPreviewFinding
     FindingStatus
     FindingStatus
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AccessPreviewFinding' {FindingStatus
status :: FindingStatus
$sel:status:AccessPreviewFinding' :: AccessPreviewFinding -> FindingStatus
status} -> FindingStatus
status) (\s :: AccessPreviewFinding
s@AccessPreviewFinding' {} FindingStatus
a -> AccessPreviewFinding
s {$sel:status:AccessPreviewFinding' :: FindingStatus
status = FindingStatus
a} :: AccessPreviewFinding)

instance Core.FromJSON AccessPreviewFinding where
  parseJSON :: Value -> Parser AccessPreviewFinding
parseJSON =
    String
-> (Object -> Parser AccessPreviewFinding)
-> Value
-> Parser AccessPreviewFinding
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
      String
"AccessPreviewFinding"
      ( \Object
x ->
          Maybe FindingStatus
-> Maybe Text
-> Maybe Bool
-> Maybe [Text]
-> Maybe [FindingSource]
-> Maybe Text
-> Maybe (HashMap Text Text)
-> Maybe Text
-> Maybe (HashMap Text Text)
-> FindingChangeType
-> POSIX
-> Text
-> Text
-> ResourceType
-> FindingStatus
-> AccessPreviewFinding
AccessPreviewFinding'
            (Maybe FindingStatus
 -> Maybe Text
 -> Maybe Bool
 -> Maybe [Text]
 -> Maybe [FindingSource]
 -> Maybe Text
 -> Maybe (HashMap Text Text)
 -> Maybe Text
 -> Maybe (HashMap Text Text)
 -> FindingChangeType
 -> POSIX
 -> Text
 -> Text
 -> ResourceType
 -> FindingStatus
 -> AccessPreviewFinding)
-> Parser (Maybe FindingStatus)
-> Parser
     (Maybe Text
      -> Maybe Bool
      -> Maybe [Text]
      -> Maybe [FindingSource]
      -> Maybe Text
      -> Maybe (HashMap Text Text)
      -> Maybe Text
      -> Maybe (HashMap Text Text)
      -> FindingChangeType
      -> POSIX
      -> Text
      -> Text
      -> ResourceType
      -> FindingStatus
      -> AccessPreviewFinding)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Parser (Maybe FindingStatus)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"existingFindingStatus")
            Parser
  (Maybe Text
   -> Maybe Bool
   -> Maybe [Text]
   -> Maybe [FindingSource]
   -> Maybe Text
   -> Maybe (HashMap Text Text)
   -> Maybe Text
   -> Maybe (HashMap Text Text)
   -> FindingChangeType
   -> POSIX
   -> Text
   -> Text
   -> ResourceType
   -> FindingStatus
   -> AccessPreviewFinding)
-> Parser (Maybe Text)
-> Parser
     (Maybe Bool
      -> Maybe [Text]
      -> Maybe [FindingSource]
      -> Maybe Text
      -> Maybe (HashMap Text Text)
      -> Maybe Text
      -> Maybe (HashMap Text Text)
      -> FindingChangeType
      -> POSIX
      -> Text
      -> Text
      -> ResourceType
      -> FindingStatus
      -> AccessPreviewFinding)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"error")
            Parser
  (Maybe Bool
   -> Maybe [Text]
   -> Maybe [FindingSource]
   -> Maybe Text
   -> Maybe (HashMap Text Text)
   -> Maybe Text
   -> Maybe (HashMap Text Text)
   -> FindingChangeType
   -> POSIX
   -> Text
   -> Text
   -> ResourceType
   -> FindingStatus
   -> AccessPreviewFinding)
-> Parser (Maybe Bool)
-> Parser
     (Maybe [Text]
      -> Maybe [FindingSource]
      -> Maybe Text
      -> Maybe (HashMap Text Text)
      -> Maybe Text
      -> Maybe (HashMap Text Text)
      -> FindingChangeType
      -> POSIX
      -> Text
      -> Text
      -> ResourceType
      -> FindingStatus
      -> AccessPreviewFinding)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Bool)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"isPublic")
            Parser
  (Maybe [Text]
   -> Maybe [FindingSource]
   -> Maybe Text
   -> Maybe (HashMap Text Text)
   -> Maybe Text
   -> Maybe (HashMap Text Text)
   -> FindingChangeType
   -> POSIX
   -> Text
   -> Text
   -> ResourceType
   -> FindingStatus
   -> AccessPreviewFinding)
-> Parser (Maybe [Text])
-> Parser
     (Maybe [FindingSource]
      -> Maybe Text
      -> Maybe (HashMap Text Text)
      -> Maybe Text
      -> Maybe (HashMap Text Text)
      -> FindingChangeType
      -> POSIX
      -> Text
      -> Text
      -> ResourceType
      -> FindingStatus
      -> AccessPreviewFinding)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe (Maybe [Text]))
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"action" Parser (Maybe (Maybe [Text]))
-> Maybe [Text] -> Parser (Maybe [Text])
forall a. Parser (Maybe a) -> a -> Parser a
Core..!= Maybe [Text]
forall a. Monoid a => a
Prelude.mempty)
            Parser
  (Maybe [FindingSource]
   -> Maybe Text
   -> Maybe (HashMap Text Text)
   -> Maybe Text
   -> Maybe (HashMap Text Text)
   -> FindingChangeType
   -> POSIX
   -> Text
   -> Text
   -> ResourceType
   -> FindingStatus
   -> AccessPreviewFinding)
-> Parser (Maybe [FindingSource])
-> Parser
     (Maybe Text
      -> Maybe (HashMap Text Text)
      -> Maybe Text
      -> Maybe (HashMap Text Text)
      -> FindingChangeType
      -> POSIX
      -> Text
      -> Text
      -> ResourceType
      -> FindingStatus
      -> AccessPreviewFinding)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe (Maybe [FindingSource]))
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"sources" Parser (Maybe (Maybe [FindingSource]))
-> Maybe [FindingSource] -> Parser (Maybe [FindingSource])
forall a. Parser (Maybe a) -> a -> Parser a
Core..!= Maybe [FindingSource]
forall a. Monoid a => a
Prelude.mempty)
            Parser
  (Maybe Text
   -> Maybe (HashMap Text Text)
   -> Maybe Text
   -> Maybe (HashMap Text Text)
   -> FindingChangeType
   -> POSIX
   -> Text
   -> Text
   -> ResourceType
   -> FindingStatus
   -> AccessPreviewFinding)
-> Parser (Maybe Text)
-> Parser
     (Maybe (HashMap Text Text)
      -> Maybe Text
      -> Maybe (HashMap Text Text)
      -> FindingChangeType
      -> POSIX
      -> Text
      -> Text
      -> ResourceType
      -> FindingStatus
      -> AccessPreviewFinding)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"resource")
            Parser
  (Maybe (HashMap Text Text)
   -> Maybe Text
   -> Maybe (HashMap Text Text)
   -> FindingChangeType
   -> POSIX
   -> Text
   -> Text
   -> ResourceType
   -> FindingStatus
   -> AccessPreviewFinding)
-> Parser (Maybe (HashMap Text Text))
-> Parser
     (Maybe Text
      -> Maybe (HashMap Text Text)
      -> FindingChangeType
      -> POSIX
      -> Text
      -> Text
      -> ResourceType
      -> FindingStatus
      -> AccessPreviewFinding)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe (Maybe (HashMap Text Text)))
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"principal" Parser (Maybe (Maybe (HashMap Text Text)))
-> Maybe (HashMap Text Text) -> Parser (Maybe (HashMap Text Text))
forall a. Parser (Maybe a) -> a -> Parser a
Core..!= Maybe (HashMap Text Text)
forall a. Monoid a => a
Prelude.mempty)
            Parser
  (Maybe Text
   -> Maybe (HashMap Text Text)
   -> FindingChangeType
   -> POSIX
   -> Text
   -> Text
   -> ResourceType
   -> FindingStatus
   -> AccessPreviewFinding)
-> Parser (Maybe Text)
-> Parser
     (Maybe (HashMap Text Text)
      -> FindingChangeType
      -> POSIX
      -> Text
      -> Text
      -> ResourceType
      -> FindingStatus
      -> AccessPreviewFinding)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"existingFindingId")
            Parser
  (Maybe (HashMap Text Text)
   -> FindingChangeType
   -> POSIX
   -> Text
   -> Text
   -> ResourceType
   -> FindingStatus
   -> AccessPreviewFinding)
-> Parser (Maybe (HashMap Text Text))
-> Parser
     (FindingChangeType
      -> POSIX
      -> Text
      -> Text
      -> ResourceType
      -> FindingStatus
      -> AccessPreviewFinding)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe (Maybe (HashMap Text Text)))
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"condition" Parser (Maybe (Maybe (HashMap Text Text)))
-> Maybe (HashMap Text Text) -> Parser (Maybe (HashMap Text Text))
forall a. Parser (Maybe a) -> a -> Parser a
Core..!= Maybe (HashMap Text Text)
forall a. Monoid a => a
Prelude.mempty)
            Parser
  (FindingChangeType
   -> POSIX
   -> Text
   -> Text
   -> ResourceType
   -> FindingStatus
   -> AccessPreviewFinding)
-> Parser FindingChangeType
-> Parser
     (POSIX
      -> Text
      -> Text
      -> ResourceType
      -> FindingStatus
      -> AccessPreviewFinding)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser FindingChangeType
forall a. FromJSON a => Object -> Text -> Parser a
Core..: Text
"changeType")
            Parser
  (POSIX
   -> Text
   -> Text
   -> ResourceType
   -> FindingStatus
   -> AccessPreviewFinding)
-> Parser POSIX
-> Parser
     (Text
      -> Text -> ResourceType -> FindingStatus -> AccessPreviewFinding)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser POSIX
forall a. FromJSON a => Object -> Text -> Parser a
Core..: Text
"createdAt")
            Parser
  (Text
   -> Text -> ResourceType -> FindingStatus -> AccessPreviewFinding)
-> Parser Text
-> Parser
     (Text -> ResourceType -> FindingStatus -> AccessPreviewFinding)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser Text
forall a. FromJSON a => Object -> Text -> Parser a
Core..: Text
"id")
            Parser
  (Text -> ResourceType -> FindingStatus -> AccessPreviewFinding)
-> Parser Text
-> Parser (ResourceType -> FindingStatus -> AccessPreviewFinding)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser Text
forall a. FromJSON a => Object -> Text -> Parser a
Core..: Text
"resourceOwnerAccount")
            Parser (ResourceType -> FindingStatus -> AccessPreviewFinding)
-> Parser ResourceType
-> Parser (FindingStatus -> AccessPreviewFinding)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser ResourceType
forall a. FromJSON a => Object -> Text -> Parser a
Core..: Text
"resourceType")
            Parser (FindingStatus -> AccessPreviewFinding)
-> Parser FindingStatus -> Parser AccessPreviewFinding
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser FindingStatus
forall a. FromJSON a => Object -> Text -> Parser a
Core..: Text
"status")
      )

instance Prelude.Hashable AccessPreviewFinding

instance Prelude.NFData AccessPreviewFinding