{-# 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.AnalyzedResource
-- 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.AnalyzedResource where

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

-- | Contains details about the analyzed resource.
--
-- /See:/ 'newAnalyzedResource' smart constructor.
data AnalyzedResource = AnalyzedResource'
  { -- | The current status of the finding generated from the analyzed resource.
    AnalyzedResource -> Maybe FindingStatus
status :: Prelude.Maybe FindingStatus,
    -- | The actions that an external principal is granted permission to use by
    -- the policy that generated the finding.
    AnalyzedResource -> Maybe [Text]
actions :: Prelude.Maybe [Prelude.Text],
    -- | An error message.
    AnalyzedResource -> Maybe Text
error :: Prelude.Maybe Prelude.Text,
    -- | Indicates how the access that generated the finding is granted. This is
    -- populated for Amazon S3 bucket findings.
    AnalyzedResource -> Maybe [Text]
sharedVia :: Prelude.Maybe [Prelude.Text],
    -- | The time at which the resource was analyzed.
    AnalyzedResource -> POSIX
analyzedAt :: Core.POSIX,
    -- | The time at which the finding was created.
    AnalyzedResource -> POSIX
createdAt :: Core.POSIX,
    -- | Indicates whether the policy that generated the finding grants public
    -- access to the resource.
    AnalyzedResource -> Bool
isPublic :: Prelude.Bool,
    -- | The ARN of the resource that was analyzed.
    AnalyzedResource -> Text
resourceArn :: Prelude.Text,
    -- | The Amazon Web Services account ID that owns the resource.
    AnalyzedResource -> Text
resourceOwnerAccount :: Prelude.Text,
    -- | The type of the resource that was analyzed.
    AnalyzedResource -> ResourceType
resourceType :: ResourceType,
    -- | The time at which the finding was updated.
    AnalyzedResource -> POSIX
updatedAt :: Core.POSIX
  }
  deriving (AnalyzedResource -> AnalyzedResource -> Bool
(AnalyzedResource -> AnalyzedResource -> Bool)
-> (AnalyzedResource -> AnalyzedResource -> Bool)
-> Eq AnalyzedResource
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: AnalyzedResource -> AnalyzedResource -> Bool
$c/= :: AnalyzedResource -> AnalyzedResource -> Bool
== :: AnalyzedResource -> AnalyzedResource -> Bool
$c== :: AnalyzedResource -> AnalyzedResource -> Bool
Prelude.Eq, ReadPrec [AnalyzedResource]
ReadPrec AnalyzedResource
Int -> ReadS AnalyzedResource
ReadS [AnalyzedResource]
(Int -> ReadS AnalyzedResource)
-> ReadS [AnalyzedResource]
-> ReadPrec AnalyzedResource
-> ReadPrec [AnalyzedResource]
-> Read AnalyzedResource
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [AnalyzedResource]
$creadListPrec :: ReadPrec [AnalyzedResource]
readPrec :: ReadPrec AnalyzedResource
$creadPrec :: ReadPrec AnalyzedResource
readList :: ReadS [AnalyzedResource]
$creadList :: ReadS [AnalyzedResource]
readsPrec :: Int -> ReadS AnalyzedResource
$creadsPrec :: Int -> ReadS AnalyzedResource
Prelude.Read, Int -> AnalyzedResource -> ShowS
[AnalyzedResource] -> ShowS
AnalyzedResource -> String
(Int -> AnalyzedResource -> ShowS)
-> (AnalyzedResource -> String)
-> ([AnalyzedResource] -> ShowS)
-> Show AnalyzedResource
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [AnalyzedResource] -> ShowS
$cshowList :: [AnalyzedResource] -> ShowS
show :: AnalyzedResource -> String
$cshow :: AnalyzedResource -> String
showsPrec :: Int -> AnalyzedResource -> ShowS
$cshowsPrec :: Int -> AnalyzedResource -> ShowS
Prelude.Show, (forall x. AnalyzedResource -> Rep AnalyzedResource x)
-> (forall x. Rep AnalyzedResource x -> AnalyzedResource)
-> Generic AnalyzedResource
forall x. Rep AnalyzedResource x -> AnalyzedResource
forall x. AnalyzedResource -> Rep AnalyzedResource x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep AnalyzedResource x -> AnalyzedResource
$cfrom :: forall x. AnalyzedResource -> Rep AnalyzedResource x
Prelude.Generic)

-- |
-- Create a value of 'AnalyzedResource' 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:
--
-- 'status', 'analyzedResource_status' - The current status of the finding generated from the analyzed resource.
--
-- 'actions', 'analyzedResource_actions' - The actions that an external principal is granted permission to use by
-- the policy that generated the finding.
--
-- 'error', 'analyzedResource_error' - An error message.
--
-- 'sharedVia', 'analyzedResource_sharedVia' - Indicates how the access that generated the finding is granted. This is
-- populated for Amazon S3 bucket findings.
--
-- 'analyzedAt', 'analyzedResource_analyzedAt' - The time at which the resource was analyzed.
--
-- 'createdAt', 'analyzedResource_createdAt' - The time at which the finding was created.
--
-- 'isPublic', 'analyzedResource_isPublic' - Indicates whether the policy that generated the finding grants public
-- access to the resource.
--
-- 'resourceArn', 'analyzedResource_resourceArn' - The ARN of the resource that was analyzed.
--
-- 'resourceOwnerAccount', 'analyzedResource_resourceOwnerAccount' - The Amazon Web Services account ID that owns the resource.
--
-- 'resourceType', 'analyzedResource_resourceType' - The type of the resource that was analyzed.
--
-- 'updatedAt', 'analyzedResource_updatedAt' - The time at which the finding was updated.
newAnalyzedResource ::
  -- | 'analyzedAt'
  Prelude.UTCTime ->
  -- | 'createdAt'
  Prelude.UTCTime ->
  -- | 'isPublic'
  Prelude.Bool ->
  -- | 'resourceArn'
  Prelude.Text ->
  -- | 'resourceOwnerAccount'
  Prelude.Text ->
  -- | 'resourceType'
  ResourceType ->
  -- | 'updatedAt'
  Prelude.UTCTime ->
  AnalyzedResource
newAnalyzedResource :: UTCTime
-> UTCTime
-> Bool
-> Text
-> Text
-> ResourceType
-> UTCTime
-> AnalyzedResource
newAnalyzedResource
  UTCTime
pAnalyzedAt_
  UTCTime
pCreatedAt_
  Bool
pIsPublic_
  Text
pResourceArn_
  Text
pResourceOwnerAccount_
  ResourceType
pResourceType_
  UTCTime
pUpdatedAt_ =
    AnalyzedResource' :: Maybe FindingStatus
-> Maybe [Text]
-> Maybe Text
-> Maybe [Text]
-> POSIX
-> POSIX
-> Bool
-> Text
-> Text
-> ResourceType
-> POSIX
-> AnalyzedResource
AnalyzedResource'
      { $sel:status:AnalyzedResource' :: Maybe FindingStatus
status = Maybe FindingStatus
forall a. Maybe a
Prelude.Nothing,
        $sel:actions:AnalyzedResource' :: Maybe [Text]
actions = Maybe [Text]
forall a. Maybe a
Prelude.Nothing,
        $sel:error:AnalyzedResource' :: Maybe Text
error = Maybe Text
forall a. Maybe a
Prelude.Nothing,
        $sel:sharedVia:AnalyzedResource' :: Maybe [Text]
sharedVia = Maybe [Text]
forall a. Maybe a
Prelude.Nothing,
        $sel:analyzedAt:AnalyzedResource' :: POSIX
analyzedAt = 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
pAnalyzedAt_,
        $sel:createdAt:AnalyzedResource' :: 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:isPublic:AnalyzedResource' :: Bool
isPublic = Bool
pIsPublic_,
        $sel:resourceArn:AnalyzedResource' :: Text
resourceArn = Text
pResourceArn_,
        $sel:resourceOwnerAccount:AnalyzedResource' :: Text
resourceOwnerAccount = Text
pResourceOwnerAccount_,
        $sel:resourceType:AnalyzedResource' :: ResourceType
resourceType = ResourceType
pResourceType_,
        $sel:updatedAt:AnalyzedResource' :: POSIX
updatedAt = 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
pUpdatedAt_
      }

-- | The current status of the finding generated from the analyzed resource.
analyzedResource_status :: Lens.Lens' AnalyzedResource (Prelude.Maybe FindingStatus)
analyzedResource_status :: (Maybe FindingStatus -> f (Maybe FindingStatus))
-> AnalyzedResource -> f AnalyzedResource
analyzedResource_status = (AnalyzedResource -> Maybe FindingStatus)
-> (AnalyzedResource -> Maybe FindingStatus -> AnalyzedResource)
-> Lens
     AnalyzedResource
     AnalyzedResource
     (Maybe FindingStatus)
     (Maybe FindingStatus)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AnalyzedResource' {Maybe FindingStatus
status :: Maybe FindingStatus
$sel:status:AnalyzedResource' :: AnalyzedResource -> Maybe FindingStatus
status} -> Maybe FindingStatus
status) (\s :: AnalyzedResource
s@AnalyzedResource' {} Maybe FindingStatus
a -> AnalyzedResource
s {$sel:status:AnalyzedResource' :: Maybe FindingStatus
status = Maybe FindingStatus
a} :: AnalyzedResource)

