{-# 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.InstanceAssociationOutputLocation where
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
import Amazonka.SSM.Types.S3OutputLocation
data InstanceAssociationOutputLocation = InstanceAssociationOutputLocation'
{
InstanceAssociationOutputLocation -> Maybe S3OutputLocation
s3Location :: Prelude.Maybe S3OutputLocation
}
deriving (InstanceAssociationOutputLocation
-> InstanceAssociationOutputLocation -> Bool
(InstanceAssociationOutputLocation
-> InstanceAssociationOutputLocation -> Bool)
-> (InstanceAssociationOutputLocation
-> InstanceAssociationOutputLocation -> Bool)
-> Eq InstanceAssociationOutputLocation
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: InstanceAssociationOutputLocation
-> InstanceAssociationOutputLocation -> Bool
$c/= :: InstanceAssociationOutputLocation
-> InstanceAssociationOutputLocation -> Bool
== :: InstanceAssociationOutputLocation
-> InstanceAssociationOutputLocation -> Bool
$c== :: InstanceAssociationOutputLocation
-> InstanceAssociationOutputLocation -> Bool
Prelude.Eq, ReadPrec [InstanceAssociationOutputLocation]
ReadPrec InstanceAssociationOutputLocation
Int -> ReadS InstanceAssociationOutputLocation
ReadS [InstanceAssociationOutputLocation]
(Int -> ReadS InstanceAssociationOutputLocation)
-> ReadS [InstanceAssociationOutputLocation]
-> ReadPrec InstanceAssociationOutputLocation
-> ReadPrec [InstanceAssociationOutputLocation]
-> Read InstanceAssociationOutputLocation
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [InstanceAssociationOutputLocation]
$creadListPrec :: ReadPrec [InstanceAssociationOutputLocation]
readPrec :: ReadPrec InstanceAssociationOutputLocation
$creadPrec :: ReadPrec InstanceAssociationOutputLocation
readList :: ReadS [InstanceAssociationOutputLocation]
$creadList :: ReadS [InstanceAssociationOutputLocation]
readsPrec :: Int -> ReadS InstanceAssociationOutputLocation
$creadsPrec :: Int -> ReadS InstanceAssociationOutputLocation
Prelude.Read, Int -> InstanceAssociationOutputLocation -> ShowS
[InstanceAssociationOutputLocation] -> ShowS
InstanceAssociationOutputLocation -> String
(Int -> InstanceAssociationOutputLocation -> ShowS)
-> (InstanceAssociationOutputLocation -> String)
-> ([InstanceAssociationOutputLocation] -> ShowS)
-> Show InstanceAssociationOutputLocation
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [InstanceAssociationOutputLocation] -> ShowS
$cshowList :: [InstanceAssociationOutputLocation] -> ShowS
show :: InstanceAssociationOutputLocation -> String
$cshow :: InstanceAssociationOutputLocation -> String
showsPrec :: Int -> InstanceAssociationOutputLocation -> ShowS
$cshowsPrec :: Int -> InstanceAssociationOutputLocation -> ShowS
Prelude.Show, (forall x.
InstanceAssociationOutputLocation
-> Rep InstanceAssociationOutputLocation x)
-> (forall x.
Rep InstanceAssociationOutputLocation x
-> InstanceAssociationOutputLocation)
-> Generic InstanceAssociationOutputLocation
forall x.
Rep InstanceAssociationOutputLocation x
-> InstanceAssociationOutputLocation
forall x.
InstanceAssociationOutputLocation
-> Rep InstanceAssociationOutputLocation x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep InstanceAssociationOutputLocation x
-> InstanceAssociationOutputLocation
$cfrom :: forall x.
InstanceAssociationOutputLocation
-> Rep InstanceAssociationOutputLocation x
Prelude.Generic)
newInstanceAssociationOutputLocation ::
InstanceAssociationOutputLocation
newInstanceAssociationOutputLocation :: InstanceAssociationOutputLocation
newInstanceAssociationOutputLocation =
InstanceAssociationOutputLocation' :: Maybe S3OutputLocation -> InstanceAssociationOutputLocation
InstanceAssociationOutputLocation'
{ $sel:s3Location:InstanceAssociationOutputLocation' :: Maybe S3OutputLocation
s3Location =
Maybe S3OutputLocation
forall a. Maybe a
Prelude.Nothing
}
instanceAssociationOutputLocation_s3Location :: Lens.Lens' InstanceAssociationOutputLocation (Prelude.Maybe S3OutputLocation)
instanceAssociationOutputLocation_s3Location :: (Maybe S3OutputLocation -> f (Maybe S3OutputLocation))
-> InstanceAssociationOutputLocation
-> f InstanceAssociationOutputLocation
instanceAssociationOutputLocation_s3Location = (InstanceAssociationOutputLocation -> Maybe S3OutputLocation)
-> (InstanceAssociationOutputLocation
-> Maybe S3OutputLocation -> InstanceAssociationOutputLocation)
-> Lens
InstanceAssociationOutputLocation
InstanceAssociationOutputLocation
(Maybe S3OutputLocation)
(Maybe S3OutputLocation)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\InstanceAssociationOutputLocation' {Maybe S3OutputLocation
s3Location :: Maybe S3OutputLocation
$sel:s3Location:InstanceAssociationOutputLocation' :: InstanceAssociationOutputLocation -> Maybe S3OutputLocation
s3Location} -> Maybe S3OutputLocation
s3Location) (\s :: InstanceAssociationOutputLocation
s@InstanceAssociationOutputLocation' {} Maybe S3OutputLocation
a -> InstanceAssociationOutputLocation
s {$sel:s3Location:InstanceAssociationOutputLocation' :: Maybe S3OutputLocation
s3Location = Maybe S3OutputLocation
a} :: InstanceAssociationOutputLocation)
instance
Core.FromJSON
InstanceAssociationOutputLocation
where
parseJSON :: Value -> Parser InstanceAssociationOutputLocation
parseJSON =
String
-> (Object -> Parser InstanceAssociationOutputLocation)
-> Value
-> Parser InstanceAssociationOutputLocation
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
String
"InstanceAssociationOutputLocation"
( \Object
x ->
Maybe S3OutputLocation -> InstanceAssociationOutputLocation
InstanceAssociationOutputLocation'
(Maybe S3OutputLocation -> InstanceAssociationOutputLocation)
-> Parser (Maybe S3OutputLocation)
-> Parser InstanceAssociationOutputLocation
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Parser (Maybe S3OutputLocation)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"S3Location")
)
instance
Prelude.Hashable
InstanceAssociationOutputLocation
instance
Prelude.NFData
InstanceAssociationOutputLocation
instance
Core.ToJSON
InstanceAssociationOutputLocation
where
toJSON :: InstanceAssociationOutputLocation -> Value
toJSON InstanceAssociationOutputLocation' {Maybe S3OutputLocation
s3Location :: Maybe S3OutputLocation
$sel:s3Location:InstanceAssociationOutputLocation' :: InstanceAssociationOutputLocation -> Maybe S3OutputLocation
..} =
[Pair] -> Value
Core.object
( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
[(Text
"S3Location" Text -> S3OutputLocation -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (S3OutputLocation -> Pair) -> Maybe S3OutputLocation -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe S3OutputLocation
s3Location]
)