{-# 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.Redshift.Types.ClusterSecurityGroupMembership
-- 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.Redshift.Types.ClusterSecurityGroupMembership where

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

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

-- |
-- Create a value of 'ClusterSecurityGroupMembership' 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', 'clusterSecurityGroupMembership_status' - The status of the cluster security group.
--
-- 'clusterSecurityGroupName', 'clusterSecurityGroupMembership_clusterSecurityGroupName' - The name of the cluster security group.
newClusterSecurityGroupMembership ::
  ClusterSecurityGroupMembership
newClusterSecurityGroupMembership :: ClusterSecurityGroupMembership
newClusterSecurityGroupMembership =
  ClusterSecurityGroupMembership' :: Maybe Text -> Maybe Text -> ClusterSecurityGroupMembership
ClusterSecurityGroupMembership'
    { $sel:status:ClusterSecurityGroupMembership' :: Maybe Text
status =
        Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:clusterSecurityGroupName:ClusterSecurityGroupMembership' :: Maybe Text
clusterSecurityGroupName = Maybe Text
forall a. Maybe a
Prelude.Nothing
    }

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

-- | The name of the cluster security group.
clusterSecurityGroupMembership_clusterSecurityGroupName :: Lens.Lens' ClusterSecurityGroupMembership (Prelude.Maybe Prelude.Text)
clusterSecurityGroupMembership_clusterSecurityGroupName :: (Maybe Text -> f (Maybe Text))
-> ClusterSecurityGroupMembership
-> f ClusterSecurityGroupMembership
clusterSecurityGroupMembership_clusterSecurityGroupName = (ClusterSecurityGroupMembership -> Maybe Text)
-> (ClusterSecurityGroupMembership
    -> Maybe Text -> ClusterSecurityGroupMembership)
-> Lens
     ClusterSecurityGroupMembership
     ClusterSecurityGroupMembership
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ClusterSecurityGroupMembership' {Maybe Text
clusterSecurityGroupName :: Maybe Text
$sel:clusterSecurityGroupName:ClusterSecurityGroupMembership' :: ClusterSecurityGroupMembership -> Maybe Text
clusterSecurityGroupName} -> Maybe Text
clusterSecurityGroupName) (\s :: ClusterSecurityGroupMembership
s@ClusterSecurityGroupMembership' {} Maybe Text
a -> ClusterSecurityGroupMembership
s {$sel:clusterSecurityGroupName:ClusterSecurityGroupMembership' :: Maybe Text
clusterSecurityGroupName = Maybe Text
a} :: ClusterSecurityGroupMembership)

instance Core.FromXML ClusterSecurityGroupMembership where
  parseXML :: [Node] -> Either String ClusterSecurityGroupMembership
parseXML [Node]
x =
    Maybe Text -> Maybe Text -> ClusterSecurityGroupMembership
ClusterSecurityGroupMembership'
      (Maybe Text -> Maybe Text -> ClusterSecurityGroupMembership)
-> Either String (Maybe Text)
-> Either String (Maybe Text -> ClusterSecurityGroupMembership)
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
"Status")
      Either String (Maybe Text -> ClusterSecurityGroupMembership)
-> Either String (Maybe Text)
-> Either String ClusterSecurityGroupMembership
forall (f :: * -> *) a b. Applicative f => 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
"ClusterSecurityGroupName")

instance
  Prelude.Hashable
    ClusterSecurityGroupMembership

instance
  Prelude.NFData
    ClusterSecurityGroupMembership