-- | The actions that an external principal is granted permission to use by
-- the policy that generated the finding.
analyzedResource_actions :: Lens.Lens' AnalyzedResource (Prelude.Maybe [Prelude.Text])
analyzedResource_actions :: (Maybe [Text] -> f (Maybe [Text]))
-> AnalyzedResource -> f AnalyzedResource
analyzedResource_actions = (AnalyzedResource -> Maybe [Text])
-> (AnalyzedResource -> Maybe [Text] -> AnalyzedResource)
-> Lens
     AnalyzedResource AnalyzedResource (Maybe [Text]) (Maybe [Text])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AnalyzedResource' {Maybe [Text]
actions :: Maybe [Text]
$sel:actions:AnalyzedResource' :: AnalyzedResource -> Maybe [Text]
actions} -> Maybe [Text]
actions) (\s :: AnalyzedResource
s@AnalyzedResource' {} Maybe [Text]
a -> AnalyzedResource
s {$sel:actions:AnalyzedResource' :: Maybe [Text]
actions = Maybe [Text]
a} :: AnalyzedResource) ((Maybe [Text] -> f (Maybe [Text]))
 -> AnalyzedResource -> f AnalyzedResource)
-> ((Maybe [Text] -> f (Maybe [Text]))
    -> Maybe [Text] -> f (Maybe [Text]))
