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

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

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

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

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

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

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

instance
  Prelude.Hashable
    AwsRedshiftClusterClusterSecurityGroup

instance
  Prelude.NFData
    AwsRedshiftClusterClusterSecurityGroup

instance
  Core.ToJSON
    AwsRedshiftClusterClusterSecurityGroup
  where
  toJSON :: AwsRedshiftClusterClusterSecurityGroup -> Value
toJSON AwsRedshiftClusterClusterSecurityGroup' {Maybe Text
clusterSecurityGroupName :: Maybe Text
status :: Maybe Text
$sel:clusterSecurityGroupName:AwsRedshiftClusterClusterSecurityGroup' :: AwsRedshiftClusterClusterSecurityGroup -> Maybe Text
$sel:status:AwsRedshiftClusterClusterSecurityGroup' :: AwsRedshiftClusterClusterSecurityGroup -> 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
"ClusterSecurityGroupName" 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
clusterSecurityGroupName
          ]
      )