{-# 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.Neptune.Types.DBClusterSnapshotAttributesResult
-- 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.Neptune.Types.DBClusterSnapshotAttributesResult where

import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import Amazonka.Neptune.Types.DBClusterSnapshotAttribute
import qualified Amazonka.Prelude as Prelude

-- | Contains the results of a successful call to the
-- DescribeDBClusterSnapshotAttributes API action.
--
-- Manual DB cluster snapshot attributes are used to authorize other Amazon
-- accounts to copy or restore a manual DB cluster snapshot. For more
-- information, see the ModifyDBClusterSnapshotAttribute API action.
--
-- /See:/ 'newDBClusterSnapshotAttributesResult' smart constructor.
data DBClusterSnapshotAttributesResult = DBClusterSnapshotAttributesResult'
  { -- | The identifier of the manual DB cluster snapshot that the attributes
    -- apply to.
    DBClusterSnapshotAttributesResult -> Maybe Text
dbClusterSnapshotIdentifier :: Prelude.Maybe Prelude.Text,
    -- | The list of attributes and values for the manual DB cluster snapshot.
    DBClusterSnapshotAttributesResult
-> Maybe [DBClusterSnapshotAttribute]
dbClusterSnapshotAttributes :: Prelude.Maybe [DBClusterSnapshotAttribute]
  }
  deriving (DBClusterSnapshotAttributesResult
-> DBClusterSnapshotAttributesResult -> Bool
(DBClusterSnapshotAttributesResult
 -> DBClusterSnapshotAttributesResult -> Bool)
-> (DBClusterSnapshotAttributesResult
    -> DBClusterSnapshotAttributesResult -> Bool)
-> Eq DBClusterSnapshotAttributesResult
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DBClusterSnapshotAttributesResult
-> DBClusterSnapshotAttributesResult -> Bool
$c/= :: DBClusterSnapshotAttributesResult
-> DBClusterSnapshotAttributesResult -> Bool
== :: DBClusterSnapshotAttributesResult
-> DBClusterSnapshotAttributesResult -> Bool
$c== :: DBClusterSnapshotAttributesResult
-> DBClusterSnapshotAttributesResult -> Bool
Prelude.Eq, ReadPrec [DBClusterSnapshotAttributesResult]
ReadPrec DBClusterSnapshotAttributesResult
Int -> ReadS DBClusterSnapshotAttributesResult
ReadS [DBClusterSnapshotAttributesResult]
(Int -> ReadS DBClusterSnapshotAttributesResult)
-> ReadS [DBClusterSnapshotAttributesResult]
-> ReadPrec DBClusterSnapshotAttributesResult
-> ReadPrec [DBClusterSnapshotAttributesResult]
-> Read DBClusterSnapshotAttributesResult
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DBClusterSnapshotAttributesResult]
$creadListPrec :: ReadPrec [DBClusterSnapshotAttributesResult]
readPrec :: ReadPrec DBClusterSnapshotAttributesResult
$creadPrec :: ReadPrec DBClusterSnapshotAttributesResult
readList :: ReadS [DBClusterSnapshotAttributesResult]
$creadList :: ReadS [DBClusterSnapshotAttributesResult]
readsPrec :: Int -> ReadS DBClusterSnapshotAttributesResult
$creadsPrec :: Int -> ReadS DBClusterSnapshotAttributesResult
Prelude.Read, Int -> DBClusterSnapshotAttributesResult -> ShowS
[DBClusterSnapshotAttributesResult] -> ShowS
DBClusterSnapshotAttributesResult -> String
(Int -> DBClusterSnapshotAttributesResult -> ShowS)
-> (DBClusterSnapshotAttributesResult -> String)
-> ([DBClusterSnapshotAttributesResult] -> ShowS)
-> Show DBClusterSnapshotAttributesResult
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DBClusterSnapshotAttributesResult] -> ShowS
$cshowList :: [DBClusterSnapshotAttributesResult] -> ShowS
show :: DBClusterSnapshotAttributesResult -> String
$cshow :: DBClusterSnapshotAttributesResult -> String
showsPrec :: Int -> DBClusterSnapshotAttributesResult -> ShowS
$cshowsPrec :: Int -> DBClusterSnapshotAttributesResult -> ShowS
Prelude.Show, (forall x.
 DBClusterSnapshotAttributesResult
 -> Rep DBClusterSnapshotAttributesResult x)
-> (forall x.
    Rep DBClusterSnapshotAttributesResult x
    -> DBClusterSnapshotAttributesResult)
