{-# 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.MigrationHubConfig.Types.HomeRegionControl where
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import Amazonka.MigrationHubConfig.Types.Target
import qualified Amazonka.Prelude as Prelude
data HomeRegionControl = HomeRegionControl'
{
HomeRegionControl -> Maybe POSIX
requestedTime :: Prelude.Maybe Core.POSIX,
HomeRegionControl -> Maybe Text
homeRegion :: Prelude.Maybe Prelude.Text,
HomeRegionControl -> Maybe Text
controlId :: Prelude.Maybe Prelude.Text,
HomeRegionControl -> Maybe Target
target :: Prelude.Maybe Target
}
deriving (HomeRegionControl -> HomeRegionControl -> Bool
(HomeRegionControl -> HomeRegionControl -> Bool)
-> (HomeRegionControl -> HomeRegionControl -> Bool)
-> Eq HomeRegionControl
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: HomeRegionControl -> HomeRegionControl -> Bool
$c/= :: HomeRegionControl -> HomeRegionControl -> Bool
== :: HomeRegionControl -> HomeRegionControl -> Bool
$c== :: HomeRegionControl -> HomeRegionControl -> Bool
Prelude.Eq, ReadPrec [HomeRegionControl]
ReadPrec HomeRegionControl
Int -> ReadS HomeRegionControl
ReadS [HomeRegionControl]
(Int -> ReadS HomeRegionControl)
-> ReadS [HomeRegionControl]
-> ReadPrec HomeRegionControl
-> ReadPrec [HomeRegionControl]
-> Read HomeRegionControl
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [HomeRegionControl]
$creadListPrec :: ReadPrec [HomeRegionControl]
readPrec :: ReadPrec HomeRegionControl
$creadPrec :: ReadPrec HomeRegionControl
readList :: ReadS [HomeRegionControl]
$creadList :: ReadS [HomeRegionControl]
readsPrec :: Int -> ReadS HomeRegionControl
$creadsPrec :: Int -> ReadS HomeRegionControl
Prelude.Read, Int -> HomeRegionControl -> ShowS
[HomeRegionControl] -> ShowS
HomeRegionControl -> String
(Int -> HomeRegionControl -> ShowS)
-> (HomeRegionControl -> String)
-> ([HomeRegionControl] -> ShowS)
-> Show HomeRegionControl
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [HomeRegionControl] -> ShowS
$cshowList :: [HomeRegionControl] -> ShowS
show :: HomeRegionControl -> String
$cshow :: HomeRegionControl -> String
showsPrec :: Int -> HomeRegionControl -> ShowS
$cshowsPrec :: Int -> HomeRegionControl -> ShowS
Prelude.Show, (forall x. HomeRegionControl -> Rep HomeRegionControl x)
-> (forall x. Rep HomeRegionControl x -> HomeRegionControl)
-> Generic HomeRegionControl
forall x. Rep HomeRegionControl x -> HomeRegionControl
forall x. HomeRegionControl -> Rep HomeRegionControl x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep HomeRegionControl x -> HomeRegionControl
$cfrom :: forall x. HomeRegionControl -> Rep HomeRegionControl x
Prelude.Generic)
newHomeRegionControl ::
HomeRegionControl
newHomeRegionControl :: HomeRegionControl
newHomeRegionControl =
HomeRegionControl' :: Maybe POSIX
-> Maybe Text -> Maybe Text -> Maybe Target -> HomeRegionControl
HomeRegionControl'
{ $sel:requestedTime:HomeRegionControl' :: Maybe POSIX
requestedTime = Maybe POSIX
forall a. Maybe a
Prelude.Nothing,
$sel:homeRegion:HomeRegionControl' :: Maybe Text
homeRegion = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:controlId:HomeRegionControl' :: Maybe Text
controlId = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:target:HomeRegionControl' :: Maybe Target
target = Maybe Target
forall a. Maybe a
Prelude.Nothing
}
homeRegionControl_requestedTime :: Lens.Lens' HomeRegionControl (Prelude.Maybe Prelude.UTCTime)
homeRegionControl_requestedTime :: (Maybe UTCTime -> f (Maybe UTCTime))
-> HomeRegionControl -> f HomeRegionControl
homeRegionControl_requestedTime = (HomeRegionControl -> Maybe POSIX)
-> (HomeRegionControl -> Maybe POSIX -> HomeRegionControl)
-> Lens
HomeRegionControl HomeRegionControl (Maybe POSIX) (Maybe POSIX)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\HomeRegionControl' {Maybe POSIX
requestedTime :: Maybe POSIX
$sel:requestedTime:HomeRegionControl' :: HomeRegionControl -> Maybe POSIX
requestedTime} -> Maybe POSIX
requestedTime) (\s :: HomeRegionControl
s@HomeRegionControl' {} Maybe POSIX
a -> HomeRegionControl
s {$sel:requestedTime:HomeRegionControl' :: Maybe POSIX
requestedTime = Maybe POSIX
a} :: HomeRegionControl) ((Maybe POSIX -> f (Maybe POSIX))
-> HomeRegionControl -> f HomeRegionControl)
-> ((Maybe UTCTime -> f (Maybe UTCTime))
-> Maybe POSIX -> f (Maybe POSIX))
-> (Maybe UTCTime -> f (Maybe UTCTime))
-> HomeRegionControl
-> f HomeRegionControl
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso POSIX POSIX UTCTime UTCTime
-> Iso (Maybe POSIX) (Maybe POSIX) (Maybe UTCTime) (Maybe UTCTime)
forall (f :: * -> *) (g :: * -> *) s t a b.
(Functor f, Functor g) =>
AnIso s t a b -> Iso (f s) (g t) (f a) (g b)
Lens.mapping AnIso POSIX POSIX UTCTime UTCTime
forall (a :: Format). Iso' (Time a) UTCTime
Core._Time
homeRegionControl_homeRegion :: Lens.Lens' HomeRegionControl (Prelude.Maybe Prelude.Text)
homeRegionControl_homeRegion :: (Maybe Text -> f (Maybe Text))
-> HomeRegionControl -> f HomeRegionControl
homeRegionControl_homeRegion = (HomeRegionControl -> Maybe Text)
-> (HomeRegionControl -> Maybe Text -> HomeRegionControl)
-> Lens
HomeRegionControl HomeRegionControl (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\HomeRegionControl' {Maybe Text
homeRegion :: Maybe Text
$sel:homeRegion:HomeRegionControl' :: HomeRegionControl -> Maybe Text
homeRegion} -> Maybe Text
homeRegion) (\s :: HomeRegionControl
s@HomeRegionControl' {} Maybe Text
a -> HomeRegionControl
s {$sel:homeRegion:HomeRegionControl' :: Maybe Text
homeRegion = Maybe Text
a} :: HomeRegionControl)
homeRegionControl_controlId :: Lens.Lens' HomeRegionControl (Prelude.Maybe Prelude.Text)
homeRegionControl_controlId :: (Maybe Text -> f (Maybe Text))
-> HomeRegionControl -> f HomeRegionControl
homeRegionControl_controlId = (HomeRegionControl -> Maybe Text)
-> (HomeRegionControl -> Maybe Text -> HomeRegionControl)
-> Lens
HomeRegionControl HomeRegionControl (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\HomeRegionControl' {Maybe Text
controlId :: Maybe Text
$sel:controlId:HomeRegionControl' :: HomeRegionControl -> Maybe Text
controlId} -> Maybe Text
controlId) (\s :: HomeRegionControl
s@HomeRegionControl' {} Maybe Text
a -> HomeRegionControl
s {$sel:controlId:HomeRegionControl' :: Maybe Text
controlId = Maybe Text
a} :: HomeRegionControl)
homeRegionControl_target :: Lens.Lens' HomeRegionControl (Prelude.Maybe Target)
homeRegionControl_target :: (Maybe Target -> f (Maybe Target))
-> HomeRegionControl -> f HomeRegionControl
homeRegionControl_target = (HomeRegionControl -> Maybe Target)
-> (HomeRegionControl -> Maybe Target -> HomeRegionControl)
-> Lens
HomeRegionControl HomeRegionControl (Maybe Target) (Maybe Target)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\HomeRegionControl' {Maybe Target
target :: Maybe Target
$sel:target:HomeRegionControl' :: HomeRegionControl -> Maybe Target
target} -> Maybe Target
target) (\s :: HomeRegionControl
s@HomeRegionControl' {} Maybe Target
a -> HomeRegionControl
s {$sel:target:HomeRegionControl' :: Maybe Target
target = Maybe Target
a} :: HomeRegionControl)
instance Core.FromJSON HomeRegionControl where
parseJSON :: Value -> Parser HomeRegionControl
parseJSON =
String
-> (Object -> Parser HomeRegionControl)
-> Value
-> Parser HomeRegionControl
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
String
"HomeRegionControl"
( \Object
x ->
Maybe POSIX
-> Maybe Text -> Maybe Text -> Maybe Target -> HomeRegionControl
HomeRegionControl'
(Maybe POSIX
-> Maybe Text -> Maybe Text -> Maybe Target -> HomeRegionControl)
-> Parser (Maybe POSIX)
-> Parser
(Maybe Text -> Maybe Text -> Maybe Target -> HomeRegionControl)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Parser (Maybe POSIX)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"RequestedTime")
Parser
(Maybe Text -> Maybe Text -> Maybe Target -> HomeRegionControl)
-> Parser (Maybe Text)
-> Parser (Maybe Text -> Maybe Target -> HomeRegionControl)
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
"HomeRegion")
Parser (Maybe Text -> Maybe Target -> HomeRegionControl)
-> Parser (Maybe Text)
-> Parser (Maybe Target -> HomeRegionControl)
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
"ControlId")
Parser (Maybe Target -> HomeRegionControl)
-> Parser (Maybe Target) -> Parser HomeRegionControl
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Target)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"Target")
)
instance Prelude.Hashable HomeRegionControl
instance Prelude.NFData HomeRegionControl