{-# 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.CloudWatchLogs.Types.LogGroup where
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
data LogGroup = LogGroup'
{
LogGroup -> Maybe Natural
creationTime :: Prelude.Maybe Prelude.Natural,
LogGroup -> Maybe Int
metricFilterCount :: Prelude.Maybe Prelude.Int,
LogGroup -> Maybe Text
arn :: Prelude.Maybe Prelude.Text,
LogGroup -> Maybe Text
logGroupName :: Prelude.Maybe Prelude.Text,
LogGroup -> Maybe Int
retentionInDays :: Prelude.Maybe Prelude.Int,
LogGroup -> Maybe Text
kmsKeyId :: Prelude.Maybe Prelude.Text,
LogGroup -> Maybe Natural
storedBytes :: Prelude.Maybe Prelude.Natural
}
deriving (LogGroup -> LogGroup -> Bool
(LogGroup -> LogGroup -> Bool)
-> (LogGroup -> LogGroup -> Bool) -> Eq LogGroup
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: LogGroup -> LogGroup -> Bool
$c/= :: LogGroup -> LogGroup -> Bool
== :: LogGroup -> LogGroup -> Bool
$c== :: LogGroup -> LogGroup -> Bool
Prelude.Eq, ReadPrec [LogGroup]
ReadPrec LogGroup
Int -> ReadS LogGroup
ReadS [LogGroup]
(Int -> ReadS LogGroup)
-> ReadS [LogGroup]
-> ReadPrec LogGroup
-> ReadPrec [LogGroup]
-> Read LogGroup
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [LogGroup]
$creadListPrec :: ReadPrec [LogGroup]
readPrec :: ReadPrec LogGroup
$creadPrec :: ReadPrec LogGroup
readList :: ReadS [LogGroup]
$creadList :: ReadS [LogGroup]
readsPrec :: Int -> ReadS LogGroup
$creadsPrec :: Int -> ReadS LogGroup
Prelude.Read, Int -> LogGroup -> ShowS
[LogGroup] -> ShowS
LogGroup -> String
(Int -> LogGroup -> ShowS)
-> (LogGroup -> String) -> ([LogGroup] -> ShowS) -> Show LogGroup
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [LogGroup] -> ShowS
$cshowList :: [LogGroup] -> ShowS
show :: LogGroup -> String
$cshow :: LogGroup -> String
showsPrec :: Int -> LogGroup -> ShowS
$cshowsPrec :: Int -> LogGroup -> ShowS
Prelude.Show, (forall x. LogGroup -> Rep LogGroup x)
-> (forall x. Rep LogGroup x -> LogGroup) -> Generic LogGroup
forall x. Rep LogGroup x -> LogGroup
forall x. LogGroup -> Rep LogGroup x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep LogGroup x -> LogGroup
$cfrom :: forall x. LogGroup -> Rep LogGroup x
Prelude.Generic)
newLogGroup ::
LogGroup
newLogGroup :: LogGroup
newLogGroup =
LogGroup' :: Maybe Natural
-> Maybe Int
-> Maybe Text
-> Maybe Text
-> Maybe Int
-> Maybe Text
-> Maybe Natural
-> LogGroup
LogGroup'
{ $sel:creationTime:LogGroup' :: Maybe Natural
creationTime = Maybe Natural
forall a. Maybe a
Prelude.Nothing,
$sel:metricFilterCount:LogGroup' :: Maybe Int
metricFilterCount = Maybe Int
forall a. Maybe a
Prelude.Nothing,
$sel:arn:LogGroup' :: Maybe Text
arn = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:logGroupName:LogGroup' :: Maybe Text
logGroupName = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:retentionInDays:LogGroup' :: Maybe Int
retentionInDays = Maybe Int
forall a. Maybe a
Prelude.Nothing,
$sel:kmsKeyId:LogGroup' :: Maybe Text
kmsKeyId = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:storedBytes:LogGroup' :: Maybe Natural
storedBytes = Maybe Natural
forall a. Maybe a
Prelude.Nothing
}
logGroup_creationTime :: Lens.Lens' LogGroup (Prelude.Maybe Prelude.Natural)
logGroup_creationTime :: (Maybe Natural -> f (Maybe Natural)) -> LogGroup -> f LogGroup
logGroup_creationTime = (LogGroup -> Maybe Natural)
-> (LogGroup -> Maybe Natural -> LogGroup)
-> Lens LogGroup LogGroup (Maybe Natural) (Maybe Natural)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\LogGroup' {Maybe Natural
creationTime :: Maybe Natural
$sel:creationTime:LogGroup' :: LogGroup -> Maybe Natural
creationTime} -> Maybe Natural
creationTime) (\s :: LogGroup
s@LogGroup' {} Maybe Natural
a -> LogGroup
s {$sel:creationTime:LogGroup' :: Maybe Natural
creationTime = Maybe Natural
a} :: LogGroup)
logGroup_metricFilterCount :: Lens.Lens' LogGroup (Prelude.Maybe Prelude.Int)
logGroup_metricFilterCount :: (Maybe Int -> f (Maybe Int)) -> LogGroup -> f LogGroup
logGroup_metricFilterCount = (LogGroup -> Maybe Int)
-> (LogGroup -> Maybe Int -> LogGroup)
-> Lens LogGroup LogGroup (Maybe Int) (Maybe Int)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\LogGroup' {Maybe Int
metricFilterCount :: Maybe Int
$sel:metricFilterCount:LogGroup' :: LogGroup -> Maybe Int
metricFilterCount} -> Maybe Int
metricFilterCount) (\s :: LogGroup
s@LogGroup' {} Maybe Int
a -> LogGroup
s {$sel:metricFilterCount:LogGroup' :: Maybe Int
metricFilterCount = Maybe Int
a} :: LogGroup)
logGroup_arn :: Lens.Lens' LogGroup (Prelude.Maybe Prelude.Text)
logGroup_arn :: (Maybe Text -> f (Maybe Text)) -> LogGroup -> f LogGroup
logGroup_arn = (LogGroup -> Maybe Text)
-> (LogGroup -> Maybe Text -> LogGroup)
-> Lens LogGroup LogGroup (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\LogGroup' {Maybe Text
arn :: Maybe Text
$sel:arn:LogGroup' :: LogGroup -> Maybe Text
arn} -> Maybe Text
arn) (\s :: LogGroup
s@LogGroup' {} Maybe Text
a -> LogGroup
s {$sel:arn:LogGroup' :: Maybe Text
arn = Maybe Text
a} :: LogGroup)
logGroup_logGroupName :: Lens.Lens' LogGroup (Prelude.Maybe Prelude.Text)
logGroup_logGroupName :: (Maybe Text -> f (Maybe Text)) -> LogGroup -> f LogGroup
logGroup_logGroupName = (LogGroup -> Maybe Text)
-> (LogGroup -> Maybe Text -> LogGroup)
-> Lens LogGroup LogGroup (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\LogGroup' {Maybe Text
logGroupName :: Maybe Text
$sel:logGroupName:LogGroup' :: LogGroup -> Maybe Text
logGroupName} -> Maybe Text
logGroupName) (\s :: LogGroup
s@LogGroup' {} Maybe Text
a -> LogGroup
s {$sel:logGroupName:LogGroup' :: Maybe Text
logGroupName = Maybe Text
a} :: LogGroup)
logGroup_retentionInDays :: Lens.Lens' LogGroup (Prelude.Maybe Prelude.Int)
logGroup_retentionInDays :: (Maybe Int -> f (Maybe Int)) -> LogGroup -> f LogGroup
logGroup_retentionInDays = (LogGroup -> Maybe Int)
-> (LogGroup -> Maybe Int -> LogGroup)
-> Lens LogGroup LogGroup (Maybe Int) (Maybe Int)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\LogGroup' {Maybe Int
retentionInDays :: Maybe Int
$sel:retentionInDays:LogGroup' :: LogGroup -> Maybe Int
retentionInDays} -> Maybe Int
retentionInDays) (\s :: LogGroup
s@LogGroup' {} Maybe Int
a -> LogGroup
s {$sel:retentionInDays:LogGroup' :: Maybe Int
retentionInDays = Maybe Int
a} :: LogGroup)
logGroup_kmsKeyId :: Lens.Lens' LogGroup (Prelude.Maybe Prelude.Text)
logGroup_kmsKeyId :: (Maybe Text -> f (Maybe Text)) -> LogGroup -> f LogGroup
logGroup_kmsKeyId = (LogGroup -> Maybe Text)
-> (LogGroup -> Maybe Text -> LogGroup)
-> Lens LogGroup LogGroup (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\LogGroup' {Maybe Text
kmsKeyId :: Maybe Text
$sel:kmsKeyId:LogGroup' :: LogGroup -> Maybe Text
kmsKeyId} -> Maybe Text
kmsKeyId) (\s :: LogGroup
s@LogGroup' {} Maybe Text
a -> LogGroup
s {$sel:kmsKeyId:LogGroup' :: Maybe Text
kmsKeyId = Maybe Text
a} :: LogGroup)
logGroup_storedBytes :: Lens.Lens' LogGroup (Prelude.Maybe Prelude.Natural)
logGroup_storedBytes :: (Maybe Natural -> f (Maybe Natural)) -> LogGroup -> f LogGroup
logGroup_storedBytes = (LogGroup -> Maybe Natural)
-> (LogGroup -> Maybe Natural -> LogGroup)
-> Lens LogGroup LogGroup (Maybe Natural) (Maybe Natural)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\LogGroup' {Maybe Natural
storedBytes :: Maybe Natural
$sel:storedBytes:LogGroup' :: LogGroup -> Maybe Natural
storedBytes} -> Maybe Natural
storedBytes) (\s :: LogGroup
s@LogGroup' {} Maybe Natural
a -> LogGroup
s {$sel:storedBytes:LogGroup' :: Maybe Natural
storedBytes = Maybe Natural
a} :: LogGroup)
instance Core.FromJSON LogGroup where
parseJSON :: Value -> Parser LogGroup
parseJSON =
String -> (Object -> Parser LogGroup) -> Value -> Parser LogGroup
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
String
"LogGroup"
( \Object
x ->
Maybe Natural
-> Maybe Int
-> Maybe Text
-> Maybe Text
-> Maybe Int
-> Maybe Text
-> Maybe Natural
-> LogGroup
LogGroup'
(Maybe Natural
-> Maybe Int
-> Maybe Text
-> Maybe Text
-> Maybe Int
-> Maybe Text
-> Maybe Natural
-> LogGroup)
-> Parser (Maybe Natural)
-> Parser
(Maybe Int
-> Maybe Text
-> Maybe Text
-> Maybe Int
-> Maybe Text
-> Maybe Natural
-> LogGroup)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Parser (Maybe Natural)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"creationTime")
Parser
(Maybe Int
-> Maybe Text
-> Maybe Text
-> Maybe Int
-> Maybe Text
-> Maybe Natural
-> LogGroup)
-> Parser (Maybe Int)
-> Parser
(Maybe Text
-> Maybe Text
-> Maybe Int
-> Maybe Text
-> Maybe Natural
-> LogGroup)
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
"metricFilterCount")
Parser
(Maybe Text
-> Maybe Text
-> Maybe Int
-> Maybe Text
-> Maybe Natural
-> LogGroup)
-> Parser (Maybe Text)
-> Parser
(Maybe Text
-> Maybe Int -> Maybe Text -> Maybe Natural -> LogGroup)
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
"arn")
Parser
(Maybe Text
-> Maybe Int -> Maybe Text -> Maybe Natural -> LogGroup)
-> Parser (Maybe Text)
-> Parser (Maybe Int -> Maybe Text -> Maybe Natural -> LogGroup)
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
"logGroupName")
Parser (Maybe Int -> Maybe Text -> Maybe Natural -> LogGroup)
-> Parser (Maybe Int)
-> Parser (Maybe Text -> Maybe Natural -> LogGroup)
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
"retentionInDays")
Parser (Maybe Text -> Maybe Natural -> LogGroup)
-> Parser (Maybe Text) -> Parser (Maybe Natural -> LogGroup)
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
"kmsKeyId")
Parser (Maybe Natural -> LogGroup)
-> Parser (Maybe Natural) -> Parser LogGroup
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Natural)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"storedBytes")
)
instance Prelude.Hashable LogGroup
instance Prelude.NFData LogGroup