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