{-# 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.MGN.Types.SourceServer where
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import Amazonka.MGN.Types.DataReplicationInfo
import Amazonka.MGN.Types.LaunchedInstance
import Amazonka.MGN.Types.LifeCycle
import Amazonka.MGN.Types.SourceProperties
import qualified Amazonka.Prelude as Prelude
data SourceServer = SourceServer'
{
SourceServer -> Maybe SourceProperties
sourceProperties :: Prelude.Maybe SourceProperties,
SourceServer -> Maybe Text
arn :: Prelude.Maybe Prelude.Text,
SourceServer -> Maybe LaunchedInstance
launchedInstance :: Prelude.Maybe LaunchedInstance,
SourceServer -> Maybe LifeCycle
lifeCycle :: Prelude.Maybe LifeCycle,
SourceServer -> Maybe Bool
isArchived :: Prelude.Maybe Prelude.Bool,
SourceServer -> Maybe DataReplicationInfo
dataReplicationInfo :: Prelude.Maybe DataReplicationInfo,
SourceServer -> Maybe Text
sourceServerID :: Prelude.Maybe Prelude.Text,
SourceServer -> Maybe (Sensitive (HashMap Text Text))
tags :: Prelude.Maybe (Core.Sensitive (Prelude.HashMap Prelude.Text Prelude.Text))
}
deriving (SourceServer -> SourceServer -> Bool
(SourceServer -> SourceServer -> Bool)
-> (SourceServer -> SourceServer -> Bool) -> Eq SourceServer
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: SourceServer -> SourceServer -> Bool
$c/= :: SourceServer -> SourceServer -> Bool
== :: SourceServer -> SourceServer -> Bool
$c== :: SourceServer -> SourceServer -> Bool
Prelude.Eq, Int -> SourceServer -> ShowS
[SourceServer] -> ShowS
SourceServer -> String
(Int -> SourceServer -> ShowS)
-> (SourceServer -> String)
-> ([SourceServer] -> ShowS)
-> Show SourceServer
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [SourceServer] -> ShowS
$cshowList :: [SourceServer] -> ShowS
show :: SourceServer -> String
$cshow :: SourceServer -> String
showsPrec :: Int -> SourceServer -> ShowS
$cshowsPrec :: Int -> SourceServer -> ShowS
Prelude.Show, (forall x. SourceServer -> Rep SourceServer x)
-> (forall x. Rep SourceServer x -> SourceServer)
-> Generic SourceServer
forall x. Rep SourceServer x -> SourceServer
forall x. SourceServer -> Rep SourceServer x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep SourceServer x -> SourceServer
$cfrom :: forall x. SourceServer -> Rep SourceServer x
Prelude.Generic)
newSourceServer ::
SourceServer
newSourceServer :: SourceServer
newSourceServer =
SourceServer' :: Maybe SourceProperties
-> Maybe Text
-> Maybe LaunchedInstance
-> Maybe LifeCycle
-> Maybe Bool
-> Maybe DataReplicationInfo
-> Maybe Text
-> Maybe (Sensitive (HashMap Text Text))
-> SourceServer
SourceServer'
{ $sel:sourceProperties:SourceServer' :: Maybe SourceProperties
sourceProperties = Maybe SourceProperties
forall a. Maybe a
Prelude.Nothing,
$sel:arn:SourceServer' :: Maybe Text
arn = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:launchedInstance:SourceServer' :: Maybe LaunchedInstance
launchedInstance = Maybe LaunchedInstance
forall a. Maybe a
Prelude.Nothing,
$sel:lifeCycle:SourceServer' :: Maybe LifeCycle
lifeCycle = Maybe LifeCycle
forall a. Maybe a
Prelude.Nothing,
$sel:isArchived:SourceServer' :: Maybe Bool
isArchived = Maybe Bool
forall a. Maybe a
Prelude.Nothing,
$sel:dataReplicationInfo:SourceServer' :: Maybe DataReplicationInfo
dataReplicationInfo = Maybe DataReplicationInfo
forall a. Maybe a
Prelude.Nothing,
$sel:sourceServerID:SourceServer' :: Maybe Text
sourceServerID = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:tags:SourceServer' :: Maybe (Sensitive (HashMap Text Text))
tags = Maybe (Sensitive (HashMap Text Text))
forall a. Maybe a
Prelude.Nothing
}
sourceServer_sourceProperties :: Lens.Lens' SourceServer (Prelude.Maybe SourceProperties)
sourceServer_sourceProperties :: (Maybe SourceProperties -> f (Maybe SourceProperties))
-> SourceServer -> f SourceServer
sourceServer_sourceProperties = (SourceServer -> Maybe SourceProperties)
-> (SourceServer -> Maybe SourceProperties -> SourceServer)
-> Lens
SourceServer
SourceServer
(Maybe SourceProperties)
(Maybe SourceProperties)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SourceServer' {Maybe SourceProperties
sourceProperties :: Maybe SourceProperties
$sel:sourceProperties:SourceServer' :: SourceServer -> Maybe SourceProperties
sourceProperties} -> Maybe SourceProperties
sourceProperties) (\s :: SourceServer
s@SourceServer' {} Maybe SourceProperties
a -> SourceServer
s {$sel:sourceProperties:SourceServer' :: Maybe SourceProperties
sourceProperties = Maybe SourceProperties
a} :: SourceServer)
sourceServer_arn :: Lens.Lens' SourceServer (Prelude.Maybe Prelude.Text)
sourceServer_arn :: (Maybe Text -> f (Maybe Text)) -> SourceServer -> f SourceServer
sourceServer_arn = (SourceServer -> Maybe Text)
-> (SourceServer -> Maybe Text -> SourceServer)
-> Lens SourceServer SourceServer (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SourceServer' {Maybe Text
arn :: Maybe Text
$sel:arn:SourceServer' :: SourceServer -> Maybe Text
arn} -> Maybe Text
arn) (\s :: SourceServer
s@SourceServer' {} Maybe Text
a -> SourceServer
s {$sel:arn:SourceServer' :: Maybe Text
arn = Maybe Text
a} :: SourceServer)
sourceServer_launchedInstance :: Lens.Lens' SourceServer (Prelude.Maybe LaunchedInstance)
sourceServer_launchedInstance :: (Maybe LaunchedInstance -> f (Maybe LaunchedInstance))
-> SourceServer -> f SourceServer
sourceServer_launchedInstance = (SourceServer -> Maybe LaunchedInstance)
-> (SourceServer -> Maybe LaunchedInstance -> SourceServer)
-> Lens
SourceServer
SourceServer
(Maybe LaunchedInstance)
(Maybe LaunchedInstance)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SourceServer' {Maybe LaunchedInstance
launchedInstance :: Maybe LaunchedInstance
$sel:launchedInstance:SourceServer' :: SourceServer -> Maybe LaunchedInstance
launchedInstance} -> Maybe LaunchedInstance
launchedInstance) (\s :: SourceServer
s@SourceServer' {} Maybe LaunchedInstance
a -> SourceServer
s {$sel:launchedInstance:SourceServer' :: Maybe LaunchedInstance
launchedInstance = Maybe LaunchedInstance
a} :: SourceServer)
sourceServer_lifeCycle :: Lens.Lens' SourceServer (Prelude.Maybe LifeCycle)
sourceServer_lifeCycle :: (Maybe LifeCycle -> f (Maybe LifeCycle))
-> SourceServer -> f SourceServer
sourceServer_lifeCycle = (SourceServer -> Maybe LifeCycle)
-> (SourceServer -> Maybe LifeCycle -> SourceServer)
-> Lens
SourceServer SourceServer (Maybe LifeCycle) (Maybe LifeCycle)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SourceServer' {Maybe LifeCycle
lifeCycle :: Maybe LifeCycle
$sel:lifeCycle:SourceServer' :: SourceServer -> Maybe LifeCycle
lifeCycle} -> Maybe LifeCycle
lifeCycle) (\s :: SourceServer
s@SourceServer' {} Maybe LifeCycle
a -> SourceServer
s {$sel:lifeCycle:SourceServer' :: Maybe LifeCycle
lifeCycle = Maybe LifeCycle
a} :: SourceServer)
sourceServer_isArchived :: Lens.Lens' SourceServer (Prelude.Maybe Prelude.Bool)
sourceServer_isArchived :: (Maybe Bool -> f (Maybe Bool)) -> SourceServer -> f SourceServer
sourceServer_isArchived = (SourceServer -> Maybe Bool)
-> (SourceServer -> Maybe Bool -> SourceServer)
-> Lens SourceServer SourceServer (Maybe Bool) (Maybe Bool)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SourceServer' {Maybe Bool
isArchived :: Maybe Bool
$sel:isArchived:SourceServer' :: SourceServer -> Maybe Bool
isArchived} -> Maybe Bool
isArchived) (\s :: SourceServer
s@SourceServer' {} Maybe Bool
a -> SourceServer
s {$sel:isArchived:SourceServer' :: Maybe Bool
isArchived = Maybe Bool
a} :: SourceServer)
sourceServer_dataReplicationInfo :: Lens.Lens' SourceServer (Prelude.Maybe DataReplicationInfo)
sourceServer_dataReplicationInfo :: (Maybe DataReplicationInfo -> f (Maybe DataReplicationInfo))
-> SourceServer -> f SourceServer
sourceServer_dataReplicationInfo = (SourceServer -> Maybe DataReplicationInfo)
-> (SourceServer -> Maybe DataReplicationInfo -> SourceServer)
-> Lens
SourceServer
SourceServer
(Maybe DataReplicationInfo)
(Maybe DataReplicationInfo)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SourceServer' {Maybe DataReplicationInfo
dataReplicationInfo :: Maybe DataReplicationInfo
$sel:dataReplicationInfo:SourceServer' :: SourceServer -> Maybe DataReplicationInfo
dataReplicationInfo} -> Maybe DataReplicationInfo
dataReplicationInfo) (\s :: SourceServer
s@SourceServer' {} Maybe DataReplicationInfo
a -> SourceServer
s {$sel:dataReplicationInfo:SourceServer' :: Maybe DataReplicationInfo
dataReplicationInfo = Maybe DataReplicationInfo
a} :: SourceServer)
sourceServer_sourceServerID :: Lens.Lens' SourceServer (Prelude.Maybe Prelude.Text)
sourceServer_sourceServerID :: (Maybe Text -> f (Maybe Text)) -> SourceServer -> f SourceServer
sourceServer_sourceServerID = (SourceServer -> Maybe Text)
-> (SourceServer -> Maybe Text -> SourceServer)
-> Lens SourceServer SourceServer (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SourceServer' {Maybe Text
sourceServerID :: Maybe Text
$sel:sourceServerID:SourceServer' :: SourceServer -> Maybe Text
sourceServerID} -> Maybe Text
sourceServerID) (\s :: SourceServer
s@SourceServer' {} Maybe Text
a -> SourceServer
s {$sel:sourceServerID:SourceServer' :: Maybe Text
sourceServerID = Maybe Text
a} :: SourceServer)
sourceServer_tags :: Lens.Lens' SourceServer (Prelude.Maybe (Prelude.HashMap Prelude.Text Prelude.Text))
sourceServer_tags :: (Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
-> SourceServer -> f SourceServer
sourceServer_tags = (SourceServer -> Maybe (Sensitive (HashMap Text Text)))
-> (SourceServer
-> Maybe (Sensitive (HashMap Text Text)) -> SourceServer)
-> Lens
SourceServer
SourceServer
(Maybe (Sensitive (HashMap Text Text)))
(Maybe (Sensitive (HashMap Text Text)))
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SourceServer' {Maybe (Sensitive (HashMap Text Text))
tags :: Maybe (Sensitive (HashMap Text Text))
$sel:tags:SourceServer' :: SourceServer -> Maybe (Sensitive (HashMap Text Text))
tags} -> Maybe (Sensitive (HashMap Text Text))
tags) (\s :: SourceServer
s@SourceServer' {} Maybe (Sensitive (HashMap Text Text))
a -> SourceServer
s {$sel:tags:SourceServer' :: Maybe (Sensitive (HashMap Text Text))
tags = Maybe (Sensitive (HashMap Text Text))
a} :: SourceServer) ((Maybe (Sensitive (HashMap Text Text))
-> f (Maybe (Sensitive (HashMap Text Text))))
-> SourceServer -> f SourceServer)
-> ((Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
-> Maybe (Sensitive (HashMap Text Text))
-> f (Maybe (Sensitive (HashMap Text Text))))
-> (Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
-> SourceServer
-> f SourceServer
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
(Sensitive (HashMap Text Text))
(Sensitive (HashMap Text Text))
(HashMap Text Text)
(HashMap Text Text)
-> Iso
(Maybe (Sensitive (HashMap Text Text)))
(Maybe (Sensitive (HashMap Text Text)))
(Maybe (HashMap Text Text))
(Maybe (HashMap Text Text))
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
(Sensitive (HashMap Text Text))
(Sensitive (HashMap Text Text))
(HashMap Text Text)
(HashMap Text Text)
forall a. Iso' (Sensitive a) a
Core._Sensitive AnIso
(Sensitive (HashMap Text Text))
(Sensitive (HashMap Text Text))
(HashMap Text Text)
(HashMap Text Text)
-> (Exchange
(HashMap Text Text)
(HashMap Text Text)
(HashMap Text Text)
(Identity (HashMap Text Text))
-> Exchange
(HashMap Text Text)
(HashMap Text Text)
(HashMap Text Text)
(Identity (HashMap Text Text)))
-> AnIso
(Sensitive (HashMap Text Text))
(Sensitive (HashMap Text Text))
(HashMap Text Text)
(HashMap Text Text)
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. Exchange
(HashMap Text Text)
(HashMap Text Text)
(HashMap Text Text)
(Identity (HashMap Text Text))
-> Exchange
(HashMap Text Text)
(HashMap Text Text)
(HashMap Text Text)
(Identity (HashMap Text Text))
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced)
instance Core.FromJSON SourceServer where
parseJSON :: Value -> Parser SourceServer
parseJSON =
String
-> (Object -> Parser SourceServer) -> Value -> Parser SourceServer
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
String
"SourceServer"
( \Object
x ->
Maybe SourceProperties
-> Maybe Text
-> Maybe LaunchedInstance
-> Maybe LifeCycle
-> Maybe Bool
-> Maybe DataReplicationInfo
-> Maybe Text
-> Maybe (Sensitive (HashMap Text Text))
-> SourceServer
SourceServer'
(Maybe SourceProperties
-> Maybe Text
-> Maybe LaunchedInstance
-> Maybe LifeCycle
-> Maybe Bool
-> Maybe DataReplicationInfo
-> Maybe Text
-> Maybe (Sensitive (HashMap Text Text))
-> SourceServer)
-> Parser (Maybe SourceProperties)
-> Parser
(Maybe Text
-> Maybe LaunchedInstance
-> Maybe LifeCycle
-> Maybe Bool
-> Maybe DataReplicationInfo
-> Maybe Text
-> Maybe (Sensitive (HashMap Text Text))
-> SourceServer)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Parser (Maybe SourceProperties)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"sourceProperties")
Parser
(Maybe Text
-> Maybe LaunchedInstance
-> Maybe LifeCycle
-> Maybe Bool
-> Maybe DataReplicationInfo
-> Maybe Text
-> Maybe (Sensitive (HashMap Text Text))
-> SourceServer)
-> Parser (Maybe Text)
-> Parser
(Maybe LaunchedInstance
-> Maybe LifeCycle
-> Maybe Bool
-> Maybe DataReplicationInfo
-> Maybe Text
-> Maybe (Sensitive (HashMap Text Text))
-> SourceServer)
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
"arn")
Parser
(Maybe LaunchedInstance
-> Maybe LifeCycle
-> Maybe Bool
-> Maybe DataReplicationInfo
-> Maybe Text
-> Maybe (Sensitive (HashMap Text Text))
-> SourceServer)
-> Parser (Maybe LaunchedInstance)
-> Parser
(Maybe LifeCycle
-> Maybe Bool
-> Maybe DataReplicationInfo
-> Maybe Text
-> Maybe (Sensitive (HashMap Text Text))
-> SourceServer)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe LaunchedInstance)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"launchedInstance")
Parser
(Maybe LifeCycle
-> Maybe Bool
-> Maybe DataReplicationInfo
-> Maybe Text
-> Maybe (Sensitive (HashMap Text Text))
-> SourceServer)
-> Parser (Maybe LifeCycle)
-> Parser
(Maybe Bool
-> Maybe DataReplicationInfo
-> Maybe Text
-> Maybe (Sensitive (HashMap Text Text))
-> SourceServer)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe LifeCycle)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"lifeCycle")
Parser
(Maybe Bool
-> Maybe DataReplicationInfo
-> Maybe Text
-> Maybe (Sensitive (HashMap Text Text))
-> SourceServer)
-> Parser (Maybe Bool)
-> Parser
(Maybe DataReplicationInfo
-> Maybe Text
-> Maybe (Sensitive (HashMap Text Text))
-> SourceServer)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Bool)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"isArchived")
Parser
(Maybe DataReplicationInfo
-> Maybe Text
-> Maybe (Sensitive (HashMap Text Text))
-> SourceServer)
-> Parser (Maybe DataReplicationInfo)
-> Parser
(Maybe Text
-> Maybe (Sensitive (HashMap Text Text)) -> SourceServer)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe DataReplicationInfo)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"dataReplicationInfo")
Parser
(Maybe Text
-> Maybe (Sensitive (HashMap Text Text)) -> SourceServer)
-> Parser (Maybe Text)
-> Parser (Maybe (Sensitive (HashMap Text Text)) -> SourceServer)
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
"sourceServerID")
Parser (Maybe (Sensitive (HashMap Text Text)) -> SourceServer)
-> Parser (Maybe (Sensitive (HashMap Text Text)))
-> Parser SourceServer
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object
-> Text -> Parser (Maybe (Maybe (Sensitive (HashMap Text Text))))
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"tags" Parser (Maybe (Maybe (Sensitive (HashMap Text Text))))
-> Maybe (Sensitive (HashMap Text Text))
-> Parser (Maybe (Sensitive (HashMap Text Text)))
forall a. Parser (Maybe a) -> a -> Parser a
Core..!= Maybe (Sensitive (HashMap Text Text))
forall a. Monoid a => a
Prelude.mempty)
)
instance Prelude.Hashable SourceServer
instance Prelude.NFData SourceServer