{-# 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.ApplicationInsights.Types.LogPattern where
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
data LogPattern = LogPattern'
{
LogPattern -> Maybe Text
pattern' :: Prelude.Maybe Prelude.Text,
LogPattern -> Maybe Text
patternName :: Prelude.Maybe Prelude.Text,
LogPattern -> Maybe Text
patternSetName :: Prelude.Maybe Prelude.Text,
LogPattern -> Maybe Int
rank :: Prelude.Maybe Prelude.Int
}
deriving (LogPattern -> LogPattern -> Bool
(LogPattern -> LogPattern -> Bool)
-> (LogPattern -> LogPattern -> Bool) -> Eq LogPattern
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: LogPattern -> LogPattern -> Bool
$c/= :: LogPattern -> LogPattern -> Bool
== :: LogPattern -> LogPattern -> Bool
$c== :: LogPattern -> LogPattern -> Bool
Prelude.Eq, ReadPrec [LogPattern]
ReadPrec LogPattern
Int -> ReadS LogPattern
ReadS [LogPattern]
(Int -> ReadS LogPattern)
-> ReadS [LogPattern]
-> ReadPrec LogPattern
-> ReadPrec [LogPattern]
-> Read LogPattern
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [LogPattern]
$creadListPrec :: ReadPrec [LogPattern]
readPrec :: ReadPrec LogPattern
$creadPrec :: ReadPrec LogPattern
readList :: ReadS [LogPattern]
$creadList :: ReadS [LogPattern]
readsPrec :: Int -> ReadS LogPattern
$creadsPrec :: Int -> ReadS LogPattern
Prelude.Read, Int -> LogPattern -> ShowS
[LogPattern] -> ShowS
LogPattern -> String
(Int -> LogPattern -> ShowS)
-> (LogPattern -> String)
-> ([LogPattern] -> ShowS)
-> Show LogPattern
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [LogPattern] -> ShowS
$cshowList :: [LogPattern] -> ShowS
show :: LogPattern -> String
$cshow :: LogPattern -> String
showsPrec :: Int -> LogPattern -> ShowS
$cshowsPrec :: Int -> LogPattern -> ShowS
Prelude.Show, (forall x. LogPattern -> Rep LogPattern x)
-> (forall x. Rep LogPattern x -> LogPattern) -> Generic LogPattern
forall x. Rep LogPattern x -> LogPattern
forall x. LogPattern -> Rep LogPattern x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep LogPattern x -> LogPattern
$cfrom :: forall x. LogPattern -> Rep LogPattern x
Prelude.Generic)
newLogPattern ::
LogPattern
newLogPattern :: LogPattern
newLogPattern =
LogPattern' :: Maybe Text -> Maybe Text -> Maybe Text -> Maybe Int -> LogPattern
LogPattern'
{ $sel:pattern':LogPattern' :: Maybe Text
pattern' = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:patternName:LogPattern' :: Maybe Text
patternName = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:patternSetName:LogPattern' :: Maybe Text
patternSetName = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:rank:LogPattern' :: Maybe Int
rank = Maybe Int
forall a. Maybe a
Prelude.Nothing
}
logPattern_pattern :: Lens.Lens' LogPattern (Prelude.Maybe Prelude.Text)
logPattern_pattern :: (Maybe Text -> f (Maybe Text)) -> LogPattern -> f LogPattern
logPattern_pattern = (LogPattern -> Maybe Text)
-> (LogPattern -> Maybe Text -> LogPattern)
-> Lens LogPattern LogPattern (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\LogPattern' {Maybe Text
pattern' :: Maybe Text
$sel:pattern':LogPattern' :: LogPattern -> Maybe Text
pattern'} -> Maybe Text
pattern') (\s :: LogPattern
s@LogPattern' {} Maybe Text
a -> LogPattern
s {$sel:pattern':LogPattern' :: Maybe Text
pattern' = Maybe Text
a} :: LogPattern)
logPattern_patternName :: Lens.Lens' LogPattern (Prelude.Maybe Prelude.Text)
logPattern_patternName :: (Maybe Text -> f (Maybe Text)) -> LogPattern -> f LogPattern
logPattern_patternName = (LogPattern -> Maybe Text)
-> (LogPattern -> Maybe Text -> LogPattern)
-> Lens LogPattern LogPattern (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\LogPattern' {Maybe Text
patternName :: Maybe Text
$sel:patternName:LogPattern' :: LogPattern -> Maybe Text
patternName} -> Maybe Text
patternName) (\s :: LogPattern
s@LogPattern' {} Maybe Text
a -> LogPattern
s {$sel:patternName:LogPattern' :: Maybe Text
patternName = Maybe Text
a} :: LogPattern)
logPattern_patternSetName :: Lens.Lens' LogPattern (Prelude.Maybe Prelude.Text)
logPattern_patternSetName :: (Maybe Text -> f (Maybe Text)) -> LogPattern -> f LogPattern
logPattern_patternSetName = (LogPattern -> Maybe Text)
-> (LogPattern -> Maybe Text -> LogPattern)
-> Lens LogPattern LogPattern (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\LogPattern' {Maybe Text
patternSetName :: Maybe Text
$sel:patternSetName:LogPattern' :: LogPattern -> Maybe Text
patternSetName} -> Maybe Text
patternSetName) (\s :: LogPattern
s@LogPattern' {} Maybe Text
a -> LogPattern
s {$sel:patternSetName:LogPattern' :: Maybe Text
patternSetName = Maybe Text
a} :: LogPattern)
logPattern_rank :: Lens.Lens' LogPattern (Prelude.Maybe Prelude.Int)
logPattern_rank :: (Maybe Int -> f (Maybe Int)) -> LogPattern -> f LogPattern
logPattern_rank = (LogPattern -> Maybe Int)
-> (LogPattern -> Maybe Int -> LogPattern)
-> Lens LogPattern LogPattern (Maybe Int) (Maybe Int)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\LogPattern' {Maybe Int
rank :: Maybe Int
$sel:rank:LogPattern' :: LogPattern -> Maybe Int
rank} -> Maybe Int
rank) (\s :: LogPattern
s@LogPattern' {} Maybe Int
a -> LogPattern
s {$sel:rank:LogPattern' :: Maybe Int
rank = Maybe Int
a} :: LogPattern)
instance Core.FromJSON LogPattern where
parseJSON :: Value -> Parser LogPattern
parseJSON =
String
-> (Object -> Parser LogPattern) -> Value -> Parser LogPattern
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
String
"LogPattern"
( \Object
x ->
Maybe Text -> Maybe Text -> Maybe Text -> Maybe Int -> LogPattern
LogPattern'
(Maybe Text -> Maybe Text -> Maybe Text -> Maybe Int -> LogPattern)
-> Parser (Maybe Text)
-> Parser (Maybe Text -> Maybe Text -> Maybe Int -> LogPattern)
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
"Pattern")
Parser (Maybe Text -> Maybe Text -> Maybe Int -> LogPattern)
-> Parser (Maybe Text)
-> Parser (Maybe Text -> Maybe Int -> LogPattern)
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
"PatternName")
Parser (Maybe Text -> Maybe Int -> LogPattern)
-> Parser (Maybe Text) -> Parser (Maybe Int -> LogPattern)
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
"PatternSetName")
Parser (Maybe Int -> LogPattern)
-> Parser (Maybe Int) -> Parser LogPattern
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Int)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"Rank")
)
instance Prelude.Hashable LogPattern
instance Prelude.NFData LogPattern