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

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

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

-- |
-- Create a value of 'ElasticIpStatus' 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', 'elasticIpStatus_status' - The status of the elastic IP (EIP) address.
--
-- 'elasticIp', 'elasticIpStatus_elasticIp' - The elastic IP (EIP) address for the cluster.
newElasticIpStatus ::
  ElasticIpStatus
newElasticIpStatus :: ElasticIpStatus
newElasticIpStatus =
  ElasticIpStatus' :: Maybe Text -> Maybe Text -> ElasticIpStatus
ElasticIpStatus'
    { $sel:status:ElasticIpStatus' :: Maybe Text
status = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:elasticIp:ElasticIpStatus' :: Maybe Text
elasticIp = Maybe Text
forall a. Maybe a
Prelude.Nothing
    }

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

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

instance Core.FromXML ElasticIpStatus where
  parseXML :: [Node] -> Either String ElasticIpStatus
parseXML [Node]
x =
    Maybe Text -> Maybe Text -> ElasticIpStatus
ElasticIpStatus'
      (Maybe Text -> Maybe Text -> ElasticIpStatus)
-> Either String (Maybe Text)
-> Either String (Maybe Text -> ElasticIpStatus)
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 -> ElasticIpStatus)
-> Either String (Maybe Text) -> Either String ElasticIpStatus
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
"ElasticIp")

instance Prelude.Hashable ElasticIpStatus

instance Prelude.NFData ElasticIpStatus