{-# 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.DeleteProjectVersion
(
DeleteProjectVersion (..),
newDeleteProjectVersion,
deleteProjectVersion_projectVersionArn,
DeleteProjectVersionResponse (..),
newDeleteProjectVersionResponse,
deleteProjectVersionResponse_status,
deleteProjectVersionResponse_httpStatus,
)
where
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
import Amazonka.Rekognition.Types
import qualified Amazonka.Request as Request
import qualified Amazonka.Response as Response
data DeleteProjectVersion = DeleteProjectVersion'
{
DeleteProjectVersion -> Text
projectVersionArn :: Prelude.Text
}
deriving (DeleteProjectVersion -> DeleteProjectVersion -> Bool
(DeleteProjectVersion -> DeleteProjectVersion -> Bool)
-> (DeleteProjectVersion -> DeleteProjectVersion -> Bool)
-> Eq DeleteProjectVersion
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DeleteProjectVersion -> DeleteProjectVersion -> Bool
$c/= :: DeleteProjectVersion -> DeleteProjectVersion -> Bool
== :: DeleteProjectVersion -> DeleteProjectVersion -> Bool
$c== :: DeleteProjectVersion -> DeleteProjectVersion -> Bool
Prelude.Eq, ReadPrec [DeleteProjectVersion]
ReadPrec DeleteProjectVersion
Int -> ReadS DeleteProjectVersion
ReadS [DeleteProjectVersion]
(Int -> ReadS DeleteProjectVersion)
-> ReadS [DeleteProjectVersion]
-> ReadPrec DeleteProjectVersion
-> ReadPrec [DeleteProjectVersion]
-> Read DeleteProjectVersion
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DeleteProjectVersion]
$creadListPrec :: ReadPrec [DeleteProjectVersion]
readPrec :: ReadPrec DeleteProjectVersion
$creadPrec :: ReadPrec DeleteProjectVersion
readList :: ReadS [DeleteProjectVersion]
$creadList :: ReadS [DeleteProjectVersion]
readsPrec :: Int -> ReadS DeleteProjectVersion
$creadsPrec :: Int -> ReadS DeleteProjectVersion
Prelude.Read, Int -> DeleteProjectVersion -> ShowS
[DeleteProjectVersion] -> ShowS
DeleteProjectVersion -> String
(Int -> DeleteProjectVersion -> ShowS)
-> (DeleteProjectVersion -> String)
-> ([DeleteProjectVersion] -> ShowS)
-> Show DeleteProjectVersion
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DeleteProjectVersion] -> ShowS
$cshowList :: [DeleteProjectVersion] -> ShowS
show :: DeleteProjectVersion -> String
$cshow :: DeleteProjectVersion -> String
showsPrec :: Int -> DeleteProjectVersion -> ShowS
$cshowsPrec :: Int -> DeleteProjectVersion -> ShowS
Prelude.Show, (forall x. DeleteProjectVersion -> Rep DeleteProjectVersion x)
-> (forall x. Rep DeleteProjectVersion x -> DeleteProjectVersion)
-> Generic DeleteProjectVersion
forall x. Rep DeleteProjectVersion x -> DeleteProjectVersion
forall x. DeleteProjectVersion -> Rep DeleteProjectVersion x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep DeleteProjectVersion x -> DeleteProjectVersion
$cfrom :: forall x. DeleteProjectVersion -> Rep DeleteProjectVersion x
Prelude.Generic)
newDeleteProjectVersion ::
Prelude.Text ->
DeleteProjectVersion
newDeleteProjectVersion :: Text -> DeleteProjectVersion
newDeleteProjectVersion Text
pProjectVersionArn_ =
DeleteProjectVersion' :: Text -> DeleteProjectVersion
DeleteProjectVersion'
{ $sel:projectVersionArn:DeleteProjectVersion' :: Text
projectVersionArn =
Text
pProjectVersionArn_
}
deleteProjectVersion_projectVersionArn :: Lens.Lens' DeleteProjectVersion Prelude.Text
deleteProjectVersion_projectVersionArn :: (Text -> f Text) -> DeleteProjectVersion -> f DeleteProjectVersion
deleteProjectVersion_projectVersionArn = (DeleteProjectVersion -> Text)
-> (DeleteProjectVersion -> Text -> DeleteProjectVersion)
-> Lens DeleteProjectVersion DeleteProjectVersion Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeleteProjectVersion' {Text
projectVersionArn :: Text
$sel:projectVersionArn:DeleteProjectVersion' :: DeleteProjectVersion -> Text
projectVersionArn} -> Text
projectVersionArn) (\s :: DeleteProjectVersion
s@DeleteProjectVersion' {} Text
a -> DeleteProjectVersion
s {$sel:projectVersionArn:DeleteProjectVersion' :: Text
projectVersionArn = Text
a} :: DeleteProjectVersion)
instance Core.AWSRequest DeleteProjectVersion where
type
AWSResponse DeleteProjectVersion =
DeleteProjectVersionResponse
request :: DeleteProjectVersion -> Request DeleteProjectVersion
request = Service -> DeleteProjectVersion -> Request DeleteProjectVersion
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON Service
defaultService
response :: Logger
-> Service
-> Proxy DeleteProjectVersion
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse DeleteProjectVersion)))
response =
(Int
-> ResponseHeaders
-> Object
-> Either String (AWSResponse DeleteProjectVersion))
-> Logger
-> Service
-> Proxy DeleteProjectVersion
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse DeleteProjectVersion)))
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 ProjectVersionStatus -> Int -> DeleteProjectVersionResponse
DeleteProjectVersionResponse'
(Maybe ProjectVersionStatus -> Int -> DeleteProjectVersionResponse)
-> Either String (Maybe ProjectVersionStatus)
-> Either String (Int -> DeleteProjectVersionResponse)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Either String (Maybe ProjectVersionStatus)
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"Status")
Either String (Int -> DeleteProjectVersionResponse)
-> Either String Int -> Either String DeleteProjectVersionResponse
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 DeleteProjectVersion
instance Prelude.NFData DeleteProjectVersion
instance Core.ToHeaders DeleteProjectVersion where
toHeaders :: DeleteProjectVersion -> ResponseHeaders
toHeaders =
ResponseHeaders -> DeleteProjectVersion -> 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
"RekognitionService.DeleteProjectVersion" ::
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 DeleteProjectVersion where
toJSON :: DeleteProjectVersion -> Value
toJSON DeleteProjectVersion' {Text
projectVersionArn :: Text
$sel:projectVersionArn:DeleteProjectVersion' :: DeleteProjectVersion -> 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
"ProjectVersionArn" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
projectVersionArn)
]
)
instance Core.ToPath DeleteProjectVersion where
toPath :: DeleteProjectVersion -> ByteString
toPath = ByteString -> DeleteProjectVersion -> ByteString
forall a b. a -> b -> a
Prelude.const ByteString
"/"
instance Core.ToQuery DeleteProjectVersion where
toQuery :: DeleteProjectVersion -> QueryString
toQuery = QueryString -> DeleteProjectVersion -> QueryString
forall a b. a -> b -> a
Prelude.const QueryString
forall a. Monoid a => a
Prelude.mempty
data DeleteProjectVersionResponse = DeleteProjectVersionResponse'
{
DeleteProjectVersionResponse -> Maybe ProjectVersionStatus
status :: Prelude.Maybe ProjectVersionStatus,
DeleteProjectVersionResponse -> Int
httpStatus :: Prelude.Int
}
deriving (DeleteProjectVersionResponse
-> DeleteProjectVersionResponse -> Bool
(DeleteProjectVersionResponse
-> DeleteProjectVersionResponse -> Bool)
-> (DeleteProjectVersionResponse
-> DeleteProjectVersionResponse -> Bool)
-> Eq DeleteProjectVersionResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DeleteProjectVersionResponse
-> DeleteProjectVersionResponse -> Bool
$c/= :: DeleteProjectVersionResponse
-> DeleteProjectVersionResponse -> Bool
== :: DeleteProjectVersionResponse
-> DeleteProjectVersionResponse -> Bool
$c== :: DeleteProjectVersionResponse
-> DeleteProjectVersionResponse -> Bool
Prelude.Eq, ReadPrec [DeleteProjectVersionResponse]
ReadPrec DeleteProjectVersionResponse
Int -> ReadS DeleteProjectVersionResponse
ReadS [DeleteProjectVersionResponse]
(Int -> ReadS DeleteProjectVersionResponse)
-> ReadS [DeleteProjectVersionResponse]
-> ReadPrec DeleteProjectVersionResponse
-> ReadPrec [DeleteProjectVersionResponse]
-> Read DeleteProjectVersionResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DeleteProjectVersionResponse]
$creadListPrec :: ReadPrec [DeleteProjectVersionResponse]
readPrec :: ReadPrec DeleteProjectVersionResponse
$creadPrec :: ReadPrec DeleteProjectVersionResponse
readList :: ReadS [DeleteProjectVersionResponse]
$creadList :: ReadS [DeleteProjectVersionResponse]
readsPrec :: Int -> ReadS DeleteProjectVersionResponse
$creadsPrec :: Int -> ReadS DeleteProjectVersionResponse
Prelude.Read, Int -> DeleteProjectVersionResponse -> ShowS
[DeleteProjectVersionResponse] -> ShowS
DeleteProjectVersionResponse -> String
(Int -> DeleteProjectVersionResponse -> ShowS)
-> (DeleteProjectVersionResponse -> String)
-> ([DeleteProjectVersionResponse] -> ShowS)
-> Show DeleteProjectVersionResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DeleteProjectVersionResponse] -> ShowS
$cshowList :: [DeleteProjectVersionResponse] -> ShowS
show :: DeleteProjectVersionResponse -> String
$cshow :: DeleteProjectVersionResponse -> String
showsPrec :: Int -> DeleteProjectVersionResponse -> ShowS
$cshowsPrec :: Int -> DeleteProjectVersionResponse -> ShowS
Prelude.Show, (forall x.
DeleteProjectVersionResponse -> Rep DeleteProjectVersionResponse x)
-> (forall x.
Rep DeleteProjectVersionResponse x -> DeleteProjectVersionResponse)
-> Generic DeleteProjectVersionResponse
forall x.
Rep DeleteProjectVersionResponse x -> DeleteProjectVersionResponse
forall x.
DeleteProjectVersionResponse -> Rep DeleteProjectVersionResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep DeleteProjectVersionResponse x -> DeleteProjectVersionResponse
$cfrom :: forall x.
DeleteProjectVersionResponse -> Rep DeleteProjectVersionResponse x
Prelude.Generic)
newDeleteProjectVersionResponse ::
Prelude.Int ->
DeleteProjectVersionResponse
newDeleteProjectVersionResponse :: Int -> DeleteProjectVersionResponse
newDeleteProjectVersionResponse Int
pHttpStatus_ =
DeleteProjectVersionResponse' :: Maybe ProjectVersionStatus -> Int -> DeleteProjectVersionResponse
DeleteProjectVersionResponse'
{ $sel:status:DeleteProjectVersionResponse' :: Maybe ProjectVersionStatus
status =
Maybe ProjectVersionStatus
forall a. Maybe a
Prelude.Nothing,
$sel:httpStatus:DeleteProjectVersionResponse' :: Int
httpStatus = Int
pHttpStatus_
}
deleteProjectVersionResponse_status :: Lens.Lens' DeleteProjectVersionResponse (Prelude.Maybe ProjectVersionStatus)
deleteProjectVersionResponse_status :: (Maybe ProjectVersionStatus -> f (Maybe ProjectVersionStatus))
-> DeleteProjectVersionResponse -> f DeleteProjectVersionResponse
deleteProjectVersionResponse_status = (DeleteProjectVersionResponse -> Maybe ProjectVersionStatus)
-> (DeleteProjectVersionResponse
-> Maybe ProjectVersionStatus -> DeleteProjectVersionResponse)
-> Lens
DeleteProjectVersionResponse
DeleteProjectVersionResponse
(Maybe ProjectVersionStatus)
(Maybe ProjectVersionStatus)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeleteProjectVersionResponse' {Maybe ProjectVersionStatus
status :: Maybe ProjectVersionStatus
$sel:status:DeleteProjectVersionResponse' :: DeleteProjectVersionResponse -> Maybe ProjectVersionStatus
status} -> Maybe ProjectVersionStatus
status) (\s :: DeleteProjectVersionResponse
s@DeleteProjectVersionResponse' {} Maybe ProjectVersionStatus
a -> DeleteProjectVersionResponse
s {$sel:status:DeleteProjectVersionResponse' :: Maybe ProjectVersionStatus
status = Maybe ProjectVersionStatus
a} :: DeleteProjectVersionResponse)
deleteProjectVersionResponse_httpStatus :: Lens.Lens' DeleteProjectVersionResponse Prelude.Int
deleteProjectVersionResponse_httpStatus :: (Int -> f Int)
-> DeleteProjectVersionResponse -> f DeleteProjectVersionResponse
deleteProjectVersionResponse_httpStatus = (DeleteProjectVersionResponse -> Int)
-> (DeleteProjectVersionResponse
-> Int -> DeleteProjectVersionResponse)
-> Lens
DeleteProjectVersionResponse DeleteProjectVersionResponse Int Int
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeleteProjectVersionResponse' {Int
httpStatus :: Int
$sel:httpStatus:DeleteProjectVersionResponse' :: DeleteProjectVersionResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: DeleteProjectVersionResponse
s@DeleteProjectVersionResponse' {} Int
a -> DeleteProjectVersionResponse
s {$sel:httpStatus:DeleteProjectVersionResponse' :: Int
httpStatus = Int
a} :: DeleteProjectVersionResponse)
instance Prelude.NFData DeleteProjectVersionResponse