{-# 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.AppStream.Types.UsageReportSubscription where
import Amazonka.AppStream.Types.LastReportGenerationExecutionError
import Amazonka.AppStream.Types.UsageReportSchedule
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 UsageReportSubscription = UsageReportSubscription'
{
UsageReportSubscription -> Maybe POSIX
lastGeneratedReportDate :: Prelude.Maybe Data.POSIX,
UsageReportSubscription -> Maybe Text
s3BucketName :: Prelude.Maybe Prelude.Text,
UsageReportSubscription -> Maybe UsageReportSchedule
schedule :: Prelude.Maybe UsageReportSchedule,
UsageReportSubscription
-> Maybe [LastReportGenerationExecutionError]
subscriptionErrors :: Prelude.Maybe [LastReportGenerationExecutionError]
}
deriving (UsageReportSubscription -> UsageReportSubscription -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: UsageReportSubscription -> UsageReportSubscription -> Bool
$c/= :: UsageReportSubscription -> UsageReportSubscription -> Bool
== :: UsageReportSubscription -> UsageReportSubscription -> Bool
$c== :: UsageReportSubscription -> UsageReportSubscription -> Bool
Prelude.Eq, ReadPrec [UsageReportSubscription]
ReadPrec UsageReportSubscription
Int -> ReadS UsageReportSubscription
ReadS [UsageReportSubscription]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [UsageReportSubscription]
$creadListPrec :: ReadPrec [UsageReportSubscription]
readPrec :: ReadPrec UsageReportSubscription
$creadPrec :: ReadPrec UsageReportSubscription
readList :: ReadS [UsageReportSubscription]
$creadList :: ReadS [UsageReportSubscription]
readsPrec :: Int -> ReadS UsageReportSubscription
$creadsPrec :: Int -> ReadS UsageReportSubscription
Prelude.Read, Int -> UsageReportSubscription -> ShowS
[UsageReportSubscription] -> ShowS
UsageReportSubscription -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [UsageReportSubscription] -> ShowS
$cshowList :: [UsageReportSubscription] -> ShowS
show :: UsageReportSubscription -> String
$cshow :: UsageReportSubscription -> String
showsPrec :: Int -> UsageReportSubscription -> ShowS
$cshowsPrec :: Int -> UsageReportSubscription -> ShowS
Prelude.Show, forall x. Rep UsageReportSubscription x -> UsageReportSubscription
forall x. UsageReportSubscription -> Rep UsageReportSubscription x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep UsageReportSubscription x -> UsageReportSubscription
$cfrom :: forall x. UsageReportSubscription -> Rep UsageReportSubscription x
Prelude.Generic)
newUsageReportSubscription ::
UsageReportSubscription
newUsageReportSubscription :: UsageReportSubscription
newUsageReportSubscription =
UsageReportSubscription'
{ $sel:lastGeneratedReportDate:UsageReportSubscription' :: Maybe POSIX
lastGeneratedReportDate =
forall a. Maybe a
Prelude.Nothing,
$sel:s3BucketName:UsageReportSubscription' :: Maybe Text
s3BucketName = forall a. Maybe a
Prelude.Nothing,
$sel:schedule:UsageReportSubscription' :: Maybe UsageReportSchedule
schedule = forall a. Maybe a
Prelude.Nothing,
$sel:subscriptionErrors:UsageReportSubscription' :: Maybe [LastReportGenerationExecutionError]
subscriptionErrors = forall a. Maybe a
Prelude.Nothing
}
usageReportSubscription_lastGeneratedReportDate :: Lens.Lens' UsageReportSubscription (Prelude.Maybe Prelude.UTCTime)
usageReportSubscription_lastGeneratedReportDate :: Lens' UsageReportSubscription (Maybe UTCTime)
usageReportSubscription_lastGeneratedReportDate = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UsageReportSubscription' {Maybe POSIX
lastGeneratedReportDate :: Maybe POSIX
$sel:lastGeneratedReportDate:UsageReportSubscription' :: UsageReportSubscription -> Maybe POSIX
lastGeneratedReportDate} -> Maybe POSIX
lastGeneratedReportDate) (\s :: UsageReportSubscription
s@UsageReportSubscription' {} Maybe POSIX
a -> UsageReportSubscription
s {$sel:lastGeneratedReportDate:UsageReportSubscription' :: Maybe POSIX
lastGeneratedReportDate = Maybe POSIX
a} :: UsageReportSubscription) 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
usageReportSubscription_s3BucketName :: Lens.Lens' UsageReportSubscription (Prelude.Maybe Prelude.Text)
usageReportSubscription_s3BucketName :: Lens' UsageReportSubscription (Maybe Text)
usageReportSubscription_s3BucketName = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UsageReportSubscription' {Maybe Text
s3BucketName :: Maybe Text
$sel:s3BucketName:UsageReportSubscription' :: UsageReportSubscription -> Maybe Text
s3BucketName} -> Maybe Text
s3BucketName) (\s :: UsageReportSubscription
s@UsageReportSubscription' {} Maybe Text
a -> UsageReportSubscription
s {$sel:s3BucketName:UsageReportSubscription' :: Maybe Text
s3BucketName = Maybe Text
a} :: UsageReportSubscription)
usageReportSubscription_schedule :: Lens.Lens' UsageReportSubscription (Prelude.Maybe UsageReportSchedule)
usageReportSubscription_schedule :: Lens' UsageReportSubscription (Maybe UsageReportSchedule)
usageReportSubscription_schedule = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UsageReportSubscription' {Maybe UsageReportSchedule
schedule :: Maybe UsageReportSchedule
$sel:schedule:UsageReportSubscription' :: UsageReportSubscription -> Maybe UsageReportSchedule
schedule} -> Maybe UsageReportSchedule
schedule) (\s :: UsageReportSubscription
s@UsageReportSubscription' {} Maybe UsageReportSchedule
a -> UsageReportSubscription
s {$sel:schedule:UsageReportSubscription' :: Maybe UsageReportSchedule
schedule = Maybe UsageReportSchedule
a} :: UsageReportSubscription)
usageReportSubscription_subscriptionErrors :: Lens.Lens' UsageReportSubscription (Prelude.Maybe [LastReportGenerationExecutionError])
usageReportSubscription_subscriptionErrors :: Lens'
UsageReportSubscription
(Maybe [LastReportGenerationExecutionError])
usageReportSubscription_subscriptionErrors = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UsageReportSubscription' {Maybe [LastReportGenerationExecutionError]
subscriptionErrors :: Maybe [LastReportGenerationExecutionError]
$sel:subscriptionErrors:UsageReportSubscription' :: UsageReportSubscription
-> Maybe [LastReportGenerationExecutionError]
subscriptionErrors} -> Maybe [LastReportGenerationExecutionError]
subscriptionErrors) (\s :: UsageReportSubscription
s@UsageReportSubscription' {} Maybe [LastReportGenerationExecutionError]
a -> UsageReportSubscription
s {$sel:subscriptionErrors:UsageReportSubscription' :: Maybe [LastReportGenerationExecutionError]
subscriptionErrors = Maybe [LastReportGenerationExecutionError]
a} :: UsageReportSubscription) 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 s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced
instance Data.FromJSON UsageReportSubscription where
parseJSON :: Value -> Parser UsageReportSubscription
parseJSON =
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
String
"UsageReportSubscription"
( \Object
x ->
Maybe POSIX
-> Maybe Text
-> Maybe UsageReportSchedule
-> Maybe [LastReportGenerationExecutionError]
-> UsageReportSubscription
UsageReportSubscription'
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
"LastGeneratedReportDate")
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
"S3BucketName")
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
"Schedule")
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
"SubscriptionErrors"
forall a. Parser (Maybe a) -> a -> Parser a
Data..!= forall a. Monoid a => a
Prelude.mempty
)
)
instance Prelude.Hashable UsageReportSubscription where
hashWithSalt :: Int -> UsageReportSubscription -> Int
hashWithSalt Int
_salt UsageReportSubscription' {Maybe [LastReportGenerationExecutionError]
Maybe Text
Maybe POSIX
Maybe UsageReportSchedule
subscriptionErrors :: Maybe [LastReportGenerationExecutionError]
schedule :: Maybe UsageReportSchedule
s3BucketName :: Maybe Text
lastGeneratedReportDate :: Maybe POSIX
$sel:subscriptionErrors:UsageReportSubscription' :: UsageReportSubscription
-> Maybe [LastReportGenerationExecutionError]
$sel:schedule:UsageReportSubscription' :: UsageReportSubscription -> Maybe UsageReportSchedule
$sel:s3BucketName:UsageReportSubscription' :: UsageReportSubscription -> Maybe Text
$sel:lastGeneratedReportDate:UsageReportSubscription' :: UsageReportSubscription -> Maybe POSIX
..} =
Int
_salt
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe POSIX
lastGeneratedReportDate
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
s3BucketName
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe UsageReportSchedule
schedule
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe [LastReportGenerationExecutionError]
subscriptionErrors
instance Prelude.NFData UsageReportSubscription where
rnf :: UsageReportSubscription -> ()
rnf UsageReportSubscription' {Maybe [LastReportGenerationExecutionError]
Maybe Text
Maybe POSIX
Maybe UsageReportSchedule
subscriptionErrors :: Maybe [LastReportGenerationExecutionError]
schedule :: Maybe UsageReportSchedule
s3BucketName :: Maybe Text
lastGeneratedReportDate :: Maybe POSIX
$sel:subscriptionErrors:UsageReportSubscription' :: UsageReportSubscription
-> Maybe [LastReportGenerationExecutionError]
$sel:schedule:UsageReportSubscription' :: UsageReportSubscription -> Maybe UsageReportSchedule
$sel:s3BucketName:UsageReportSubscription' :: UsageReportSubscription -> Maybe Text
$sel:lastGeneratedReportDate:UsageReportSubscription' :: UsageReportSubscription -> Maybe POSIX
..} =
forall a. NFData a => a -> ()
Prelude.rnf Maybe POSIX
lastGeneratedReportDate
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
s3BucketName
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe UsageReportSchedule
schedule
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe [LastReportGenerationExecutionError]
subscriptionErrors