-> Generic DBClusterSnapshotAttributesResult
forall x.
Rep DBClusterSnapshotAttributesResult x
-> DBClusterSnapshotAttributesResult
forall x.
DBClusterSnapshotAttributesResult
-> Rep DBClusterSnapshotAttributesResult x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep DBClusterSnapshotAttributesResult x
-> DBClusterSnapshotAttributesResult
$cfrom :: forall x.
DBClusterSnapshotAttributesResult
-> Rep DBClusterSnapshotAttributesResult x
Prelude.Generic)

-- |
-- Create a value of 'DBClusterSnapshotAttributesResult' 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:
--
-- 'dbClusterSnapshotIdentifier', 'dbClusterSnapshotAttributesResult_dbClusterSnapshotIdentifier' - The identifier of the manual DB cluster snapshot that the attributes
-- apply to.
--
-- 'dbClusterSnapshotAttributes', 'dbClusterSnapshotAttributesResult_dbClusterSnapshotAttributes' - The list of attributes and values for the manual DB cluster snapshot.
newDBClusterSnapshotAttributesResult ::
  DBClusterSnapshotAttributesResult
newDBClusterSnapshotAttributesResult :: DBClusterSnapshotAttributesResult
newDBClusterSnapshotAttributesResult =
  DBClusterSnapshotAttributesResult' :: Maybe Text
-> Maybe [DBClusterSnapshotAttribute]
-> DBClusterSnapshotAttributesResult
DBClusterSnapshotAttributesResult'
    { $sel:dbClusterSnapshotIdentifier:DBClusterSnapshotAttributesResult' :: Maybe Text
dbClusterSnapshotIdentifier =
        Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:dbClusterSnapshotAttributes:DBClusterSnapshotAttributesResult' :: Maybe [DBClusterSnapshotAttribute]
dbClusterSnapshotAttributes =
        Maybe [DBClusterSnapshotAttribute]
forall a. Maybe a
Prelude.Nothing
    }

-- | The identifier of the manual DB cluster snapshot that the attributes
-- apply to.
dbClusterSnapshotAttributesResult_dbClusterSnapshotIdentifier :: Lens.Lens' DBClusterSnapshotAttributesResult (Prelude.Maybe Prelude.Text)
dbClusterSnapshotAttributesResult_dbClusterSnapshotIdentifier :: (Maybe Text -> f (Maybe Text))
-> DBClusterSnapshotAttributesResult
-> f DBClusterSnapshotAttributesResult
dbClusterSnapshotAttributesResult_dbClusterSnapshotIdentifier = (DBClusterSnapshotAttributesResult -> Maybe Text)
-> (DBClusterSnapshotAttributesResult
    -> Maybe Text -> DBClusterSnapshotAttributesResult)
-> Lens
     DBClusterSnapshotAttributesResult
     DBClusterSnapshotAttributesResult
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DBClusterSnapshotAttributesResult' {Maybe Text
dbClusterSnapshotIdentifier :: Maybe Text
$sel:dbClusterSnapshotIdentifier:DBClusterSnapshotAttributesResult' :: DBClusterSnapshotAttributesResult -> Maybe Text
dbClusterSnapshotIdentifier} -> Maybe Text
dbClusterSnapshotIdentifier) (\s :: DBClusterSnapshotAttributesResult
s@DBClusterSnapshotAttributesResult' {} Maybe Text
a -> DBClusterSnapshotAttributesResult
s {$sel:dbClusterSnapshotIdentifier:DBClusterSnapshotAttributesResult' :: Maybe Text
dbClusterSnapshotIdentifier = Maybe Text
a} :: DBClusterSnapshotAttributesResult)

-- | The list of attributes and values for the manual DB cluster snapshot.
dbClusterSnapshotAttributesResult_dbClusterSnapshotAttributes :: Lens.Lens' DBClusterSnapshotAttributesResult (Prelude.Maybe [DBClusterSnapshotAttribute])
dbClusterSnapshotAttributesResult_dbClusterSnapshotAttributes :: (Maybe [DBClusterSnapshotAttribute]
 -> f (Maybe [DBClusterSnapshotAttribute]))
-> DBClusterSnapshotAttributesResult
-> f DBClusterSnapshotAttributesResult
dbClusterSnapshotAttributesResult_dbClusterSnapshotAttributes = (DBClusterSnapshotAttributesResult
 -> Maybe [DBClusterSnapshotAttribute])
-> (DBClusterSnapshotAttributesResult
    -> Maybe [DBClusterSnapshotAttribute]
    -> DBClusterSnapshotAttributesResult)
-> Lens
     DBClusterSnapshotAttributesResult
     DBClusterSnapshotAttributesResult
     (Maybe [DBClusterSnapshotAttribute])
     (Maybe [DBClusterSnapshotAttribute])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DBClusterSnapshotAttributesResult' {Maybe [DBClusterSnapshotAttribute]
