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