{-# 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.DeleteReportDefinition
(
DeleteReportDefinition (..),
newDeleteReportDefinition,
deleteReportDefinition_reportName,
DeleteReportDefinitionResponse (..),
newDeleteReportDefinitionResponse,
deleteReportDefinitionResponse_responseMessage,
deleteReportDefinitionResponse_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 DeleteReportDefinition = DeleteReportDefinition'
{
DeleteReportDefinition -> Maybe Text
reportName :: Prelude.Maybe Prelude.Text
}
deriving (DeleteReportDefinition -> DeleteReportDefinition -> Bool
(DeleteReportDefinition -> DeleteReportDefinition -> Bool)
-> (DeleteReportDefinition -> DeleteReportDefinition -> Bool)
-> Eq DeleteReportDefinition
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DeleteReportDefinition -> DeleteReportDefinition -> Bool
$c/= :: DeleteReportDefinition -> DeleteReportDefinition -> Bool
== :: DeleteReportDefinition -> DeleteReportDefinition -> Bool
$c== :: DeleteReportDefinition -> DeleteReportDefinition -> Bool
Prelude.Eq, ReadPrec [DeleteReportDefinition]
ReadPrec DeleteReportDefinition
Int -> ReadS DeleteReportDefinition
ReadS [DeleteReportDefinition]
(Int -> ReadS DeleteReportDefinition)
-> ReadS [DeleteReportDefinition]
-> ReadPrec DeleteReportDefinition
-> ReadPrec [DeleteReportDefinition]
-> Read DeleteReportDefinition
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DeleteReportDefinition]
$creadListPrec :: ReadPrec [DeleteReportDefinition]
readPrec :: ReadPrec DeleteReportDefinition
$creadPrec :: ReadPrec DeleteReportDefinition
readList :: ReadS [DeleteReportDefinition]
$creadList :: ReadS [DeleteReportDefinition]
readsPrec :: Int -> ReadS DeleteReportDefinition
$creadsPrec :: Int -> ReadS DeleteReportDefinition
Prelude.Read, Int -> DeleteReportDefinition -> ShowS
[DeleteReportDefinition] -> ShowS
DeleteReportDefinition -> String
(Int -> DeleteReportDefinition -> ShowS)
-> (DeleteReportDefinition -> String)
-> ([DeleteReportDefinition] -> ShowS)
-> Show DeleteReportDefinition
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DeleteReportDefinition] -> ShowS
$cshowList :: [DeleteReportDefinition] -> ShowS
show :: DeleteReportDefinition -> String
$cshow :: DeleteReportDefinition -> String
showsPrec :: Int -> DeleteReportDefinition -> ShowS
$cshowsPrec :: Int -> DeleteReportDefinition -> ShowS
Prelude.Show, (forall x. DeleteReportDefinition -> Rep DeleteReportDefinition x)
-> (forall x.
Rep DeleteReportDefinition x -> DeleteReportDefinition)
-> Generic DeleteReportDefinition
forall x. Rep DeleteReportDefinition x -> DeleteReportDefinition
forall x. DeleteReportDefinition -> Rep DeleteReportDefinition x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep DeleteReportDefinition x -> DeleteReportDefinition
$cfrom :: forall x. DeleteReportDefinition -> Rep DeleteReportDefinition x
Prelude.Generic)
newDeleteReportDefinition ::
DeleteReportDefinition
newDeleteReportDefinition :: DeleteReportDefinition
newDeleteReportDefinition =
DeleteReportDefinition' :: Maybe Text -> DeleteReportDefinition
DeleteReportDefinition'
{ $sel:reportName:DeleteReportDefinition' :: Maybe Text
reportName =
Maybe Text
forall a. Maybe a
Prelude.Nothing
}
deleteReportDefinition_reportName :: Lens.Lens' DeleteReportDefinition (Prelude.Maybe Prelude.Text)
deleteReportDefinition_reportName :: (Maybe Text -> f (Maybe Text))
-> DeleteReportDefinition -> f DeleteReportDefinition
deleteReportDefinition_reportName = (DeleteReportDefinition -> Maybe Text)
-> (DeleteReportDefinition -> Maybe Text -> DeleteReportDefinition)
-> Lens
DeleteReportDefinition
DeleteReportDefinition
(Maybe Text)
(Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeleteReportDefinition' {Maybe Text
reportName :: Maybe Text
$sel:reportName:DeleteReportDefinition' :: DeleteReportDefinition -> Maybe Text
reportName} -> Maybe Text
reportName) (\s :: DeleteReportDefinition
s@DeleteReportDefinition' {} Maybe Text
a -> DeleteReportDefinition
s {$sel:reportName:DeleteReportDefinition' :: Maybe Text
reportName = Maybe Text
a} :: DeleteReportDefinition)
instance Core.AWSRequest DeleteReportDefinition where
type
AWSResponse DeleteReportDefinition =
DeleteReportDefinitionResponse
request :: DeleteReportDefinition -> Request DeleteReportDefinition
request = Service -> DeleteReportDefinition -> Request DeleteReportDefinition
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON Service
defaultService
response :: Logger
-> Service
-> Proxy DeleteReportDefinition
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse DeleteReportDefinition)))
response =
(Int
-> ResponseHeaders
-> Object
-> Either String (AWSResponse DeleteReportDefinition))
-> Logger
-> Service
-> Proxy DeleteReportDefinition
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse DeleteReportDefinition)))
forall (m :: * -> *) a.
MonadResource m =>
(Int -> ResponseHeaders -> Object -> Either String (AWSResponse a))
-> Logger
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveJSON
( \Int
s ResponseHeaders
h Object
x ->
Maybe Text -> Int -> DeleteReportDefinitionResponse
DeleteReportDefinitionResponse'
(Maybe Text -> Int -> DeleteReportDefinitionResponse)
-> Either String (Maybe Text)
-> Either String (Int -> DeleteReportDefinitionResponse)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Either String (Maybe Text)
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"ResponseMessage")
Either String (Int -> DeleteReportDefinitionResponse)
-> Either String Int
-> Either String DeleteReportDefinitionResponse
forall (f :: * -> *) a b. Applicative f => 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 DeleteReportDefinition
instance Prelude.NFData DeleteReportDefinition
instance Core.ToHeaders DeleteReportDefinition where
toHeaders :: DeleteReportDefinition -> ResponseHeaders
toHeaders =
ResponseHeaders -> DeleteReportDefinition -> 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.DeleteReportDefinition" ::
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 DeleteReportDefinition where
toJSON :: DeleteReportDefinition -> Value
toJSON DeleteReportDefinition' {Maybe Text
reportName :: Maybe Text
$sel:reportName:DeleteReportDefinition' :: DeleteReportDefinition -> Maybe Text
..} =
[Pair] -> Value
Core.object
( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
[(Text
"ReportName" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (Text -> Pair) -> Maybe Text -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
reportName]
)
instance Core.ToPath DeleteReportDefinition where
toPath :: DeleteReportDefinition -> ByteString
toPath = ByteString -> DeleteReportDefinition -> ByteString
forall a b. a -> b -> a
Prelude.const ByteString
"/"
instance Core.ToQuery DeleteReportDefinition where
toQuery :: DeleteReportDefinition -> QueryString
toQuery = QueryString -> DeleteReportDefinition -> QueryString
forall a b. a -> b -> a
Prelude.const QueryString
forall a. Monoid a => a
Prelude.mempty
data DeleteReportDefinitionResponse = DeleteReportDefinitionResponse'
{ DeleteReportDefinitionResponse -> Maybe Text
responseMessage :: Prelude.Maybe Prelude.Text,
DeleteReportDefinitionResponse -> Int
httpStatus :: Prelude.Int
}
deriving (DeleteReportDefinitionResponse
-> DeleteReportDefinitionResponse -> Bool
(DeleteReportDefinitionResponse
-> DeleteReportDefinitionResponse -> Bool)
-> (DeleteReportDefinitionResponse
-> DeleteReportDefinitionResponse -> Bool)
-> Eq DeleteReportDefinitionResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DeleteReportDefinitionResponse
-> DeleteReportDefinitionResponse -> Bool
$c/= :: DeleteReportDefinitionResponse
-> DeleteReportDefinitionResponse -> Bool
== :: DeleteReportDefinitionResponse
-> DeleteReportDefinitionResponse -> Bool
$c== :: DeleteReportDefinitionResponse
-> DeleteReportDefinitionResponse -> Bool
Prelude.Eq, ReadPrec [DeleteReportDefinitionResponse]
ReadPrec DeleteReportDefinitionResponse
Int -> ReadS DeleteReportDefinitionResponse
ReadS [DeleteReportDefinitionResponse]
(Int -> ReadS DeleteReportDefinitionResponse)
-> ReadS [DeleteReportDefinitionResponse]
-> ReadPrec DeleteReportDefinitionResponse
-> ReadPrec [DeleteReportDefinitionResponse]
-> Read DeleteReportDefinitionResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DeleteReportDefinitionResponse]
$creadListPrec :: ReadPrec [DeleteReportDefinitionResponse]
readPrec :: ReadPrec DeleteReportDefinitionResponse
$creadPrec :: ReadPrec DeleteReportDefinitionResponse
readList :: ReadS [DeleteReportDefinitionResponse]
$creadList :: ReadS [DeleteReportDefinitionResponse]
readsPrec :: Int -> ReadS DeleteReportDefinitionResponse
$creadsPrec :: Int -> ReadS DeleteReportDefinitionResponse
Prelude.Read, Int -> DeleteReportDefinitionResponse -> ShowS
[DeleteReportDefinitionResponse] -> ShowS
DeleteReportDefinitionResponse -> String
(Int -> DeleteReportDefinitionResponse -> ShowS)
-> (DeleteReportDefinitionResponse -> String)
-> ([DeleteReportDefinitionResponse] -> ShowS)
-> Show DeleteReportDefinitionResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DeleteReportDefinitionResponse] -> ShowS
$cshowList :: [DeleteReportDefinitionResponse] -> ShowS
show :: DeleteReportDefinitionResponse -> String
$cshow :: DeleteReportDefinitionResponse -> String
showsPrec :: Int -> DeleteReportDefinitionResponse -> ShowS
$cshowsPrec :: Int -> DeleteReportDefinitionResponse -> ShowS
Prelude.Show, (forall x.
DeleteReportDefinitionResponse
-> Rep DeleteReportDefinitionResponse x)
-> (forall x.
Rep DeleteReportDefinitionResponse x
-> DeleteReportDefinitionResponse)
-> Generic DeleteReportDefinitionResponse
forall x.
Rep DeleteReportDefinitionResponse x
-> DeleteReportDefinitionResponse
forall x.
DeleteReportDefinitionResponse
-> Rep DeleteReportDefinitionResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep DeleteReportDefinitionResponse x
-> DeleteReportDefinitionResponse
$cfrom :: forall x.
DeleteReportDefinitionResponse
-> Rep DeleteReportDefinitionResponse x
Prelude.Generic)
newDeleteReportDefinitionResponse ::
Prelude.Int ->
DeleteReportDefinitionResponse
newDeleteReportDefinitionResponse :: Int -> DeleteReportDefinitionResponse
newDeleteReportDefinitionResponse Int
pHttpStatus_ =
DeleteReportDefinitionResponse' :: Maybe Text -> Int -> DeleteReportDefinitionResponse
DeleteReportDefinitionResponse'
{ $sel:responseMessage:DeleteReportDefinitionResponse' :: Maybe Text
responseMessage =
Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:httpStatus:DeleteReportDefinitionResponse' :: Int
httpStatus = Int
pHttpStatus_
}
deleteReportDefinitionResponse_responseMessage :: Lens.Lens' DeleteReportDefinitionResponse (Prelude.Maybe Prelude.Text)
deleteReportDefinitionResponse_responseMessage :: (Maybe Text -> f (Maybe Text))
-> DeleteReportDefinitionResponse
-> f DeleteReportDefinitionResponse
deleteReportDefinitionResponse_responseMessage = (DeleteReportDefinitionResponse -> Maybe Text)
-> (DeleteReportDefinitionResponse
-> Maybe Text -> DeleteReportDefinitionResponse)
-> Lens
DeleteReportDefinitionResponse
DeleteReportDefinitionResponse
(Maybe Text)
(Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeleteReportDefinitionResponse' {Maybe Text
responseMessage :: Maybe Text
$sel:responseMessage:DeleteReportDefinitionResponse' :: DeleteReportDefinitionResponse -> Maybe Text
responseMessage} -> Maybe Text
responseMessage) (\s :: DeleteReportDefinitionResponse
s@DeleteReportDefinitionResponse' {} Maybe Text
a -> DeleteReportDefinitionResponse
s {$sel:responseMessage:DeleteReportDefinitionResponse' :: Maybe Text
responseMessage = Maybe Text
a} :: DeleteReportDefinitionResponse)
deleteReportDefinitionResponse_httpStatus :: Lens.Lens' DeleteReportDefinitionResponse Prelude.Int
deleteReportDefinitionResponse_httpStatus :: (Int -> f Int)
-> DeleteReportDefinitionResponse
-> f DeleteReportDefinitionResponse
deleteReportDefinitionResponse_httpStatus = (DeleteReportDefinitionResponse -> Int)
-> (DeleteReportDefinitionResponse
-> Int -> DeleteReportDefinitionResponse)
-> Lens
DeleteReportDefinitionResponse
DeleteReportDefinitionResponse
Int
Int
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeleteReportDefinitionResponse' {Int
httpStatus :: Int
$sel:httpStatus:DeleteReportDefinitionResponse' :: DeleteReportDefinitionResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: DeleteReportDefinitionResponse
s@DeleteReportDefinitionResponse' {} Int
a -> DeleteReportDefinitionResponse
s {$sel:httpStatus:DeleteReportDefinitionResponse' :: Int
httpStatus = Int
a} :: DeleteReportDefinitionResponse)
instance
Prelude.NFData
DeleteReportDefinitionResponse