{-# 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.UpdateReportDefinition
(
UpdateReportDefinition (..),
newUpdateReportDefinition,
updateReportDefinition_reportId,
updateReportDefinition_reportDescription,
updateReportDefinition_reportFrequency,
updateReportDefinition_format,
updateReportDefinition_destinationS3Location,
UpdateReportDefinitionResponse (..),
newUpdateReportDefinitionResponse,
updateReportDefinitionResponse_reportId,
updateReportDefinitionResponse_httpStatus,
)
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 UpdateReportDefinition = UpdateReportDefinition'
{
UpdateReportDefinition -> Text
reportId :: Prelude.Text,
UpdateReportDefinition -> Text
reportDescription :: Prelude.Text,
UpdateReportDefinition -> ReportFrequency
reportFrequency :: ReportFrequency,
UpdateReportDefinition -> Format
format :: Format,
UpdateReportDefinition -> S3Location
destinationS3Location :: S3Location
}
deriving (UpdateReportDefinition -> UpdateReportDefinition -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: UpdateReportDefinition -> UpdateReportDefinition -> Bool
$c/= :: UpdateReportDefinition -> UpdateReportDefinition -> Bool
== :: UpdateReportDefinition -> UpdateReportDefinition -> Bool
$c== :: UpdateReportDefinition -> UpdateReportDefinition -> Bool
Prelude.Eq, ReadPrec [UpdateReportDefinition]
ReadPrec UpdateReportDefinition
Int -> ReadS UpdateReportDefinition
ReadS [UpdateReportDefinition]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [UpdateReportDefinition]
$creadListPrec :: ReadPrec [UpdateReportDefinition]
readPrec :: ReadPrec UpdateReportDefinition
$creadPrec :: ReadPrec UpdateReportDefinition
readList :: ReadS [UpdateReportDefinition]
$creadList :: ReadS [UpdateReportDefinition]
readsPrec :: Int -> ReadS UpdateReportDefinition
$creadsPrec :: Int -> ReadS UpdateReportDefinition
Prelude.Read, Int -> UpdateReportDefinition -> ShowS
[UpdateReportDefinition] -> ShowS
UpdateReportDefinition -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [UpdateReportDefinition] -> ShowS
$cshowList :: [UpdateReportDefinition] -> ShowS
show :: UpdateReportDefinition -> String
$cshow :: UpdateReportDefinition -> String
showsPrec :: Int -> UpdateReportDefinition -> ShowS
$cshowsPrec :: Int -> UpdateReportDefinition -> ShowS
Prelude.Show, forall x. Rep UpdateReportDefinition x -> UpdateReportDefinition
forall x. UpdateReportDefinition -> Rep UpdateReportDefinition x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep UpdateReportDefinition x -> UpdateReportDefinition
$cfrom :: forall x. UpdateReportDefinition -> Rep UpdateReportDefinition x
Prelude.Generic)
newUpdateReportDefinition ::
Prelude.Text ->
Prelude.Text ->
ReportFrequency ->
Format ->
S3Location ->
UpdateReportDefinition
newUpdateReportDefinition :: Text
-> Text
-> ReportFrequency
-> Format
-> S3Location
-> UpdateReportDefinition
newUpdateReportDefinition
Text
pReportId_
Text
pReportDescription_
ReportFrequency
pReportFrequency_
Format
pFormat_
S3Location
pDestinationS3Location_ =
UpdateReportDefinition'
{ $sel:reportId:UpdateReportDefinition' :: Text
reportId = Text
pReportId_,
$sel:reportDescription:UpdateReportDefinition' :: Text
reportDescription = Text
pReportDescription_,
$sel:reportFrequency:UpdateReportDefinition' :: ReportFrequency
reportFrequency = ReportFrequency
pReportFrequency_,
$sel:format:UpdateReportDefinition' :: Format
format = Format
pFormat_,
$sel:destinationS3Location:UpdateReportDefinition' :: S3Location
destinationS3Location = S3Location
pDestinationS3Location_
}
updateReportDefinition_reportId :: Lens.Lens' UpdateReportDefinition Prelude.Text
updateReportDefinition_reportId :: Lens' UpdateReportDefinition Text
updateReportDefinition_reportId = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateReportDefinition' {Text
reportId :: Text
$sel:reportId:UpdateReportDefinition' :: UpdateReportDefinition -> Text
reportId} -> Text
reportId) (\s :: UpdateReportDefinition
s@UpdateReportDefinition' {} Text
a -> UpdateReportDefinition
s {$sel:reportId:UpdateReportDefinition' :: Text
reportId = Text
a} :: UpdateReportDefinition)
updateReportDefinition_reportDescription :: Lens.Lens' UpdateReportDefinition Prelude.Text
updateReportDefinition_reportDescription :: Lens' UpdateReportDefinition Text
updateReportDefinition_reportDescription = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateReportDefinition' {Text
reportDescription :: Text
$sel:reportDescription:UpdateReportDefinition' :: UpdateReportDefinition -> Text
reportDescription} -> Text
reportDescription) (\s :: UpdateReportDefinition
s@UpdateReportDefinition' {} Text
a -> UpdateReportDefinition
s {$sel:reportDescription:UpdateReportDefinition' :: Text
reportDescription = Text
a} :: UpdateReportDefinition)
updateReportDefinition_reportFrequency :: Lens.Lens' UpdateReportDefinition ReportFrequency
updateReportDefinition_reportFrequency :: Lens' UpdateReportDefinition ReportFrequency
updateReportDefinition_reportFrequency = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateReportDefinition' {ReportFrequency
reportFrequency :: ReportFrequency
$sel:reportFrequency:UpdateReportDefinition' :: UpdateReportDefinition -> ReportFrequency
reportFrequency} -> ReportFrequency
reportFrequency) (\s :: UpdateReportDefinition
s@UpdateReportDefinition' {} ReportFrequency
a -> UpdateReportDefinition
s {$sel:reportFrequency:UpdateReportDefinition' :: ReportFrequency
reportFrequency = ReportFrequency
a} :: UpdateReportDefinition)
updateReportDefinition_format :: Lens.Lens' UpdateReportDefinition Format
updateReportDefinition_format :: Lens' UpdateReportDefinition Format
updateReportDefinition_format = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateReportDefinition' {Format
format :: Format
$sel:format:UpdateReportDefinition' :: UpdateReportDefinition -> Format
format} -> Format
format) (\s :: UpdateReportDefinition
s@UpdateReportDefinition' {} Format
a -> UpdateReportDefinition
s {$sel:format:UpdateReportDefinition' :: Format
format = Format
a} :: UpdateReportDefinition)
updateReportDefinition_destinationS3Location :: Lens.Lens' UpdateReportDefinition S3Location
updateReportDefinition_destinationS3Location :: Lens' UpdateReportDefinition S3Location
updateReportDefinition_destinationS3Location = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateReportDefinition' {S3Location
destinationS3Location :: S3Location
$sel:destinationS3Location:UpdateReportDefinition' :: UpdateReportDefinition -> S3Location
destinationS3Location} -> S3Location
destinationS3Location) (\s :: UpdateReportDefinition
s@UpdateReportDefinition' {} S3Location
a -> UpdateReportDefinition
s {$sel:destinationS3Location:UpdateReportDefinition' :: S3Location
destinationS3Location = S3Location
a} :: UpdateReportDefinition)
instance Core.AWSRequest UpdateReportDefinition where
type
AWSResponse UpdateReportDefinition =
UpdateReportDefinitionResponse
request :: (Service -> Service)
-> UpdateReportDefinition -> Request UpdateReportDefinition
request Service -> Service
overrides =
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.putJSON (Service -> Service
overrides Service
defaultService)
response :: forall (m :: * -> *).
MonadResource m =>
(ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy UpdateReportDefinition
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse UpdateReportDefinition)))
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 ->
Maybe Text -> Int -> UpdateReportDefinitionResponse
UpdateReportDefinitionResponse'
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x forall a. FromJSON a => Object -> Key -> Either String (Maybe a)
Data..?> Key
"reportId")
forall (f :: * -> *) a b. Applicative f => 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))
)
instance Prelude.Hashable UpdateReportDefinition where
hashWithSalt :: Int -> UpdateReportDefinition -> Int
hashWithSalt Int
_salt UpdateReportDefinition' {Text
Format
ReportFrequency
S3Location
destinationS3Location :: S3Location
format :: Format
reportFrequency :: ReportFrequency
reportDescription :: Text
reportId :: Text
$sel:destinationS3Location:UpdateReportDefinition' :: UpdateReportDefinition -> S3Location
$sel:format:UpdateReportDefinition' :: UpdateReportDefinition -> Format
$sel:reportFrequency:UpdateReportDefinition' :: UpdateReportDefinition -> ReportFrequency
$sel:reportDescription:UpdateReportDefinition' :: UpdateReportDefinition -> Text
$sel:reportId:UpdateReportDefinition' :: UpdateReportDefinition -> Text
..} =
Int
_salt
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
reportId
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
reportDescription
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` ReportFrequency
reportFrequency
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Format
format
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` S3Location
destinationS3Location
instance Prelude.NFData UpdateReportDefinition where
rnf :: UpdateReportDefinition -> ()
rnf UpdateReportDefinition' {Text
Format
ReportFrequency
S3Location
destinationS3Location :: S3Location
format :: Format
reportFrequency :: ReportFrequency
reportDescription :: Text
reportId :: Text
$sel:destinationS3Location:UpdateReportDefinition' :: UpdateReportDefinition -> S3Location
$sel:format:UpdateReportDefinition' :: UpdateReportDefinition -> Format
$sel:reportFrequency:UpdateReportDefinition' :: UpdateReportDefinition -> ReportFrequency
$sel:reportDescription:UpdateReportDefinition' :: UpdateReportDefinition -> Text
$sel:reportId:UpdateReportDefinition' :: UpdateReportDefinition -> Text
..} =
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
instance Data.ToHeaders UpdateReportDefinition where
toHeaders :: UpdateReportDefinition -> 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.ToJSON UpdateReportDefinition where
toJSON :: UpdateReportDefinition -> Value
toJSON UpdateReportDefinition' {Text
Format
ReportFrequency
S3Location
destinationS3Location :: S3Location
format :: Format
reportFrequency :: ReportFrequency
reportDescription :: Text
reportId :: Text
$sel:destinationS3Location:UpdateReportDefinition' :: UpdateReportDefinition -> S3Location
$sel:format:UpdateReportDefinition' :: UpdateReportDefinition -> Format
$sel:reportFrequency:UpdateReportDefinition' :: UpdateReportDefinition -> ReportFrequency
$sel:reportDescription:UpdateReportDefinition' :: UpdateReportDefinition -> Text
$sel:reportId:UpdateReportDefinition' :: UpdateReportDefinition -> Text
..} =
[Pair] -> Value
Data.object
( forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ forall a. a -> Maybe a
Prelude.Just
(Key
"reportDescription" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= Text
reportDescription),
forall a. a -> Maybe a
Prelude.Just
(Key
"reportFrequency" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= ReportFrequency
reportFrequency),
forall a. a -> Maybe a
Prelude.Just (Key
"format" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= Format
format),
forall a. a -> Maybe a
Prelude.Just
( Key
"destinationS3Location"
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= S3Location
destinationS3Location
)
]
)
instance Data.ToPath UpdateReportDefinition where
toPath :: UpdateReportDefinition -> ByteString
toPath UpdateReportDefinition' {Text
Format
ReportFrequency
S3Location
destinationS3Location :: S3Location
format :: Format
reportFrequency :: ReportFrequency
reportDescription :: Text
reportId :: Text
$sel:destinationS3Location:UpdateReportDefinition' :: UpdateReportDefinition -> S3Location
$sel:format:UpdateReportDefinition' :: UpdateReportDefinition -> Format
$sel:reportFrequency:UpdateReportDefinition' :: UpdateReportDefinition -> ReportFrequency
$sel:reportDescription:UpdateReportDefinition' :: UpdateReportDefinition -> Text
$sel:reportId:UpdateReportDefinition' :: UpdateReportDefinition -> Text
..} =
forall a. Monoid a => [a] -> a
Prelude.mconcat
[ByteString
"/reportDefinition/", forall a. ToByteString a => a -> ByteString
Data.toBS Text
reportId]
instance Data.ToQuery UpdateReportDefinition where
toQuery :: UpdateReportDefinition -> QueryString
toQuery = forall a b. a -> b -> a
Prelude.const forall a. Monoid a => a
Prelude.mempty
data UpdateReportDefinitionResponse = UpdateReportDefinitionResponse'
{
UpdateReportDefinitionResponse -> Maybe Text
reportId :: Prelude.Maybe Prelude.Text,
UpdateReportDefinitionResponse -> Int
httpStatus :: Prelude.Int
}
deriving (UpdateReportDefinitionResponse
-> UpdateReportDefinitionResponse -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: UpdateReportDefinitionResponse
-> UpdateReportDefinitionResponse -> Bool
$c/= :: UpdateReportDefinitionResponse
-> UpdateReportDefinitionResponse -> Bool
== :: UpdateReportDefinitionResponse
-> UpdateReportDefinitionResponse -> Bool
$c== :: UpdateReportDefinitionResponse
-> UpdateReportDefinitionResponse -> Bool
Prelude.Eq, ReadPrec [UpdateReportDefinitionResponse]
ReadPrec UpdateReportDefinitionResponse
Int -> ReadS UpdateReportDefinitionResponse
ReadS [UpdateReportDefinitionResponse]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [UpdateReportDefinitionResponse]
$creadListPrec :: ReadPrec [UpdateReportDefinitionResponse]
readPrec :: ReadPrec UpdateReportDefinitionResponse
$creadPrec :: ReadPrec UpdateReportDefinitionResponse
readList :: ReadS [UpdateReportDefinitionResponse]
$creadList :: ReadS [UpdateReportDefinitionResponse]
readsPrec :: Int -> ReadS UpdateReportDefinitionResponse
$creadsPrec :: Int -> ReadS UpdateReportDefinitionResponse
Prelude.Read, Int -> UpdateReportDefinitionResponse -> ShowS
[UpdateReportDefinitionResponse] -> ShowS
UpdateReportDefinitionResponse -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [UpdateReportDefinitionResponse] -> ShowS
$cshowList :: [UpdateReportDefinitionResponse] -> ShowS
show :: UpdateReportDefinitionResponse -> String
$cshow :: UpdateReportDefinitionResponse -> String
showsPrec :: Int -> UpdateReportDefinitionResponse -> ShowS
$cshowsPrec :: Int -> UpdateReportDefinitionResponse -> ShowS
Prelude.Show, forall x.
Rep UpdateReportDefinitionResponse x
-> UpdateReportDefinitionResponse
forall x.
UpdateReportDefinitionResponse
-> Rep UpdateReportDefinitionResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep UpdateReportDefinitionResponse x
-> UpdateReportDefinitionResponse
$cfrom :: forall x.
UpdateReportDefinitionResponse
-> Rep UpdateReportDefinitionResponse x
Prelude.Generic)
newUpdateReportDefinitionResponse ::
Prelude.Int ->
UpdateReportDefinitionResponse
newUpdateReportDefinitionResponse :: Int -> UpdateReportDefinitionResponse
newUpdateReportDefinitionResponse Int
pHttpStatus_ =
UpdateReportDefinitionResponse'
{ $sel:reportId:UpdateReportDefinitionResponse' :: Maybe Text
reportId =
forall a. Maybe a
Prelude.Nothing,
$sel:httpStatus:UpdateReportDefinitionResponse' :: Int
httpStatus = Int
pHttpStatus_
}
updateReportDefinitionResponse_reportId :: Lens.Lens' UpdateReportDefinitionResponse (Prelude.Maybe Prelude.Text)
updateReportDefinitionResponse_reportId :: Lens' UpdateReportDefinitionResponse (Maybe Text)
updateReportDefinitionResponse_reportId = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateReportDefinitionResponse' {Maybe Text
reportId :: Maybe Text
$sel:reportId:UpdateReportDefinitionResponse' :: UpdateReportDefinitionResponse -> Maybe Text
reportId} -> Maybe Text
reportId) (\s :: UpdateReportDefinitionResponse
s@UpdateReportDefinitionResponse' {} Maybe Text
a -> UpdateReportDefinitionResponse
s {$sel:reportId:UpdateReportDefinitionResponse' :: Maybe Text
reportId = Maybe Text
a} :: UpdateReportDefinitionResponse)
updateReportDefinitionResponse_httpStatus :: Lens.Lens' UpdateReportDefinitionResponse Prelude.Int
updateReportDefinitionResponse_httpStatus :: Lens' UpdateReportDefinitionResponse Int
updateReportDefinitionResponse_httpStatus = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateReportDefinitionResponse' {Int
httpStatus :: Int
$sel:httpStatus:UpdateReportDefinitionResponse' :: UpdateReportDefinitionResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: UpdateReportDefinitionResponse
s@UpdateReportDefinitionResponse' {} Int
a -> UpdateReportDefinitionResponse
s {$sel:httpStatus:UpdateReportDefinitionResponse' :: Int
httpStatus = Int
a} :: UpdateReportDefinitionResponse)
instance
Prelude.NFData
UpdateReportDefinitionResponse
where
rnf :: UpdateReportDefinitionResponse -> ()
rnf UpdateReportDefinitionResponse' {Int
Maybe Text
httpStatus :: Int
reportId :: Maybe Text
$sel:httpStatus:UpdateReportDefinitionResponse' :: UpdateReportDefinitionResponse -> Int
$sel:reportId:UpdateReportDefinitionResponse' :: UpdateReportDefinitionResponse -> Maybe Text
..} =
forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
reportId
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Int
httpStatus