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