{-# 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.WellArchitected.Types.LensReviewSummary
-- Copyright   : (c) 2013-2023 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay
-- Stability   : auto-generated
-- Portability : non-portable (GHC extensions)
module Amazonka.WellArchitected.Types.LensReviewSummary where

import qualified Amazonka.Core as Core
import qualified Amazonka.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
import qualified Amazonka.Prelude as Prelude
import Amazonka.WellArchitected.Types.LensStatus
import Amazonka.WellArchitected.Types.Risk

-- | A lens review summary of a workload.
--
-- /See:/ 'newLensReviewSummary' smart constructor.
data LensReviewSummary = LensReviewSummary'
  { LensReviewSummary -> Maybe Text
lensAlias :: Prelude.Maybe Prelude.Text,
    -- | The ARN for the lens.
    LensReviewSummary -> Maybe Text
lensArn :: Prelude.Maybe Prelude.Text,
    LensReviewSummary -> Maybe Text
lensName :: Prelude.Maybe Prelude.Text,
    -- | The status of the lens.
    LensReviewSummary -> Maybe LensStatus
lensStatus :: Prelude.Maybe LensStatus,
    -- | The version of the lens.
    LensReviewSummary -> Maybe Text
lensVersion :: Prelude.Maybe Prelude.Text,
    LensReviewSummary -> Maybe (HashMap Risk Natural)
riskCounts :: Prelude.Maybe (Prelude.HashMap Risk Prelude.Natural),
    LensReviewSummary -> Maybe POSIX
updatedAt :: Prelude.Maybe Data.POSIX
  }
  deriving (LensReviewSummary -> LensReviewSummary -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: LensReviewSummary -> LensReviewSummary -> Bool
$c/= :: LensReviewSummary -> LensReviewSummary -> Bool
== :: LensReviewSummary -> LensReviewSummary -> Bool
$c== :: LensReviewSummary -> LensReviewSummary -> Bool
Prelude.Eq, ReadPrec [LensReviewSummary]
ReadPrec LensReviewSummary
Int -> ReadS LensReviewSummary
ReadS [LensReviewSummary]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [LensReviewSummary]
$creadListPrec :: ReadPrec [LensReviewSummary]
readPrec :: ReadPrec LensReviewSummary
$creadPrec :: ReadPrec LensReviewSummary
readList :: ReadS [LensReviewSummary]
$creadList :: ReadS [LensReviewSummary]
readsPrec :: Int -> ReadS LensReviewSummary
$creadsPrec :: Int -> ReadS LensReviewSummary
Prelude.Read, Int -> LensReviewSummary -> ShowS
[LensReviewSummary] -> ShowS
LensReviewSummary -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [LensReviewSummary] -> ShowS
$cshowList :: [LensReviewSummary] -> ShowS
show :: LensReviewSummary -> String
$cshow :: LensReviewSummary -> String
showsPrec :: Int -> LensReviewSummary -> ShowS
$cshowsPrec :: Int -> LensReviewSummary -> ShowS
Prelude.Show, forall x. Rep LensReviewSummary x -> LensReviewSummary
forall x. LensReviewSummary -> Rep LensReviewSummary x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep LensReviewSummary x -> LensReviewSummary
$cfrom :: forall x. LensReviewSummary -> Rep LensReviewSummary x
Prelude.Generic)

-- |
-- Create a value of 'LensReviewSummary' 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:
--
-- 'lensAlias', 'lensReviewSummary_lensAlias' - Undocumented member.
--
-- 'lensArn', 'lensReviewSummary_lensArn' - The ARN for the lens.
--
-- 'lensName', 'lensReviewSummary_lensName' - Undocumented member.
--
-- 'lensStatus', 'lensReviewSummary_lensStatus' - The status of the lens.
--
-- 'lensVersion', 'lensReviewSummary_lensVersion' - The version of the lens.
--
-- 'riskCounts', 'lensReviewSummary_riskCounts' - Undocumented member.
--
-- 'updatedAt', 'lensReviewSummary_updatedAt' - Undocumented member.
newLensReviewSummary ::
  LensReviewSummary
newLensReviewSummary :: LensReviewSummary
newLensReviewSummary =
  LensReviewSummary'
    { $sel:lensAlias:LensReviewSummary' :: Maybe Text
lensAlias = forall a. Maybe a
Prelude.Nothing,
      $sel:lensArn:LensReviewSummary' :: Maybe Text
lensArn = forall a. Maybe a
Prelude.Nothing,
      $sel:lensName:LensReviewSummary' :: Maybe Text
lensName = forall a. Maybe a
Prelude.Nothing,
      $sel:lensStatus:LensReviewSummary' :: Maybe LensStatus
lensStatus = forall a. Maybe a
Prelude.Nothing,
      $sel:lensVersion:LensReviewSummary' :: Maybe Text
lensVersion = forall a. Maybe a
Prelude.Nothing,
      $sel:riskCounts:LensReviewSummary' :: Maybe (HashMap Risk Natural)
riskCounts = forall a. Maybe a
Prelude.Nothing,
      $sel:updatedAt:LensReviewSummary' :: Maybe POSIX
updatedAt = forall a. Maybe a
Prelude.Nothing
    }

-- | Undocumented member.
lensReviewSummary_lensAlias :: Lens.Lens' LensReviewSummary (Prelude.Maybe Prelude.Text)
lensReviewSummary_lensAlias :: Lens' LensReviewSummary (Maybe Text)
lensReviewSummary_lensAlias = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\LensReviewSummary' {Maybe Text
lensAlias :: Maybe Text
$sel:lensAlias:LensReviewSummary' :: LensReviewSummary -> Maybe Text
lensAlias} -> Maybe Text
lensAlias) (\s :: LensReviewSummary
s@LensReviewSummary' {} Maybe Text
a -> LensReviewSummary
s {$sel:lensAlias:LensReviewSummary' :: Maybe Text
lensAlias = Maybe Text
a} :: LensReviewSummary)

