{-# 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 #-}
module Amazonka.Route53RecoveryControlConfig.Types.RoutingControl where
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
import Amazonka.Route53RecoveryControlConfig.Types.Status
data RoutingControl = RoutingControl'
{
RoutingControl -> Maybe Status
status :: Prelude.Maybe Status,
RoutingControl -> Maybe Text
controlPanelArn :: Prelude.Maybe Prelude.Text,
RoutingControl -> Maybe Text
name :: Prelude.Maybe Prelude.Text,
RoutingControl -> Maybe Text
routingControlArn :: Prelude.Maybe Prelude.Text
}
deriving (RoutingControl -> RoutingControl -> Bool
(RoutingControl -> RoutingControl -> Bool)
-> (RoutingControl -> RoutingControl -> Bool) -> Eq RoutingControl
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: RoutingControl -> RoutingControl -> Bool
$c/= :: RoutingControl -> RoutingControl -> Bool
== :: RoutingControl -> RoutingControl -> Bool
$c== :: RoutingControl -> RoutingControl -> Bool
Prelude.Eq, ReadPrec [RoutingControl]
ReadPrec RoutingControl
Int -> ReadS RoutingControl
ReadS [RoutingControl]
(Int -> ReadS RoutingControl)
-> ReadS [RoutingControl]
-> ReadPrec RoutingControl
-> ReadPrec [RoutingControl]
-> Read RoutingControl
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [RoutingControl]
$creadListPrec :: ReadPrec [RoutingControl]
readPrec :: ReadPrec RoutingControl
$creadPrec :: ReadPrec RoutingControl
readList :: ReadS [RoutingControl]
$creadList :: ReadS [RoutingControl]
readsPrec :: Int -> ReadS RoutingControl
$creadsPrec :: Int -> ReadS RoutingControl
Prelude.Read, Int -> RoutingControl -> ShowS
[RoutingControl] -> ShowS
RoutingControl -> String
(Int -> RoutingControl -> ShowS)
-> (RoutingControl -> String)
-> ([RoutingControl] -> ShowS)
-> Show RoutingControl
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [RoutingControl] -> ShowS
$cshowList :: [RoutingControl] -> ShowS
show :: RoutingControl -> String
$cshow :: RoutingControl -> String
showsPrec :: Int -> RoutingControl -> ShowS
$cshowsPrec :: Int -> RoutingControl -> ShowS
Prelude.Show, (forall x. RoutingControl -> Rep RoutingControl x)
-> (forall x. Rep RoutingControl x -> RoutingControl)
-> Generic RoutingControl
forall x. Rep RoutingControl x -> RoutingControl
forall x. RoutingControl -> Rep RoutingControl x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep RoutingControl x -> RoutingControl
$cfrom :: forall x. RoutingControl -> Rep RoutingControl x
Prelude.Generic)
newRoutingControl ::
RoutingControl
newRoutingControl :: RoutingControl
newRoutingControl =
RoutingControl' :: Maybe Status
-> Maybe Text -> Maybe Text -> Maybe Text -> RoutingControl
RoutingControl'
{ $sel:status:RoutingControl' :: Maybe Status
status = Maybe Status
forall a. Maybe a
Prelude.Nothing,
$sel:controlPanelArn:RoutingControl' :: Maybe Text
controlPanelArn = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:name:RoutingControl' :: Maybe Text
name = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:routingControlArn:RoutingControl' :: Maybe Text
routingControlArn = Maybe Text
forall a. Maybe a
Prelude.Nothing
}
routingControl_status :: Lens.Lens' RoutingControl (Prelude.Maybe Status)
routingControl_status :: (Maybe Status -> f (Maybe Status))
-> RoutingControl -> f RoutingControl
routingControl_status = (RoutingControl -> Maybe Status)
-> (RoutingControl -> Maybe Status -> RoutingControl)
-> Lens RoutingControl RoutingControl (Maybe Status) (Maybe Status)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\RoutingControl' {Maybe Status
status :: Maybe Status
$sel:status:RoutingControl' :: RoutingControl -> Maybe Status
status} -> Maybe Status
status) (\s :: RoutingControl
s@RoutingControl' {} Maybe Status
a -> RoutingControl
s {$sel:status:RoutingControl' :: Maybe Status
status = Maybe Status
a} :: RoutingControl)
routingControl_controlPanelArn :: Lens.Lens' RoutingControl (Prelude.Maybe Prelude.Text)
routingControl_controlPanelArn :: (Maybe Text -> f (Maybe Text))
-> RoutingControl -> f RoutingControl
routingControl_controlPanelArn = (RoutingControl -> Maybe Text)
-> (RoutingControl -> Maybe Text -> RoutingControl)
-> Lens RoutingControl RoutingControl (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\RoutingControl' {Maybe Text
controlPanelArn :: Maybe Text
$sel:controlPanelArn:RoutingControl' :: RoutingControl -> Maybe Text
controlPanelArn} -> Maybe Text
controlPanelArn) (\s :: RoutingControl
s@RoutingControl' {} Maybe Text
a -> RoutingControl
s {$sel:controlPanelArn:RoutingControl' :: Maybe Text
controlPanelArn = Maybe Text
a} :: RoutingControl)
routingControl_name :: Lens.Lens' RoutingControl (Prelude.Maybe Prelude.Text)
routingControl_name :: (Maybe Text -> f (Maybe Text))
-> RoutingControl -> f RoutingControl
routingControl_name = (RoutingControl -> Maybe Text)
-> (RoutingControl -> Maybe Text -> RoutingControl)
-> Lens RoutingControl RoutingControl (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\RoutingControl' {Maybe Text
name :: Maybe Text
$sel:name:RoutingControl' :: RoutingControl -> Maybe Text
name} -> Maybe Text
name) (\s :: RoutingControl
s@RoutingControl' {} Maybe Text
a -> RoutingControl
s {$sel:name:RoutingControl' :: Maybe Text
name = Maybe Text
a} :: RoutingControl)
routingControl_routingControlArn :: Lens.Lens' RoutingControl (Prelude.Maybe Prelude.Text)
routingControl_routingControlArn :: (Maybe Text -> f (Maybe Text))
-> RoutingControl -> f RoutingControl
routingControl_routingControlArn = (RoutingControl -> Maybe Text)
-> (RoutingControl -> Maybe Text -> RoutingControl)
-> Lens RoutingControl RoutingControl (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\RoutingControl' {Maybe Text
routingControlArn :: Maybe Text
$sel:routingControlArn:RoutingControl' :: RoutingControl -> Maybe Text
routingControlArn} -> Maybe Text
routingControlArn) (\s :: RoutingControl
s@RoutingControl' {} Maybe Text
a -> RoutingControl
s {$sel:routingControlArn:RoutingControl' :: Maybe Text
routingControlArn = Maybe Text
a} :: RoutingControl)
instance Core.FromJSON RoutingControl where
parseJSON :: Value -> Parser RoutingControl
parseJSON =
String
-> (Object -> Parser RoutingControl)
-> Value
-> Parser RoutingControl
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
String
"RoutingControl"
( \Object
x ->
Maybe Status
-> Maybe Text -> Maybe Text -> Maybe Text -> RoutingControl
RoutingControl'
(Maybe Status
-> Maybe Text -> Maybe Text -> Maybe Text -> RoutingControl)
-> Parser (Maybe Status)
-> Parser
(Maybe Text -> Maybe Text -> Maybe Text -> RoutingControl)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Parser (Maybe Status)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"Status")
Parser (Maybe Text -> Maybe Text -> Maybe Text -> RoutingControl)
-> Parser (Maybe Text)
-> Parser (Maybe Text -> Maybe Text -> RoutingControl)
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
"ControlPanelArn")
Parser (Maybe Text -> Maybe Text -> RoutingControl)
-> Parser (Maybe Text) -> Parser (Maybe Text -> RoutingControl)
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
"Name")
Parser (Maybe Text -> RoutingControl)
-> Parser (Maybe Text) -> Parser RoutingControl
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
"RoutingControlArn")
)
instance Prelude.Hashable RoutingControl
instance Prelude.NFData RoutingControl