{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE DuplicateRecordFields #-}
{-# LANGUAGE NamedFieldPuns #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE RecordWildCards #-}
{-# LANGUAGE StrictData #-}
{-# LANGUAGE TypeFamilies #-}
{-# LANGUAGE NoImplicitPrelude #-}
{-# OPTIONS_GHC -fno-warn-unused-binds #-}
{-# OPTIONS_GHC -fno-warn-unused-imports #-}
{-# OPTIONS_GHC -fno-warn-unused-matches #-}
module Amazonka.ApplicationCostProfiler.GetReportDefinition
(
GetReportDefinition (..),
newGetReportDefinition,
getReportDefinition_reportId,
GetReportDefinitionResponse (..),
newGetReportDefinitionResponse,
getReportDefinitionResponse_httpStatus,
getReportDefinitionResponse_reportId,
getReportDefinitionResponse_reportDescription,
getReportDefinitionResponse_reportFrequency,
getReportDefinitionResponse_format,
getReportDefinitionResponse_destinationS3Location,
getReportDefinitionResponse_createdAt,
getReportDefinitionResponse_lastUpdated,
)
where
import Amazonka.ApplicationCostProfiler.Types
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
import qualified Amazonka.Request as Request
import qualified Amazonka.Response as Response
data GetReportDefinition = GetReportDefinition'
{
GetReportDefinition -> Text
reportId :: Prelude.Text
}
deriving (GetReportDefinition -> GetReportDefinition -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: GetReportDefinition -> GetReportDefinition -> Bool
$c/= :: GetReportDefinition -> GetReportDefinition -> Bool
== :: GetReportDefinition -> GetReportDefinition -> Bool
$c== :: GetReportDefinition -> GetReportDefinition -> Bool
Prelude.Eq, ReadPrec [GetReportDefinition]
ReadPrec GetReportDefinition
Int -> ReadS GetReportDefinition
ReadS [GetReportDefinition]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [GetReportDefinition]
$creadListPrec :: ReadPrec [GetReportDefinition]
readPrec :: ReadPrec GetReportDefinition
$creadPrec :: ReadPrec GetReportDefinition
readList :: ReadS [GetReportDefinition]
$creadList :: ReadS [GetReportDefinition]
readsPrec :: Int -> ReadS GetReportDefinition
$creadsPrec :: Int -> ReadS GetReportDefinition
Prelude.Read, Int -> GetReportDefinition -> ShowS
[GetReportDefinition] -> ShowS
GetReportDefinition -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [GetReportDefinition] -> ShowS
$cshowList :: [GetReportDefinition] -> ShowS
show :: GetReportDefinition -> String
$cshow :: GetReportDefinition -> String
showsPrec :: Int -> GetReportDefinition -> ShowS
$cshowsPrec :: Int -> GetReportDefinition -> ShowS
Prelude.Show, forall x. Rep GetReportDefinition x -> GetReportDefinition
forall x. GetReportDefinition -> Rep GetReportDefinition x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep GetReportDefinition x -> GetReportDefinition
$cfrom :: forall x. GetReportDefinition -> Rep GetReportDefinition x
Prelude.Generic)
newGetReportDefinition ::
Prelude.Text ->
GetReportDefinition
newGetReportDefinition :: Text -> GetReportDefinition
newGetReportDefinition Text
pReportId_ =
GetReportDefinition' {$sel:reportId:GetReportDefinition' :: Text
reportId = Text
pReportId_}
getReportDefinition_reportId :: Lens.Lens' GetReportDefinition Prelude.Text
getReportDefinition_reportId :: Lens' GetReportDefinition Text
getReportDefinition_reportId = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetReportDefinition' {Text
reportId :: Text
$sel:reportId:GetReportDefinition' :: GetReportDefinition -> Text
reportId} -> Text
reportId) (\s :: GetReportDefinition
s@GetReportDefinition' {} Text
a -> GetReportDefinition
s {$sel:reportId:GetReportDefinition' :: Text
reportId = Text
a} :: GetReportDefinition)
instance Core.AWSRequest GetReportDefinition where
type
AWSResponse GetReportDefinition =
GetReportDefinitionResponse
request :: (Service -> Service)
-> GetReportDefinition -> Request GetReportDefinition
request Service -> Service
overrides =
forall a. ToRequest a => Service -> a -> Request a
Request.get (Service -> Service
overrides Service
defaultService)
response :: forall (m :: * -> *).
MonadResource m =>
(ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy GetReportDefinition
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse GetReportDefinition)))
response =
forall (m :: * -> *) a.
MonadResource m =>
(Int -> ResponseHeaders -> Object -> Either String (AWSResponse a))
-> (ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveJSON
( \Int
s ResponseHeaders
h Object
x ->
Int
-> Text
-> Text
-> ReportFrequency
-> Format
-> S3Location
-> POSIX
-> POSIX
-> GetReportDefinitionResponse
GetReportDefinitionResponse'
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (forall (f :: * -> *) a. Applicative f => a -> f a
Prelude.pure (forall a. Enum a => a -> Int
Prelude.fromEnum Int
s))
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Either String a
Data..:> Key
"reportId")
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Either String 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 -> Either String 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 -> Either String 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 -> Either String 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 -> Either String 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 -> Either String a
Data..:> Key
"lastUpdated")
)
instance Prelude.Hashable GetReportDefinition where
hashWithSalt :: Int -> GetReportDefinition -> Int
hashWithSalt Int
_salt GetReportDefinition' {Text
reportId :: Text
$sel:reportId:GetReportDefinition' :: GetReportDefinition -> Text
..} =
Int
_salt forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
reportId
instance Prelude.NFData GetReportDefinition where
rnf :: GetReportDefinition -> ()
rnf GetReportDefinition' {Text
reportId :: Text
$sel:reportId:GetReportDefinition' :: GetReportDefinition -> Text
..} = forall a. NFData a => a -> ()
Prelude.rnf Text
reportId
instance Data.ToHeaders GetReportDefinition where
toHeaders :: GetReportDefinition -> ResponseHeaders
toHeaders =
forall a b. a -> b -> a
Prelude.const
( forall a. Monoid a => [a] -> a
Prelude.mconcat
[ HeaderName
"Content-Type"
forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Data.=# ( ByteString
"application/x-amz-json-1.1" ::
Prelude.ByteString
)
]
)
instance Data.ToPath GetReportDefinition where
toPath :: GetReportDefinition -> ByteString
toPath GetReportDefinition' {Text
reportId :: Text
$sel:reportId:GetReportDefinition' :: GetReportDefinition -> Text
..} =
forall a. Monoid a => [a] -> a
Prelude.mconcat
[ByteString
"/reportDefinition/", forall a. ToByteString a => a -> ByteString
Data.toBS Text
reportId]
instance Data.ToQuery GetReportDefinition where
toQuery :: GetReportDefinition -> QueryString
toQuery = forall a b. a -> b -> a
Prelude.const forall a. Monoid a => a
Prelude.mempty
data GetReportDefinitionResponse = GetReportDefinitionResponse'
{
GetReportDefinitionResponse -> Int
httpStatus :: Prelude.Int,
GetReportDefinitionResponse -> Text
reportId :: Prelude.Text,
GetReportDefinitionResponse -> Text
reportDescription :: Prelude.Text,
GetReportDefinitionResponse -> ReportFrequency
reportFrequency :: ReportFrequency,
GetReportDefinitionResponse -> Format
format :: Format,
GetReportDefinitionResponse -> S3Location
destinationS3Location :: S3Location,
GetReportDefinitionResponse -> POSIX
createdAt :: Data.POSIX,
GetReportDefinitionResponse -> POSIX
lastUpdated :: Data.POSIX
}
deriving (GetReportDefinitionResponse -> GetReportDefinitionResponse -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: GetReportDefinitionResponse -> GetReportDefinitionResponse -> Bool
$c/= :: GetReportDefinitionResponse -> GetReportDefinitionResponse -> Bool
== :: GetReportDefinitionResponse -> GetReportDefinitionResponse -> Bool
$c== :: GetReportDefinitionResponse -> GetReportDefinitionResponse -> Bool
Prelude.Eq, ReadPrec [GetReportDefinitionResponse]
ReadPrec GetReportDefinitionResponse
Int -> ReadS GetReportDefinitionResponse
ReadS [GetReportDefinitionResponse]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [GetReportDefinitionResponse]
$creadListPrec :: ReadPrec [GetReportDefinitionResponse]
readPrec :: ReadPrec GetReportDefinitionResponse
$creadPrec :: ReadPrec GetReportDefinitionResponse
readList :: ReadS [GetReportDefinitionResponse]
$creadList :: ReadS [GetReportDefinitionResponse]
readsPrec :: Int -> ReadS GetReportDefinitionResponse
$creadsPrec :: Int -> ReadS GetReportDefinitionResponse
Prelude.Read, Int -> GetReportDefinitionResponse -> ShowS
[GetReportDefinitionResponse] -> ShowS
GetReportDefinitionResponse -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [GetReportDefinitionResponse] -> ShowS
$cshowList :: [GetReportDefinitionResponse] -> ShowS
show :: GetReportDefinitionResponse -> String
$cshow :: GetReportDefinitionResponse -> String
showsPrec :: Int -> GetReportDefinitionResponse -> ShowS
$cshowsPrec :: Int -> GetReportDefinitionResponse -> ShowS
Prelude.Show, forall x.
Rep GetReportDefinitionResponse x -> GetReportDefinitionResponse
forall x.
GetReportDefinitionResponse -> Rep GetReportDefinitionResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep GetReportDefinitionResponse x -> GetReportDefinitionResponse
$cfrom :: forall x.
GetReportDefinitionResponse -> Rep GetReportDefinitionResponse x
Prelude.Generic)
newGetReportDefinitionResponse ::
Prelude.Int ->
Prelude.Text ->
Prelude.Text ->
ReportFrequency ->
Format ->
S3Location ->
Prelude.UTCTime ->
Prelude.UTCTime ->
GetReportDefinitionResponse
newGetReportDefinitionResponse :: Int
-> Text
-> Text
-> ReportFrequency
-> Format
-> S3Location
-> UTCTime
-> UTCTime
-> GetReportDefinitionResponse
newGetReportDefinitionResponse
Int
pHttpStatus_
Text
pReportId_
Text
pReportDescription_
ReportFrequency
pReportFrequency_
Format
pFormat_
S3Location
pDestinationS3Location_
UTCTime
pCreatedAt_
UTCTime
pLastUpdated_ =
GetReportDefinitionResponse'
{ $sel:httpStatus:GetReportDefinitionResponse' :: Int
httpStatus =
Int
pHttpStatus_,
$sel:reportId:GetReportDefinitionResponse' :: Text
reportId = Text
pReportId_,
$sel:reportDescription:GetReportDefinitionResponse' :: Text
reportDescription = Text
pReportDescription_,
$sel:reportFrequency:GetReportDefinitionResponse' :: ReportFrequency
reportFrequency = ReportFrequency
pReportFrequency_,
$sel:format:GetReportDefinitionResponse' :: Format
format = Format
pFormat_,
$sel:destinationS3Location:GetReportDefinitionResponse' :: S3Location
destinationS3Location =
S3Location
pDestinationS3Location_,
$sel:createdAt:GetReportDefinitionResponse' :: POSIX
createdAt = forall (a :: Format). Iso' (Time a) UTCTime
Data._Time forall t b. AReview t b -> b -> t
Lens.# UTCTime
pCreatedAt_,
$sel:lastUpdated:GetReportDefinitionResponse' :: POSIX
lastUpdated = forall (a :: Format). Iso' (Time a) UTCTime
Data._Time forall t b. AReview t b -> b -> t
Lens.# UTCTime
pLastUpdated_
}
getReportDefinitionResponse_httpStatus :: Lens.Lens' GetReportDefinitionResponse Prelude.Int
getReportDefinitionResponse_httpStatus :: Lens' GetReportDefinitionResponse Int
getReportDefinitionResponse_httpStatus = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetReportDefinitionResponse' {Int
httpStatus :: Int
$sel:httpStatus:GetReportDefinitionResponse' :: GetReportDefinitionResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: GetReportDefinitionResponse
s@GetReportDefinitionResponse' {} Int
a -> GetReportDefinitionResponse
s {$sel:httpStatus:GetReportDefinitionResponse' :: Int
httpStatus = Int
a} :: GetReportDefinitionResponse)
getReportDefinitionResponse_reportId :: Lens.Lens' GetReportDefinitionResponse Prelude.Text
getReportDefinitionResponse_reportId :: Lens' GetReportDefinitionResponse Text
getReportDefinitionResponse_reportId = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetReportDefinitionResponse' {Text
reportId :: Text
$sel:reportId:GetReportDefinitionResponse' :: GetReportDefinitionResponse -> Text
reportId} -> Text
reportId) (\s :: GetReportDefinitionResponse
s@GetReportDefinitionResponse' {} Text
a -> GetReportDefinitionResponse
s {$sel:reportId:GetReportDefinitionResponse' :: Text
reportId = Text
a} :: GetReportDefinitionResponse)
getReportDefinitionResponse_reportDescription :: Lens.Lens' GetReportDefinitionResponse Prelude.Text
getReportDefinitionResponse_reportDescription :: Lens' GetReportDefinitionResponse Text
getReportDefinitionResponse_reportDescription = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetReportDefinitionResponse' {Text
reportDescription :: Text
$sel:reportDescription:GetReportDefinitionResponse' :: GetReportDefinitionResponse -> Text
reportDescription} -> Text
reportDescription) (\s :: GetReportDefinitionResponse
s@GetReportDefinitionResponse' {} Text
a -> GetReportDefinitionResponse
s {$sel:reportDescription:GetReportDefinitionResponse' :: Text
reportDescription = Text
a} :: GetReportDefinitionResponse)
getReportDefinitionResponse_reportFrequency :: Lens.Lens' GetReportDefinitionResponse ReportFrequency
getReportDefinitionResponse_reportFrequency :: Lens' GetReportDefinitionResponse ReportFrequency
getReportDefinitionResponse_reportFrequency = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetReportDefinitionResponse' {ReportFrequency
reportFrequency :: ReportFrequency
$sel:reportFrequency:GetReportDefinitionResponse' :: GetReportDefinitionResponse -> ReportFrequency
reportFrequency} -> ReportFrequency
reportFrequency) (\s :: GetReportDefinitionResponse
s@GetReportDefinitionResponse' {} ReportFrequency
a -> GetReportDefinitionResponse
s {$sel:reportFrequency:GetReportDefinitionResponse' :: ReportFrequency
reportFrequency = ReportFrequency
a} :: GetReportDefinitionResponse)
getReportDefinitionResponse_format :: Lens.Lens' GetReportDefinitionResponse Format
getReportDefinitionResponse_format :: Lens' GetReportDefinitionResponse Format
getReportDefinitionResponse_format = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetReportDefinitionResponse' {Format
format :: Format
$sel:format:GetReportDefinitionResponse' :: GetReportDefinitionResponse -> Format
format} -> Format
format) (\s :: GetReportDefinitionResponse
s@GetReportDefinitionResponse' {} Format
a -> GetReportDefinitionResponse
s {$sel:format:GetReportDefinitionResponse' :: Format
format = Format
a} :: GetReportDefinitionResponse)
getReportDefinitionResponse_destinationS3Location :: Lens.Lens' GetReportDefinitionResponse S3Location
getReportDefinitionResponse_destinationS3Location :: Lens' GetReportDefinitionResponse S3Location
getReportDefinitionResponse_destinationS3Location = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetReportDefinitionResponse' {S3Location
destinationS3Location :: S3Location
$sel:destinationS3Location:GetReportDefinitionResponse' :: GetReportDefinitionResponse -> S3Location
destinationS3Location} -> S3Location
destinationS3Location) (\s :: GetReportDefinitionResponse
s@GetReportDefinitionResponse' {} S3Location
a -> GetReportDefinitionResponse
s {$sel:destinationS3Location:GetReportDefinitionResponse' :: S3Location
destinationS3Location = S3Location
a} :: GetReportDefinitionResponse)
getReportDefinitionResponse_createdAt :: Lens.Lens' GetReportDefinitionResponse Prelude.UTCTime
getReportDefinitionResponse_createdAt :: Lens' GetReportDefinitionResponse UTCTime
getReportDefinitionResponse_createdAt = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetReportDefinitionResponse' {POSIX
createdAt :: POSIX
$sel:createdAt:GetReportDefinitionResponse' :: GetReportDefinitionResponse -> POSIX
createdAt} -> POSIX
createdAt) (\s :: GetReportDefinitionResponse
s@GetReportDefinitionResponse' {} POSIX
a -> GetReportDefinitionResponse
s {$sel:createdAt:GetReportDefinitionResponse' :: POSIX
createdAt = POSIX
a} :: GetReportDefinitionResponse) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. forall (a :: Format). Iso' (Time a) UTCTime
Data._Time
getReportDefinitionResponse_lastUpdated :: Lens.Lens' GetReportDefinitionResponse Prelude.UTCTime
getReportDefinitionResponse_lastUpdated :: Lens' GetReportDefinitionResponse UTCTime
getReportDefinitionResponse_lastUpdated = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetReportDefinitionResponse' {POSIX
lastUpdated :: POSIX
$sel:lastUpdated:GetReportDefinitionResponse' :: GetReportDefinitionResponse -> POSIX
lastUpdated} -> POSIX
lastUpdated) (\s :: GetReportDefinitionResponse
s@GetReportDefinitionResponse' {} POSIX
a -> GetReportDefinitionResponse
s {$sel:lastUpdated:GetReportDefinitionResponse' :: POSIX
lastUpdated = POSIX
a} :: GetReportDefinitionResponse) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. forall (a :: Format). Iso' (Time a) UTCTime
Data._Time
instance Prelude.NFData GetReportDefinitionResponse where
rnf :: GetReportDefinitionResponse -> ()
rnf GetReportDefinitionResponse' {Int
Text
POSIX
Format
ReportFrequency
S3Location
lastUpdated :: POSIX
createdAt :: POSIX
destinationS3Location :: S3Location
format :: Format
reportFrequency :: ReportFrequency
reportDescription :: Text
reportId :: Text
httpStatus :: Int
$sel:lastUpdated:GetReportDefinitionResponse' :: GetReportDefinitionResponse -> POSIX
$sel:createdAt:GetReportDefinitionResponse' :: GetReportDefinitionResponse -> POSIX
$sel:destinationS3Location:GetReportDefinitionResponse' :: GetReportDefinitionResponse -> S3Location
$sel:format:GetReportDefinitionResponse' :: GetReportDefinitionResponse -> Format
$sel:reportFrequency:GetReportDefinitionResponse' :: GetReportDefinitionResponse -> ReportFrequency
$sel:reportDescription:GetReportDefinitionResponse' :: GetReportDefinitionResponse -> Text
$sel:reportId:GetReportDefinitionResponse' :: GetReportDefinitionResponse -> Text
$sel:httpStatus:GetReportDefinitionResponse' :: GetReportDefinitionResponse -> Int
..} =
forall a. NFData a => a -> ()
Prelude.rnf Int
httpStatus
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
reportId
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
reportDescription
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf ReportFrequency
reportFrequency
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Format
format
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf S3Location
destinationS3Location
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf POSIX
createdAt
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf POSIX
lastUpdated