-- | The ARN for the lens.
lensReviewSummary_lensArn :: Lens.Lens' LensReviewSummary (Prelude.Maybe Prelude.Text)
lensReviewSummary_lensArn :: Lens' LensReviewSummary (Maybe Text)
lensReviewSummary_lensArn = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\LensReviewSummary' {Maybe Text
lensArn :: Maybe Text
$sel:lensArn:LensReviewSummary' :: LensReviewSummary -> Maybe Text
lensArn} -> Maybe Text
lensArn) (\s :: LensReviewSummary
s@LensReviewSummary' {} Maybe Text
a -> LensReviewSummary
s {$sel:lensArn:LensReviewSummary' :: Maybe Text
lensArn = Maybe Text
a} :: LensReviewSummary)

-- | Undocumented member.
lensReviewSummary_lensName :: Lens.Lens' LensReviewSummary (Prelude.Maybe Prelude.Text)
lensReviewSummary_lensName :: Lens' LensReviewSummary (Maybe Text)
lensReviewSummary_lensName = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\LensReviewSummary' {Maybe Text
lensName :: Maybe Text
$sel:lensName:LensReviewSummary' :: LensReviewSummary -> Maybe Text
lensName} -> Maybe Text
lensName) (\s :: LensReviewSummary
s@LensReviewSummary' {} Maybe Text
a -> LensReviewSummary
s {$sel:lensName:LensReviewSummary' :: Maybe Text
lensName = Maybe Text
a} :: LensReviewSummary)

-- | The status of the lens.
lensReviewSummary_lensStatus :: Lens.Lens' LensReviewSummary (Prelude.Maybe LensStatus)
lensReviewSummary_lensStatus :: Lens' LensReviewSummary (Maybe LensStatus)
lensReviewSummary_lensStatus = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\LensReviewSummary' {Maybe LensStatus
lensStatus :: Maybe LensStatus
$sel:lensStatus:LensReviewSummary' :: LensReviewSummary -> Maybe LensStatus
lensStatus} -> Maybe LensStatus
lensStatus) (\s :: LensReviewSummary
s@LensReviewSummary' {} Maybe LensStatus
a -> LensReviewSummary
s {$sel:lensStatus:LensReviewSummary' :: Maybe LensStatus
lensStatus = Maybe LensStatus
a} :: LensReviewSummary)

-- | The version of the lens.
lensReviewSummary_lensVersion :: Lens.Lens' LensReviewSummary (Prelude.Maybe Prelude.Text)
lensReviewSummary_lensVersion :: Lens' LensReviewSummary (Maybe Text)
lensReviewSummary_lensVersion = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\LensReviewSummary' {Maybe Text
lensVersion :: Maybe Text
$sel:lensVersion:LensReviewSummary' :: LensReviewSummary -> Maybe Text
lensVersion} -> Maybe Text
lensVersion) (\s :: LensReviewSummary
s@LensReviewSummary' {} Maybe Text
a -> LensReviewSummary
s {$sel:lensVersion:LensReviewSummary' :: Maybe Text
lensVersion = Maybe Text
a} :: LensReviewSummary)

