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