{-# 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.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
import qualified Amazonka.Prelude as Prelude
data ControlInputParameter = ControlInputParameter'
{
ControlInputParameter -> Maybe Text
parameterName :: Prelude.Maybe Prelude.Text,
ControlInputParameter -> Maybe Text
parameterValue :: Prelude.Maybe Prelude.Text
}
deriving (ControlInputParameter -> ControlInputParameter -> Bool
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]
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
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. 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'
{ $sel:parameterName:ControlInputParameter' :: Maybe Text
parameterName =
forall a. Maybe a
Prelude.Nothing,
$sel:parameterValue:ControlInputParameter' :: Maybe Text
parameterValue = forall a. Maybe a
Prelude.Nothing
}
controlInputParameter_parameterName :: Lens.Lens' ControlInputParameter (Prelude.Maybe Prelude.Text)
controlInputParameter_parameterName :: Lens' ControlInputParameter (Maybe Text)
controlInputParameter_parameterName = 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)
controlInputParameter_parameterValue :: Lens.Lens' ControlInputParameter (Prelude.Maybe Prelude.Text)
controlInputParameter_parameterValue :: Lens' ControlInputParameter (Maybe Text)
controlInputParameter_parameterValue = 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)
instance Data.FromJSON ControlInputParameter where
parseJSON :: Value -> Parser ControlInputParameter
parseJSON =
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
String
"ControlInputParameter"
( \Object
x ->
Maybe Text -> Maybe Text -> ControlInputParameter
ControlInputParameter'
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"ParameterName")
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"ParameterValue")
)
instance Prelude.Hashable ControlInputParameter where
hashWithSalt :: Int -> ControlInputParameter -> Int
hashWithSalt Int
_salt ControlInputParameter' {Maybe Text
parameterValue :: Maybe Text
parameterName :: Maybe Text
$sel:parameterValue:ControlInputParameter' :: ControlInputParameter -> Maybe Text
$sel:parameterName:ControlInputParameter' :: ControlInputParameter -> Maybe Text
..} =
Int
_salt
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
parameterName
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
parameterValue
instance Prelude.NFData ControlInputParameter where
rnf :: ControlInputParameter -> ()
rnf ControlInputParameter' {Maybe Text
parameterValue :: Maybe Text
parameterName :: Maybe Text
$sel:parameterValue:ControlInputParameter' :: ControlInputParameter -> Maybe Text
$sel:parameterName:ControlInputParameter' :: ControlInputParameter -> Maybe Text
..} =
forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
parameterName
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
parameterValue
instance Data.ToJSON ControlInputParameter where
toJSON :: ControlInputParameter -> Value
toJSON ControlInputParameter' {Maybe Text
parameterValue :: Maybe Text
parameterName :: Maybe Text
$sel:parameterValue:ControlInputParameter' :: ControlInputParameter -> Maybe Text
$sel:parameterName:ControlInputParameter' :: ControlInputParameter -> Maybe Text
..} =
[Pair] -> Value
Data.object
( forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ (Key
"ParameterName" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=) forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
parameterName,
(Key
"ParameterValue" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
parameterValue
]
)