-> (Maybe [Text] -> f (Maybe [Text]))
-> AnalyzedResource
-> f AnalyzedResource
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

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

-- | Indicates how the access that generated the finding is granted. This is
-- populated for Amazon S3 bucket findings.
analyzedResource_sharedVia :: Lens.Lens' AnalyzedResource (Prelude.Maybe [Prelude.Text])
analyzedResource_sharedVia :: (Maybe [Text] -> f (Maybe [Text]))
-> AnalyzedResource -> f AnalyzedResource
analyzedResource_sharedVia = (AnalyzedResource -> Maybe [Text])
-> (AnalyzedResource -> Maybe [Text] -> AnalyzedResource)
-> Lens
     AnalyzedResource AnalyzedResource (Maybe [Text]) (Maybe [Text])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AnalyzedResource' {Maybe [Text]
sharedVia :: Maybe [Text]
$sel:sharedVia:AnalyzedResource' :: AnalyzedResource -> Maybe [Text]
sharedVia} -> Maybe [Text]
sharedVia) (\s :: AnalyzedResource
s@AnalyzedResource' {} Maybe [Text]
a -> AnalyzedResource
s {$sel:sharedVia:AnalyzedResource' :: Maybe [Text]
sharedVia = Maybe [Text]
a} :: AnalyzedResource) ((Maybe [Text] -> f (Maybe [Text]))
 -> AnalyzedResource -> f AnalyzedResource)
