{-# 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 Amazonka.CloudWatchLogs.Types.DataProtectionStatus
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 LogGroup = LogGroup'
{
LogGroup -> Maybe Text
arn :: Prelude.Maybe Prelude.Text,
LogGroup -> Maybe Natural
creationTime :: Prelude.Maybe Prelude.Natural,
LogGroup -> Maybe DataProtectionStatus
dataProtectionStatus :: Prelude.Maybe DataProtectionStatus,
LogGroup -> Maybe Text
kmsKeyId :: Prelude.Maybe Prelude.Text,
LogGroup -> Maybe Text
logGroupName :: Prelude.Maybe Prelude.Text,
LogGroup -> Maybe Int
metricFilterCount :: Prelude.Maybe Prelude.Int,
LogGroup -> Maybe Int
retentionInDays :: Prelude.Maybe Prelude.Int,
LogGroup -> Maybe Natural
storedBytes :: Prelude.Maybe Prelude.Natural
}
deriving (LogGroup -> LogGroup -> Bool
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]
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
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. 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'
{ $sel:arn:LogGroup' :: Maybe Text
arn = forall a. Maybe a
Prelude.Nothing,
$sel:creationTime:LogGroup' :: Maybe Natural
creationTime = forall a. Maybe a
Prelude.Nothing,
$sel:dataProtectionStatus:LogGroup' :: Maybe DataProtectionStatus
dataProtectionStatus = forall a. Maybe a
Prelude.Nothing,
$sel:kmsKeyId:LogGroup' :: Maybe Text
kmsKeyId = forall a. Maybe a
Prelude.Nothing,
$sel:logGroupName:LogGroup' :: Maybe Text
logGroupName = forall a. Maybe a
Prelude.Nothing,
$sel:metricFilterCount:LogGroup' :: Maybe Int
metricFilterCount = forall a. Maybe a
Prelude.Nothing,
$sel:retentionInDays:LogGroup' :: Maybe Int
retentionInDays = forall a. Maybe a
Prelude.Nothing,
$sel:storedBytes:LogGroup' :: Maybe Natural
storedBytes = forall a. Maybe a
Prelude.Nothing
}
logGroup_arn :: Lens.Lens' LogGroup (Prelude.Maybe Prelude.Text)
logGroup_arn :: Lens' LogGroup (Maybe Text)
logGroup_arn = 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_creationTime :: Lens.Lens' LogGroup (Prelude.Maybe Prelude.Natural)
logGroup_creationTime :: Lens' LogGroup (Maybe Natural)
logGroup_creationTime = 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_dataProtectionStatus :: Lens.Lens' LogGroup (Prelude.Maybe DataProtectionStatus)
logGroup_dataProtectionStatus :: Lens' LogGroup (Maybe DataProtectionStatus)
logGroup_dataProtectionStatus = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\LogGroup' {Maybe DataProtectionStatus
dataProtectionStatus :: Maybe DataProtectionStatus
$sel:dataProtectionStatus:LogGroup' :: LogGroup -> Maybe DataProtectionStatus
dataProtectionStatus} -> Maybe DataProtectionStatus
dataProtectionStatus) (\s :: LogGroup
s@LogGroup' {} Maybe DataProtectionStatus
a -> LogGroup
s {$sel:dataProtectionStatus:LogGroup' :: Maybe DataProtectionStatus
dataProtectionStatus = Maybe DataProtectionStatus
a} :: LogGroup)
logGroup_kmsKeyId :: Lens.Lens' LogGroup (Prelude.Maybe Prelude.Text)
logGroup_kmsKeyId :: Lens' LogGroup (Maybe Text)
logGroup_kmsKeyId = 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_logGroupName :: Lens.Lens' LogGroup (Prelude.Maybe Prelude.Text)
logGroup_logGroupName :: Lens' LogGroup (Maybe Text)
logGroup_logGroupName = 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_metricFilterCount :: Lens.Lens' LogGroup (Prelude.Maybe Prelude.Int)
logGroup_metricFilterCount :: Lens' LogGroup (Maybe Int)
logGroup_metricFilterCount = 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_retentionInDays :: Lens.Lens' LogGroup (Prelude.Maybe Prelude.Int)
logGroup_retentionInDays :: Lens' LogGroup (Maybe Int)
logGroup_retentionInDays = 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_storedBytes :: Lens.Lens' LogGroup (Prelude.Maybe Prelude.Natural)
logGroup_storedBytes :: Lens' LogGroup (Maybe Natural)
logGroup_storedBytes = 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 Data.FromJSON LogGroup where
parseJSON :: Value -> Parser LogGroup
parseJSON =
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
String
"LogGroup"
( \Object
x ->
Maybe Text
-> Maybe Natural
-> Maybe DataProtectionStatus
-> Maybe Text
-> Maybe Text
-> Maybe Int
-> Maybe Int
-> Maybe Natural
-> LogGroup
LogGroup'
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
"arn")
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"creationTime")
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"dataProtectionStatus")
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"kmsKeyId")
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"logGroupName")
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"metricFilterCount")
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"retentionInDays")
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"storedBytes")
)
instance Prelude.Hashable LogGroup where
hashWithSalt :: Int -> LogGroup -> Int
hashWithSalt Int
_salt LogGroup' {Maybe Int
Maybe Natural
Maybe Text
Maybe DataProtectionStatus
storedBytes :: Maybe Natural
retentionInDays :: Maybe Int
metricFilterCount :: Maybe Int
logGroupName :: Maybe Text
kmsKeyId :: Maybe Text
dataProtectionStatus :: Maybe DataProtectionStatus
creationTime :: Maybe Natural
arn :: Maybe Text
$sel:storedBytes:LogGroup' :: LogGroup -> Maybe Natural
$sel:retentionInDays:LogGroup' :: LogGroup -> Maybe Int
$sel:metricFilterCount:LogGroup' :: LogGroup -> Maybe Int
$sel:logGroupName:LogGroup' :: LogGroup -> Maybe Text
$sel:kmsKeyId:LogGroup' :: LogGroup -> Maybe Text
$sel:dataProtectionStatus:LogGroup' :: LogGroup -> Maybe DataProtectionStatus
$sel:creationTime:LogGroup' :: LogGroup -> Maybe Natural
$sel:arn:LogGroup' :: LogGroup -> Maybe Text
..} =
Int
_salt
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
arn
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Natural
creationTime
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe DataProtectionStatus
dataProtectionStatus
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
kmsKeyId
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
logGroupName
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Int
metricFilterCount
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Int
retentionInDays
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Natural
storedBytes
instance Prelude.NFData LogGroup where
rnf :: LogGroup -> ()
rnf LogGroup' {Maybe Int
Maybe Natural
Maybe Text
Maybe DataProtectionStatus
storedBytes :: Maybe Natural
retentionInDays :: Maybe Int
metricFilterCount :: Maybe Int
logGroupName :: Maybe Text
kmsKeyId :: Maybe Text
dataProtectionStatus :: Maybe DataProtectionStatus
creationTime :: Maybe Natural
arn :: Maybe Text
$sel:storedBytes:LogGroup' :: LogGroup -> Maybe Natural
$sel:retentionInDays:LogGroup' :: LogGroup -> Maybe Int
$sel:metricFilterCount:LogGroup' :: LogGroup -> Maybe Int
$sel:logGroupName:LogGroup' :: LogGroup -> Maybe Text
$sel:kmsKeyId:LogGroup' :: LogGroup -> Maybe Text
$sel:dataProtectionStatus:LogGroup' :: LogGroup -> Maybe DataProtectionStatus
$sel:creationTime:LogGroup' :: LogGroup -> Maybe Natural
$sel:arn:LogGroup' :: LogGroup -> Maybe Text
..} =
forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
arn
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Natural
creationTime
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe DataProtectionStatus
dataProtectionStatus
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
kmsKeyId
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
logGroupName
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Int
metricFilterCount
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Int
retentionInDays
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Natural
storedBytes