{-# 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.SecurityHub.Types.AwsRdsDbClusterOptionGroupMembership
-- 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.SecurityHub.Types.AwsRdsDbClusterOptionGroupMembership where

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

-- | Information about an option group membership for a DB cluster.
--
-- /See:/ 'newAwsRdsDbClusterOptionGroupMembership' smart constructor.
data AwsRdsDbClusterOptionGroupMembership = AwsRdsDbClusterOptionGroupMembership'
  { -- | The status of the DB cluster option group.
    AwsRdsDbClusterOptionGroupMembership -> Maybe Text
status :: Prelude.Maybe Prelude.Text,
    -- | The name of the DB cluster option group.
    AwsRdsDbClusterOptionGroupMembership -> Maybe Text
dbClusterOptionGroupName :: Prelude.Maybe Prelude.Text
  }
  deriving (AwsRdsDbClusterOptionGroupMembership
-> AwsRdsDbClusterOptionGroupMembership -> Bool
(AwsRdsDbClusterOptionGroupMembership
 -> AwsRdsDbClusterOptionGroupMembership -> Bool)
-> (AwsRdsDbClusterOptionGroupMembership
    -> AwsRdsDbClusterOptionGroupMembership -> Bool)
-> Eq AwsRdsDbClusterOptionGroupMembership
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: AwsRdsDbClusterOptionGroupMembership
-> AwsRdsDbClusterOptionGroupMembership -> Bool
$c/= :: AwsRdsDbClusterOptionGroupMembership
-> AwsRdsDbClusterOptionGroupMembership -> Bool
== :: AwsRdsDbClusterOptionGroupMembership
-> AwsRdsDbClusterOptionGroupMembership -> Bool
$c== :: AwsRdsDbClusterOptionGroupMembership
-> AwsRdsDbClusterOptionGroupMembership -> Bool
Prelude.Eq, ReadPrec [AwsRdsDbClusterOptionGroupMembership]
ReadPrec AwsRdsDbClusterOptionGroupMembership
Int -> ReadS AwsRdsDbClusterOptionGroupMembership
ReadS [AwsRdsDbClusterOptionGroupMembership]
(Int -> ReadS AwsRdsDbClusterOptionGroupMembership)
-> ReadS [AwsRdsDbClusterOptionGroupMembership]
-> ReadPrec AwsRdsDbClusterOptionGroupMembership
-> ReadPrec [AwsRdsDbClusterOptionGroupMembership]
-> Read AwsRdsDbClusterOptionGroupMembership
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [AwsRdsDbClusterOptionGroupMembership]
$creadListPrec :: ReadPrec [AwsRdsDbClusterOptionGroupMembership]
readPrec :: ReadPrec AwsRdsDbClusterOptionGroupMembership
$creadPrec :: ReadPrec AwsRdsDbClusterOptionGroupMembership
readList :: ReadS [AwsRdsDbClusterOptionGroupMembership]
$creadList :: ReadS [AwsRdsDbClusterOptionGroupMembership]
readsPrec :: Int -> ReadS AwsRdsDbClusterOptionGroupMembership
$creadsPrec :: Int -> ReadS AwsRdsDbClusterOptionGroupMembership
Prelude.Read, Int -> AwsRdsDbClusterOptionGroupMembership -> ShowS
[AwsRdsDbClusterOptionGroupMembership] -> ShowS
AwsRdsDbClusterOptionGroupMembership -> String
(Int -> AwsRdsDbClusterOptionGroupMembership -> ShowS)
-> (AwsRdsDbClusterOptionGroupMembership -> String)
-> ([AwsRdsDbClusterOptionGroupMembership] -> ShowS)
-> Show AwsRdsDbClusterOptionGroupMembership
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [AwsRdsDbClusterOptionGroupMembership] -> ShowS
$cshowList :: [AwsRdsDbClusterOptionGroupMembership] -> ShowS
show :: AwsRdsDbClusterOptionGroupMembership -> String
$cshow :: AwsRdsDbClusterOptionGroupMembership -> String
showsPrec :: Int -> AwsRdsDbClusterOptionGroupMembership -> ShowS
$cshowsPrec :: Int -> AwsRdsDbClusterOptionGroupMembership -> ShowS
Prelude.Show, (forall x.
 AwsRdsDbClusterOptionGroupMembership
 -> Rep AwsRdsDbClusterOptionGroupMembership x)
-> (forall x.
    Rep AwsRdsDbClusterOptionGroupMembership x
    -> AwsRdsDbClusterOptionGroupMembership)
-> Generic AwsRdsDbClusterOptionGroupMembership
forall x.
Rep AwsRdsDbClusterOptionGroupMembership x
-> AwsRdsDbClusterOptionGroupMembership
forall x.
AwsRdsDbClusterOptionGroupMembership
-> Rep AwsRdsDbClusterOptionGroupMembership x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep AwsRdsDbClusterOptionGroupMembership x
-> AwsRdsDbClusterOptionGroupMembership
$cfrom :: forall x.
AwsRdsDbClusterOptionGroupMembership
-> Rep AwsRdsDbClusterOptionGroupMembership x
Prelude.Generic)

-- |
-- Create a value of 'AwsRdsDbClusterOptionGroupMembership' 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:
--
-- 'status', 'awsRdsDbClusterOptionGroupMembership_status' - The status of the DB cluster option group.
--
-- 'dbClusterOptionGroupName', 'awsRdsDbClusterOptionGroupMembership_dbClusterOptionGroupName' - The name of the DB cluster option group.
newAwsRdsDbClusterOptionGroupMembership ::
  AwsRdsDbClusterOptionGroupMembership
newAwsRdsDbClusterOptionGroupMembership :: AwsRdsDbClusterOptionGroupMembership
newAwsRdsDbClusterOptionGroupMembership =
  AwsRdsDbClusterOptionGroupMembership' :: Maybe Text -> Maybe Text -> AwsRdsDbClusterOptionGroupMembership
AwsRdsDbClusterOptionGroupMembership'
    { $sel:status:AwsRdsDbClusterOptionGroupMembership' :: Maybe Text
status =
        Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:dbClusterOptionGroupName:AwsRdsDbClusterOptionGroupMembership' :: Maybe Text
dbClusterOptionGroupName =
        Maybe Text
forall a. Maybe a
Prelude.Nothing
    }

-- | The status of the DB cluster option group.
awsRdsDbClusterOptionGroupMembership_status :: Lens.Lens' AwsRdsDbClusterOptionGroupMembership (Prelude.Maybe Prelude.Text)
awsRdsDbClusterOptionGroupMembership_status :: (Maybe Text -> f (Maybe Text))
-> AwsRdsDbClusterOptionGroupMembership
-> f AwsRdsDbClusterOptionGroupMembership
awsRdsDbClusterOptionGroupMembership_status = (AwsRdsDbClusterOptionGroupMembership -> Maybe Text)
-> (AwsRdsDbClusterOptionGroupMembership
    -> Maybe Text -> AwsRdsDbClusterOptionGroupMembership)
-> Lens
     AwsRdsDbClusterOptionGroupMembership
     AwsRdsDbClusterOptionGroupMembership
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AwsRdsDbClusterOptionGroupMembership' {Maybe Text
status :: Maybe Text
$sel:status:AwsRdsDbClusterOptionGroupMembership' :: AwsRdsDbClusterOptionGroupMembership -> Maybe Text
status} -> Maybe Text
status) (\s :: AwsRdsDbClusterOptionGroupMembership
s@AwsRdsDbClusterOptionGroupMembership' {} Maybe Text
a -> AwsRdsDbClusterOptionGroupMembership
s {$sel:status:AwsRdsDbClusterOptionGroupMembership' :: Maybe Text
status = Maybe Text
a} :: AwsRdsDbClusterOptionGroupMembership)

