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