{-# 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.CodeGuruProfiler.Types.Pattern where
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
data Pattern = Pattern'
{
Pattern -> Maybe Double
thresholdPercent :: Prelude.Maybe Prelude.Double,
Pattern -> Maybe [[Text]]
targetFrames :: Prelude.Maybe [[Prelude.Text]],
Pattern -> Maybe [Text]
countersToAggregate :: Prelude.Maybe [Prelude.Text],
Pattern -> Maybe Text
name :: Prelude.Maybe Prelude.Text,
Pattern -> Maybe Text
resolutionSteps :: Prelude.Maybe Prelude.Text,
Pattern -> Maybe Text
id :: Prelude.Maybe Prelude.Text,
Pattern -> Maybe Text
description :: Prelude.Maybe Prelude.Text
}
deriving (Pattern -> Pattern -> Bool
(Pattern -> Pattern -> Bool)
-> (Pattern -> Pattern -> Bool) -> Eq Pattern
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: Pattern -> Pattern -> Bool
$c/= :: Pattern -> Pattern -> Bool
== :: Pattern -> Pattern -> Bool
$c== :: Pattern -> Pattern -> Bool
Prelude.Eq, ReadPrec [Pattern]
ReadPrec Pattern
Int -> ReadS Pattern
ReadS [Pattern]
(Int -> ReadS Pattern)
-> ReadS [Pattern]
-> ReadPrec Pattern
-> ReadPrec [Pattern]
-> Read Pattern
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [Pattern]
$creadListPrec :: ReadPrec [Pattern]
readPrec :: ReadPrec Pattern
$creadPrec :: ReadPrec Pattern
readList :: ReadS [Pattern]
$creadList :: ReadS [Pattern]
readsPrec :: Int -> ReadS Pattern
$creadsPrec :: Int -> ReadS Pattern
Prelude.Read, Int -> Pattern -> ShowS
[Pattern] -> ShowS
Pattern -> String
(Int -> Pattern -> ShowS)
-> (Pattern -> String) -> ([Pattern] -> ShowS) -> Show Pattern
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [Pattern] -> ShowS
$cshowList :: [Pattern] -> ShowS
show :: Pattern -> String
$cshow :: Pattern -> String
showsPrec :: Int -> Pattern -> ShowS
$cshowsPrec :: Int -> Pattern -> ShowS
Prelude.Show, (forall x. Pattern -> Rep Pattern x)
-> (forall x. Rep Pattern x -> Pattern) -> Generic Pattern
forall x. Rep Pattern x -> Pattern
forall x. Pattern -> Rep Pattern x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep Pattern x -> Pattern
$cfrom :: forall x. Pattern -> Rep Pattern x
Prelude.Generic)
newPattern ::
Pattern
newPattern :: Pattern
newPattern =
Pattern' :: Maybe Double
-> Maybe [[Text]]
-> Maybe [Text]
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Pattern
Pattern'
{ $sel:thresholdPercent:Pattern' :: Maybe Double
thresholdPercent = Maybe Double
forall a. Maybe a
Prelude.Nothing,
$sel:targetFrames:Pattern' :: Maybe [[Text]]
targetFrames = Maybe [[Text]]
forall a. Maybe a
Prelude.Nothing,
$sel:countersToAggregate:Pattern' :: Maybe [Text]
countersToAggregate = Maybe [Text]
forall a. Maybe a
Prelude.Nothing,
$sel:name:Pattern' :: Maybe Text
name = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:resolutionSteps:Pattern' :: Maybe Text
resolutionSteps = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:id:Pattern' :: Maybe Text
id = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:description:Pattern' :: Maybe Text
description = Maybe Text
forall a. Maybe a
Prelude.Nothing
}
pattern_thresholdPercent :: Lens.Lens' Pattern (Prelude.Maybe Prelude.Double)
pattern_thresholdPercent :: (Maybe Double -> f (Maybe Double)) -> Pattern -> f Pattern
pattern_thresholdPercent = (Pattern -> Maybe Double)
-> (Pattern -> Maybe Double -> Pattern)
-> Lens Pattern Pattern (Maybe Double) (Maybe Double)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Pattern' {Maybe Double
thresholdPercent :: Maybe Double
$sel:thresholdPercent:Pattern' :: Pattern -> Maybe Double
thresholdPercent} -> Maybe Double
thresholdPercent) (\s :: Pattern
s@Pattern' {} Maybe Double
a -> Pattern
s {$sel:thresholdPercent:Pattern' :: Maybe Double
thresholdPercent = Maybe Double
a} :: Pattern)
pattern_targetFrames :: Lens.Lens' Pattern (Prelude.Maybe [[Prelude.Text]])
pattern_targetFrames :: (Maybe [[Text]] -> f (Maybe [[Text]])) -> Pattern -> f Pattern
pattern_targetFrames = (Pattern -> Maybe [[Text]])
-> (Pattern -> Maybe [[Text]] -> Pattern)
-> Lens Pattern Pattern (Maybe [[Text]]) (Maybe [[Text]])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Pattern' {Maybe [[Text]]
targetFrames :: Maybe [[Text]]
$sel:targetFrames:Pattern' :: Pattern -> Maybe [[Text]]
targetFrames} -> Maybe [[Text]]
targetFrames) (\s :: Pattern
s@Pattern' {} Maybe [[Text]]
a -> Pattern
s {$sel:targetFrames:Pattern' :: Maybe [[Text]]
targetFrames = Maybe [[Text]]
a} :: Pattern) ((Maybe [[Text]] -> f (Maybe [[Text]])) -> Pattern -> f Pattern)
-> ((Maybe [[Text]] -> f (Maybe [[Text]]))
-> Maybe [[Text]] -> f (Maybe [[Text]]))
-> (Maybe [[Text]] -> f (Maybe [[Text]]))
-> Pattern
-> f Pattern
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso [[Text]] [[Text]] [[Text]] [[Text]]
-> Iso
(Maybe [[Text]]) (Maybe [[Text]]) (Maybe [[Text]]) (Maybe [[Text]])
forall (f :: * -> *) (g :: * -> *) s t a b.
(Functor f, Functor g) =>
AnIso s t a b -> Iso (f s) (g t) (f a) (g b)
Lens.mapping AnIso [[Text]] [[Text]] [[Text]] [[Text]]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced
pattern_countersToAggregate :: Lens.Lens' Pattern (Prelude.Maybe [Prelude.Text])
pattern_countersToAggregate :: (Maybe [Text] -> f (Maybe [Text])) -> Pattern -> f Pattern
pattern_countersToAggregate = (Pattern -> Maybe [Text])
-> (Pattern -> Maybe [Text] -> Pattern)
-> Lens Pattern Pattern (Maybe [Text]) (Maybe [Text])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Pattern' {Maybe [Text]
countersToAggregate :: Maybe [Text]
$sel:countersToAggregate:Pattern' :: Pattern -> Maybe [Text]
countersToAggregate} -> Maybe [Text]
countersToAggregate) (\s :: Pattern
s@Pattern' {} Maybe [Text]
a -> Pattern
s {$sel:countersToAggregate:Pattern' :: Maybe [Text]
countersToAggregate = Maybe [Text]
a} :: Pattern) ((Maybe [Text] -> f (Maybe [Text])) -> Pattern -> f Pattern)
-> ((Maybe [Text] -> f (Maybe [Text]))
-> Maybe [Text] -> f (Maybe [Text]))
-> (Maybe [Text] -> f (Maybe [Text]))
-> Pattern
-> f Pattern
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso [Text] [Text] [Text] [Text]
-> Iso (Maybe [Text]) (Maybe [Text]) (Maybe [Text]) (Maybe [Text])
forall (f :: * -> *) (g :: * -> *) s t a b.
(Functor f, Functor g) =>
AnIso s t a b -> Iso (f s) (g t) (f a) (g b)
Lens.mapping AnIso [Text] [Text] [Text] [Text]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced
pattern_name :: Lens.Lens' Pattern (Prelude.Maybe Prelude.Text)
pattern_name :: (Maybe Text -> f (Maybe Text)) -> Pattern -> f Pattern
pattern_name = (Pattern -> Maybe Text)
-> (Pattern -> Maybe Text -> Pattern)
-> Lens Pattern Pattern (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Pattern' {Maybe Text
name :: Maybe Text
$sel:name:Pattern' :: Pattern -> Maybe Text
name} -> Maybe Text
name) (\s :: Pattern
s@Pattern' {} Maybe Text
a -> Pattern
s {$sel:name:Pattern' :: Maybe Text
name = Maybe Text
a} :: Pattern)
pattern_resolutionSteps :: Lens.Lens' Pattern (Prelude.Maybe Prelude.Text)
pattern_resolutionSteps :: (Maybe Text -> f (Maybe Text)) -> Pattern -> f Pattern
pattern_resolutionSteps = (Pattern -> Maybe Text)
-> (Pattern -> Maybe Text -> Pattern)
-> Lens Pattern Pattern (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Pattern' {Maybe Text
resolutionSteps :: Maybe Text
$sel:resolutionSteps:Pattern' :: Pattern -> Maybe Text
resolutionSteps} -> Maybe Text
resolutionSteps) (\s :: Pattern
s@Pattern' {} Maybe Text
a -> Pattern
s {$sel:resolutionSteps:Pattern' :: Maybe Text
resolutionSteps = Maybe Text
a} :: Pattern)
pattern_id :: Lens.Lens' Pattern (Prelude.Maybe Prelude.Text)
pattern_id :: (Maybe Text -> f (Maybe Text)) -> Pattern -> f Pattern
pattern_id = (Pattern -> Maybe Text)
-> (Pattern -> Maybe Text -> Pattern)
-> Lens Pattern Pattern (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Pattern' {Maybe Text
id :: Maybe Text
$sel:id:Pattern' :: Pattern -> Maybe Text
id} -> Maybe Text
id) (\s :: Pattern
s@Pattern' {} Maybe Text
a -> Pattern
s {$sel:id:Pattern' :: Maybe Text
id = Maybe Text
a} :: Pattern)
pattern_description :: Lens.Lens' Pattern (Prelude.Maybe Prelude.Text)
pattern_description :: (Maybe Text -> f (Maybe Text)) -> Pattern -> f Pattern
pattern_description = (Pattern -> Maybe Text)
-> (Pattern -> Maybe Text -> Pattern)
-> Lens Pattern Pattern (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Pattern' {Maybe Text
description :: Maybe Text
$sel:description:Pattern' :: Pattern -> Maybe Text
description} -> Maybe Text
description) (\s :: Pattern
s@Pattern' {} Maybe Text
a -> Pattern
s {$sel:description:Pattern' :: Maybe Text
description = Maybe Text
a} :: Pattern)
instance Core.FromJSON Pattern where
parseJSON :: Value -> Parser Pattern
parseJSON =
String -> (Object -> Parser Pattern) -> Value -> Parser Pattern
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
String
"Pattern"
( \Object
x ->
Maybe Double
-> Maybe [[Text]]
-> Maybe [Text]
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Pattern
Pattern'
(Maybe Double
-> Maybe [[Text]]
-> Maybe [Text]
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Pattern)
-> Parser (Maybe Double)
-> Parser
(Maybe [[Text]]
-> Maybe [Text]
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Pattern)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Parser (Maybe Double)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"thresholdPercent")
Parser
(Maybe [[Text]]
-> Maybe [Text]
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Pattern)
-> Parser (Maybe [[Text]])
-> Parser
(Maybe [Text]
-> Maybe Text -> Maybe Text -> Maybe Text -> Maybe Text -> Pattern)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe (Maybe [[Text]]))
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"targetFrames" Parser (Maybe (Maybe [[Text]]))
-> Maybe [[Text]] -> Parser (Maybe [[Text]])
forall a. Parser (Maybe a) -> a -> Parser a
Core..!= Maybe [[Text]]
forall a. Monoid a => a
Prelude.mempty)
Parser
(Maybe [Text]
-> Maybe Text -> Maybe Text -> Maybe Text -> Maybe Text -> Pattern)
-> Parser (Maybe [Text])
-> Parser
(Maybe Text -> Maybe Text -> Maybe Text -> Maybe Text -> Pattern)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ( Object
x Object -> Text -> Parser (Maybe (Maybe [Text]))
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"countersToAggregate"
Parser (Maybe (Maybe [Text]))
-> Maybe [Text] -> Parser (Maybe [Text])
forall a. Parser (Maybe a) -> a -> Parser a
Core..!= Maybe [Text]
forall a. Monoid a => a
Prelude.mempty
)
Parser
(Maybe Text -> Maybe Text -> Maybe Text -> Maybe Text -> Pattern)
-> Parser (Maybe Text)
-> Parser (Maybe Text -> Maybe Text -> Maybe Text -> Pattern)
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
"name")
Parser (Maybe Text -> Maybe Text -> Maybe Text -> Pattern)
-> Parser (Maybe Text)
-> Parser (Maybe Text -> Maybe Text -> Pattern)
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
"resolutionSteps")
Parser (Maybe Text -> Maybe Text -> Pattern)
-> Parser (Maybe Text) -> Parser (Maybe Text -> Pattern)
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
"id")
Parser (Maybe Text -> Pattern)
-> Parser (Maybe Text) -> Parser Pattern
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
"description")
)
instance Prelude.Hashable Pattern
instance Prelude.NFData Pattern