{-# 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-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.VersionDifferences 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.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
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]
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
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. 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'
    { $sel:pillarDifferences:VersionDifferences' :: Maybe [PillarDifference]
pillarDifferences =
        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 :: Lens' VersionDifferences (Maybe [PillarDifference])
versionDifferences_pillarDifferences = 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) 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

instance Data.FromJSON VersionDifferences where
  parseJSON :: Value -> Parser VersionDifferences
parseJSON =
    forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
      String
"VersionDifferences"
      ( \Object
x ->
          Maybe [PillarDifference] -> VersionDifferences
VersionDifferences'
            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
"PillarDifferences"
                            forall a. Parser (Maybe a) -> a -> Parser a
Data..!= forall a. Monoid a => a
Prelude.mempty
                        )
      )

instance Prelude.Hashable VersionDifferences where
  hashWithSalt :: Int -> VersionDifferences -> Int
hashWithSalt Int
_salt VersionDifferences' {Maybe [PillarDifference]
pillarDifferences :: Maybe [PillarDifference]
$sel:pillarDifferences:VersionDifferences' :: VersionDifferences -> Maybe [PillarDifference]
..} =
    Int
_salt forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe [PillarDifference]
pillarDifferences

instance Prelude.NFData VersionDifferences where
  rnf :: VersionDifferences -> ()
rnf VersionDifferences' {Maybe [PillarDifference]
pillarDifferences :: Maybe [PillarDifference]
$sel:pillarDifferences:VersionDifferences' :: VersionDifferences -> Maybe [PillarDifference]
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe [PillarDifference]
pillarDifferences