{-# 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.OutputSource where
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
data OutputSource = OutputSource'
{
OutputSource -> Maybe Text
outputSourceId :: Prelude.Maybe Prelude.Text,
OutputSource -> Maybe Text
outputSourceType :: Prelude.Maybe Prelude.Text
}
deriving (OutputSource -> OutputSource -> Bool
(OutputSource -> OutputSource -> Bool)
-> (OutputSource -> OutputSource -> Bool) -> Eq OutputSource
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: OutputSource -> OutputSource -> Bool
$c/= :: OutputSource -> OutputSource -> Bool
== :: OutputSource -> OutputSource -> Bool
$c== :: OutputSource -> OutputSource -> Bool
Prelude.Eq, ReadPrec [OutputSource]
ReadPrec OutputSource
Int -> ReadS OutputSource
ReadS [OutputSource]
(Int -> ReadS OutputSource)
-> ReadS [OutputSource]
-> ReadPrec OutputSource
-> ReadPrec [OutputSource]
-> Read OutputSource
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [OutputSource]
$creadListPrec :: ReadPrec [OutputSource]
readPrec :: ReadPrec OutputSource
$creadPrec :: ReadPrec OutputSource
readList :: ReadS [OutputSource]
$creadList :: ReadS [OutputSource]
readsPrec :: Int -> ReadS OutputSource
$creadsPrec :: Int -> ReadS OutputSource
Prelude.Read, Int -> OutputSource -> ShowS
[OutputSource] -> ShowS
OutputSource -> String
(Int -> OutputSource -> ShowS)
-> (OutputSource -> String)
-> ([OutputSource] -> ShowS)
-> Show OutputSource
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [OutputSource] -> ShowS
$cshowList :: [OutputSource] -> ShowS
show :: OutputSource -> String
$cshow :: OutputSource -> String
showsPrec :: Int -> OutputSource -> ShowS
$cshowsPrec :: Int -> OutputSource -> ShowS
Prelude.Show, (forall x. OutputSource -> Rep OutputSource x)
-> (forall x. Rep OutputSource x -> OutputSource)
-> Generic OutputSource
forall x. Rep OutputSource x -> OutputSource
forall x. OutputSource -> Rep OutputSource x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep OutputSource x -> OutputSource
$cfrom :: forall x. OutputSource -> Rep OutputSource x
Prelude.Generic)
newOutputSource ::
OutputSource
newOutputSource :: OutputSource
newOutputSource =
OutputSource' :: Maybe Text -> Maybe Text -> OutputSource
OutputSource'
{ $sel:outputSourceId:OutputSource' :: Maybe Text
outputSourceId = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:outputSourceType:OutputSource' :: Maybe Text
outputSourceType = Maybe Text
forall a. Maybe a
Prelude.Nothing
}
outputSource_outputSourceId :: Lens.Lens' OutputSource (Prelude.Maybe Prelude.Text)
outputSource_outputSourceId :: (Maybe Text -> f (Maybe Text)) -> OutputSource -> f OutputSource
outputSource_outputSourceId = (OutputSource -> Maybe Text)
-> (OutputSource -> Maybe Text -> OutputSource)
-> Lens OutputSource OutputSource (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\OutputSource' {Maybe Text
outputSourceId :: Maybe Text
$sel:outputSourceId:OutputSource' :: OutputSource -> Maybe Text
outputSourceId} -> Maybe Text
outputSourceId) (\s :: OutputSource
s@OutputSource' {} Maybe Text
a -> OutputSource
s {$sel:outputSourceId:OutputSource' :: Maybe Text
outputSourceId = Maybe Text
a} :: OutputSource)
outputSource_outputSourceType :: Lens.Lens' OutputSource (Prelude.Maybe Prelude.Text)
outputSource_outputSourceType :: (Maybe Text -> f (Maybe Text)) -> OutputSource -> f OutputSource
outputSource_outputSourceType = (OutputSource -> Maybe Text)
-> (OutputSource -> Maybe Text -> OutputSource)
-> Lens OutputSource OutputSource (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\OutputSource' {Maybe Text
outputSourceType :: Maybe Text
$sel:outputSourceType:OutputSource' :: OutputSource -> Maybe Text
outputSourceType} -> Maybe Text
outputSourceType) (\s :: OutputSource
s@OutputSource' {} Maybe Text
a -> OutputSource
s {$sel:outputSourceType:OutputSource' :: Maybe Text
outputSourceType = Maybe Text
a} :: OutputSource)
instance Core.FromJSON OutputSource where
parseJSON :: Value -> Parser OutputSource
parseJSON =
String
-> (Object -> Parser OutputSource) -> Value -> Parser OutputSource
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
String
"OutputSource"
( \Object
x ->
Maybe Text -> Maybe Text -> OutputSource
OutputSource'
(Maybe Text -> Maybe Text -> OutputSource)
-> Parser (Maybe Text) -> Parser (Maybe Text -> OutputSource)
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
"OutputSourceId")
Parser (Maybe Text -> OutputSource)
-> Parser (Maybe Text) -> Parser OutputSource
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
"OutputSourceType")
)
instance Prelude.Hashable OutputSource
instance Prelude.NFData OutputSource