dbClusterSnapshotAttributes :: Maybe [DBClusterSnapshotAttribute]
$sel:dbClusterSnapshotAttributes:DBClusterSnapshotAttributesResult' :: DBClusterSnapshotAttributesResult
-> Maybe [DBClusterSnapshotAttribute]
dbClusterSnapshotAttributes} -> Maybe [DBClusterSnapshotAttribute]
dbClusterSnapshotAttributes) (\s :: DBClusterSnapshotAttributesResult
s@DBClusterSnapshotAttributesResult' {} Maybe [DBClusterSnapshotAttribute]
a -> DBClusterSnapshotAttributesResult
s {$sel:dbClusterSnapshotAttributes:DBClusterSnapshotAttributesResult' :: Maybe [DBClusterSnapshotAttribute]
dbClusterSnapshotAttributes = Maybe [DBClusterSnapshotAttribute]
a} :: DBClusterSnapshotAttributesResult) ((Maybe [DBClusterSnapshotAttribute]
  -> f (Maybe [DBClusterSnapshotAttribute]))
 -> DBClusterSnapshotAttributesResult
 -> f DBClusterSnapshotAttributesResult)
-> ((Maybe [DBClusterSnapshotAttribute]
     -> f (Maybe [DBClusterSnapshotAttribute]))
    -> Maybe [DBClusterSnapshotAttribute]
    -> f (Maybe [DBClusterSnapshotAttribute]))
-> (Maybe [DBClusterSnapshotAttribute]
    -> f (Maybe [DBClusterSnapshotAttribute]))
-> DBClusterSnapshotAttributesResult
-> f DBClusterSnapshotAttributesResult
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
  [DBClusterSnapshotAttribute]
  [DBClusterSnapshotAttribute]
  [DBClusterSnapshotAttribute]
  [DBClusterSnapshotAttribute]
-> Iso
     (Maybe [DBClusterSnapshotAttribute])
     (Maybe [DBClusterSnapshotAttribute])
     (Maybe [DBClusterSnapshotAttribute])
     (Maybe [DBClusterSnapshotAttribute])
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
  [DBClusterSnapshotAttribute]
  [DBClusterSnapshotAttribute]
  [DBClusterSnapshotAttribute]
  [DBClusterSnapshotAttribute]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

instance
  Core.FromXML
    DBClusterSnapshotAttributesResult
  where
  parseXML :: [Node] -> Either String DBClusterSnapshotAttributesResult
parseXML [Node]
x =
    Maybe Text
-> Maybe [DBClusterSnapshotAttribute]
-> DBClusterSnapshotAttributesResult
DBClusterSnapshotAttributesResult'
      (Maybe Text
 -> Maybe [DBClusterSnapshotAttribute]
 -> DBClusterSnapshotAttributesResult)
-> Either String (Maybe Text)
-> Either
     String
     (Maybe [DBClusterSnapshotAttribute]
      -> DBClusterSnapshotAttributesResult)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> ([Node]
x [Node] -> Text -> Either String (Maybe Text)
forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Core..@? Text
"DBClusterSnapshotIdentifier")
      Either
  String
  (Maybe [DBClusterSnapshotAttribute]
   -> DBClusterSnapshotAttributesResult)
-> Either String (Maybe [DBClusterSnapshotAttribute])
-> Either String DBClusterSnapshotAttributesResult
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ( [Node]
x [Node] -> Text -> Either String (Maybe [Node])
forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Core..@? Text
"DBClusterSnapshotAttributes"
                      Either String (Maybe [Node]) -> [Node] -> Either String [Node]
forall (f :: * -> *) a. Functor f => f (Maybe a) -> a -> f a
Core..!@ [Node]
forall a. Monoid a => a
Prelude.mempty
                      Either String [Node]
-> ([Node] -> Either String (Maybe [DBClusterSnapshotAttribute]))
-> Either String (Maybe [DBClusterSnapshotAttribute])
forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b
Prelude.>>= ([Node] -> Either String [DBClusterSnapshotAttribute])
-> [Node] -> Either String (Maybe [DBClusterSnapshotAttribute])
forall (f :: * -> *) a b.
Applicative f =>
([a] -> f b) -> [a] -> f (Maybe b)
Core.may
                        (Text -> [Node] -> Either String [DBClusterSnapshotAttribute]
forall a. FromXML a => Text -> [Node] -> Either String [a]
Core.parseXMLList Text
"DBClusterSnapshotAttribute")
                  )

instance
  Prelude.Hashable
    DBClusterSnapshotAttributesResult

instance
  Prelude.NFData
    DBClusterSnapshotAttributesResult