{-# 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.InstanceAssociation where
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
data InstanceAssociation = InstanceAssociation'
{
InstanceAssociation -> Maybe Text
associationId :: Prelude.Maybe Prelude.Text,
InstanceAssociation -> Maybe Text
instanceId :: Prelude.Maybe Prelude.Text,
InstanceAssociation -> Maybe Text
content :: Prelude.Maybe Prelude.Text,
InstanceAssociation -> Maybe Text
associationVersion :: Prelude.Maybe Prelude.Text
}
deriving (InstanceAssociation -> InstanceAssociation -> Bool
(InstanceAssociation -> InstanceAssociation -> Bool)
-> (InstanceAssociation -> InstanceAssociation -> Bool)
-> Eq InstanceAssociation
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: InstanceAssociation -> InstanceAssociation -> Bool
$c/= :: InstanceAssociation -> InstanceAssociation -> Bool
== :: InstanceAssociation -> InstanceAssociation -> Bool
$c== :: InstanceAssociation -> InstanceAssociation -> Bool
Prelude.Eq, ReadPrec [InstanceAssociation]
ReadPrec InstanceAssociation
Int -> ReadS InstanceAssociation
ReadS [InstanceAssociation]
(Int -> ReadS InstanceAssociation)
-> ReadS [InstanceAssociation]
-> ReadPrec InstanceAssociation
-> ReadPrec [InstanceAssociation]
-> Read InstanceAssociation
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [InstanceAssociation]
$creadListPrec :: ReadPrec [InstanceAssociation]
readPrec :: ReadPrec InstanceAssociation
$creadPrec :: ReadPrec InstanceAssociation
readList :: ReadS [InstanceAssociation]
$creadList :: ReadS [InstanceAssociation]
readsPrec :: Int -> ReadS InstanceAssociation
$creadsPrec :: Int -> ReadS InstanceAssociation
Prelude.Read, Int -> InstanceAssociation -> ShowS
[InstanceAssociation] -> ShowS
InstanceAssociation -> String
(Int -> InstanceAssociation -> ShowS)
-> (InstanceAssociation -> String)
-> ([InstanceAssociation] -> ShowS)
-> Show InstanceAssociation
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [InstanceAssociation] -> ShowS
$cshowList :: [InstanceAssociation] -> ShowS
show :: InstanceAssociation -> String
$cshow :: InstanceAssociation -> String
showsPrec :: Int -> InstanceAssociation -> ShowS
$cshowsPrec :: Int -> InstanceAssociation -> ShowS
Prelude.Show, (forall x. InstanceAssociation -> Rep InstanceAssociation x)
-> (forall x. Rep InstanceAssociation x -> InstanceAssociation)
-> Generic InstanceAssociation
forall x. Rep InstanceAssociation x -> InstanceAssociation
forall x. InstanceAssociation -> Rep InstanceAssociation x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep InstanceAssociation x -> InstanceAssociation
$cfrom :: forall x. InstanceAssociation -> Rep InstanceAssociation x
Prelude.Generic)
newInstanceAssociation ::
InstanceAssociation
newInstanceAssociation :: InstanceAssociation
newInstanceAssociation =
InstanceAssociation' :: Maybe Text
-> Maybe Text -> Maybe Text -> Maybe Text -> InstanceAssociation
InstanceAssociation'
{ $sel:associationId:InstanceAssociation' :: Maybe Text
associationId =
Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:instanceId:InstanceAssociation' :: Maybe Text
instanceId = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:content:InstanceAssociation' :: Maybe Text
content = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:associationVersion:InstanceAssociation' :: Maybe Text
associationVersion = Maybe Text
forall a. Maybe a
Prelude.Nothing
}
instanceAssociation_associationId :: Lens.Lens' InstanceAssociation (Prelude.Maybe Prelude.Text)
instanceAssociation_associationId :: (Maybe Text -> f (Maybe Text))
-> InstanceAssociation -> f InstanceAssociation
instanceAssociation_associationId = (InstanceAssociation -> Maybe Text)
-> (InstanceAssociation -> Maybe Text -> InstanceAssociation)
-> Lens
InstanceAssociation InstanceAssociation (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\InstanceAssociation' {Maybe Text
associationId :: Maybe Text
$sel:associationId:InstanceAssociation' :: InstanceAssociation -> Maybe Text
associationId} -> Maybe Text
associationId) (\s :: InstanceAssociation
s@InstanceAssociation' {} Maybe Text
a -> InstanceAssociation
s {$sel:associationId:InstanceAssociation' :: Maybe Text
associationId = Maybe Text
a} :: InstanceAssociation)
instanceAssociation_instanceId :: Lens.Lens' InstanceAssociation (Prelude.Maybe Prelude.Text)
instanceAssociation_instanceId :: (Maybe Text -> f (Maybe Text))
-> InstanceAssociation -> f InstanceAssociation
instanceAssociation_instanceId = (InstanceAssociation -> Maybe Text)
-> (InstanceAssociation -> Maybe Text -> InstanceAssociation)
-> Lens
InstanceAssociation InstanceAssociation (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\InstanceAssociation' {Maybe Text
instanceId :: Maybe Text
$sel:instanceId:InstanceAssociation' :: InstanceAssociation -> Maybe Text
instanceId} -> Maybe Text
instanceId) (\s :: InstanceAssociation
s@InstanceAssociation' {} Maybe Text
a -> InstanceAssociation
s {$sel:instanceId:InstanceAssociation' :: Maybe Text
instanceId = Maybe Text
a} :: InstanceAssociation)
instanceAssociation_content :: Lens.Lens' InstanceAssociation (Prelude.Maybe Prelude.Text)
instanceAssociation_content :: (Maybe Text -> f (Maybe Text))
-> InstanceAssociation -> f InstanceAssociation
instanceAssociation_content = (InstanceAssociation -> Maybe Text)
-> (InstanceAssociation -> Maybe Text -> InstanceAssociation)
-> Lens
InstanceAssociation InstanceAssociation (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\InstanceAssociation' {Maybe Text
content :: Maybe Text
$sel:content:InstanceAssociation' :: InstanceAssociation -> Maybe Text
content} -> Maybe Text
content) (\s :: InstanceAssociation
s@InstanceAssociation' {} Maybe Text
a -> InstanceAssociation
s {$sel:content:InstanceAssociation' :: Maybe Text
content = Maybe Text
a} :: InstanceAssociation)
instanceAssociation_associationVersion :: Lens.Lens' InstanceAssociation (Prelude.Maybe Prelude.Text)
instanceAssociation_associationVersion :: (Maybe Text -> f (Maybe Text))
-> InstanceAssociation -> f InstanceAssociation
instanceAssociation_associationVersion = (InstanceAssociation -> Maybe Text)
-> (InstanceAssociation -> Maybe Text -> InstanceAssociation)
-> Lens
InstanceAssociation InstanceAssociation (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\InstanceAssociation' {Maybe Text
associationVersion :: Maybe Text
$sel:associationVersion:InstanceAssociation' :: InstanceAssociation -> Maybe Text
associationVersion} -> Maybe Text
associationVersion) (\s :: InstanceAssociation
s@InstanceAssociation' {} Maybe Text
a -> InstanceAssociation
s {$sel:associationVersion:InstanceAssociation' :: Maybe Text
associationVersion = Maybe Text
a} :: InstanceAssociation)
instance Core.FromJSON InstanceAssociation where
parseJSON :: Value -> Parser InstanceAssociation
parseJSON =
String
-> (Object -> Parser InstanceAssociation)
-> Value
-> Parser InstanceAssociation
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
String
"InstanceAssociation"
( \Object
x ->
Maybe Text
-> Maybe Text -> Maybe Text -> Maybe Text -> InstanceAssociation
InstanceAssociation'
(Maybe Text
-> Maybe Text -> Maybe Text -> Maybe Text -> InstanceAssociation)
-> Parser (Maybe Text)
-> Parser
(Maybe Text -> Maybe Text -> Maybe Text -> InstanceAssociation)
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
"AssociationId")
Parser
(Maybe Text -> Maybe Text -> Maybe Text -> InstanceAssociation)
-> Parser (Maybe Text)
-> Parser (Maybe Text -> Maybe Text -> InstanceAssociation)
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
"InstanceId")
Parser (Maybe Text -> Maybe Text -> InstanceAssociation)
-> Parser (Maybe Text)
-> Parser (Maybe Text -> InstanceAssociation)
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
"Content")
Parser (Maybe Text -> InstanceAssociation)
-> Parser (Maybe Text) -> Parser InstanceAssociation
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
"AssociationVersion")
)
instance Prelude.Hashable InstanceAssociation
instance Prelude.NFData InstanceAssociation