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