{-# 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.ApplicationCostProfiler.Types.ReportDefinition where
import Amazonka.ApplicationCostProfiler.Types.Format
import Amazonka.ApplicationCostProfiler.Types.ReportFrequency
import Amazonka.ApplicationCostProfiler.Types.S3Location
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 ReportDefinition = ReportDefinition'
{
ReportDefinition -> Maybe POSIX
createdAt :: Prelude.Maybe Data.POSIX,
ReportDefinition -> Maybe S3Location
destinationS3Location :: Prelude.Maybe S3Location,
ReportDefinition -> Maybe Format
format :: Prelude.Maybe Format,
ReportDefinition -> Maybe POSIX
lastUpdatedAt :: Prelude.Maybe Data.POSIX,
ReportDefinition -> Maybe Text
reportDescription :: Prelude.Maybe Prelude.Text,
ReportDefinition -> Maybe ReportFrequency
reportFrequency :: Prelude.Maybe ReportFrequency,
ReportDefinition -> Maybe Text
reportId :: Prelude.Maybe Prelude.Text
}
deriving (ReportDefinition -> ReportDefinition -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ReportDefinition -> ReportDefinition -> Bool
$c/= :: ReportDefinition -> ReportDefinition -> Bool
== :: ReportDefinition -> ReportDefinition -> Bool
$c== :: ReportDefinition -> ReportDefinition -> Bool
Prelude.Eq, ReadPrec [ReportDefinition]
ReadPrec ReportDefinition
Int -> ReadS ReportDefinition
ReadS [ReportDefinition]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ReportDefinition]
$creadListPrec :: ReadPrec [ReportDefinition]
readPrec :: ReadPrec ReportDefinition
$creadPrec :: ReadPrec ReportDefinition
readList :: ReadS [ReportDefinition]
$creadList :: ReadS [ReportDefinition]
readsPrec :: Int -> ReadS ReportDefinition
$creadsPrec :: Int -> ReadS ReportDefinition
Prelude.Read, Int -> ReportDefinition -> ShowS
[ReportDefinition] -> ShowS
ReportDefinition -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ReportDefinition] -> ShowS
$cshowList :: [ReportDefinition] -> ShowS
show :: ReportDefinition -> String
$cshow :: ReportDefinition -> String
showsPrec :: Int -> ReportDefinition -> ShowS
$cshowsPrec :: Int -> ReportDefinition -> ShowS
Prelude.Show, forall x. Rep ReportDefinition x -> ReportDefinition
forall x. ReportDefinition -> Rep ReportDefinition x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ReportDefinition x -> ReportDefinition
$cfrom :: forall x. ReportDefinition -> Rep ReportDefinition x
Prelude.Generic)
newReportDefinition ::
ReportDefinition
newReportDefinition :: ReportDefinition
newReportDefinition =
ReportDefinition'
{ $sel:createdAt:ReportDefinition' :: Maybe POSIX
createdAt = forall a. Maybe a
Prelude.Nothing,
$sel:destinationS3Location:ReportDefinition' :: Maybe S3Location
destinationS3Location = forall a. Maybe a
Prelude.Nothing,
$sel:format:ReportDefinition' :: Maybe Format
format = forall a. Maybe a
Prelude.Nothing,
$sel:lastUpdatedAt:ReportDefinition' :: Maybe POSIX
lastUpdatedAt = forall a. Maybe a
Prelude.Nothing,
$sel:reportDescription:ReportDefinition' :: Maybe Text
reportDescription = forall a. Maybe a
Prelude.Nothing,
$sel:reportFrequency:ReportDefinition' :: Maybe ReportFrequency
reportFrequency = forall a. Maybe a
Prelude.Nothing,
$sel:reportId:ReportDefinition' :: Maybe Text
reportId = forall a. Maybe a
Prelude.Nothing
}
reportDefinition_createdAt :: Lens.Lens' ReportDefinition (Prelude.Maybe Prelude.UTCTime)
reportDefinition_createdAt :: Lens' ReportDefinition (Maybe UTCTime)
reportDefinition_createdAt = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ReportDefinition' {Maybe POSIX
createdAt :: Maybe POSIX
$sel:createdAt:ReportDefinition' :: ReportDefinition -> Maybe POSIX
createdAt} -> Maybe POSIX
createdAt) (\s :: ReportDefinition
s@ReportDefinition' {} Maybe POSIX
a -> ReportDefinition
s {$sel:createdAt:ReportDefinition' :: Maybe POSIX
createdAt = Maybe POSIX
a} :: ReportDefinition) 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 (a :: Format). Iso' (Time a) UTCTime
Data._Time
reportDefinition_destinationS3Location :: Lens.Lens' ReportDefinition (Prelude.Maybe S3Location)
reportDefinition_destinationS3Location :: Lens' ReportDefinition (Maybe S3Location)
reportDefinition_destinationS3Location = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ReportDefinition' {Maybe S3Location
destinationS3Location :: Maybe S3Location
$sel:destinationS3Location:ReportDefinition' :: ReportDefinition -> Maybe S3Location
destinationS3Location} -> Maybe S3Location
destinationS3Location) (\s :: ReportDefinition
s@ReportDefinition' {} Maybe S3Location
a -> ReportDefinition
s {$sel:destinationS3Location:ReportDefinition' :: Maybe S3Location
destinationS3Location = Maybe S3Location
a} :: ReportDefinition)
reportDefinition_format :: Lens.Lens' ReportDefinition (Prelude.Maybe Format)
reportDefinition_format :: Lens' ReportDefinition (Maybe Format)
reportDefinition_format = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ReportDefinition' {Maybe Format
format :: Maybe Format
$sel:format:ReportDefinition' :: ReportDefinition -> Maybe Format
format} -> Maybe Format
format) (\s :: ReportDefinition
s@ReportDefinition' {} Maybe Format
a -> ReportDefinition
s {$sel:format:ReportDefinition' :: Maybe Format
format = Maybe Format
a} :: ReportDefinition)
reportDefinition_lastUpdatedAt :: Lens.Lens' ReportDefinition (Prelude.Maybe Prelude.UTCTime)
reportDefinition_lastUpdatedAt :: Lens' ReportDefinition (Maybe UTCTime)
reportDefinition_lastUpdatedAt = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ReportDefinition' {Maybe POSIX
lastUpdatedAt :: Maybe POSIX
$sel:lastUpdatedAt:ReportDefinition' :: ReportDefinition -> Maybe POSIX
lastUpdatedAt} -> Maybe POSIX
lastUpdatedAt) (\s :: ReportDefinition
s@ReportDefinition' {} Maybe POSIX
a -> ReportDefinition
s {$sel:lastUpdatedAt:ReportDefinition' :: Maybe POSIX
lastUpdatedAt = Maybe POSIX
a} :: ReportDefinition) 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 (a :: Format). Iso' (Time a) UTCTime
Data._Time
reportDefinition_reportDescription :: Lens.Lens' ReportDefinition (Prelude.Maybe Prelude.Text)
reportDefinition_reportDescription :: Lens' ReportDefinition (Maybe Text)
reportDefinition_reportDescription = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ReportDefinition' {Maybe Text
reportDescription :: Maybe Text
$sel:reportDescription:ReportDefinition' :: ReportDefinition -> Maybe Text
reportDescription} -> Maybe Text
reportDescription) (\s :: ReportDefinition
s@ReportDefinition' {} Maybe Text
a -> ReportDefinition
s {$sel:reportDescription:ReportDefinition' :: Maybe Text
reportDescription = Maybe Text
a} :: ReportDefinition)
reportDefinition_reportFrequency :: Lens.Lens' ReportDefinition (Prelude.Maybe ReportFrequency)
reportDefinition_reportFrequency :: Lens' ReportDefinition (Maybe ReportFrequency)
reportDefinition_reportFrequency = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ReportDefinition' {Maybe ReportFrequency
reportFrequency :: Maybe ReportFrequency
$sel:reportFrequency:ReportDefinition' :: ReportDefinition -> Maybe ReportFrequency
reportFrequency} -> Maybe ReportFrequency
reportFrequency) (\s :: ReportDefinition
s@ReportDefinition' {} Maybe ReportFrequency
a -> ReportDefinition
s {$sel:reportFrequency:ReportDefinition' :: Maybe ReportFrequency
reportFrequency = Maybe ReportFrequency
a} :: ReportDefinition)
reportDefinition_reportId :: Lens.Lens' ReportDefinition (Prelude.Maybe Prelude.Text)
reportDefinition_reportId :: Lens' ReportDefinition (Maybe Text)
reportDefinition_reportId = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ReportDefinition' {Maybe Text
reportId :: Maybe Text
$sel:reportId:ReportDefinition' :: ReportDefinition -> Maybe Text
reportId} -> Maybe Text
reportId) (\s :: ReportDefinition
s@ReportDefinition' {} Maybe Text
a -> ReportDefinition
s {$sel:reportId:ReportDefinition' :: Maybe Text
reportId = Maybe Text
a} :: ReportDefinition)
instance Data.FromJSON ReportDefinition where
parseJSON :: Value -> Parser ReportDefinition
parseJSON =
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
String
"ReportDefinition"
( \Object
x ->
Maybe POSIX
-> Maybe S3Location
-> Maybe Format
-> Maybe POSIX
-> Maybe Text
-> Maybe ReportFrequency
-> Maybe Text
-> ReportDefinition
ReportDefinition'
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
"createdAt")
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
"destinationS3Location")
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
"format")
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
"lastUpdatedAt")
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
"reportDescription")
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
"reportFrequency")
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
"reportId")
)
instance Prelude.Hashable ReportDefinition where
hashWithSalt :: Int -> ReportDefinition -> Int
hashWithSalt Int
_salt ReportDefinition' {Maybe Text
Maybe POSIX
Maybe Format
Maybe ReportFrequency
Maybe S3Location
reportId :: Maybe Text
reportFrequency :: Maybe ReportFrequency
reportDescription :: Maybe Text
lastUpdatedAt :: Maybe POSIX
format :: Maybe Format
destinationS3Location :: Maybe S3Location
createdAt :: Maybe POSIX
$sel:reportId:ReportDefinition' :: ReportDefinition -> Maybe Text
$sel:reportFrequency:ReportDefinition' :: ReportDefinition -> Maybe ReportFrequency
$sel:reportDescription:ReportDefinition' :: ReportDefinition -> Maybe Text
$sel:lastUpdatedAt:ReportDefinition' :: ReportDefinition -> Maybe POSIX
$sel:format:ReportDefinition' :: ReportDefinition -> Maybe Format
$sel:destinationS3Location:ReportDefinition' :: ReportDefinition -> Maybe S3Location
$sel:createdAt:ReportDefinition' :: ReportDefinition -> Maybe POSIX
..} =
Int
_salt
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe POSIX
createdAt
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe S3Location
destinationS3Location
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Format
format
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe POSIX
lastUpdatedAt
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
reportDescription
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe ReportFrequency
reportFrequency
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
reportId
instance Prelude.NFData ReportDefinition where
rnf :: ReportDefinition -> ()
rnf ReportDefinition' {Maybe Text
Maybe POSIX
Maybe Format
Maybe ReportFrequency
Maybe S3Location
reportId :: Maybe Text
reportFrequency :: Maybe ReportFrequency
reportDescription :: Maybe Text
lastUpdatedAt :: Maybe POSIX
format :: Maybe Format
destinationS3Location :: Maybe S3Location
createdAt :: Maybe POSIX
$sel:reportId:ReportDefinition' :: ReportDefinition -> Maybe Text
$sel:reportFrequency:ReportDefinition' :: ReportDefinition -> Maybe ReportFrequency
$sel:reportDescription:ReportDefinition' :: ReportDefinition -> Maybe Text
$sel:lastUpdatedAt:ReportDefinition' :: ReportDefinition -> Maybe POSIX
$sel:format:ReportDefinition' :: ReportDefinition -> Maybe Format
$sel:destinationS3Location:ReportDefinition' :: ReportDefinition -> Maybe S3Location
$sel:createdAt:ReportDefinition' :: ReportDefinition -> Maybe POSIX
..} =
forall a. NFData a => a -> ()
Prelude.rnf Maybe POSIX
createdAt
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe S3Location
destinationS3Location
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Format
format
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe POSIX
lastUpdatedAt
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
reportDescription
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe ReportFrequency
reportFrequency
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
reportId