-- | Undocumented member.
lensReviewSummary_riskCounts :: Lens.Lens' LensReviewSummary (Prelude.Maybe (Prelude.HashMap Risk Prelude.Natural))
lensReviewSummary_riskCounts :: Lens' LensReviewSummary (Maybe (HashMap Risk Natural))
lensReviewSummary_riskCounts = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\LensReviewSummary' {Maybe (HashMap Risk Natural)
riskCounts :: Maybe (HashMap Risk Natural)
$sel:riskCounts:LensReviewSummary' :: LensReviewSummary -> Maybe (HashMap Risk Natural)
riskCounts} -> Maybe (HashMap Risk Natural)
riskCounts) (\s :: LensReviewSummary
s@LensReviewSummary' {} Maybe (HashMap Risk Natural)
a -> LensReviewSummary
s {$sel:riskCounts:LensReviewSummary' :: Maybe (HashMap Risk Natural)
riskCounts = Maybe (HashMap Risk Natural)
a} :: LensReviewSummary) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. 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 forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | Undocumented member.
lensReviewSummary_updatedAt :: Lens.Lens' LensReviewSummary (Prelude.Maybe Prelude.UTCTime)
lensReviewSummary_updatedAt :: Lens' LensReviewSummary (Maybe UTCTime)
lensReviewSummary_updatedAt = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\LensReviewSummary' {Maybe POSIX
updatedAt :: Maybe POSIX
$sel:updatedAt:LensReviewSummary' :: LensReviewSummary -> Maybe POSIX
updatedAt} -> Maybe POSIX
updatedAt) (\s :: LensReviewSummary
s@LensReviewSummary' {} Maybe POSIX
a -> LensReviewSummary
s {$sel:updatedAt:LensReviewSummary' :: Maybe POSIX
updatedAt = Maybe POSIX
a} :: LensReviewSummary) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. 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 forall (a :: Format). Iso' (Time a) UTCTime
Data._Time

instance Data.FromJSON LensReviewSummary where
  parseJSON :: Value -> Parser LensReviewSummary
parseJSON =
    forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
      String
"LensReviewSummary"
      ( \Object
x ->
          Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe LensStatus
-> Maybe Text
-> Maybe (HashMap Risk Natural)
-> Maybe POSIX
-> LensReviewSummary
LensReviewSummary'
            forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"LensAlias")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"LensArn")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"LensName")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"LensStatus")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"LensVersion")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"RiskCounts" forall a. Parser (Maybe a) -> a -> Parser a
Data..!= forall a. Monoid a => a
Prelude.mempty)
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"UpdatedAt")
      )

instance Prelude.Hashable LensReviewSummary where
  hashWithSalt :: Int -> LensReviewSummary -> Int
hashWithSalt Int
_salt LensReviewSummary' {Maybe Text
Maybe (HashMap Risk Natural)
Maybe POSIX
Maybe LensStatus
updatedAt :: Maybe POSIX
riskCounts :: Maybe (HashMap Risk Natural)
lensVersion :: Maybe Text
lensStatus :: Maybe LensStatus
lensName :: Maybe Text
lensArn :: Maybe Text
lensAlias :: Maybe Text
$sel:updatedAt:LensReviewSummary' :: LensReviewSummary -> Maybe POSIX
$sel:riskCounts:LensReviewSummary' :: LensReviewSummary -> Maybe (HashMap Risk Natural)
$sel:lensVersion:LensReviewSummary' :: LensReviewSummary -> Maybe Text
$sel:lensStatus:LensReviewSummary' :: LensReviewSummary -> Maybe LensStatus
$sel:lensName:LensReviewSummary' :: LensReviewSummary -> Maybe Text
$sel:lensArn:LensReviewSummary' :: LensReviewSummary -> Maybe Text
$sel:lensAlias:LensReviewSummary' :: LensReviewSummary -> Maybe Text
..} =
    Int
_salt
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
lensAlias
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
lensArn
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
lensName
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe LensStatus
lensStatus
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
lensVersion
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe (HashMap Risk Natural)
riskCounts
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe POSIX
updatedAt

instance Prelude.NFData LensReviewSummary where
  rnf :: LensReviewSummary -> ()
rnf LensReviewSummary' {Maybe Text
Maybe (HashMap Risk Natural)
Maybe POSIX
Maybe LensStatus
updatedAt :: Maybe POSIX
riskCounts :: Maybe (HashMap Risk Natural)
lensVersion :: Maybe Text
lensStatus :: Maybe LensStatus
lensName :: Maybe Text
lensArn :: Maybe Text
lensAlias :: Maybe Text
$sel:updatedAt:LensReviewSummary' :: LensReviewSummary -> Maybe POSIX
$sel:riskCounts:LensReviewSummary' :: LensReviewSummary -> Maybe (HashMap Risk Natural)
$sel:lensVersion:LensReviewSummary' :: LensReviewSummary -> Maybe Text
$sel:lensStatus:LensReviewSummary' :: LensReviewSummary -> Maybe LensStatus
$sel:lensName:LensReviewSummary' :: LensReviewSummary -> Maybe Text
$sel:lensArn:LensReviewSummary' :: LensReviewSummary -> Maybe Text
$sel:lensAlias:LensReviewSummary' :: LensReviewSummary -> Maybe Text
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
lensAlias
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
lensArn
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
lensName
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe LensStatus
lensStatus
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
lensVersion
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe (HashMap Risk Natural)
riskCounts
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe POSIX
updatedAt