-- | The name of the DB cluster option group.
awsRdsDbClusterOptionGroupMembership_dbClusterOptionGroupName :: Lens.Lens' AwsRdsDbClusterOptionGroupMembership (Prelude.Maybe Prelude.Text)
awsRdsDbClusterOptionGroupMembership_dbClusterOptionGroupName :: (Maybe Text -> f (Maybe Text))
-> AwsRdsDbClusterOptionGroupMembership
-> f AwsRdsDbClusterOptionGroupMembership
awsRdsDbClusterOptionGroupMembership_dbClusterOptionGroupName = (AwsRdsDbClusterOptionGroupMembership -> Maybe Text)
-> (AwsRdsDbClusterOptionGroupMembership
    -> Maybe Text -> AwsRdsDbClusterOptionGroupMembership)
-> Lens
     AwsRdsDbClusterOptionGroupMembership
     AwsRdsDbClusterOptionGroupMembership
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AwsRdsDbClusterOptionGroupMembership' {Maybe Text
dbClusterOptionGroupName :: Maybe Text
$sel:dbClusterOptionGroupName:AwsRdsDbClusterOptionGroupMembership' :: AwsRdsDbClusterOptionGroupMembership -> Maybe Text
dbClusterOptionGroupName} -> Maybe Text
dbClusterOptionGroupName) (\s :: AwsRdsDbClusterOptionGroupMembership
s@AwsRdsDbClusterOptionGroupMembership' {} Maybe Text
a -> AwsRdsDbClusterOptionGroupMembership
s {$sel:dbClusterOptionGroupName:AwsRdsDbClusterOptionGroupMembership' :: Maybe Text
dbClusterOptionGroupName = Maybe Text
a} :: AwsRdsDbClusterOptionGroupMembership)

