{-# 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.AgentConfiguration where
import Amazonka.CodeGuruProfiler.Types.AgentParameterField
import qualified Amazonka.Core as Core
import qualified Amazonka.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
import qualified Amazonka.Prelude as Prelude
data AgentConfiguration = AgentConfiguration'
{
AgentConfiguration -> Maybe (HashMap AgentParameterField Text)
agentParameters :: Prelude.Maybe (Prelude.HashMap AgentParameterField Prelude.Text),
AgentConfiguration -> Int
periodInSeconds :: Prelude.Int,
AgentConfiguration -> Bool
shouldProfile :: Prelude.Bool
}
deriving (AgentConfiguration -> AgentConfiguration -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: AgentConfiguration -> AgentConfiguration -> Bool
$c/= :: AgentConfiguration -> AgentConfiguration -> Bool
== :: AgentConfiguration -> AgentConfiguration -> Bool
$c== :: AgentConfiguration -> AgentConfiguration -> Bool
Prelude.Eq, ReadPrec [AgentConfiguration]
ReadPrec AgentConfiguration
Int -> ReadS AgentConfiguration
ReadS [AgentConfiguration]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [AgentConfiguration]
$creadListPrec :: ReadPrec [AgentConfiguration]
readPrec :: ReadPrec AgentConfiguration
$creadPrec :: ReadPrec AgentConfiguration
readList :: ReadS [AgentConfiguration]
$creadList :: ReadS [AgentConfiguration]
readsPrec :: Int -> ReadS AgentConfiguration
$creadsPrec :: Int -> ReadS AgentConfiguration
Prelude.Read, Int -> AgentConfiguration -> ShowS
[AgentConfiguration] -> ShowS
AgentConfiguration -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [AgentConfiguration] -> ShowS
$cshowList :: [AgentConfiguration] -> ShowS
show :: AgentConfiguration -> String
$cshow :: AgentConfiguration -> String
showsPrec :: Int -> AgentConfiguration -> ShowS
$cshowsPrec :: Int -> AgentConfiguration -> ShowS
Prelude.Show, forall x. Rep AgentConfiguration x -> AgentConfiguration
forall x. AgentConfiguration -> Rep AgentConfiguration x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep AgentConfiguration x -> AgentConfiguration
$cfrom :: forall x. AgentConfiguration -> Rep AgentConfiguration x
Prelude.Generic)
newAgentConfiguration ::
Prelude.Int ->
Prelude.Bool ->
AgentConfiguration
newAgentConfiguration :: Int -> Bool -> AgentConfiguration
newAgentConfiguration
Int
pPeriodInSeconds_
Bool
pShouldProfile_ =
AgentConfiguration'
{ $sel:agentParameters:AgentConfiguration' :: Maybe (HashMap AgentParameterField Text)
agentParameters =
forall a. Maybe a
Prelude.Nothing,
$sel:periodInSeconds:AgentConfiguration' :: Int
periodInSeconds = Int
pPeriodInSeconds_,
$sel:shouldProfile:AgentConfiguration' :: Bool
shouldProfile = Bool
pShouldProfile_
}
agentConfiguration_agentParameters :: Lens.Lens' AgentConfiguration (Prelude.Maybe (Prelude.HashMap AgentParameterField Prelude.Text))
agentConfiguration_agentParameters :: Lens' AgentConfiguration (Maybe (HashMap AgentParameterField Text))
agentConfiguration_agentParameters = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AgentConfiguration' {Maybe (HashMap AgentParameterField Text)
agentParameters :: Maybe (HashMap AgentParameterField Text)
$sel:agentParameters:AgentConfiguration' :: AgentConfiguration -> Maybe (HashMap AgentParameterField Text)
agentParameters} -> Maybe (HashMap AgentParameterField Text)
agentParameters) (\s :: AgentConfiguration
s@AgentConfiguration' {} Maybe (HashMap AgentParameterField Text)
a -> AgentConfiguration
s {$sel:agentParameters:AgentConfiguration' :: Maybe (HashMap AgentParameterField Text)
agentParameters = Maybe (HashMap AgentParameterField Text)
a} :: AgentConfiguration) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. 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 forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced
agentConfiguration_periodInSeconds :: Lens.Lens' AgentConfiguration Prelude.Int
agentConfiguration_periodInSeconds :: Lens' AgentConfiguration Int
agentConfiguration_periodInSeconds = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AgentConfiguration' {Int
periodInSeconds :: Int
$sel:periodInSeconds:AgentConfiguration' :: AgentConfiguration -> Int
periodInSeconds} -> Int
periodInSeconds) (\s :: AgentConfiguration
s@AgentConfiguration' {} Int
a -> AgentConfiguration
s {$sel:periodInSeconds:AgentConfiguration' :: Int
periodInSeconds = Int
a} :: AgentConfiguration)
agentConfiguration_shouldProfile :: Lens.Lens' AgentConfiguration Prelude.Bool
agentConfiguration_shouldProfile :: Lens' AgentConfiguration Bool
agentConfiguration_shouldProfile = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AgentConfiguration' {Bool
shouldProfile :: Bool
$sel:shouldProfile:AgentConfiguration' :: AgentConfiguration -> Bool
shouldProfile} -> Bool
shouldProfile) (\s :: AgentConfiguration
s@AgentConfiguration' {} Bool
a -> AgentConfiguration
s {$sel:shouldProfile:AgentConfiguration' :: Bool
shouldProfile = Bool
a} :: AgentConfiguration)
instance Data.FromJSON AgentConfiguration where
parseJSON :: Value -> Parser AgentConfiguration
parseJSON =
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
String
"AgentConfiguration"
( \Object
x ->
Maybe (HashMap AgentParameterField Text)
-> Int -> Bool -> AgentConfiguration
AgentConfiguration'
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> ( Object
x
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"agentParameters"
forall a. Parser (Maybe a) -> a -> Parser a
Data..!= forall a. Monoid a => a
Prelude.mempty
)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser a
Data..: Key
"periodInSeconds")
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser a
Data..: Key
"shouldProfile")
)
instance Prelude.Hashable AgentConfiguration where
hashWithSalt :: Int -> AgentConfiguration -> Int
hashWithSalt Int
_salt AgentConfiguration' {Bool
Int
Maybe (HashMap AgentParameterField Text)
shouldProfile :: Bool
periodInSeconds :: Int
agentParameters :: Maybe (HashMap AgentParameterField Text)
$sel:shouldProfile:AgentConfiguration' :: AgentConfiguration -> Bool
$sel:periodInSeconds:AgentConfiguration' :: AgentConfiguration -> Int
$sel:agentParameters:AgentConfiguration' :: AgentConfiguration -> Maybe (HashMap AgentParameterField Text)
..} =
Int
_salt
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe (HashMap AgentParameterField Text)
agentParameters
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Int
periodInSeconds
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Bool
shouldProfile
instance Prelude.NFData AgentConfiguration where
rnf :: AgentConfiguration -> ()
rnf AgentConfiguration' {Bool
Int
Maybe (HashMap AgentParameterField Text)
shouldProfile :: Bool
periodInSeconds :: Int
agentParameters :: Maybe (HashMap AgentParameterField Text)
$sel:shouldProfile:AgentConfiguration' :: AgentConfiguration -> Bool
$sel:periodInSeconds:AgentConfiguration' :: AgentConfiguration -> Int
$sel:agentParameters:AgentConfiguration' :: AgentConfiguration -> Maybe (HashMap AgentParameterField Text)
..} =
forall a. NFData a => a -> ()
Prelude.rnf Maybe (HashMap AgentParameterField Text)
agentParameters
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Int
periodInSeconds
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Bool
shouldProfile