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