{-# 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.LensSummary
-- 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.WellArchitected.Types.LensSummary where

import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude

-- | A lens summary of a lens.
--
-- /See:/ 'newLensSummary' smart constructor.
data LensSummary = LensSummary'
  { LensSummary -> Maybe Text
lensAlias :: Prelude.Maybe Prelude.Text,
    LensSummary -> Maybe Text
lensName :: Prelude.Maybe Prelude.Text,
    -- | The version of the lens.
    LensSummary -> Maybe Text
lensVersion :: Prelude.Maybe Prelude.Text,
    LensSummary -> Maybe Text
description :: Prelude.Maybe Prelude.Text
  }
  deriving (LensSummary -> LensSummary -> Bool
(LensSummary -> LensSummary -> Bool)
-> (LensSummary -> LensSummary -> Bool) -> Eq LensSummary
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: LensSummary -> LensSummary -> Bool
$c/= :: LensSummary -> LensSummary -> Bool
== :: LensSummary -> LensSummary -> Bool
$c== :: LensSummary -> LensSummary -> Bool
Prelude.Eq, ReadPrec [LensSummary]
ReadPrec LensSummary
Int -> ReadS LensSummary
ReadS [LensSummary]
(Int -> ReadS LensSummary)
-> ReadS [LensSummary]
-> ReadPrec LensSummary
-> ReadPrec [LensSummary]
-> Read LensSummary
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [LensSummary]
$creadListPrec :: ReadPrec [LensSummary]
readPrec :: ReadPrec LensSummary
$creadPrec :: ReadPrec LensSummary
readList :: ReadS [LensSummary]
$creadList :: ReadS [LensSummary]
readsPrec :: Int -> ReadS LensSummary
$creadsPrec :: Int -> ReadS LensSummary
Prelude.Read, Int -> LensSummary -> ShowS
[LensSummary] -> ShowS
LensSummary -> String
(Int -> LensSummary -> ShowS)
-> (LensSummary -> String)
-> ([LensSummary] -> ShowS)
-> Show LensSummary
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [LensSummary] -> ShowS
$cshowList :: [LensSummary] -> ShowS
show :: LensSummary -> String
$cshow :: LensSummary -> String
showsPrec :: Int -> LensSummary -> ShowS
$cshowsPrec :: Int -> LensSummary -> ShowS
Prelude.Show, (forall x. LensSummary -> Rep LensSummary x)
-> (forall x. Rep LensSummary x -> LensSummary)
-> Generic LensSummary
forall x. Rep LensSummary x -> LensSummary
forall x. LensSummary -> Rep LensSummary x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep LensSummary x -> LensSummary
$cfrom :: forall x. LensSummary -> Rep LensSummary x
Prelude.Generic)

-- |
-- Create a value of 'LensSummary' 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', 'lensSummary_lensAlias' - Undocumented member.
--
-- 'lensName', 'lensSummary_lensName' - Undocumented member.
--
-- 'lensVersion', 'lensSummary_lensVersion' - The version of the lens.
--
-- 'description', 'lensSummary_description' - Undocumented member.
newLensSummary ::
  LensSummary
newLensSummary :: LensSummary
newLensSummary =
  LensSummary' :: Maybe Text -> Maybe Text -> Maybe Text -> Maybe Text -> LensSummary
LensSummary'
    { $sel:lensAlias:LensSummary' :: Maybe Text
lensAlias = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:lensName:LensSummary' :: Maybe Text
lensName = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:lensVersion:LensSummary' :: Maybe Text
lensVersion = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:description:LensSummary' :: Maybe Text
description = Maybe Text
forall a. Maybe a
Prelude.Nothing
    }

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

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

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

-- | Undocumented member.
lensSummary_description :: Lens.Lens' LensSummary (Prelude.Maybe Prelude.Text)
lensSummary_description :: (Maybe Text -> f (Maybe Text)) -> LensSummary -> f LensSummary
lensSummary_description = (LensSummary -> Maybe Text)
-> (LensSummary -> Maybe Text -> LensSummary)
-> Lens LensSummary LensSummary (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\LensSummary' {Maybe Text
description :: Maybe Text
$sel:description:LensSummary' :: LensSummary -> Maybe Text
description} -> Maybe Text
description) (\s :: LensSummary
s@LensSummary' {} Maybe Text
a -> LensSummary
s {$sel:description:LensSummary' :: Maybe Text
description = Maybe Text
a} :: LensSummary)

instance Core.FromJSON LensSummary where
  parseJSON :: Value -> Parser LensSummary
parseJSON =
    String
-> (Object -> Parser LensSummary) -> Value -> Parser LensSummary
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
      String
"LensSummary"
      ( \Object
x ->
          Maybe Text -> Maybe Text -> Maybe Text -> Maybe Text -> LensSummary
LensSummary'
            (Maybe Text
 -> Maybe Text -> Maybe Text -> Maybe Text -> LensSummary)
-> Parser (Maybe Text)
-> Parser (Maybe Text -> Maybe Text -> Maybe Text -> LensSummary)
forall (f :: * -> *) a b. Functor 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
"LensAlias")
            Parser (Maybe Text -> Maybe Text -> Maybe Text -> LensSummary)
-> Parser (Maybe Text)
-> Parser (Maybe Text -> Maybe Text -> LensSummary)
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
"LensName")
            Parser (Maybe Text -> Maybe Text -> LensSummary)
-> Parser (Maybe Text) -> Parser (Maybe Text -> LensSummary)
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
"LensVersion")
            Parser (Maybe Text -> LensSummary)
-> Parser (Maybe Text) -> Parser LensSummary
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
"Description")
      )

instance Prelude.Hashable LensSummary

instance Prelude.NFData LensSummary