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