{-# 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.ECS.Types.ManagedAgentStateChange where
import qualified Amazonka.Core as Core
import Amazonka.ECS.Types.ManagedAgentName
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
data ManagedAgentStateChange = ManagedAgentStateChange'
{
ManagedAgentStateChange -> Maybe Text
reason :: Prelude.Maybe Prelude.Text,
ManagedAgentStateChange -> Text
containerName :: Prelude.Text,
ManagedAgentStateChange -> ManagedAgentName
managedAgentName :: ManagedAgentName,
ManagedAgentStateChange -> Text
status :: Prelude.Text
}
deriving (ManagedAgentStateChange -> ManagedAgentStateChange -> Bool
(ManagedAgentStateChange -> ManagedAgentStateChange -> Bool)
-> (ManagedAgentStateChange -> ManagedAgentStateChange -> Bool)
-> Eq ManagedAgentStateChange
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ManagedAgentStateChange -> ManagedAgentStateChange -> Bool
$c/= :: ManagedAgentStateChange -> ManagedAgentStateChange -> Bool
== :: ManagedAgentStateChange -> ManagedAgentStateChange -> Bool
$c== :: ManagedAgentStateChange -> ManagedAgentStateChange -> Bool
Prelude.Eq, ReadPrec [ManagedAgentStateChange]
ReadPrec ManagedAgentStateChange
Int -> ReadS ManagedAgentStateChange
ReadS [ManagedAgentStateChange]
(Int -> ReadS ManagedAgentStateChange)
-> ReadS [ManagedAgentStateChange]
-> ReadPrec ManagedAgentStateChange
-> ReadPrec [ManagedAgentStateChange]
-> Read ManagedAgentStateChange
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ManagedAgentStateChange]
$creadListPrec :: ReadPrec [ManagedAgentStateChange]
readPrec :: ReadPrec ManagedAgentStateChange
$creadPrec :: ReadPrec ManagedAgentStateChange
readList :: ReadS [ManagedAgentStateChange]
$creadList :: ReadS [ManagedAgentStateChange]
readsPrec :: Int -> ReadS ManagedAgentStateChange
$creadsPrec :: Int -> ReadS ManagedAgentStateChange
Prelude.Read, Int -> ManagedAgentStateChange -> ShowS
[ManagedAgentStateChange] -> ShowS
ManagedAgentStateChange -> String
(Int -> ManagedAgentStateChange -> ShowS)
-> (ManagedAgentStateChange -> String)
-> ([ManagedAgentStateChange] -> ShowS)
-> Show ManagedAgentStateChange
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ManagedAgentStateChange] -> ShowS
$cshowList :: [ManagedAgentStateChange] -> ShowS
show :: ManagedAgentStateChange -> String
$cshow :: ManagedAgentStateChange -> String
showsPrec :: Int -> ManagedAgentStateChange -> ShowS
$cshowsPrec :: Int -> ManagedAgentStateChange -> ShowS
Prelude.Show, (forall x.
ManagedAgentStateChange -> Rep ManagedAgentStateChange x)
-> (forall x.
Rep ManagedAgentStateChange x -> ManagedAgentStateChange)
-> Generic ManagedAgentStateChange
forall x. Rep ManagedAgentStateChange x -> ManagedAgentStateChange
forall x. ManagedAgentStateChange -> Rep ManagedAgentStateChange x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ManagedAgentStateChange x -> ManagedAgentStateChange
$cfrom :: forall x. ManagedAgentStateChange -> Rep ManagedAgentStateChange x
Prelude.Generic)
newManagedAgentStateChange ::
Prelude.Text ->
ManagedAgentName ->
Prelude.Text ->
ManagedAgentStateChange
newManagedAgentStateChange :: Text -> ManagedAgentName -> Text -> ManagedAgentStateChange
newManagedAgentStateChange
Text
pContainerName_
ManagedAgentName
pManagedAgentName_
Text
pStatus_ =
ManagedAgentStateChange' :: Maybe Text
-> Text -> ManagedAgentName -> Text -> ManagedAgentStateChange
ManagedAgentStateChange'
{ $sel:reason:ManagedAgentStateChange' :: Maybe Text
reason = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:containerName:ManagedAgentStateChange' :: Text
containerName = Text
pContainerName_,
$sel:managedAgentName:ManagedAgentStateChange' :: ManagedAgentName
managedAgentName = ManagedAgentName
pManagedAgentName_,
$sel:status:ManagedAgentStateChange' :: Text
status = Text
pStatus_
}
managedAgentStateChange_reason :: Lens.Lens' ManagedAgentStateChange (Prelude.Maybe Prelude.Text)
managedAgentStateChange_reason :: (Maybe Text -> f (Maybe Text))
-> ManagedAgentStateChange -> f ManagedAgentStateChange
managedAgentStateChange_reason = (ManagedAgentStateChange -> Maybe Text)
-> (ManagedAgentStateChange
-> Maybe Text -> ManagedAgentStateChange)
-> Lens
ManagedAgentStateChange
ManagedAgentStateChange
(Maybe Text)
(Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ManagedAgentStateChange' {Maybe Text
reason :: Maybe Text
$sel:reason:ManagedAgentStateChange' :: ManagedAgentStateChange -> Maybe Text
reason} -> Maybe Text
reason) (\s :: ManagedAgentStateChange
s@ManagedAgentStateChange' {} Maybe Text
a -> ManagedAgentStateChange
s {$sel:reason:ManagedAgentStateChange' :: Maybe Text
reason = Maybe Text
a} :: ManagedAgentStateChange)
managedAgentStateChange_containerName :: Lens.Lens' ManagedAgentStateChange Prelude.Text
managedAgentStateChange_containerName :: (Text -> f Text)
-> ManagedAgentStateChange -> f ManagedAgentStateChange
managedAgentStateChange_containerName = (ManagedAgentStateChange -> Text)
-> (ManagedAgentStateChange -> Text -> ManagedAgentStateChange)
-> Lens ManagedAgentStateChange ManagedAgentStateChange Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ManagedAgentStateChange' {Text
containerName :: Text
$sel:containerName:ManagedAgentStateChange' :: ManagedAgentStateChange -> Text
containerName} -> Text
containerName) (\s :: ManagedAgentStateChange
s@ManagedAgentStateChange' {} Text
a -> ManagedAgentStateChange
s {$sel:containerName:ManagedAgentStateChange' :: Text
containerName = Text
a} :: ManagedAgentStateChange)
managedAgentStateChange_managedAgentName :: Lens.Lens' ManagedAgentStateChange ManagedAgentName
managedAgentStateChange_managedAgentName :: (ManagedAgentName -> f ManagedAgentName)
-> ManagedAgentStateChange -> f ManagedAgentStateChange
managedAgentStateChange_managedAgentName = (ManagedAgentStateChange -> ManagedAgentName)
-> (ManagedAgentStateChange
-> ManagedAgentName -> ManagedAgentStateChange)
-> Lens
ManagedAgentStateChange
ManagedAgentStateChange
ManagedAgentName
ManagedAgentName
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ManagedAgentStateChange' {ManagedAgentName
managedAgentName :: ManagedAgentName
$sel:managedAgentName:ManagedAgentStateChange' :: ManagedAgentStateChange -> ManagedAgentName
managedAgentName} -> ManagedAgentName
managedAgentName) (\s :: ManagedAgentStateChange
s@ManagedAgentStateChange' {} ManagedAgentName
a -> ManagedAgentStateChange
s {$sel:managedAgentName:ManagedAgentStateChange' :: ManagedAgentName
managedAgentName = ManagedAgentName
a} :: ManagedAgentStateChange)
managedAgentStateChange_status :: Lens.Lens' ManagedAgentStateChange Prelude.Text
managedAgentStateChange_status :: (Text -> f Text)
-> ManagedAgentStateChange -> f ManagedAgentStateChange
managedAgentStateChange_status = (ManagedAgentStateChange -> Text)
-> (ManagedAgentStateChange -> Text -> ManagedAgentStateChange)
-> Lens ManagedAgentStateChange ManagedAgentStateChange Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ManagedAgentStateChange' {Text
status :: Text
$sel:status:ManagedAgentStateChange' :: ManagedAgentStateChange -> Text
status} -> Text
status) (\s :: ManagedAgentStateChange
s@ManagedAgentStateChange' {} Text
a -> ManagedAgentStateChange
s {$sel:status:ManagedAgentStateChange' :: Text
status = Text
a} :: ManagedAgentStateChange)
instance Prelude.Hashable ManagedAgentStateChange
instance Prelude.NFData ManagedAgentStateChange
instance Core.ToJSON ManagedAgentStateChange where
toJSON :: ManagedAgentStateChange -> Value
toJSON ManagedAgentStateChange' {Maybe Text
Text
ManagedAgentName
status :: Text
managedAgentName :: ManagedAgentName
containerName :: Text
reason :: Maybe Text
$sel:status:ManagedAgentStateChange' :: ManagedAgentStateChange -> Text
$sel:managedAgentName:ManagedAgentStateChange' :: ManagedAgentStateChange -> ManagedAgentName
$sel:containerName:ManagedAgentStateChange' :: ManagedAgentStateChange -> Text
$sel:reason:ManagedAgentStateChange' :: ManagedAgentStateChange -> Maybe Text
..} =
[Pair] -> Value
Core.object
( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ (Text
"reason" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (Text -> Pair) -> Maybe Text -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
reason,
Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"containerName" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
containerName),
Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just
(Text
"managedAgentName" Text -> ManagedAgentName -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= ManagedAgentName
managedAgentName),
Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"status" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
status)
]
)