{-# 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.SSM.Types.AssociationStatus where
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
import Amazonka.SSM.Types.AssociationStatusName
data AssociationStatus = AssociationStatus'
{
AssociationStatus -> Maybe Text
additionalInfo :: Prelude.Maybe Prelude.Text,
AssociationStatus -> POSIX
date :: Core.POSIX,
AssociationStatus -> AssociationStatusName
name :: AssociationStatusName,
AssociationStatus -> Text
message :: Prelude.Text
}
deriving (AssociationStatus -> AssociationStatus -> Bool
(AssociationStatus -> AssociationStatus -> Bool)
-> (AssociationStatus -> AssociationStatus -> Bool)
-> Eq AssociationStatus
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: AssociationStatus -> AssociationStatus -> Bool
$c/= :: AssociationStatus -> AssociationStatus -> Bool
== :: AssociationStatus -> AssociationStatus -> Bool
$c== :: AssociationStatus -> AssociationStatus -> Bool
Prelude.Eq, ReadPrec [AssociationStatus]
ReadPrec AssociationStatus
Int -> ReadS AssociationStatus
ReadS [AssociationStatus]
(Int -> ReadS AssociationStatus)
-> ReadS [AssociationStatus]
-> ReadPrec AssociationStatus
-> ReadPrec [AssociationStatus]
-> Read AssociationStatus
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [AssociationStatus]
$creadListPrec :: ReadPrec [AssociationStatus]
readPrec :: ReadPrec AssociationStatus
$creadPrec :: ReadPrec AssociationStatus
readList :: ReadS [AssociationStatus]
$creadList :: ReadS [AssociationStatus]
readsPrec :: Int -> ReadS AssociationStatus
$creadsPrec :: Int -> ReadS AssociationStatus
Prelude.Read, Int -> AssociationStatus -> ShowS
[AssociationStatus] -> ShowS
AssociationStatus -> String
(Int -> AssociationStatus -> ShowS)
-> (AssociationStatus -> String)
-> ([AssociationStatus] -> ShowS)
-> Show AssociationStatus
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [AssociationStatus] -> ShowS
$cshowList :: [AssociationStatus] -> ShowS
show :: AssociationStatus -> String
$cshow :: AssociationStatus -> String
showsPrec :: Int -> AssociationStatus -> ShowS
$cshowsPrec :: Int -> AssociationStatus -> ShowS
Prelude.Show, (forall x. AssociationStatus -> Rep AssociationStatus x)
-> (forall x. Rep AssociationStatus x -> AssociationStatus)
-> Generic AssociationStatus
forall x. Rep AssociationStatus x -> AssociationStatus
forall x. AssociationStatus -> Rep AssociationStatus x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep AssociationStatus x -> AssociationStatus
$cfrom :: forall x. AssociationStatus -> Rep AssociationStatus x
Prelude.Generic)
newAssociationStatus ::
Prelude.UTCTime ->
AssociationStatusName ->
Prelude.Text ->
AssociationStatus
newAssociationStatus :: UTCTime -> AssociationStatusName -> Text -> AssociationStatus
newAssociationStatus UTCTime
pDate_ AssociationStatusName
pName_ Text
pMessage_ =
AssociationStatus' :: Maybe Text
-> POSIX -> AssociationStatusName -> Text -> AssociationStatus
AssociationStatus'
{ $sel:additionalInfo:AssociationStatus' :: Maybe Text
additionalInfo =
Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:date:AssociationStatus' :: POSIX
date = Tagged UTCTime (Identity UTCTime) -> Tagged POSIX (Identity POSIX)
forall (a :: Format). Iso' (Time a) UTCTime
Core._Time (Tagged UTCTime (Identity UTCTime)
-> Tagged POSIX (Identity POSIX))
-> UTCTime -> POSIX
forall t b. AReview t b -> b -> t
Lens.# UTCTime
pDate_,
$sel:name:AssociationStatus' :: AssociationStatusName
name = AssociationStatusName
pName_,
$sel:message:AssociationStatus' :: Text
message = Text
pMessage_
}
associationStatus_additionalInfo :: Lens.Lens' AssociationStatus (Prelude.Maybe Prelude.Text)
associationStatus_additionalInfo :: (Maybe Text -> f (Maybe Text))
-> AssociationStatus -> f AssociationStatus
associationStatus_additionalInfo = (AssociationStatus -> Maybe Text)
-> (AssociationStatus -> Maybe Text -> AssociationStatus)
-> Lens
AssociationStatus AssociationStatus (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AssociationStatus' {Maybe Text
additionalInfo :: Maybe Text
$sel:additionalInfo:AssociationStatus' :: AssociationStatus -> Maybe Text
additionalInfo} -> Maybe Text
additionalInfo) (\s :: AssociationStatus
s@AssociationStatus' {} Maybe Text
a -> AssociationStatus
s {$sel:additionalInfo:AssociationStatus' :: Maybe Text
additionalInfo = Maybe Text
a} :: AssociationStatus)
associationStatus_date :: Lens.Lens' AssociationStatus Prelude.UTCTime
associationStatus_date :: (UTCTime -> f UTCTime) -> AssociationStatus -> f AssociationStatus
associationStatus_date = (AssociationStatus -> POSIX)
-> (AssociationStatus -> POSIX -> AssociationStatus)
-> Lens AssociationStatus AssociationStatus POSIX POSIX
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AssociationStatus' {POSIX
date :: POSIX
$sel:date:AssociationStatus' :: AssociationStatus -> POSIX
date} -> POSIX
date) (\s :: AssociationStatus
s@AssociationStatus' {} POSIX
a -> AssociationStatus
s {$sel:date:AssociationStatus' :: POSIX
date = POSIX
a} :: AssociationStatus) ((POSIX -> f POSIX) -> AssociationStatus -> f AssociationStatus)
-> ((UTCTime -> f UTCTime) -> POSIX -> f POSIX)
-> (UTCTime -> f UTCTime)
-> AssociationStatus
-> f AssociationStatus
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. (UTCTime -> f UTCTime) -> POSIX -> f POSIX
forall (a :: Format). Iso' (Time a) UTCTime
Core._Time
associationStatus_name :: Lens.Lens' AssociationStatus AssociationStatusName
associationStatus_name :: (AssociationStatusName -> f AssociationStatusName)
-> AssociationStatus -> f AssociationStatus
associationStatus_name = (AssociationStatus -> AssociationStatusName)
-> (AssociationStatus
-> AssociationStatusName -> AssociationStatus)
-> Lens
AssociationStatus
AssociationStatus
AssociationStatusName
AssociationStatusName
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AssociationStatus' {AssociationStatusName
name :: AssociationStatusName
$sel:name:AssociationStatus' :: AssociationStatus -> AssociationStatusName
name} -> AssociationStatusName
name) (\s :: AssociationStatus
s@AssociationStatus' {} AssociationStatusName
a -> AssociationStatus
s {$sel:name:AssociationStatus' :: AssociationStatusName
name = AssociationStatusName
a} :: AssociationStatus)
associationStatus_message :: Lens.Lens' AssociationStatus Prelude.Text
associationStatus_message :: (Text -> f Text) -> AssociationStatus -> f AssociationStatus
associationStatus_message = (AssociationStatus -> Text)
-> (AssociationStatus -> Text -> AssociationStatus)
-> Lens AssociationStatus AssociationStatus Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AssociationStatus' {Text
message :: Text
$sel:message:AssociationStatus' :: AssociationStatus -> Text
message} -> Text
message) (\s :: AssociationStatus
s@AssociationStatus' {} Text
a -> AssociationStatus
s {$sel:message:AssociationStatus' :: Text
message = Text
a} :: AssociationStatus)
instance Core.FromJSON AssociationStatus where
parseJSON :: Value -> Parser AssociationStatus
parseJSON =
String
-> (Object -> Parser AssociationStatus)
-> Value
-> Parser AssociationStatus
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
String
"AssociationStatus"
( \Object
x ->
Maybe Text
-> POSIX -> AssociationStatusName -> Text -> AssociationStatus
AssociationStatus'
(Maybe Text
-> POSIX -> AssociationStatusName -> Text -> AssociationStatus)
-> Parser (Maybe Text)
-> Parser
(POSIX -> AssociationStatusName -> Text -> AssociationStatus)
forall (f :: * -> *) a b. Functor 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
"AdditionalInfo")
Parser
(POSIX -> AssociationStatusName -> Text -> AssociationStatus)
-> Parser POSIX
-> Parser (AssociationStatusName -> Text -> AssociationStatus)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser POSIX
forall a. FromJSON a => Object -> Text -> Parser a
Core..: Text
"Date")
Parser (AssociationStatusName -> Text -> AssociationStatus)
-> Parser AssociationStatusName
-> Parser (Text -> AssociationStatus)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser AssociationStatusName
forall a. FromJSON a => Object -> Text -> Parser a
Core..: Text
"Name")
Parser (Text -> AssociationStatus)
-> Parser Text -> Parser AssociationStatus
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser Text
forall a. FromJSON a => Object -> Text -> Parser a
Core..: Text
"Message")
)
instance Prelude.Hashable AssociationStatus
instance Prelude.NFData AssociationStatus
instance Core.ToJSON AssociationStatus where
toJSON :: AssociationStatus -> Value
toJSON AssociationStatus' {Maybe Text
Text
POSIX
AssociationStatusName
message :: Text
name :: AssociationStatusName
date :: POSIX
additionalInfo :: Maybe Text
$sel:message:AssociationStatus' :: AssociationStatus -> Text
$sel:name:AssociationStatus' :: AssociationStatus -> AssociationStatusName
$sel:date:AssociationStatus' :: AssociationStatus -> POSIX
$sel:additionalInfo:AssociationStatus' :: AssociationStatus -> Maybe Text
..} =
[Pair] -> Value
Core.object
( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ (Text
"AdditionalInfo" 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
additionalInfo,
Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"Date" Text -> POSIX -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= POSIX
date),
Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"Name" Text -> AssociationStatusName -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= AssociationStatusName
name),
Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"Message" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
message)
]
)