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

import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
import Amazonka.WellArchitected.Types.PillarDifference

-- | The differences between the base and latest versions of the lens.
--
-- /See:/ 'newVersionDifferences' smart constructor.
data VersionDifferences = VersionDifferences'
  { -- | The differences between the base and latest versions of the lens.
    VersionDifferences -> Maybe [PillarDifference]
pillarDifferences :: Prelude.Maybe [PillarDifference]
  }
  deriving (VersionDifferences -> VersionDifferences -> Bool
(VersionDifferences -> VersionDifferences -> Bool)
-> (VersionDifferences -> VersionDifferences -> Bool)
-> Eq VersionDifferences
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: VersionDifferences -> VersionDifferences -> Bool
$c/= :: VersionDifferences -> VersionDifferences -> Bool
== :: VersionDifferences -> VersionDifferences -> Bool
$c== :: VersionDifferences -> VersionDifferences -> Bool
Prelude.Eq, ReadPrec [VersionDifferences]
ReadPrec VersionDifferences
Int -> ReadS VersionDifferences
ReadS [VersionDifferences]
(Int -> ReadS VersionDifferences)
-> ReadS [VersionDifferences]
-> ReadPrec VersionDifferences
-> ReadPrec [VersionDifferences]
-> Read VersionDifferences
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [VersionDifferences]
$creadListPrec :: ReadPrec [VersionDifferences]
readPrec :: ReadPrec VersionDifferences
$creadPrec :: ReadPrec VersionDifferences
readList :: ReadS [VersionDifferences]
$creadList :: ReadS [VersionDifferences]
readsPrec :: Int -> ReadS VersionDifferences
$creadsPrec :: Int -> ReadS VersionDifferences
Prelude.Read, Int -> VersionDifferences -> ShowS
[VersionDifferences] -> ShowS
VersionDifferences -> String
(Int -> VersionDifferences -> ShowS)
-> (VersionDifferences -> String)
-> ([VersionDifferences] -> ShowS)
-> Show VersionDifferences
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [VersionDifferences] -> ShowS
$cshowList :: [VersionDifferences] -> ShowS
show :: VersionDifferences -> String
$cshow :: VersionDifferences -> String
showsPrec :: Int -> VersionDifferences -> ShowS
$cshowsPrec :: Int -> VersionDifferences -> ShowS
Prelude.Show, (forall x. VersionDifferences -> Rep VersionDifferences x)
-> (forall x. Rep VersionDifferences x -> VersionDifferences)
-> Generic VersionDifferences
forall x. Rep VersionDifferences x -> VersionDifferences
forall x. VersionDifferences -> Rep VersionDifferences x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep VersionDifferences x -> VersionDifferences
$cfrom :: forall x. VersionDifferences -> Rep VersionDifferences x
Prelude.Generic)

-- |
-- Create a value of 'VersionDifferences' 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:
--
-- 'pillarDifferences', 'versionDifferences_pillarDifferences' - The differences between the base and latest versions of the lens.
newVersionDifferences ::
  VersionDifferences
newVersionDifferences :: VersionDifferences
newVersionDifferences =
  VersionDifferences' :: Maybe [PillarDifference] -> VersionDifferences
VersionDifferences'
    { $sel:pillarDifferences:VersionDifferences' :: Maybe [PillarDifference]
pillarDifferences =
        Maybe [PillarDifference]
forall a. Maybe a
Prelude.Nothing
    }

-- | The differences between the base and latest versions of the lens.
versionDifferences_pillarDifferences :: Lens.Lens' VersionDifferences (Prelude.Maybe [PillarDifference])
versionDifferences_pillarDifferences :: (Maybe [PillarDifference] -> f (Maybe [PillarDifference]))
-> VersionDifferences -> f VersionDifferences
versionDifferences_pillarDifferences = (VersionDifferences -> Maybe [PillarDifference])
-> (VersionDifferences
    -> Maybe [PillarDifference] -> VersionDifferences)
-> Lens
     VersionDifferences
     VersionDifferences
     (Maybe [PillarDifference])
     (Maybe [PillarDifference])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\VersionDifferences' {Maybe [PillarDifference]
pillarDifferences :: Maybe [PillarDifference]
$sel:pillarDifferences:VersionDifferences' :: VersionDifferences -> Maybe [PillarDifference]
pillarDifferences} -> Maybe [PillarDifference]
pillarDifferences) (\s :: VersionDifferences
s@VersionDifferences' {} Maybe [PillarDifference]
a -> VersionDifferences
s {$sel:pillarDifferences:VersionDifferences' :: Maybe [PillarDifference]
pillarDifferences = Maybe [PillarDifference]
a} :: VersionDifferences) ((Maybe [PillarDifference] -> f (Maybe [PillarDifference]))
 -> VersionDifferences -> f VersionDifferences)
-> ((Maybe [PillarDifference] -> f (Maybe [PillarDifference]))
    -> Maybe [PillarDifference] -> f (Maybe [PillarDifference]))
-> (Maybe [PillarDifference] -> f (Maybe [PillarDifference]))
-> VersionDifferences
-> f VersionDifferences
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
  [PillarDifference]
  [PillarDifference]
  [PillarDifference]
  [PillarDifference]
-> Iso
     (Maybe [PillarDifference])
     (Maybe [PillarDifference])
     (Maybe [PillarDifference])
     (Maybe [PillarDifference])
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
  [PillarDifference]
  [PillarDifference]
  [PillarDifference]
  [PillarDifference]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

instance Core.FromJSON VersionDifferences where
  parseJSON :: Value -> Parser VersionDifferences
parseJSON =
    String
-> (Object -> Parser VersionDifferences)
-> Value
-> Parser VersionDifferences
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
      String
"VersionDifferences"
      ( \Object
x ->
          Maybe [PillarDifference] -> VersionDifferences
VersionDifferences'
            (Maybe [PillarDifference] -> VersionDifferences)
-> Parser (Maybe [PillarDifference]) -> Parser VersionDifferences
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> ( Object
x Object -> Text -> Parser (Maybe (Maybe [PillarDifference]))
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"PillarDifferences"
                            Parser (Maybe (Maybe [PillarDifference]))
-> Maybe [PillarDifference] -> Parser (Maybe [PillarDifference])
forall a. Parser (Maybe a) -> a -> Parser a
Core..!= Maybe [PillarDifference]
forall a. Monoid a => a
Prelude.mempty
                        )
      )

instance Prelude.Hashable VersionDifferences

instance Prelude.NFData VersionDifferences