instance
  Core.FromJSON
    AwsRdsDbClusterOptionGroupMembership
  where
  parseJSON :: Value -> Parser AwsRdsDbClusterOptionGroupMembership
parseJSON =
    String
-> (Object -> Parser AwsRdsDbClusterOptionGroupMembership)
-> Value
-> Parser AwsRdsDbClusterOptionGroupMembership
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
      String
"AwsRdsDbClusterOptionGroupMembership"
      ( \Object
x ->
          Maybe Text -> Maybe Text -> AwsRdsDbClusterOptionGroupMembership
AwsRdsDbClusterOptionGroupMembership'
            (Maybe Text -> Maybe Text -> AwsRdsDbClusterOptionGroupMembership)
-> Parser (Maybe Text)
-> Parser (Maybe Text -> AwsRdsDbClusterOptionGroupMembership)
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
"Status")
            Parser (Maybe Text -> AwsRdsDbClusterOptionGroupMembership)
-> Parser (Maybe Text)
-> Parser AwsRdsDbClusterOptionGroupMembership
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
"DbClusterOptionGroupName")
      )

instance
  Prelude.Hashable
    AwsRdsDbClusterOptionGroupMembership

instance
  Prelude.NFData
    AwsRdsDbClusterOptionGroupMembership

instance
  Core.ToJSON
    AwsRdsDbClusterOptionGroupMembership
  where
  toJSON :: AwsRdsDbClusterOptionGroupMembership -> Value
toJSON AwsRdsDbClusterOptionGroupMembership' {Maybe Text
dbClusterOptionGroupName :: Maybe Text
status :: Maybe Text
$sel:dbClusterOptionGroupName:AwsRdsDbClusterOptionGroupMembership' :: AwsRdsDbClusterOptionGroupMembership -> Maybe Text
$sel:status:AwsRdsDbClusterOptionGroupMembership' :: AwsRdsDbClusterOptionGroupMembership -> Maybe Text
..} =
    [Pair] -> Value
Core.object
      ( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ (Text
"Status" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (Text -> Pair) -> Maybe Text -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
status,
            (Text
"DbClusterOptionGroupName" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
              (Text -> Pair) -> Maybe Text -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
dbClusterOptionGroupName
          ]
      )