-> ((Maybe [Text] -> f (Maybe [Text]))
    -> Maybe [Text] -> f (Maybe [Text]))
-> (Maybe [Text] -> f (Maybe [Text]))
-> AnalyzedResource
-> f AnalyzedResource
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 time at which the resource was analyzed.
analyzedResource_analyzedAt :: Lens.Lens' AnalyzedResource Prelude.UTCTime
analyzedResource_analyzedAt :: (UTCTime -> f UTCTime) -> AnalyzedResource -> f AnalyzedResource
analyzedResource_analyzedAt = (AnalyzedResource -> POSIX)
-> (AnalyzedResource -> POSIX -> AnalyzedResource)
-> Lens AnalyzedResource AnalyzedResource POSIX POSIX
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AnalyzedResource' {POSIX
analyzedAt :: POSIX
$sel:analyzedAt:AnalyzedResource' :: AnalyzedResource -> POSIX
analyzedAt} -> POSIX
analyzedAt) (\s :: AnalyzedResource
s@AnalyzedResource' {} POSIX
a -> AnalyzedResource
s {$sel:analyzedAt:AnalyzedResource' :: POSIX
analyzedAt = POSIX
a} :: AnalyzedResource) ((POSIX -> f POSIX) -> AnalyzedResource -> f AnalyzedResource)
-> ((UTCTime -> f UTCTime) -> POSIX -> f POSIX)
-> (UTCTime -> f UTCTime)
-> AnalyzedResource
-> f AnalyzedResource
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 time at which the finding was created.
analyzedResource_createdAt :: Lens.Lens' AnalyzedResource Prelude.UTCTime
analyzedResource_createdAt :: (UTCTime -> f UTCTime) -> AnalyzedResource -> f AnalyzedResource
analyzedResource_createdAt = (AnalyzedResource -> POSIX)
-> (AnalyzedResource -> POSIX -> AnalyzedResource)
-> Lens AnalyzedResource AnalyzedResource POSIX POSIX
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AnalyzedResource' {POSIX
createdAt :: POSIX
$sel:createdAt:AnalyzedResource' :: AnalyzedResource -> POSIX
createdAt} -> POSIX
createdAt) (\s :: AnalyzedResource
s@AnalyzedResource' {} POSIX
a -> AnalyzedResource
s {$sel:createdAt:AnalyzedResource' :: POSIX
createdAt = POSIX
a} :: AnalyzedResource) ((POSIX -> f POSIX) -> AnalyzedResource -> f AnalyzedResource)
-> ((UTCTime -> f UTCTime) -> POSIX -> f POSIX)
-> (UTCTime -> f UTCTime)
-> AnalyzedResource
-> f AnalyzedResource
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

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

-- | The ARN of the resource that was analyzed.
analyzedResource_resourceArn :: Lens.Lens' AnalyzedResource Prelude.Text
analyzedResource_resourceArn :: (Text -> f Text) -> AnalyzedResource -> f AnalyzedResource
analyzedResource_resourceArn = (AnalyzedResource -> Text)
-> (AnalyzedResource -> Text -> AnalyzedResource)
-> Lens AnalyzedResource AnalyzedResource Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AnalyzedResource' {Text
resourceArn :: Text
$sel:resourceArn:AnalyzedResource' :: AnalyzedResource -> Text
resourceArn} -> Text
resourceArn) (\s :: AnalyzedResource
s@AnalyzedResource' {} Text
a -> AnalyzedResource
s {$sel:resourceArn:AnalyzedResource' :: Text
resourceArn = Text
a} :: AnalyzedResource)

