{-# 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.CostAndUsageReport.ModifyReportDefinition
(
ModifyReportDefinition (..),
newModifyReportDefinition,
modifyReportDefinition_reportName,
modifyReportDefinition_reportDefinition,
ModifyReportDefinitionResponse (..),
newModifyReportDefinitionResponse,
modifyReportDefinitionResponse_httpStatus,
)
where
import qualified Amazonka.Core as Core
import Amazonka.CostAndUsageReport.Types
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
import qualified Amazonka.Request as Request
import qualified Amazonka.Response as Response
data ModifyReportDefinition = ModifyReportDefinition'
{ ModifyReportDefinition -> Text
reportName :: Prelude.Text,
ModifyReportDefinition -> ReportDefinition
reportDefinition :: ReportDefinition
}
deriving (ModifyReportDefinition -> ModifyReportDefinition -> Bool
(ModifyReportDefinition -> ModifyReportDefinition -> Bool)
-> (ModifyReportDefinition -> ModifyReportDefinition -> Bool)
-> Eq ModifyReportDefinition
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ModifyReportDefinition -> ModifyReportDefinition -> Bool
$c/= :: ModifyReportDefinition -> ModifyReportDefinition -> Bool
== :: ModifyReportDefinition -> ModifyReportDefinition -> Bool
$c== :: ModifyReportDefinition -> ModifyReportDefinition -> Bool
Prelude.Eq, ReadPrec [ModifyReportDefinition]
ReadPrec ModifyReportDefinition
Int -> ReadS ModifyReportDefinition
ReadS [ModifyReportDefinition]
(Int -> ReadS ModifyReportDefinition)
-> ReadS [ModifyReportDefinition]
-> ReadPrec ModifyReportDefinition
-> ReadPrec [ModifyReportDefinition]
-> Read ModifyReportDefinition
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ModifyReportDefinition]
$creadListPrec :: ReadPrec [ModifyReportDefinition]
readPrec :: ReadPrec ModifyReportDefinition
$creadPrec :: ReadPrec ModifyReportDefinition
readList :: ReadS [ModifyReportDefinition]
$creadList :: ReadS [ModifyReportDefinition]
readsPrec :: Int -> ReadS ModifyReportDefinition
$creadsPrec :: Int -> ReadS ModifyReportDefinition
Prelude.Read, Int -> ModifyReportDefinition -> ShowS
[ModifyReportDefinition] -> ShowS
ModifyReportDefinition -> String
(Int -> ModifyReportDefinition -> ShowS)
-> (ModifyReportDefinition -> String)
-> ([ModifyReportDefinition] -> ShowS)
-> Show ModifyReportDefinition
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ModifyReportDefinition] -> ShowS
$cshowList :: [ModifyReportDefinition] -> ShowS
show :: ModifyReportDefinition -> String
$cshow :: ModifyReportDefinition -> String
showsPrec :: Int -> ModifyReportDefinition -> ShowS
$cshowsPrec :: Int -> ModifyReportDefinition -> ShowS
Prelude.Show, (forall x. ModifyReportDefinition -> Rep ModifyReportDefinition x)
-> (forall x.
Rep ModifyReportDefinition x -> ModifyReportDefinition)
-> Generic ModifyReportDefinition
forall x. Rep ModifyReportDefinition x -> ModifyReportDefinition
forall x. ModifyReportDefinition -> Rep ModifyReportDefinition x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ModifyReportDefinition x -> ModifyReportDefinition
$cfrom :: forall x. ModifyReportDefinition -> Rep ModifyReportDefinition x
Prelude.Generic)
newModifyReportDefinition ::
Prelude.Text ->
ReportDefinition ->
ModifyReportDefinition
newModifyReportDefinition :: Text -> ReportDefinition -> ModifyReportDefinition
newModifyReportDefinition
Text
pReportName_
ReportDefinition
pReportDefinition_ =
ModifyReportDefinition' :: Text -> ReportDefinition -> ModifyReportDefinition
ModifyReportDefinition'
{ $sel:reportName:ModifyReportDefinition' :: Text
reportName = Text
pReportName_,
$sel:reportDefinition:ModifyReportDefinition' :: ReportDefinition
reportDefinition = ReportDefinition
pReportDefinition_
}
modifyReportDefinition_reportName :: Lens.Lens' ModifyReportDefinition Prelude.Text
modifyReportDefinition_reportName :: (Text -> f Text)
-> ModifyReportDefinition -> f ModifyReportDefinition
modifyReportDefinition_reportName = (ModifyReportDefinition -> Text)
-> (ModifyReportDefinition -> Text -> ModifyReportDefinition)
-> Lens ModifyReportDefinition ModifyReportDefinition Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ModifyReportDefinition' {Text
reportName :: Text
$sel:reportName:ModifyReportDefinition' :: ModifyReportDefinition -> Text
reportName} -> Text
reportName) (\s :: ModifyReportDefinition
s@ModifyReportDefinition' {} Text
a -> ModifyReportDefinition
s {$sel:reportName:ModifyReportDefinition' :: Text
reportName = Text
a} :: ModifyReportDefinition)
modifyReportDefinition_reportDefinition :: Lens.Lens' ModifyReportDefinition ReportDefinition
modifyReportDefinition_reportDefinition :: (ReportDefinition -> f ReportDefinition)
-> ModifyReportDefinition -> f ModifyReportDefinition
modifyReportDefinition_reportDefinition = (ModifyReportDefinition -> ReportDefinition)
-> (ModifyReportDefinition
-> ReportDefinition -> ModifyReportDefinition)
-> Lens
ModifyReportDefinition
ModifyReportDefinition
ReportDefinition
ReportDefinition
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ModifyReportDefinition' {ReportDefinition
reportDefinition :: ReportDefinition
$sel:reportDefinition:ModifyReportDefinition' :: ModifyReportDefinition -> ReportDefinition
reportDefinition} -> ReportDefinition
reportDefinition) (\s :: ModifyReportDefinition
s@ModifyReportDefinition' {} ReportDefinition
a -> ModifyReportDefinition
s {$sel:reportDefinition:ModifyReportDefinition' :: ReportDefinition
reportDefinition = ReportDefinition
a} :: ModifyReportDefinition)
instance Core.AWSRequest ModifyReportDefinition where
type
AWSResponse ModifyReportDefinition =
ModifyReportDefinitionResponse
request :: ModifyReportDefinition -> Request ModifyReportDefinition
request = Service -> ModifyReportDefinition -> Request ModifyReportDefinition
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON Service
defaultService
response :: Logger
-> Service
-> Proxy ModifyReportDefinition
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse ModifyReportDefinition)))
response =
(Int
-> ResponseHeaders
-> ()
-> Either String (AWSResponse ModifyReportDefinition))
-> Logger
-> Service
-> Proxy ModifyReportDefinition
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse ModifyReportDefinition)))
forall (m :: * -> *) a.
MonadResource m =>
(Int -> ResponseHeaders -> () -> Either String (AWSResponse a))
-> Logger
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveEmpty
( \Int
s ResponseHeaders
h ()
x ->
Int -> ModifyReportDefinitionResponse
ModifyReportDefinitionResponse'
(Int -> ModifyReportDefinitionResponse)
-> Either String Int
-> Either String ModifyReportDefinitionResponse
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Int -> Either String Int
forall (f :: * -> *) a. Applicative f => a -> f a
Prelude.pure (Int -> Int
forall a. Enum a => a -> Int
Prelude.fromEnum Int
s))
)
instance Prelude.Hashable ModifyReportDefinition
instance Prelude.NFData ModifyReportDefinition
instance Core.ToHeaders ModifyReportDefinition where
toHeaders :: ModifyReportDefinition -> ResponseHeaders
toHeaders =
ResponseHeaders -> ModifyReportDefinition -> ResponseHeaders
forall a b. a -> b -> a
Prelude.const
( [ResponseHeaders] -> ResponseHeaders
forall a. Monoid a => [a] -> a
Prelude.mconcat
[ HeaderName
"X-Amz-Target"
HeaderName -> ByteString -> ResponseHeaders
forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Core.=# ( ByteString
"AWSOrigamiServiceGatewayService.ModifyReportDefinition" ::
Prelude.ByteString
),
HeaderName
"Content-Type"
HeaderName -> ByteString -> ResponseHeaders
forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Core.=# ( ByteString
"application/x-amz-json-1.1" ::
Prelude.ByteString
)
]
)
instance Core.ToJSON ModifyReportDefinition where
toJSON :: ModifyReportDefinition -> Value
toJSON ModifyReportDefinition' {Text
ReportDefinition
reportDefinition :: ReportDefinition
reportName :: Text
$sel:reportDefinition:ModifyReportDefinition' :: ModifyReportDefinition -> ReportDefinition
$sel:reportName:ModifyReportDefinition' :: ModifyReportDefinition -> Text
..} =
[Pair] -> Value
Core.object
( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"ReportName" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
reportName),
Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just
(Text
"ReportDefinition" Text -> ReportDefinition -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= ReportDefinition
reportDefinition)
]
)
instance Core.ToPath ModifyReportDefinition where
toPath :: ModifyReportDefinition -> ByteString
toPath = ByteString -> ModifyReportDefinition -> ByteString
forall a b. a -> b -> a
Prelude.const ByteString
"/"
instance Core.ToQuery ModifyReportDefinition where
toQuery :: ModifyReportDefinition -> QueryString
toQuery = QueryString -> ModifyReportDefinition -> QueryString
forall a b. a -> b -> a
Prelude.const QueryString
forall a. Monoid a => a
Prelude.mempty
data ModifyReportDefinitionResponse = ModifyReportDefinitionResponse'
{
ModifyReportDefinitionResponse -> Int
httpStatus :: Prelude.Int
}
deriving (ModifyReportDefinitionResponse
-> ModifyReportDefinitionResponse -> Bool
(ModifyReportDefinitionResponse
-> ModifyReportDefinitionResponse -> Bool)
-> (ModifyReportDefinitionResponse
-> ModifyReportDefinitionResponse -> Bool)
-> Eq ModifyReportDefinitionResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ModifyReportDefinitionResponse
-> ModifyReportDefinitionResponse -> Bool
$c/= :: ModifyReportDefinitionResponse
-> ModifyReportDefinitionResponse -> Bool
== :: ModifyReportDefinitionResponse
-> ModifyReportDefinitionResponse -> Bool
$c== :: ModifyReportDefinitionResponse
-> ModifyReportDefinitionResponse -> Bool
Prelude.Eq, ReadPrec [ModifyReportDefinitionResponse]
ReadPrec ModifyReportDefinitionResponse
Int -> ReadS ModifyReportDefinitionResponse
ReadS [ModifyReportDefinitionResponse]
(Int -> ReadS ModifyReportDefinitionResponse)
-> ReadS [ModifyReportDefinitionResponse]
-> ReadPrec ModifyReportDefinitionResponse
-> ReadPrec [ModifyReportDefinitionResponse]
-> Read ModifyReportDefinitionResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ModifyReportDefinitionResponse]
$creadListPrec :: ReadPrec [ModifyReportDefinitionResponse]
readPrec :: ReadPrec ModifyReportDefinitionResponse
$creadPrec :: ReadPrec ModifyReportDefinitionResponse
readList :: ReadS [ModifyReportDefinitionResponse]
$creadList :: ReadS [ModifyReportDefinitionResponse]
readsPrec :: Int -> ReadS ModifyReportDefinitionResponse
$creadsPrec :: Int -> ReadS ModifyReportDefinitionResponse
Prelude.Read, Int -> ModifyReportDefinitionResponse -> ShowS
[ModifyReportDefinitionResponse] -> ShowS
ModifyReportDefinitionResponse -> String
(Int -> ModifyReportDefinitionResponse -> ShowS)
-> (ModifyReportDefinitionResponse -> String)
-> ([ModifyReportDefinitionResponse] -> ShowS)
-> Show ModifyReportDefinitionResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ModifyReportDefinitionResponse] -> ShowS
$cshowList :: [ModifyReportDefinitionResponse] -> ShowS
show :: ModifyReportDefinitionResponse -> String
$cshow :: ModifyReportDefinitionResponse -> String
showsPrec :: Int -> ModifyReportDefinitionResponse -> ShowS
$cshowsPrec :: Int -> ModifyReportDefinitionResponse -> ShowS
Prelude.Show, (forall x.
ModifyReportDefinitionResponse
-> Rep ModifyReportDefinitionResponse x)
-> (forall x.
Rep ModifyReportDefinitionResponse x
-> ModifyReportDefinitionResponse)
-> Generic ModifyReportDefinitionResponse
forall x.
Rep ModifyReportDefinitionResponse x
-> ModifyReportDefinitionResponse
forall x.
ModifyReportDefinitionResponse
-> Rep ModifyReportDefinitionResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep ModifyReportDefinitionResponse x
-> ModifyReportDefinitionResponse
$cfrom :: forall x.
ModifyReportDefinitionResponse
-> Rep ModifyReportDefinitionResponse x
Prelude.Generic)
newModifyReportDefinitionResponse ::
Prelude.Int ->
ModifyReportDefinitionResponse
newModifyReportDefinitionResponse :: Int -> ModifyReportDefinitionResponse
newModifyReportDefinitionResponse Int
pHttpStatus_ =
ModifyReportDefinitionResponse' :: Int -> ModifyReportDefinitionResponse
ModifyReportDefinitionResponse'
{ $sel:httpStatus:ModifyReportDefinitionResponse' :: Int
httpStatus =
Int
pHttpStatus_
}
modifyReportDefinitionResponse_httpStatus :: Lens.Lens' ModifyReportDefinitionResponse Prelude.Int
modifyReportDefinitionResponse_httpStatus :: (Int -> f Int)
-> ModifyReportDefinitionResponse
-> f ModifyReportDefinitionResponse
modifyReportDefinitionResponse_httpStatus = (ModifyReportDefinitionResponse -> Int)
-> (ModifyReportDefinitionResponse
-> Int -> ModifyReportDefinitionResponse)
-> Lens
ModifyReportDefinitionResponse
ModifyReportDefinitionResponse
Int
Int
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ModifyReportDefinitionResponse' {Int
httpStatus :: Int
$sel:httpStatus:ModifyReportDefinitionResponse' :: ModifyReportDefinitionResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: ModifyReportDefinitionResponse
s@ModifyReportDefinitionResponse' {} Int
a -> ModifyReportDefinitionResponse
s {$sel:httpStatus:ModifyReportDefinitionResponse' :: Int
httpStatus = Int
a} :: ModifyReportDefinitionResponse)
instance
Prelude.NFData
ModifyReportDefinitionResponse