{-# 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.Greengrass.Types.TelemetryConfiguration where
import qualified Amazonka.Core as Core
import Amazonka.Greengrass.Types.ConfigurationSyncStatus
import Amazonka.Greengrass.Types.Telemetry
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
data TelemetryConfiguration = TelemetryConfiguration'
{
TelemetryConfiguration -> Maybe ConfigurationSyncStatus
configurationSyncStatus :: Prelude.Maybe ConfigurationSyncStatus,
TelemetryConfiguration -> Telemetry
telemetry :: Telemetry
}
deriving (TelemetryConfiguration -> TelemetryConfiguration -> Bool
(TelemetryConfiguration -> TelemetryConfiguration -> Bool)
-> (TelemetryConfiguration -> TelemetryConfiguration -> Bool)
-> Eq TelemetryConfiguration
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: TelemetryConfiguration -> TelemetryConfiguration -> Bool
$c/= :: TelemetryConfiguration -> TelemetryConfiguration -> Bool
== :: TelemetryConfiguration -> TelemetryConfiguration -> Bool
$c== :: TelemetryConfiguration -> TelemetryConfiguration -> Bool
Prelude.Eq, ReadPrec [TelemetryConfiguration]
ReadPrec TelemetryConfiguration
Int -> ReadS TelemetryConfiguration
ReadS [TelemetryConfiguration]
(Int -> ReadS TelemetryConfiguration)
-> ReadS [TelemetryConfiguration]
-> ReadPrec TelemetryConfiguration
-> ReadPrec [TelemetryConfiguration]
-> Read TelemetryConfiguration
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [TelemetryConfiguration]
$creadListPrec :: ReadPrec [TelemetryConfiguration]
readPrec :: ReadPrec TelemetryConfiguration
$creadPrec :: ReadPrec TelemetryConfiguration
readList :: ReadS [TelemetryConfiguration]
$creadList :: ReadS [TelemetryConfiguration]
readsPrec :: Int -> ReadS TelemetryConfiguration
$creadsPrec :: Int -> ReadS TelemetryConfiguration
Prelude.Read, Int -> TelemetryConfiguration -> ShowS
[TelemetryConfiguration] -> ShowS
TelemetryConfiguration -> String
(Int -> TelemetryConfiguration -> ShowS)
-> (TelemetryConfiguration -> String)
-> ([TelemetryConfiguration] -> ShowS)
-> Show TelemetryConfiguration
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [TelemetryConfiguration] -> ShowS
$cshowList :: [TelemetryConfiguration] -> ShowS
show :: TelemetryConfiguration -> String
$cshow :: TelemetryConfiguration -> String
showsPrec :: Int -> TelemetryConfiguration -> ShowS
$cshowsPrec :: Int -> TelemetryConfiguration -> ShowS
Prelude.Show, (forall x. TelemetryConfiguration -> Rep TelemetryConfiguration x)
-> (forall x.
Rep TelemetryConfiguration x -> TelemetryConfiguration)
-> Generic TelemetryConfiguration
forall x. Rep TelemetryConfiguration x -> TelemetryConfiguration
forall x. TelemetryConfiguration -> Rep TelemetryConfiguration x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep TelemetryConfiguration x -> TelemetryConfiguration
$cfrom :: forall x. TelemetryConfiguration -> Rep TelemetryConfiguration x
Prelude.Generic)
newTelemetryConfiguration ::
Telemetry ->
TelemetryConfiguration
newTelemetryConfiguration :: Telemetry -> TelemetryConfiguration
newTelemetryConfiguration Telemetry
pTelemetry_ =
TelemetryConfiguration' :: Maybe ConfigurationSyncStatus
-> Telemetry -> TelemetryConfiguration
TelemetryConfiguration'
{ $sel:configurationSyncStatus:TelemetryConfiguration' :: Maybe ConfigurationSyncStatus
configurationSyncStatus =
Maybe ConfigurationSyncStatus
forall a. Maybe a
Prelude.Nothing,
$sel:telemetry:TelemetryConfiguration' :: Telemetry
telemetry = Telemetry
pTelemetry_
}
telemetryConfiguration_configurationSyncStatus :: Lens.Lens' TelemetryConfiguration (Prelude.Maybe ConfigurationSyncStatus)
telemetryConfiguration_configurationSyncStatus :: (Maybe ConfigurationSyncStatus
-> f (Maybe ConfigurationSyncStatus))
-> TelemetryConfiguration -> f TelemetryConfiguration
telemetryConfiguration_configurationSyncStatus = (TelemetryConfiguration -> Maybe ConfigurationSyncStatus)
-> (TelemetryConfiguration
-> Maybe ConfigurationSyncStatus -> TelemetryConfiguration)
-> Lens
TelemetryConfiguration
TelemetryConfiguration
(Maybe ConfigurationSyncStatus)
(Maybe ConfigurationSyncStatus)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\TelemetryConfiguration' {Maybe ConfigurationSyncStatus
configurationSyncStatus :: Maybe ConfigurationSyncStatus
$sel:configurationSyncStatus:TelemetryConfiguration' :: TelemetryConfiguration -> Maybe ConfigurationSyncStatus
configurationSyncStatus} -> Maybe ConfigurationSyncStatus
configurationSyncStatus) (\s :: TelemetryConfiguration
s@TelemetryConfiguration' {} Maybe ConfigurationSyncStatus
a -> TelemetryConfiguration
s {$sel:configurationSyncStatus:TelemetryConfiguration' :: Maybe ConfigurationSyncStatus
configurationSyncStatus = Maybe ConfigurationSyncStatus
a} :: TelemetryConfiguration)
telemetryConfiguration_telemetry :: Lens.Lens' TelemetryConfiguration Telemetry
telemetryConfiguration_telemetry :: (Telemetry -> f Telemetry)
-> TelemetryConfiguration -> f TelemetryConfiguration
telemetryConfiguration_telemetry = (TelemetryConfiguration -> Telemetry)
-> (TelemetryConfiguration -> Telemetry -> TelemetryConfiguration)
-> Lens
TelemetryConfiguration TelemetryConfiguration Telemetry Telemetry
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\TelemetryConfiguration' {Telemetry
telemetry :: Telemetry
$sel:telemetry:TelemetryConfiguration' :: TelemetryConfiguration -> Telemetry
telemetry} -> Telemetry
telemetry) (\s :: TelemetryConfiguration
s@TelemetryConfiguration' {} Telemetry
a -> TelemetryConfiguration
s {$sel:telemetry:TelemetryConfiguration' :: Telemetry
telemetry = Telemetry
a} :: TelemetryConfiguration)
instance Core.FromJSON TelemetryConfiguration where
parseJSON :: Value -> Parser TelemetryConfiguration
parseJSON =
String
-> (Object -> Parser TelemetryConfiguration)
-> Value
-> Parser TelemetryConfiguration
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
String
"TelemetryConfiguration"
( \Object
x ->
Maybe ConfigurationSyncStatus
-> Telemetry -> TelemetryConfiguration
TelemetryConfiguration'
(Maybe ConfigurationSyncStatus
-> Telemetry -> TelemetryConfiguration)
-> Parser (Maybe ConfigurationSyncStatus)
-> Parser (Telemetry -> TelemetryConfiguration)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Parser (Maybe ConfigurationSyncStatus)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"ConfigurationSyncStatus")
Parser (Telemetry -> TelemetryConfiguration)
-> Parser Telemetry -> Parser TelemetryConfiguration
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser Telemetry
forall a. FromJSON a => Object -> Text -> Parser a
Core..: Text
"Telemetry")
)
instance Prelude.Hashable TelemetryConfiguration
instance Prelude.NFData TelemetryConfiguration