{-# 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.FraudDetector.DeleteLabel
(
DeleteLabel (..),
newDeleteLabel,
deleteLabel_name,
DeleteLabelResponse (..),
newDeleteLabelResponse,
deleteLabelResponse_httpStatus,
)
where
import qualified Amazonka.Core as Core
import Amazonka.FraudDetector.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 DeleteLabel = DeleteLabel'
{
DeleteLabel -> Text
name :: Prelude.Text
}
deriving (DeleteLabel -> DeleteLabel -> Bool
(DeleteLabel -> DeleteLabel -> Bool)
-> (DeleteLabel -> DeleteLabel -> Bool) -> Eq DeleteLabel
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DeleteLabel -> DeleteLabel -> Bool
$c/= :: DeleteLabel -> DeleteLabel -> Bool
== :: DeleteLabel -> DeleteLabel -> Bool
$c== :: DeleteLabel -> DeleteLabel -> Bool
Prelude.Eq, ReadPrec [DeleteLabel]
ReadPrec DeleteLabel
Int -> ReadS DeleteLabel
ReadS [DeleteLabel]
(Int -> ReadS DeleteLabel)
-> ReadS [DeleteLabel]
-> ReadPrec DeleteLabel
-> ReadPrec [DeleteLabel]
-> Read DeleteLabel
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DeleteLabel]
$creadListPrec :: ReadPrec [DeleteLabel]
readPrec :: ReadPrec DeleteLabel
$creadPrec :: ReadPrec DeleteLabel
readList :: ReadS [DeleteLabel]
$creadList :: ReadS [DeleteLabel]
readsPrec :: Int -> ReadS DeleteLabel
$creadsPrec :: Int -> ReadS DeleteLabel
Prelude.Read, Int -> DeleteLabel -> ShowS
[DeleteLabel] -> ShowS
DeleteLabel -> String
(Int -> DeleteLabel -> ShowS)
-> (DeleteLabel -> String)
-> ([DeleteLabel] -> ShowS)
-> Show DeleteLabel
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DeleteLabel] -> ShowS
$cshowList :: [DeleteLabel] -> ShowS
show :: DeleteLabel -> String
$cshow :: DeleteLabel -> String
showsPrec :: Int -> DeleteLabel -> ShowS
$cshowsPrec :: Int -> DeleteLabel -> ShowS
Prelude.Show, (forall x. DeleteLabel -> Rep DeleteLabel x)
-> (forall x. Rep DeleteLabel x -> DeleteLabel)
-> Generic DeleteLabel
forall x. Rep DeleteLabel x -> DeleteLabel
forall x. DeleteLabel -> Rep DeleteLabel x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep DeleteLabel x -> DeleteLabel
$cfrom :: forall x. DeleteLabel -> Rep DeleteLabel x
Prelude.Generic)
newDeleteLabel ::
Prelude.Text ->
DeleteLabel
newDeleteLabel :: Text -> DeleteLabel
newDeleteLabel Text
pName_ = DeleteLabel' :: Text -> DeleteLabel
DeleteLabel' {$sel:name:DeleteLabel' :: Text
name = Text
pName_}
deleteLabel_name :: Lens.Lens' DeleteLabel Prelude.Text
deleteLabel_name :: (Text -> f Text) -> DeleteLabel -> f DeleteLabel
deleteLabel_name = (DeleteLabel -> Text)
-> (DeleteLabel -> Text -> DeleteLabel)
-> Lens DeleteLabel DeleteLabel Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeleteLabel' {Text
name :: Text
$sel:name:DeleteLabel' :: DeleteLabel -> Text
name} -> Text
name) (\s :: DeleteLabel
s@DeleteLabel' {} Text
a -> DeleteLabel
s {$sel:name:DeleteLabel' :: Text
name = Text
a} :: DeleteLabel)
instance Core.AWSRequest DeleteLabel where
type AWSResponse DeleteLabel = DeleteLabelResponse
request :: DeleteLabel -> Request DeleteLabel
request = Service -> DeleteLabel -> Request DeleteLabel
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON Service
defaultService
response :: Logger
-> Service
-> Proxy DeleteLabel
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse DeleteLabel)))
response =
(Int
-> ResponseHeaders
-> ()
-> Either String (AWSResponse DeleteLabel))
-> Logger
-> Service
-> Proxy DeleteLabel
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse DeleteLabel)))
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 -> DeleteLabelResponse
DeleteLabelResponse'
(Int -> DeleteLabelResponse)
-> Either String Int -> Either String DeleteLabelResponse
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 DeleteLabel
instance Prelude.NFData DeleteLabel
instance Core.ToHeaders DeleteLabel where
toHeaders :: DeleteLabel -> ResponseHeaders
toHeaders =
ResponseHeaders -> DeleteLabel -> 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
"AWSHawksNestServiceFacade.DeleteLabel" ::
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 DeleteLabel where
toJSON :: DeleteLabel -> Value
toJSON DeleteLabel' {Text
name :: Text
$sel:name:DeleteLabel' :: DeleteLabel -> 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
"name" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
name)]
)
instance Core.ToPath DeleteLabel where
toPath :: DeleteLabel -> ByteString
toPath = ByteString -> DeleteLabel -> ByteString
forall a b. a -> b -> a
Prelude.const ByteString
"/"
instance Core.ToQuery DeleteLabel where
toQuery :: DeleteLabel -> QueryString
toQuery = QueryString -> DeleteLabel -> QueryString
forall a b. a -> b -> a
Prelude.const QueryString
forall a. Monoid a => a
Prelude.mempty
data DeleteLabelResponse = DeleteLabelResponse'
{
DeleteLabelResponse -> Int
httpStatus :: Prelude.Int
}
deriving (DeleteLabelResponse -> DeleteLabelResponse -> Bool
(DeleteLabelResponse -> DeleteLabelResponse -> Bool)
-> (DeleteLabelResponse -> DeleteLabelResponse -> Bool)
-> Eq DeleteLabelResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DeleteLabelResponse -> DeleteLabelResponse -> Bool
$c/= :: DeleteLabelResponse -> DeleteLabelResponse -> Bool
== :: DeleteLabelResponse -> DeleteLabelResponse -> Bool
$c== :: DeleteLabelResponse -> DeleteLabelResponse -> Bool
Prelude.Eq, ReadPrec [DeleteLabelResponse]
ReadPrec DeleteLabelResponse
Int -> ReadS DeleteLabelResponse
ReadS [DeleteLabelResponse]
(Int -> ReadS DeleteLabelResponse)
-> ReadS [DeleteLabelResponse]
-> ReadPrec DeleteLabelResponse
-> ReadPrec [DeleteLabelResponse]
-> Read DeleteLabelResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DeleteLabelResponse]
$creadListPrec :: ReadPrec [DeleteLabelResponse]
readPrec :: ReadPrec DeleteLabelResponse
$creadPrec :: ReadPrec DeleteLabelResponse
readList :: ReadS [DeleteLabelResponse]
$creadList :: ReadS [DeleteLabelResponse]
readsPrec :: Int -> ReadS DeleteLabelResponse
$creadsPrec :: Int -> ReadS DeleteLabelResponse
Prelude.Read, Int -> DeleteLabelResponse -> ShowS
[DeleteLabelResponse] -> ShowS
DeleteLabelResponse -> String
(Int -> DeleteLabelResponse -> ShowS)
-> (DeleteLabelResponse -> String)
-> ([DeleteLabelResponse] -> ShowS)
-> Show DeleteLabelResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DeleteLabelResponse] -> ShowS
$cshowList :: [DeleteLabelResponse] -> ShowS
show :: DeleteLabelResponse -> String
$cshow :: DeleteLabelResponse -> String
showsPrec :: Int -> DeleteLabelResponse -> ShowS
$cshowsPrec :: Int -> DeleteLabelResponse -> ShowS
Prelude.Show, (forall x. DeleteLabelResponse -> Rep DeleteLabelResponse x)
-> (forall x. Rep DeleteLabelResponse x -> DeleteLabelResponse)
-> Generic DeleteLabelResponse
forall x. Rep DeleteLabelResponse x -> DeleteLabelResponse
forall x. DeleteLabelResponse -> Rep DeleteLabelResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep DeleteLabelResponse x -> DeleteLabelResponse
$cfrom :: forall x. DeleteLabelResponse -> Rep DeleteLabelResponse x
Prelude.Generic)
newDeleteLabelResponse ::
Prelude.Int ->
DeleteLabelResponse
newDeleteLabelResponse :: Int -> DeleteLabelResponse
newDeleteLabelResponse Int
pHttpStatus_ =
DeleteLabelResponse' :: Int -> DeleteLabelResponse
DeleteLabelResponse' {$sel:httpStatus:DeleteLabelResponse' :: Int
httpStatus = Int
pHttpStatus_}
deleteLabelResponse_httpStatus :: Lens.Lens' DeleteLabelResponse Prelude.Int
deleteLabelResponse_httpStatus :: (Int -> f Int) -> DeleteLabelResponse -> f DeleteLabelResponse
deleteLabelResponse_httpStatus = (DeleteLabelResponse -> Int)
-> (DeleteLabelResponse -> Int -> DeleteLabelResponse)
-> Lens DeleteLabelResponse DeleteLabelResponse Int Int
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeleteLabelResponse' {Int
httpStatus :: Int
$sel:httpStatus:DeleteLabelResponse' :: DeleteLabelResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: DeleteLabelResponse
s@DeleteLabelResponse' {} Int
a -> DeleteLabelResponse
s {$sel:httpStatus:DeleteLabelResponse' :: Int
httpStatus = Int
a} :: DeleteLabelResponse)
instance Prelude.NFData DeleteLabelResponse