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

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

-- | The status of the elastic IP (EIP) address for an Amazon Redshift
-- cluster.
--
-- /See:/ 'newAwsRedshiftClusterElasticIpStatus' smart constructor.
data AwsRedshiftClusterElasticIpStatus = AwsRedshiftClusterElasticIpStatus'
  { -- | The status of the elastic IP address.
    AwsRedshiftClusterElasticIpStatus -> Maybe Text
status :: Prelude.Maybe Prelude.Text,
    -- | The elastic IP address for the cluster.
    AwsRedshiftClusterElasticIpStatus -> Maybe Text
elasticIp :: Prelude.Maybe Prelude.Text
  }
  deriving (AwsRedshiftClusterElasticIpStatus
-> AwsRedshiftClusterElasticIpStatus -> Bool
(AwsRedshiftClusterElasticIpStatus
 -> AwsRedshiftClusterElasticIpStatus -> Bool)
-> (AwsRedshiftClusterElasticIpStatus
    -> AwsRedshiftClusterElasticIpStatus -> Bool)
-> Eq AwsRedshiftClusterElasticIpStatus
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: AwsRedshiftClusterElasticIpStatus
-> AwsRedshiftClusterElasticIpStatus -> Bool
$c/= :: AwsRedshiftClusterElasticIpStatus
-> AwsRedshiftClusterElasticIpStatus -> Bool
== :: AwsRedshiftClusterElasticIpStatus
-> AwsRedshiftClusterElasticIpStatus -> Bool
$c== :: AwsRedshiftClusterElasticIpStatus
-> AwsRedshiftClusterElasticIpStatus -> Bool
Prelude.Eq, ReadPrec [AwsRedshiftClusterElasticIpStatus]
ReadPrec AwsRedshiftClusterElasticIpStatus
Int -> ReadS AwsRedshiftClusterElasticIpStatus
ReadS [AwsRedshiftClusterElasticIpStatus]
(Int -> ReadS AwsRedshiftClusterElasticIpStatus)
-> ReadS [AwsRedshiftClusterElasticIpStatus]
-> ReadPrec AwsRedshiftClusterElasticIpStatus
-> ReadPrec [AwsRedshiftClusterElasticIpStatus]
-> Read AwsRedshiftClusterElasticIpStatus
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [AwsRedshiftClusterElasticIpStatus]
$creadListPrec :: ReadPrec [AwsRedshiftClusterElasticIpStatus]
readPrec :: ReadPrec AwsRedshiftClusterElasticIpStatus
$creadPrec :: ReadPrec AwsRedshiftClusterElasticIpStatus
readList :: ReadS [AwsRedshiftClusterElasticIpStatus]
$creadList :: ReadS [AwsRedshiftClusterElasticIpStatus]
readsPrec :: Int -> ReadS AwsRedshiftClusterElasticIpStatus
$creadsPrec :: Int -> ReadS AwsRedshiftClusterElasticIpStatus
Prelude.Read, Int -> AwsRedshiftClusterElasticIpStatus -> ShowS
[AwsRedshiftClusterElasticIpStatus] -> ShowS
AwsRedshiftClusterElasticIpStatus -> String
(Int -> AwsRedshiftClusterElasticIpStatus -> ShowS)
-> (AwsRedshiftClusterElasticIpStatus -> String)
-> ([AwsRedshiftClusterElasticIpStatus] -> ShowS)
-> Show AwsRedshiftClusterElasticIpStatus
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [AwsRedshiftClusterElasticIpStatus] -> ShowS
$cshowList :: [AwsRedshiftClusterElasticIpStatus] -> ShowS
show :: AwsRedshiftClusterElasticIpStatus -> String
$cshow :: AwsRedshiftClusterElasticIpStatus -> String
showsPrec :: Int -> AwsRedshiftClusterElasticIpStatus -> ShowS
$cshowsPrec :: Int -> AwsRedshiftClusterElasticIpStatus -> ShowS
Prelude.Show, (forall x.
 AwsRedshiftClusterElasticIpStatus
 -> Rep AwsRedshiftClusterElasticIpStatus x)
-> (forall x.
    Rep AwsRedshiftClusterElasticIpStatus x
    -> AwsRedshiftClusterElasticIpStatus)
-> Generic AwsRedshiftClusterElasticIpStatus
forall x.
Rep AwsRedshiftClusterElasticIpStatus x
-> AwsRedshiftClusterElasticIpStatus
forall x.
AwsRedshiftClusterElasticIpStatus
-> Rep AwsRedshiftClusterElasticIpStatus x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep AwsRedshiftClusterElasticIpStatus x
-> AwsRedshiftClusterElasticIpStatus
$cfrom :: forall x.
AwsRedshiftClusterElasticIpStatus
-> Rep AwsRedshiftClusterElasticIpStatus x
Prelude.Generic)