-- | The Amazon Web Services account ID that owns the resource.
analyzedResource_resourceOwnerAccount :: Lens.Lens' AnalyzedResource Prelude.Text
analyzedResource_resourceOwnerAccount :: (Text -> f Text) -> AnalyzedResource -> f AnalyzedResource
analyzedResource_resourceOwnerAccount = (AnalyzedResource -> Text)
-> (AnalyzedResource -> Text -> AnalyzedResource)
-> Lens AnalyzedResource AnalyzedResource Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AnalyzedResource' {Text
resourceOwnerAccount :: Text
$sel:resourceOwnerAccount:AnalyzedResource' :: AnalyzedResource -> Text
resourceOwnerAccount} -> Text
resourceOwnerAccount) (\s :: AnalyzedResource
s@AnalyzedResource' {} Text
a -> AnalyzedResource
s {$sel:resourceOwnerAccount:AnalyzedResource' :: Text
resourceOwnerAccount = Text
a} :: AnalyzedResource)

-- | The type of the resource that was analyzed.
analyzedResource_resourceType :: Lens.Lens' AnalyzedResource ResourceType
analyzedResource_resourceType :: (ResourceType -> f ResourceType)
-> AnalyzedResource -> f AnalyzedResource
analyzedResource_resourceType = (AnalyzedResource -> ResourceType)
-> (AnalyzedResource -> ResourceType -> AnalyzedResource)
-> Lens AnalyzedResource AnalyzedResource ResourceType ResourceType
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AnalyzedResource' {ResourceType
resourceType :: ResourceType
$sel:resourceType:AnalyzedResource' :: AnalyzedResource -> ResourceType
resourceType} -> ResourceType
resourceType) (\s :: AnalyzedResource
s@AnalyzedResource' {} ResourceType
a -> AnalyzedResource
s {$sel:resourceType:AnalyzedResource' :: ResourceType
resourceType = ResourceType
a} :: AnalyzedResource)

-- | The time at which the finding was updated.
analyzedResource_updatedAt :: Lens.Lens' AnalyzedResource Prelude.UTCTime
analyzedResource_updatedAt :: (UTCTime -> f UTCTime) -> AnalyzedResource -> f AnalyzedResource
analyzedResource_updatedAt = (AnalyzedResource -> POSIX)
-> (AnalyzedResource -> POSIX -> AnalyzedResource)
-> Lens AnalyzedResource AnalyzedResource POSIX POSIX
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AnalyzedResource' {POSIX
updatedAt :: POSIX
$sel:updatedAt:AnalyzedResource' :: AnalyzedResource -> POSIX
updatedAt} -> POSIX
updatedAt) (\s :: AnalyzedResource
s@AnalyzedResource' {} POSIX
a -> AnalyzedResource
s {$sel:updatedAt:AnalyzedResource' :: POSIX
updatedAt = POSIX
a} :: AnalyzedResource) ((POSIX -> f POSIX) -> AnalyzedResource -> f AnalyzedResource)
-> ((UTCTime -> f UTCTime) -> POSIX -> f POSIX)
-> (UTCTime -> f UTCTime)
-> AnalyzedResource
-> f AnalyzedResource
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

instance Core.FromJSON AnalyzedResource where
  parseJSON :: Value -> Parser AnalyzedResource
parseJSON =
    String
-> (Object -> Parser AnalyzedResource)
-> Value
-> Parser AnalyzedResource
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
      String
