{-# 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.Association where
import qualified Amazonka.Core as Core
import qualified Amazonka.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
import qualified Amazonka.Prelude as Prelude
import Amazonka.SSM.Types.AssociationOverview
import Amazonka.SSM.Types.Target
data Association = Association'
{
Association -> Maybe Text
associationId :: Prelude.Maybe Prelude.Text,
Association -> Maybe Text
associationName :: Prelude.Maybe Prelude.Text,
Association -> Maybe Text
associationVersion :: Prelude.Maybe Prelude.Text,
Association -> Maybe Text
documentVersion :: Prelude.Maybe Prelude.Text,
Association -> Maybe Text
instanceId :: Prelude.Maybe Prelude.Text,
Association -> Maybe POSIX
lastExecutionDate :: Prelude.Maybe Data.POSIX,
Association -> Maybe Text
name :: Prelude.Maybe Prelude.Text,
Association -> Maybe AssociationOverview
overview :: Prelude.Maybe AssociationOverview,
Association -> Maybe Text
scheduleExpression :: Prelude.Maybe Prelude.Text,
Association -> Maybe Natural
scheduleOffset :: Prelude.Maybe Prelude.Natural,
Association -> Maybe [HashMap Text [Text]]
targetMaps :: Prelude.Maybe [Prelude.HashMap Prelude.Text [Prelude.Text]],
Association -> Maybe [Target]
targets :: Prelude.Maybe [Target]
}
deriving (Association -> Association -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: Association -> Association -> Bool
$c/= :: Association -> Association -> Bool
== :: Association -> Association -> Bool
$c== :: Association -> Association -> Bool
Prelude.Eq, ReadPrec [Association]
ReadPrec Association
Int -> ReadS Association
ReadS [Association]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [Association]
$creadListPrec :: ReadPrec [Association]
readPrec :: ReadPrec Association
$creadPrec :: ReadPrec Association
readList :: ReadS [Association]
$creadList :: ReadS [Association]
readsPrec :: Int -> ReadS Association
$creadsPrec :: Int -> ReadS Association
Prelude.Read, Int -> Association -> ShowS
[Association] -> ShowS
Association -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [Association] -> ShowS
$cshowList :: [Association] -> ShowS
show :: Association -> String
$cshow :: Association -> String
showsPrec :: Int -> Association -> ShowS
$cshowsPrec :: Int -> Association -> ShowS
Prelude.Show, forall x. Rep Association x -> Association
forall x. Association -> Rep Association x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep Association x -> Association
$cfrom :: forall x. Association -> Rep Association x
Prelude.Generic)
newAssociation ::
Association
newAssociation :: Association
newAssociation =
Association'
{ $sel:associationId:Association' :: Maybe Text
associationId = forall a. Maybe a
Prelude.Nothing,
$sel:associationName:Association' :: Maybe Text
associationName = forall a. Maybe a
Prelude.Nothing,
$sel:associationVersion:Association' :: Maybe Text
associationVersion = forall a. Maybe a
Prelude.Nothing,
$sel:documentVersion:Association' :: Maybe Text
documentVersion = forall a. Maybe a
Prelude.Nothing,
$sel:instanceId:Association' :: Maybe Text
instanceId = forall a. Maybe a
Prelude.Nothing,
$sel:lastExecutionDate:Association' :: Maybe POSIX
lastExecutionDate = forall a. Maybe a
Prelude.Nothing,
$sel:name:Association' :: Maybe Text
name = forall a. Maybe a
Prelude.Nothing,
$sel:overview:Association' :: Maybe AssociationOverview
overview = forall a. Maybe a
Prelude.Nothing,
$sel:scheduleExpression:Association' :: Maybe Text
scheduleExpression = forall a. Maybe a
Prelude.Nothing,
$sel:scheduleOffset:Association' :: Maybe Natural
scheduleOffset = forall a. Maybe a
Prelude.Nothing,
$sel:targetMaps:Association' :: Maybe [HashMap Text [Text]]
targetMaps = forall a. Maybe a
Prelude.Nothing,
$sel:targets:Association' :: Maybe [Target]
targets = forall a. Maybe a
Prelude.Nothing
}
association_associationId :: Lens.Lens' Association (Prelude.Maybe Prelude.Text)
association_associationId :: Lens' Association (Maybe Text)
association_associationId = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Association' {Maybe Text
associationId :: Maybe Text
$sel:associationId:Association' :: Association -> Maybe Text
associationId} -> Maybe Text
associationId) (\s :: Association
s@Association' {} Maybe Text
a -> Association
s {$sel:associationId:Association' :: Maybe Text
associationId = Maybe Text
a} :: Association)
association_associationName :: Lens.Lens' Association (Prelude.Maybe Prelude.Text)
association_associationName :: Lens' Association (Maybe Text)
association_associationName = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Association' {Maybe Text
associationName :: Maybe Text
$sel:associationName:Association' :: Association -> Maybe Text
associationName} -> Maybe Text
associationName) (\s :: Association
s@Association' {} Maybe Text
a -> Association
s {$sel:associationName:Association' :: Maybe Text
associationName = Maybe Text
a} :: Association)
association_associationVersion :: Lens.Lens' Association (Prelude.Maybe Prelude.Text)
association_associationVersion :: Lens' Association (Maybe Text)
association_associationVersion = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Association' {Maybe Text
associationVersion :: Maybe Text
$sel:associationVersion:Association' :: Association -> Maybe Text
associationVersion} -> Maybe Text
associationVersion) (\s :: Association
s@Association' {} Maybe Text
a -> Association
s {$sel:associationVersion:Association' :: Maybe Text
associationVersion = Maybe Text
a} :: Association)
association_documentVersion :: Lens.Lens' Association (Prelude.Maybe Prelude.Text)
association_documentVersion :: Lens' Association (Maybe Text)
association_documentVersion = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Association' {Maybe Text
documentVersion :: Maybe Text
$sel:documentVersion:Association' :: Association -> Maybe Text
documentVersion} -> Maybe Text
documentVersion) (\s :: Association
s@Association' {} Maybe Text
a -> Association
s {$sel:documentVersion:Association' :: Maybe Text
documentVersion = Maybe Text
a} :: Association)
association_instanceId :: Lens.Lens' Association (Prelude.Maybe Prelude.Text)
association_instanceId :: Lens' Association (Maybe Text)
association_instanceId = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Association' {Maybe Text
instanceId :: Maybe Text
$sel:instanceId:Association' :: Association -> Maybe Text
instanceId} -> Maybe Text
instanceId) (\s :: Association
s@Association' {} Maybe Text
a -> Association
s {$sel:instanceId:Association' :: Maybe Text
instanceId = Maybe Text
a} :: Association)
association_lastExecutionDate :: Lens.Lens' Association (Prelude.Maybe Prelude.UTCTime)
association_lastExecutionDate :: Lens' Association (Maybe UTCTime)
association_lastExecutionDate = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Association' {Maybe POSIX
lastExecutionDate :: Maybe POSIX
$sel:lastExecutionDate:Association' :: Association -> Maybe POSIX
lastExecutionDate} -> Maybe POSIX
lastExecutionDate) (\s :: Association
s@Association' {} Maybe POSIX
a -> Association
s {$sel:lastExecutionDate:Association' :: Maybe POSIX
lastExecutionDate = Maybe POSIX
a} :: Association) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. 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 forall (a :: Format). Iso' (Time a) UTCTime
Data._Time
association_name :: Lens.Lens' Association (Prelude.Maybe Prelude.Text)
association_name :: Lens' Association (Maybe Text)
association_name = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Association' {Maybe Text
name :: Maybe Text
$sel:name:Association' :: Association -> Maybe Text
name} -> Maybe Text
name) (\s :: Association
s@Association' {} Maybe Text
a -> Association
s {$sel:name:Association' :: Maybe Text
name = Maybe Text
a} :: Association)
association_overview :: Lens.Lens' Association (Prelude.Maybe AssociationOverview)
association_overview :: Lens' Association (Maybe AssociationOverview)
association_overview = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Association' {Maybe AssociationOverview
overview :: Maybe AssociationOverview
$sel:overview:Association' :: Association -> Maybe AssociationOverview
overview} -> Maybe AssociationOverview
overview) (\s :: Association
s@Association' {} Maybe AssociationOverview
a -> Association
s {$sel:overview:Association' :: Maybe AssociationOverview
overview = Maybe AssociationOverview
a} :: Association)
association_scheduleExpression :: Lens.Lens' Association (Prelude.Maybe Prelude.Text)
association_scheduleExpression :: Lens' Association (Maybe Text)
association_scheduleExpression = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Association' {Maybe Text
scheduleExpression :: Maybe Text
$sel:scheduleExpression:Association' :: Association -> Maybe Text
scheduleExpression} -> Maybe Text
scheduleExpression) (\s :: Association
s@Association' {} Maybe Text
a -> Association
s {$sel:scheduleExpression:Association' :: Maybe Text
scheduleExpression = Maybe Text
a} :: Association)
association_scheduleOffset :: Lens.Lens' Association (Prelude.Maybe Prelude.Natural)
association_scheduleOffset :: Lens' Association (Maybe Natural)
association_scheduleOffset = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Association' {Maybe Natural
scheduleOffset :: Maybe Natural
$sel:scheduleOffset:Association' :: Association -> Maybe Natural
scheduleOffset} -> Maybe Natural
scheduleOffset) (\s :: Association
s@Association' {} Maybe Natural
a -> Association
s {$sel:scheduleOffset:Association' :: Maybe Natural
scheduleOffset = Maybe Natural
a} :: Association)
association_targetMaps :: Lens.Lens' Association (Prelude.Maybe [Prelude.HashMap Prelude.Text [Prelude.Text]])
association_targetMaps :: Lens' Association (Maybe [HashMap Text [Text]])
association_targetMaps = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Association' {Maybe [HashMap Text [Text]]
targetMaps :: Maybe [HashMap Text [Text]]
$sel:targetMaps:Association' :: Association -> Maybe [HashMap Text [Text]]
targetMaps} -> Maybe [HashMap Text [Text]]
targetMaps) (\s :: Association
s@Association' {} Maybe [HashMap Text [Text]]
a -> Association
s {$sel:targetMaps:Association' :: Maybe [HashMap Text [Text]]
targetMaps = Maybe [HashMap Text [Text]]
a} :: Association) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. 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 forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced
association_targets :: Lens.Lens' Association (Prelude.Maybe [Target])
association_targets :: Lens' Association (Maybe [Target])
association_targets = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Association' {Maybe [Target]
targets :: Maybe [Target]
$sel:targets:Association' :: Association -> Maybe [Target]
targets} -> Maybe [Target]
targets) (\s :: Association
s@Association' {} Maybe [Target]
a -> Association
s {$sel:targets:Association' :: Maybe [Target]
targets = Maybe [Target]
a} :: Association) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. 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 forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced
instance Data.FromJSON Association where
parseJSON :: Value -> Parser Association
parseJSON =
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
String
"Association"
( \Object
x ->
Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe POSIX
-> Maybe Text
-> Maybe AssociationOverview
-> Maybe Text
-> Maybe Natural
-> Maybe [HashMap Text [Text]]
-> Maybe [Target]
-> Association
Association'
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
"AssociationId")
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
"AssociationName")
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
"AssociationVersion")
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
"DocumentVersion")
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
"InstanceId")
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
"LastExecutionDate")
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
"Name")
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
"Overview")
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
"ScheduleExpression")
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
"ScheduleOffset")
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
"TargetMaps" forall a. Parser (Maybe a) -> a -> Parser a
Data..!= forall a. Monoid a => a
Prelude.mempty)
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
"Targets" forall a. Parser (Maybe a) -> a -> Parser a
Data..!= forall a. Monoid a => a
Prelude.mempty)
)
instance Prelude.Hashable Association where
hashWithSalt :: Int -> Association -> Int
hashWithSalt Int
_salt Association' {Maybe Natural
Maybe [HashMap Text [Text]]
Maybe [Target]
Maybe Text
Maybe POSIX
Maybe AssociationOverview
targets :: Maybe [Target]
targetMaps :: Maybe [HashMap Text [Text]]
scheduleOffset :: Maybe Natural
scheduleExpression :: Maybe Text
overview :: Maybe AssociationOverview
name :: Maybe Text
lastExecutionDate :: Maybe POSIX
instanceId :: Maybe Text
documentVersion :: Maybe Text
associationVersion :: Maybe Text
associationName :: Maybe Text
associationId :: Maybe Text
$sel:targets:Association' :: Association -> Maybe [Target]
$sel:targetMaps:Association' :: Association -> Maybe [HashMap Text [Text]]
$sel:scheduleOffset:Association' :: Association -> Maybe Natural
$sel:scheduleExpression:Association' :: Association -> Maybe Text
$sel:overview:Association' :: Association -> Maybe AssociationOverview
$sel:name:Association' :: Association -> Maybe Text
$sel:lastExecutionDate:Association' :: Association -> Maybe POSIX
$sel:instanceId:Association' :: Association -> Maybe Text
$sel:documentVersion:Association' :: Association -> Maybe Text
$sel:associationVersion:Association' :: Association -> Maybe Text
$sel:associationName:Association' :: Association -> Maybe Text
$sel:associationId:Association' :: Association -> Maybe Text
..} =
Int
_salt
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
associationId
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
associationName
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
associationVersion
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
documentVersion
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
instanceId
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe POSIX
lastExecutionDate
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
name
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe AssociationOverview
overview
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
scheduleExpression
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Natural
scheduleOffset
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe [HashMap Text [Text]]
targetMaps
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe [Target]
targets
instance Prelude.NFData Association where
rnf :: Association -> ()
rnf Association' {Maybe Natural
Maybe [HashMap Text [Text]]
Maybe [Target]
Maybe Text
Maybe POSIX
Maybe AssociationOverview
targets :: Maybe [Target]
targetMaps :: Maybe [HashMap Text [Text]]
scheduleOffset :: Maybe Natural
scheduleExpression :: Maybe Text
overview :: Maybe AssociationOverview
name :: Maybe Text
lastExecutionDate :: Maybe POSIX
instanceId :: Maybe Text
documentVersion :: Maybe Text
associationVersion :: Maybe Text
associationName :: Maybe Text
associationId :: Maybe Text
$sel:targets:Association' :: Association -> Maybe [Target]
$sel:targetMaps:Association' :: Association -> Maybe [HashMap Text [Text]]
$sel:scheduleOffset:Association' :: Association -> Maybe Natural
$sel:scheduleExpression:Association' :: Association -> Maybe Text
$sel:overview:Association' :: Association -> Maybe AssociationOverview
$sel:name:Association' :: Association -> Maybe Text
$sel:lastExecutionDate:Association' :: Association -> Maybe POSIX
$sel:instanceId:Association' :: Association -> Maybe Text
$sel:documentVersion:Association' :: Association -> Maybe Text
$sel:associationVersion:Association' :: Association -> Maybe Text
$sel:associationName:Association' :: Association -> Maybe Text
$sel:associationId:Association' :: Association -> Maybe Text
..} =
forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
associationId
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
associationName
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
associationVersion
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
documentVersion
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
instanceId
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe POSIX
lastExecutionDate
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
name
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe AssociationOverview
overview
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
scheduleExpression
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Natural
scheduleOffset
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe [HashMap Text [Text]]
targetMaps
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe [Target]
targets