{-# 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.Rekognition.DeleteProject
(
DeleteProject (..),
newDeleteProject,
deleteProject_projectArn,
DeleteProjectResponse (..),
newDeleteProjectResponse,
deleteProjectResponse_status,
deleteProjectResponse_httpStatus,
)
where
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 Amazonka.Rekognition.Types
import qualified Amazonka.Request as Request
import qualified Amazonka.Response as Response
data DeleteProject = DeleteProject'
{
DeleteProject -> Text
projectArn :: Prelude.Text
}
deriving (DeleteProject -> DeleteProject -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DeleteProject -> DeleteProject -> Bool
$c/= :: DeleteProject -> DeleteProject -> Bool
== :: DeleteProject -> DeleteProject -> Bool
$c== :: DeleteProject -> DeleteProject -> Bool
Prelude.Eq, ReadPrec [DeleteProject]
ReadPrec DeleteProject
Int -> ReadS DeleteProject
ReadS [DeleteProject]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DeleteProject]
$creadListPrec :: ReadPrec [DeleteProject]
readPrec :: ReadPrec DeleteProject
$creadPrec :: ReadPrec DeleteProject
readList :: ReadS [DeleteProject]
$creadList :: ReadS [DeleteProject]
readsPrec :: Int -> ReadS DeleteProject
$creadsPrec :: Int -> ReadS DeleteProject
Prelude.Read, Int -> DeleteProject -> ShowS
[DeleteProject] -> ShowS
DeleteProject -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DeleteProject] -> ShowS
$cshowList :: [DeleteProject] -> ShowS
show :: DeleteProject -> String
$cshow :: DeleteProject -> String
showsPrec :: Int -> DeleteProject -> ShowS
$cshowsPrec :: Int -> DeleteProject -> ShowS
Prelude.Show, forall x. Rep DeleteProject x -> DeleteProject
forall x. DeleteProject -> Rep DeleteProject x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep DeleteProject x -> DeleteProject
$cfrom :: forall x. DeleteProject -> Rep DeleteProject x
Prelude.Generic)
newDeleteProject ::
Prelude.Text ->
DeleteProject
newDeleteProject :: Text -> DeleteProject
newDeleteProject Text
pProjectArn_ =
DeleteProject' {$sel:projectArn:DeleteProject' :: Text
projectArn = Text
pProjectArn_}
deleteProject_projectArn :: Lens.Lens' DeleteProject Prelude.Text
deleteProject_projectArn :: Lens' DeleteProject Text
deleteProject_projectArn = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeleteProject' {Text
projectArn :: Text
$sel:projectArn:DeleteProject' :: DeleteProject -> Text
projectArn} -> Text
projectArn) (\s :: DeleteProject
s@DeleteProject' {} Text
a -> DeleteProject
s {$sel:projectArn:DeleteProject' :: Text
projectArn = Text
a} :: DeleteProject)
instance Core.AWSRequest DeleteProject where
type
AWSResponse DeleteProject =
DeleteProjectResponse
request :: (Service -> Service) -> DeleteProject -> Request DeleteProject
request Service -> Service
overrides =
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON (Service -> Service
overrides Service
defaultService)
response :: forall (m :: * -> *).
MonadResource m =>
(ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy DeleteProject
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse DeleteProject)))
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 ProjectStatus -> Int -> DeleteProjectResponse
DeleteProjectResponse'
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
"Status")
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 DeleteProject where
hashWithSalt :: Int -> DeleteProject -> Int
hashWithSalt Int
_salt DeleteProject' {Text
projectArn :: Text
$sel:projectArn:DeleteProject' :: DeleteProject -> Text
..} =
Int
_salt forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
projectArn
instance Prelude.NFData DeleteProject where
rnf :: DeleteProject -> ()
rnf DeleteProject' {Text
projectArn :: Text
$sel:projectArn:DeleteProject' :: DeleteProject -> Text
..} = forall a. NFData a => a -> ()
Prelude.rnf Text
projectArn
instance Data.ToHeaders DeleteProject where
toHeaders :: DeleteProject -> ResponseHeaders
toHeaders =
forall a b. a -> b -> a
Prelude.const
( forall a. Monoid a => [a] -> a
Prelude.mconcat
[ HeaderName
"X-Amz-Target"
forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Data.=# ( ByteString
"RekognitionService.DeleteProject" ::
Prelude.ByteString
),
HeaderName
"Content-Type"
forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Data.=# ( ByteString
"application/x-amz-json-1.1" ::
Prelude.ByteString
)
]
)
instance Data.ToJSON DeleteProject where
toJSON :: DeleteProject -> Value
toJSON DeleteProject' {Text
projectArn :: Text
$sel:projectArn:DeleteProject' :: DeleteProject -> Text
..} =
[Pair] -> Value
Data.object
( forall a. [Maybe a] -> [a]
Prelude.catMaybes
[forall a. a -> Maybe a
Prelude.Just (Key
"ProjectArn" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= Text
projectArn)]
)
instance Data.ToPath DeleteProject where
toPath :: DeleteProject -> ByteString
toPath = forall a b. a -> b -> a
Prelude.const ByteString
"/"
instance Data.ToQuery DeleteProject where
toQuery :: DeleteProject -> QueryString
toQuery = forall a b. a -> b -> a
Prelude.const forall a. Monoid a => a
Prelude.mempty
data DeleteProjectResponse = DeleteProjectResponse'
{
DeleteProjectResponse -> Maybe ProjectStatus
status :: Prelude.Maybe ProjectStatus,
DeleteProjectResponse -> Int
httpStatus :: Prelude.Int
}
deriving (DeleteProjectResponse -> DeleteProjectResponse -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DeleteProjectResponse -> DeleteProjectResponse -> Bool
$c/= :: DeleteProjectResponse -> DeleteProjectResponse -> Bool
== :: DeleteProjectResponse -> DeleteProjectResponse -> Bool
$c== :: DeleteProjectResponse -> DeleteProjectResponse -> Bool
Prelude.Eq, ReadPrec [DeleteProjectResponse]
ReadPrec DeleteProjectResponse
Int -> ReadS DeleteProjectResponse
ReadS [DeleteProjectResponse]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DeleteProjectResponse]
$creadListPrec :: ReadPrec [DeleteProjectResponse]
readPrec :: ReadPrec DeleteProjectResponse
$creadPrec :: ReadPrec DeleteProjectResponse
readList :: ReadS [DeleteProjectResponse]
$creadList :: ReadS [DeleteProjectResponse]
readsPrec :: Int -> ReadS DeleteProjectResponse
$creadsPrec :: Int -> ReadS DeleteProjectResponse
Prelude.Read, Int -> DeleteProjectResponse -> ShowS
[DeleteProjectResponse] -> ShowS
DeleteProjectResponse -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DeleteProjectResponse] -> ShowS
$cshowList :: [DeleteProjectResponse] -> ShowS
show :: DeleteProjectResponse -> String
$cshow :: DeleteProjectResponse -> String
showsPrec :: Int -> DeleteProjectResponse -> ShowS
$cshowsPrec :: Int -> DeleteProjectResponse -> ShowS
Prelude.Show, forall x. Rep DeleteProjectResponse x -> DeleteProjectResponse
forall x. DeleteProjectResponse -> Rep DeleteProjectResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep DeleteProjectResponse x -> DeleteProjectResponse
$cfrom :: forall x. DeleteProjectResponse -> Rep DeleteProjectResponse x
Prelude.Generic)
newDeleteProjectResponse ::
Prelude.Int ->
DeleteProjectResponse
newDeleteProjectResponse :: Int -> DeleteProjectResponse
newDeleteProjectResponse Int
pHttpStatus_ =
DeleteProjectResponse'
{ $sel:status:DeleteProjectResponse' :: Maybe ProjectStatus
status = forall a. Maybe a
Prelude.Nothing,
$sel:httpStatus:DeleteProjectResponse' :: Int
httpStatus = Int
pHttpStatus_
}
deleteProjectResponse_status :: Lens.Lens' DeleteProjectResponse (Prelude.Maybe ProjectStatus)
deleteProjectResponse_status :: Lens' DeleteProjectResponse (Maybe ProjectStatus)
deleteProjectResponse_status = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeleteProjectResponse' {Maybe ProjectStatus
status :: Maybe ProjectStatus
$sel:status:DeleteProjectResponse' :: DeleteProjectResponse -> Maybe ProjectStatus
status} -> Maybe ProjectStatus
status) (\s :: DeleteProjectResponse
s@DeleteProjectResponse' {} Maybe ProjectStatus
a -> DeleteProjectResponse
s {$sel:status:DeleteProjectResponse' :: Maybe ProjectStatus
status = Maybe ProjectStatus
a} :: DeleteProjectResponse)
deleteProjectResponse_httpStatus :: Lens.Lens' DeleteProjectResponse Prelude.Int
deleteProjectResponse_httpStatus :: Lens' DeleteProjectResponse Int
deleteProjectResponse_httpStatus = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeleteProjectResponse' {Int
httpStatus :: Int
$sel:httpStatus:DeleteProjectResponse' :: DeleteProjectResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: DeleteProjectResponse
s@DeleteProjectResponse' {} Int
a -> DeleteProjectResponse
s {$sel:httpStatus:DeleteProjectResponse' :: Int
httpStatus = Int
a} :: DeleteProjectResponse)
instance Prelude.NFData DeleteProjectResponse where
rnf :: DeleteProjectResponse -> ()
rnf DeleteProjectResponse' {Int
Maybe ProjectStatus
httpStatus :: Int
status :: Maybe ProjectStatus
$sel:httpStatus:DeleteProjectResponse' :: DeleteProjectResponse -> Int
$sel:status:DeleteProjectResponse' :: DeleteProjectResponse -> Maybe ProjectStatus
..} =
forall a. NFData a => a -> ()
Prelude.rnf Maybe ProjectStatus
status
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Int
httpStatus