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