{-# 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.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
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
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]
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
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. 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' {$sel:workforceName:DeleteWorkforce' :: Text
workforceName = Text
pWorkforceName_}
deleteWorkforce_workforceName :: Lens.Lens' DeleteWorkforce Prelude.Text
deleteWorkforce_workforceName :: Lens' DeleteWorkforce Text
deleteWorkforce_workforceName = 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 :: (Service -> Service) -> DeleteWorkforce -> Request DeleteWorkforce
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 DeleteWorkforce
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse DeleteWorkforce)))
response =
forall (m :: * -> *) a.
MonadResource m =>
(Int -> ResponseHeaders -> () -> Either String (AWSResponse a))
-> (ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveEmpty
( \Int
s ResponseHeaders
h ()
x ->
Int -> DeleteWorkforceResponse
DeleteWorkforceResponse'
forall (f :: * -> *) a b. Functor 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 DeleteWorkforce where
hashWithSalt :: Int -> DeleteWorkforce -> Int
hashWithSalt Int
_salt DeleteWorkforce' {Text
workforceName :: Text
$sel:workforceName:DeleteWorkforce' :: DeleteWorkforce -> Text
..} =
Int
_salt forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
workforceName
instance Prelude.NFData DeleteWorkforce where
rnf :: DeleteWorkforce -> ()
rnf DeleteWorkforce' {Text
workforceName :: Text
$sel:workforceName:DeleteWorkforce' :: DeleteWorkforce -> Text
..} = forall a. NFData a => a -> ()
Prelude.rnf Text
workforceName
instance Data.ToHeaders DeleteWorkforce where
toHeaders :: DeleteWorkforce -> 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
"SageMaker.DeleteWorkforce" :: 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 DeleteWorkforce where
toJSON :: DeleteWorkforce -> Value
toJSON DeleteWorkforce' {Text
workforceName :: Text
$sel:workforceName:DeleteWorkforce' :: DeleteWorkforce -> Text
..} =
[Pair] -> Value
Data.object
( forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ forall a. a -> Maybe a
Prelude.Just
(Key
"WorkforceName" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= Text
workforceName)
]
)
instance Data.ToPath DeleteWorkforce where
toPath :: DeleteWorkforce -> ByteString
toPath = forall a b. a -> b -> a
Prelude.const ByteString
"/"
instance Data.ToQuery DeleteWorkforce where
toQuery :: DeleteWorkforce -> QueryString
toQuery = forall a b. a -> b -> a
Prelude.const forall a. Monoid a => a
Prelude.mempty
data DeleteWorkforceResponse = DeleteWorkforceResponse'
{
DeleteWorkforceResponse -> Int
httpStatus :: Prelude.Int
}
deriving (DeleteWorkforceResponse -> DeleteWorkforceResponse -> Bool
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]
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
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. 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' {$sel:httpStatus:DeleteWorkforceResponse' :: Int
httpStatus = Int
pHttpStatus_}
deleteWorkforceResponse_httpStatus :: Lens.Lens' DeleteWorkforceResponse Prelude.Int
deleteWorkforceResponse_httpStatus :: Lens' DeleteWorkforceResponse Int
deleteWorkforceResponse_httpStatus = 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 where
rnf :: DeleteWorkforceResponse -> ()
rnf DeleteWorkforceResponse' {Int
httpStatus :: Int
$sel:httpStatus:DeleteWorkforceResponse' :: DeleteWorkforceResponse -> Int
..} =
forall a. NFData a => a -> ()
Prelude.rnf Int
httpStatus