{-# 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.ParticipatingServer where
import qualified Amazonka.Core as Core
import qualified Amazonka.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
import Amazonka.MGN.Types.LaunchStatus
import Amazonka.MGN.Types.PostLaunchActionsStatus
import qualified Amazonka.Prelude as Prelude
data ParticipatingServer = ParticipatingServer'
{
ParticipatingServer -> Maybe LaunchStatus
launchStatus :: Prelude.Maybe LaunchStatus,
ParticipatingServer -> Maybe Text
launchedEc2InstanceID :: Prelude.Maybe Prelude.Text,
ParticipatingServer -> Maybe PostLaunchActionsStatus
postLaunchActionsStatus :: Prelude.Maybe PostLaunchActionsStatus,
ParticipatingServer -> Text
sourceServerID :: Prelude.Text
}
deriving (ParticipatingServer -> ParticipatingServer -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ParticipatingServer -> ParticipatingServer -> Bool
$c/= :: ParticipatingServer -> ParticipatingServer -> Bool
== :: ParticipatingServer -> ParticipatingServer -> Bool
$c== :: ParticipatingServer -> ParticipatingServer -> Bool
Prelude.Eq, ReadPrec [ParticipatingServer]
ReadPrec ParticipatingServer
Int -> ReadS ParticipatingServer
ReadS [ParticipatingServer]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ParticipatingServer]
$creadListPrec :: ReadPrec [ParticipatingServer]
readPrec :: ReadPrec ParticipatingServer
$creadPrec :: ReadPrec ParticipatingServer
readList :: ReadS [ParticipatingServer]
$creadList :: ReadS [ParticipatingServer]
readsPrec :: Int -> ReadS ParticipatingServer
$creadsPrec :: Int -> ReadS ParticipatingServer
Prelude.Read, Int -> ParticipatingServer -> ShowS
[ParticipatingServer] -> ShowS
ParticipatingServer -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ParticipatingServer] -> ShowS
$cshowList :: [ParticipatingServer] -> ShowS
show :: ParticipatingServer -> String
$cshow :: ParticipatingServer -> String
showsPrec :: Int -> ParticipatingServer -> ShowS
$cshowsPrec :: Int -> ParticipatingServer -> ShowS
Prelude.Show, forall x. Rep ParticipatingServer x -> ParticipatingServer
forall x. ParticipatingServer -> Rep ParticipatingServer x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ParticipatingServer x -> ParticipatingServer
$cfrom :: forall x. ParticipatingServer -> Rep ParticipatingServer x
Prelude.Generic)
newParticipatingServer ::
Prelude.Text ->
ParticipatingServer
newParticipatingServer :: Text -> ParticipatingServer
newParticipatingServer Text
pSourceServerID_ =
ParticipatingServer'
{ $sel:launchStatus:ParticipatingServer' :: Maybe LaunchStatus
launchStatus =
forall a. Maybe a
Prelude.Nothing,
$sel:launchedEc2InstanceID:ParticipatingServer' :: Maybe Text
launchedEc2InstanceID = forall a. Maybe a
Prelude.Nothing,
$sel:postLaunchActionsStatus:ParticipatingServer' :: Maybe PostLaunchActionsStatus
postLaunchActionsStatus = forall a. Maybe a
Prelude.Nothing,
$sel:sourceServerID:ParticipatingServer' :: Text
sourceServerID = Text
pSourceServerID_
}
participatingServer_launchStatus :: Lens.Lens' ParticipatingServer (Prelude.Maybe LaunchStatus)
participatingServer_launchStatus :: Lens' ParticipatingServer (Maybe LaunchStatus)
participatingServer_launchStatus = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ParticipatingServer' {Maybe LaunchStatus
launchStatus :: Maybe LaunchStatus
$sel:launchStatus:ParticipatingServer' :: ParticipatingServer -> Maybe LaunchStatus
launchStatus} -> Maybe LaunchStatus
launchStatus) (\s :: ParticipatingServer
s@ParticipatingServer' {} Maybe LaunchStatus
a -> ParticipatingServer
s {$sel:launchStatus:ParticipatingServer' :: Maybe LaunchStatus
launchStatus = Maybe LaunchStatus
a} :: ParticipatingServer)
participatingServer_launchedEc2InstanceID :: Lens.Lens' ParticipatingServer (Prelude.Maybe Prelude.Text)
participatingServer_launchedEc2InstanceID :: Lens' ParticipatingServer (Maybe Text)
participatingServer_launchedEc2InstanceID = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ParticipatingServer' {Maybe Text
launchedEc2InstanceID :: Maybe Text
$sel:launchedEc2InstanceID:ParticipatingServer' :: ParticipatingServer -> Maybe Text
launchedEc2InstanceID} -> Maybe Text
launchedEc2InstanceID) (\s :: ParticipatingServer
s@ParticipatingServer' {} Maybe Text
a -> ParticipatingServer
s {$sel:launchedEc2InstanceID:ParticipatingServer' :: Maybe Text
launchedEc2InstanceID = Maybe Text
a} :: ParticipatingServer)
participatingServer_postLaunchActionsStatus :: Lens.Lens' ParticipatingServer (Prelude.Maybe PostLaunchActionsStatus)
participatingServer_postLaunchActionsStatus :: Lens' ParticipatingServer (Maybe PostLaunchActionsStatus)
participatingServer_postLaunchActionsStatus = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ParticipatingServer' {Maybe PostLaunchActionsStatus
postLaunchActionsStatus :: Maybe PostLaunchActionsStatus
$sel:postLaunchActionsStatus:ParticipatingServer' :: ParticipatingServer -> Maybe PostLaunchActionsStatus
postLaunchActionsStatus} -> Maybe PostLaunchActionsStatus
postLaunchActionsStatus) (\s :: ParticipatingServer
s@ParticipatingServer' {} Maybe PostLaunchActionsStatus
a -> ParticipatingServer
s {$sel:postLaunchActionsStatus:ParticipatingServer' :: Maybe PostLaunchActionsStatus
postLaunchActionsStatus = Maybe PostLaunchActionsStatus
a} :: ParticipatingServer)
participatingServer_sourceServerID :: Lens.Lens' ParticipatingServer Prelude.Text
participatingServer_sourceServerID :: Lens' ParticipatingServer Text
participatingServer_sourceServerID = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ParticipatingServer' {Text
sourceServerID :: Text
$sel:sourceServerID:ParticipatingServer' :: ParticipatingServer -> Text
sourceServerID} -> Text
sourceServerID) (\s :: ParticipatingServer
s@ParticipatingServer' {} Text
a -> ParticipatingServer
s {$sel:sourceServerID:ParticipatingServer' :: Text
sourceServerID = Text
a} :: ParticipatingServer)
instance Data.FromJSON ParticipatingServer where
parseJSON :: Value -> Parser ParticipatingServer
parseJSON =
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
String
"ParticipatingServer"
( \Object
x ->
Maybe LaunchStatus
-> Maybe Text
-> Maybe PostLaunchActionsStatus
-> Text
-> ParticipatingServer
ParticipatingServer'
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"launchStatus")
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"launchedEc2InstanceID")
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"postLaunchActionsStatus")
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser a
Data..: Key
"sourceServerID")
)
instance Prelude.Hashable ParticipatingServer where
hashWithSalt :: Int -> ParticipatingServer -> Int
hashWithSalt Int
_salt ParticipatingServer' {Maybe Text
Maybe LaunchStatus
Maybe PostLaunchActionsStatus
Text
sourceServerID :: Text
postLaunchActionsStatus :: Maybe PostLaunchActionsStatus
launchedEc2InstanceID :: Maybe Text
launchStatus :: Maybe LaunchStatus
$sel:sourceServerID:ParticipatingServer' :: ParticipatingServer -> Text
$sel:postLaunchActionsStatus:ParticipatingServer' :: ParticipatingServer -> Maybe PostLaunchActionsStatus
$sel:launchedEc2InstanceID:ParticipatingServer' :: ParticipatingServer -> Maybe Text
$sel:launchStatus:ParticipatingServer' :: ParticipatingServer -> Maybe LaunchStatus
..} =
Int
_salt
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe LaunchStatus
launchStatus
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
launchedEc2InstanceID
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe PostLaunchActionsStatus
postLaunchActionsStatus
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
sourceServerID
instance Prelude.NFData ParticipatingServer where
rnf :: ParticipatingServer -> ()
rnf ParticipatingServer' {Maybe Text
Maybe LaunchStatus
Maybe PostLaunchActionsStatus
Text
sourceServerID :: Text
postLaunchActionsStatus :: Maybe PostLaunchActionsStatus
launchedEc2InstanceID :: Maybe Text
launchStatus :: Maybe LaunchStatus
$sel:sourceServerID:ParticipatingServer' :: ParticipatingServer -> Text
$sel:postLaunchActionsStatus:ParticipatingServer' :: ParticipatingServer -> Maybe PostLaunchActionsStatus
$sel:launchedEc2InstanceID:ParticipatingServer' :: ParticipatingServer -> Maybe Text
$sel:launchStatus:ParticipatingServer' :: ParticipatingServer -> Maybe LaunchStatus
..} =
forall a. NFData a => a -> ()
Prelude.rnf Maybe LaunchStatus
launchStatus
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
launchedEc2InstanceID
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe PostLaunchActionsStatus
postLaunchActionsStatus
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
sourceServerID