-- |
-- Create a value of 'AwsRedshiftClusterElasticIpStatus' 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', 'awsRedshiftClusterElasticIpStatus_status' - The status of the elastic IP address.
--
-- 'elasticIp', 'awsRedshiftClusterElasticIpStatus_elasticIp' - The elastic IP address for the cluster.
newAwsRedshiftClusterElasticIpStatus ::
  AwsRedshiftClusterElasticIpStatus
newAwsRedshiftClusterElasticIpStatus :: AwsRedshiftClusterElasticIpStatus
newAwsRedshiftClusterElasticIpStatus =
  AwsRedshiftClusterElasticIpStatus' :: Maybe Text -> Maybe Text -> AwsRedshiftClusterElasticIpStatus
AwsRedshiftClusterElasticIpStatus'
    { $sel:status:AwsRedshiftClusterElasticIpStatus' :: Maybe Text
status =
        Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:elasticIp:AwsRedshiftClusterElasticIpStatus' :: Maybe Text
elasticIp = Maybe Text
forall a. Maybe a
Prelude.Nothing
    }

-- | The status of the elastic IP address.
awsRedshiftClusterElasticIpStatus_status :: Lens.Lens' AwsRedshiftClusterElasticIpStatus (Prelude.Maybe Prelude.Text)
awsRedshiftClusterElasticIpStatus_status :: (Maybe Text -> f (Maybe Text))
-> AwsRedshiftClusterElasticIpStatus
-> f AwsRedshiftClusterElasticIpStatus
awsRedshiftClusterElasticIpStatus_status = (AwsRedshiftClusterElasticIpStatus -> Maybe Text)
-> (AwsRedshiftClusterElasticIpStatus
    -> Maybe Text -> AwsRedshiftClusterElasticIpStatus)
-> Lens
     AwsRedshiftClusterElasticIpStatus
     AwsRedshiftClusterElasticIpStatus
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AwsRedshiftClusterElasticIpStatus' {Maybe Text
status :: Maybe Text
$sel:status:AwsRedshiftClusterElasticIpStatus' :: AwsRedshiftClusterElasticIpStatus -> Maybe Text
status} -> Maybe Text
status) (\s :: AwsRedshiftClusterElasticIpStatus
s@AwsRedshiftClusterElasticIpStatus' {} Maybe Text
a -> AwsRedshiftClusterElasticIpStatus
s {$sel:status:AwsRedshiftClusterElasticIpStatus' :: Maybe Text
status = Maybe Text
a} :: AwsRedshiftClusterElasticIpStatus)

-- | The elastic IP address for the cluster.
awsRedshiftClusterElasticIpStatus_elasticIp :: Lens.Lens' AwsRedshiftClusterElasticIpStatus (Prelude.Maybe Prelude.Text)
awsRedshiftClusterElasticIpStatus_elasticIp :: (Maybe Text -> f (Maybe Text))
-> AwsRedshiftClusterElasticIpStatus
-> f AwsRedshiftClusterElasticIpStatus
awsRedshiftClusterElasticIpStatus_elasticIp = (AwsRedshiftClusterElasticIpStatus -> Maybe Text)
-> (AwsRedshiftClusterElasticIpStatus
    -> Maybe Text -> AwsRedshiftClusterElasticIpStatus)
-> Lens
     AwsRedshiftClusterElasticIpStatus
     AwsRedshiftClusterElasticIpStatus
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AwsRedshiftClusterElasticIpStatus' {Maybe Text
elasticIp :: Maybe Text
$sel:elasticIp:AwsRedshiftClusterElasticIpStatus' :: AwsRedshiftClusterElasticIpStatus -> Maybe Text
elasticIp} -> Maybe Text
elasticIp) (\s :: AwsRedshiftClusterElasticIpStatus
s@AwsRedshiftClusterElasticIpStatus' {} Maybe Text
a -> AwsRedshiftClusterElasticIpStatus
s {$sel:elasticIp:AwsRedshiftClusterElasticIpStatus' :: Maybe Text
elasticIp = Maybe Text
a} :: AwsRedshiftClusterElasticIpStatus)

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

instance
  Prelude.Hashable
    AwsRedshiftClusterElasticIpStatus

instance
  Prelude.NFData
    AwsRedshiftClusterElasticIpStatus

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