"AnalyzedResource"
      ( \Object
x ->
          Maybe FindingStatus
-> Maybe [Text]
-> Maybe Text
-> Maybe [Text]
-> POSIX
-> POSIX
-> Bool
-> Text
-> Text
-> ResourceType
-> POSIX
-> AnalyzedResource
AnalyzedResource'
            (Maybe FindingStatus
 -> Maybe [Text]
 -> Maybe Text
 -> Maybe [Text]
 -> POSIX
 -> POSIX
 -> Bool
 -> Text
 -> Text
 -> ResourceType
 -> POSIX
 -> AnalyzedResource)
-> Parser (Maybe FindingStatus)
-> Parser
     (Maybe [Text]
      -> Maybe Text
      -> Maybe [Text]
      -> POSIX
      -> POSIX
      -> Bool
      -> Text
      -> Text
      -> ResourceType
      -> POSIX
      -> AnalyzedResource)
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
"status")
            Parser
  (Maybe [Text]
   -> Maybe Text
   -> Maybe [Text]
   -> POSIX
   -> POSIX
   -> Bool
   -> Text
   -> Text
   -> ResourceType
   -> POSIX
   -> AnalyzedResource)
-> Parser (Maybe [Text])
-> Parser
     (Maybe Text
      -> Maybe [Text]
      -> POSIX
      -> POSIX
      -> Bool
      -> Text
      -> Text
      -> ResourceType
      -> POSIX
      -> AnalyzedResource)
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
"actions" 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 Text
   -> Maybe [Text]
   -> POSIX
   -> POSIX
   -> Bool
   -> Text
   -> Text
   -> ResourceType
   -> POSIX
   -> AnalyzedResource)
-> Parser (Maybe Text)
-> Parser
     (Maybe [Text]
      -> POSIX
      -> POSIX
      -> Bool
      -> Text
      -> Text
      -> ResourceType
      -> POSIX
      -> AnalyzedResource)
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 [Text]
   -> POSIX
   -> POSIX
   -> Bool
   -> Text
   -> Text
   -> ResourceType
   -> POSIX
   -> AnalyzedResource)
-> Parser (Maybe [Text])
-> Parser
     (POSIX
      -> POSIX
      -> Bool
      -> Text
      -> Text
      -> ResourceType
      -> POSIX
      -> AnalyzedResource)
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
"sharedVia" 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
  (POSIX
   -> POSIX
   -> Bool
   -> Text
   -> Text
   -> ResourceType
   -> POSIX
   -> AnalyzedResource)
-> Parser POSIX
-> Parser
     (POSIX
      -> Bool
      -> Text
      -> Text
      -> ResourceType
      -> POSIX
      -> AnalyzedResource)
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
"analyzedAt")
            Parser
  (POSIX
   -> Bool
   -> Text
   -> Text
   -> ResourceType
   -> POSIX
   -> AnalyzedResource)
-> Parser POSIX
-> Parser
     (Bool -> Text -> Text -> ResourceType -> POSIX -> AnalyzedResource)
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
  (Bool -> Text -> Text -> ResourceType -> POSIX -> AnalyzedResource)
-> Parser Bool
-> Parser
     (Text -> Text -> ResourceType -> POSIX -> AnalyzedResource)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser Bool
forall a. FromJSON a => Object -> Text -> Parser a
Core..: Text
"isPublic")
            Parser (Text -> Text -> ResourceType -> POSIX -> AnalyzedResource)
-> Parser Text
-> Parser (Text -> ResourceType -> POSIX -> AnalyzedResource)
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
"resourceArn")
            Parser (Text -> ResourceType -> POSIX -> AnalyzedResource)
-> Parser Text
-> Parser (ResourceType -> POSIX -> AnalyzedResource)
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 -> POSIX -> AnalyzedResource)
-> Parser ResourceType -> Parser (POSIX -> AnalyzedResource)
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 (POSIX -> AnalyzedResource)
-> Parser POSIX -> Parser AnalyzedResource
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
"updatedAt")
      )

instance Prelude.Hashable AnalyzedResource

instance Prelude.NFData AnalyzedResource