{-# 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.DocumentParameter where
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
import Amazonka.SSM.Types.DocumentParameterType
data DocumentParameter = DocumentParameter'
{
DocumentParameter -> Maybe Text
name :: Prelude.Maybe Prelude.Text,
DocumentParameter -> Maybe Text
defaultValue :: Prelude.Maybe Prelude.Text,
DocumentParameter -> Maybe DocumentParameterType
type' :: Prelude.Maybe DocumentParameterType,
DocumentParameter -> Maybe Text
description :: Prelude.Maybe Prelude.Text
}
deriving (DocumentParameter -> DocumentParameter -> Bool
(DocumentParameter -> DocumentParameter -> Bool)
-> (DocumentParameter -> DocumentParameter -> Bool)
-> Eq DocumentParameter
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DocumentParameter -> DocumentParameter -> Bool
$c/= :: DocumentParameter -> DocumentParameter -> Bool
== :: DocumentParameter -> DocumentParameter -> Bool
$c== :: DocumentParameter -> DocumentParameter -> Bool
Prelude.Eq, ReadPrec [DocumentParameter]
ReadPrec DocumentParameter
Int -> ReadS DocumentParameter
ReadS [DocumentParameter]
(Int -> ReadS DocumentParameter)
-> ReadS [DocumentParameter]
-> ReadPrec DocumentParameter
-> ReadPrec [DocumentParameter]
-> Read DocumentParameter
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DocumentParameter]
$creadListPrec :: ReadPrec [DocumentParameter]
readPrec :: ReadPrec DocumentParameter
$creadPrec :: ReadPrec DocumentParameter
readList :: ReadS [DocumentParameter]
$creadList :: ReadS [DocumentParameter]
readsPrec :: Int -> ReadS DocumentParameter
$creadsPrec :: Int -> ReadS DocumentParameter
Prelude.Read, Int -> DocumentParameter -> ShowS
[DocumentParameter] -> ShowS
DocumentParameter -> String
(Int -> DocumentParameter -> ShowS)
-> (DocumentParameter -> String)
-> ([DocumentParameter] -> ShowS)
-> Show DocumentParameter
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DocumentParameter] -> ShowS
$cshowList :: [DocumentParameter] -> ShowS
show :: DocumentParameter -> String
$cshow :: DocumentParameter -> String
showsPrec :: Int -> DocumentParameter -> ShowS
$cshowsPrec :: Int -> DocumentParameter -> ShowS
Prelude.Show, (forall x. DocumentParameter -> Rep DocumentParameter x)
-> (forall x. Rep DocumentParameter x -> DocumentParameter)
-> Generic DocumentParameter
forall x. Rep DocumentParameter x -> DocumentParameter
forall x. DocumentParameter -> Rep DocumentParameter x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep DocumentParameter x -> DocumentParameter
$cfrom :: forall x. DocumentParameter -> Rep DocumentParameter x
Prelude.Generic)
newDocumentParameter ::
DocumentParameter
newDocumentParameter :: DocumentParameter
newDocumentParameter =
DocumentParameter' :: Maybe Text
-> Maybe Text
-> Maybe DocumentParameterType
-> Maybe Text
-> DocumentParameter
DocumentParameter'
{ $sel:name:DocumentParameter' :: Maybe Text
name = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:defaultValue:DocumentParameter' :: Maybe Text
defaultValue = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:type':DocumentParameter' :: Maybe DocumentParameterType
type' = Maybe DocumentParameterType
forall a. Maybe a
Prelude.Nothing,
$sel:description:DocumentParameter' :: Maybe Text
description = Maybe Text
forall a. Maybe a
Prelude.Nothing
}
documentParameter_name :: Lens.Lens' DocumentParameter (Prelude.Maybe Prelude.Text)
documentParameter_name :: (Maybe Text -> f (Maybe Text))
-> DocumentParameter -> f DocumentParameter
documentParameter_name = (DocumentParameter -> Maybe Text)
-> (DocumentParameter -> Maybe Text -> DocumentParameter)
-> Lens
DocumentParameter DocumentParameter (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DocumentParameter' {Maybe Text
name :: Maybe Text
$sel:name:DocumentParameter' :: DocumentParameter -> Maybe Text
name} -> Maybe Text
name) (\s :: DocumentParameter
s@DocumentParameter' {} Maybe Text
a -> DocumentParameter
s {$sel:name:DocumentParameter' :: Maybe Text
name = Maybe Text
a} :: DocumentParameter)
documentParameter_defaultValue :: Lens.Lens' DocumentParameter (Prelude.Maybe Prelude.Text)
documentParameter_defaultValue :: (Maybe Text -> f (Maybe Text))
-> DocumentParameter -> f DocumentParameter
documentParameter_defaultValue = (DocumentParameter -> Maybe Text)
-> (DocumentParameter -> Maybe Text -> DocumentParameter)
-> Lens
DocumentParameter DocumentParameter (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DocumentParameter' {Maybe Text
defaultValue :: Maybe Text
$sel:defaultValue:DocumentParameter' :: DocumentParameter -> Maybe Text
defaultValue} -> Maybe Text
defaultValue) (\s :: DocumentParameter
s@DocumentParameter' {} Maybe Text
a -> DocumentParameter
s {$sel:defaultValue:DocumentParameter' :: Maybe Text
defaultValue = Maybe Text
a} :: DocumentParameter)
documentParameter_type :: Lens.Lens' DocumentParameter (Prelude.Maybe DocumentParameterType)
documentParameter_type :: (Maybe DocumentParameterType -> f (Maybe DocumentParameterType))
-> DocumentParameter -> f DocumentParameter
documentParameter_type = (DocumentParameter -> Maybe DocumentParameterType)
-> (DocumentParameter
-> Maybe DocumentParameterType -> DocumentParameter)
-> Lens
DocumentParameter
DocumentParameter
(Maybe DocumentParameterType)
(Maybe DocumentParameterType)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DocumentParameter' {Maybe DocumentParameterType
type' :: Maybe DocumentParameterType
$sel:type':DocumentParameter' :: DocumentParameter -> Maybe DocumentParameterType
type'} -> Maybe DocumentParameterType
type') (\s :: DocumentParameter
s@DocumentParameter' {} Maybe DocumentParameterType
a -> DocumentParameter
s {$sel:type':DocumentParameter' :: Maybe DocumentParameterType
type' = Maybe DocumentParameterType
a} :: DocumentParameter)
documentParameter_description :: Lens.Lens' DocumentParameter (Prelude.Maybe Prelude.Text)
documentParameter_description :: (Maybe Text -> f (Maybe Text))
-> DocumentParameter -> f DocumentParameter
documentParameter_description = (DocumentParameter -> Maybe Text)
-> (DocumentParameter -> Maybe Text -> DocumentParameter)
-> Lens
DocumentParameter DocumentParameter (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DocumentParameter' {Maybe Text
description :: Maybe Text
$sel:description:DocumentParameter' :: DocumentParameter -> Maybe Text
description} -> Maybe Text
description) (\s :: DocumentParameter
s@DocumentParameter' {} Maybe Text
a -> DocumentParameter
s {$sel:description:DocumentParameter' :: Maybe Text
description = Maybe Text
a} :: DocumentParameter)
instance Core.FromJSON DocumentParameter where
parseJSON :: Value -> Parser DocumentParameter
parseJSON =
String
-> (Object -> Parser DocumentParameter)
-> Value
-> Parser DocumentParameter
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
String
"DocumentParameter"
( \Object
x ->
Maybe Text
-> Maybe Text
-> Maybe DocumentParameterType
-> Maybe Text
-> DocumentParameter
DocumentParameter'
(Maybe Text
-> Maybe Text
-> Maybe DocumentParameterType
-> Maybe Text
-> DocumentParameter)
-> Parser (Maybe Text)
-> Parser
(Maybe Text
-> Maybe DocumentParameterType -> Maybe Text -> DocumentParameter)
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
"Name")
Parser
(Maybe Text
-> Maybe DocumentParameterType -> Maybe Text -> DocumentParameter)
-> Parser (Maybe Text)
-> Parser
(Maybe DocumentParameterType -> Maybe Text -> DocumentParameter)
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
"DefaultValue")
Parser
(Maybe DocumentParameterType -> Maybe Text -> DocumentParameter)
-> Parser (Maybe DocumentParameterType)
-> Parser (Maybe Text -> DocumentParameter)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe DocumentParameterType)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"Type")
Parser (Maybe Text -> DocumentParameter)
-> Parser (Maybe Text) -> Parser DocumentParameter
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
"Description")
)
instance Prelude.Hashable DocumentParameter
instance Prelude.NFData DocumentParameter