{-# 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.DeleteWorkteam
(
DeleteWorkteam (..),
newDeleteWorkteam,
deleteWorkteam_workteamName,
DeleteWorkteamResponse (..),
newDeleteWorkteamResponse,
deleteWorkteamResponse_httpStatus,
deleteWorkteamResponse_success,
)
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 DeleteWorkteam = DeleteWorkteam'
{
DeleteWorkteam -> Text
workteamName :: Prelude.Text
}
deriving (DeleteWorkteam -> DeleteWorkteam -> Bool
(DeleteWorkteam -> DeleteWorkteam -> Bool)
-> (DeleteWorkteam -> DeleteWorkteam -> Bool) -> Eq DeleteWorkteam
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DeleteWorkteam -> DeleteWorkteam -> Bool
$c/= :: DeleteWorkteam -> DeleteWorkteam -> Bool
== :: DeleteWorkteam -> DeleteWorkteam -> Bool
$c== :: DeleteWorkteam -> DeleteWorkteam -> Bool
Prelude.Eq, ReadPrec [DeleteWorkteam]
ReadPrec DeleteWorkteam
Int -> ReadS DeleteWorkteam
ReadS [DeleteWorkteam]
(Int -> ReadS DeleteWorkteam)
-> ReadS [DeleteWorkteam]
-> ReadPrec DeleteWorkteam
-> ReadPrec [DeleteWorkteam]
-> Read DeleteWorkteam
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DeleteWorkteam]
$creadListPrec :: ReadPrec [DeleteWorkteam]
readPrec :: ReadPrec DeleteWorkteam
$creadPrec :: ReadPrec DeleteWorkteam
readList :: ReadS [DeleteWorkteam]
$creadList :: ReadS [DeleteWorkteam]
readsPrec :: Int -> ReadS DeleteWorkteam
$creadsPrec :: Int -> ReadS DeleteWorkteam
Prelude.Read, Int -> DeleteWorkteam -> ShowS
[DeleteWorkteam] -> ShowS
DeleteWorkteam -> String
(Int -> DeleteWorkteam -> ShowS)
-> (DeleteWorkteam -> String)
-> ([DeleteWorkteam] -> ShowS)
-> Show DeleteWorkteam
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DeleteWorkteam] -> ShowS
$cshowList :: [DeleteWorkteam] -> ShowS
show :: DeleteWorkteam -> String
$cshow :: DeleteWorkteam -> String
showsPrec :: Int -> DeleteWorkteam -> ShowS
$cshowsPrec :: Int -> DeleteWorkteam -> ShowS
Prelude.Show, (forall x. DeleteWorkteam -> Rep DeleteWorkteam x)
-> (forall x. Rep DeleteWorkteam x -> DeleteWorkteam)
-> Generic DeleteWorkteam
forall x. Rep DeleteWorkteam x -> DeleteWorkteam
forall x. DeleteWorkteam -> Rep DeleteWorkteam x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep DeleteWorkteam x -> DeleteWorkteam
$cfrom :: forall x. DeleteWorkteam -> Rep DeleteWorkteam x
Prelude.Generic)
newDeleteWorkteam ::
Prelude.Text ->
DeleteWorkteam
newDeleteWorkteam :: Text -> DeleteWorkteam
newDeleteWorkteam Text
pWorkteamName_ =
DeleteWorkteam' :: Text -> DeleteWorkteam
DeleteWorkteam' {$sel:workteamName:DeleteWorkteam' :: Text
workteamName = Text
pWorkteamName_}
deleteWorkteam_workteamName :: Lens.Lens' DeleteWorkteam Prelude.Text
deleteWorkteam_workteamName :: (Text -> f Text) -> DeleteWorkteam -> f DeleteWorkteam
deleteWorkteam_workteamName = (DeleteWorkteam -> Text)
-> (DeleteWorkteam -> Text -> DeleteWorkteam)
-> Lens DeleteWorkteam DeleteWorkteam Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeleteWorkteam' {Text
workteamName :: Text
$sel:workteamName:DeleteWorkteam' :: DeleteWorkteam -> Text
workteamName} -> Text
workteamName) (\s :: DeleteWorkteam
s@DeleteWorkteam' {} Text
a -> DeleteWorkteam
s {$sel:workteamName:DeleteWorkteam' :: Text
workteamName = Text
a} :: DeleteWorkteam)
instance Core.AWSRequest DeleteWorkteam where
type
AWSResponse DeleteWorkteam =
DeleteWorkteamResponse
request :: DeleteWorkteam -> Request DeleteWorkteam
request = Service -> DeleteWorkteam -> Request DeleteWorkteam
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON Service
defaultService
response :: Logger
-> Service
-> Proxy DeleteWorkteam
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse DeleteWorkteam)))
response =
(Int
-> ResponseHeaders
-> Object
-> Either String (AWSResponse DeleteWorkteam))
-> Logger
-> Service
-> Proxy DeleteWorkteam
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse DeleteWorkteam)))
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 ->
Int -> Bool -> DeleteWorkteamResponse
DeleteWorkteamResponse'
(Int -> Bool -> DeleteWorkteamResponse)
-> Either String Int
-> Either String (Bool -> DeleteWorkteamResponse)
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))
Either String (Bool -> DeleteWorkteamResponse)
-> Either String Bool -> Either String DeleteWorkteamResponse
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Either String Bool
forall a. FromJSON a => Object -> Text -> Either String a
Core..:> Text
"Success")
)
instance Prelude.Hashable DeleteWorkteam
instance Prelude.NFData DeleteWorkteam
instance Core.ToHeaders DeleteWorkteam where
toHeaders :: DeleteWorkteam -> ResponseHeaders
toHeaders =
ResponseHeaders -> DeleteWorkteam -> 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.DeleteWorkteam" :: 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 DeleteWorkteam where
toJSON :: DeleteWorkteam -> Value
toJSON DeleteWorkteam' {Text
workteamName :: Text
$sel:workteamName:DeleteWorkteam' :: DeleteWorkteam -> 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
"WorkteamName" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
workteamName)]
)
instance Core.ToPath DeleteWorkteam where
toPath :: DeleteWorkteam -> ByteString
toPath = ByteString -> DeleteWorkteam -> ByteString
forall a b. a -> b -> a
Prelude.const ByteString
"/"
instance Core.ToQuery DeleteWorkteam where
toQuery :: DeleteWorkteam -> QueryString
toQuery = QueryString -> DeleteWorkteam -> QueryString
forall a b. a -> b -> a
Prelude.const QueryString
forall a. Monoid a => a
Prelude.mempty
data DeleteWorkteamResponse = DeleteWorkteamResponse'
{
DeleteWorkteamResponse -> Int
httpStatus :: Prelude.Int,
DeleteWorkteamResponse -> Bool
success :: Prelude.Bool
}
deriving (DeleteWorkteamResponse -> DeleteWorkteamResponse -> Bool
(DeleteWorkteamResponse -> DeleteWorkteamResponse -> Bool)
-> (DeleteWorkteamResponse -> DeleteWorkteamResponse -> Bool)
-> Eq DeleteWorkteamResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DeleteWorkteamResponse -> DeleteWorkteamResponse -> Bool
$c/= :: DeleteWorkteamResponse -> DeleteWorkteamResponse -> Bool
== :: DeleteWorkteamResponse -> DeleteWorkteamResponse -> Bool
$c== :: DeleteWorkteamResponse -> DeleteWorkteamResponse -> Bool
Prelude.Eq, ReadPrec [DeleteWorkteamResponse]
ReadPrec DeleteWorkteamResponse
Int -> ReadS DeleteWorkteamResponse
ReadS [DeleteWorkteamResponse]
(Int -> ReadS DeleteWorkteamResponse)
-> ReadS [DeleteWorkteamResponse]
-> ReadPrec DeleteWorkteamResponse
-> ReadPrec [DeleteWorkteamResponse]
-> Read DeleteWorkteamResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DeleteWorkteamResponse]
$creadListPrec :: ReadPrec [DeleteWorkteamResponse]
readPrec :: ReadPrec DeleteWorkteamResponse
$creadPrec :: ReadPrec DeleteWorkteamResponse
readList :: ReadS [DeleteWorkteamResponse]
$creadList :: ReadS [DeleteWorkteamResponse]
readsPrec :: Int -> ReadS DeleteWorkteamResponse
$creadsPrec :: Int -> ReadS DeleteWorkteamResponse
Prelude.Read, Int -> DeleteWorkteamResponse -> ShowS
[DeleteWorkteamResponse] -> ShowS
DeleteWorkteamResponse -> String
(Int -> DeleteWorkteamResponse -> ShowS)
-> (DeleteWorkteamResponse -> String)
-> ([DeleteWorkteamResponse] -> ShowS)
-> Show DeleteWorkteamResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DeleteWorkteamResponse] -> ShowS
$cshowList :: [DeleteWorkteamResponse] -> ShowS
show :: DeleteWorkteamResponse -> String
$cshow :: DeleteWorkteamResponse -> String
showsPrec :: Int -> DeleteWorkteamResponse -> ShowS
$cshowsPrec :: Int -> DeleteWorkteamResponse -> ShowS
Prelude.Show, (forall x. DeleteWorkteamResponse -> Rep DeleteWorkteamResponse x)
-> (forall x.
Rep DeleteWorkteamResponse x -> DeleteWorkteamResponse)
-> Generic DeleteWorkteamResponse
forall x. Rep DeleteWorkteamResponse x -> DeleteWorkteamResponse
forall x. DeleteWorkteamResponse -> Rep DeleteWorkteamResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep DeleteWorkteamResponse x -> DeleteWorkteamResponse
$cfrom :: forall x. DeleteWorkteamResponse -> Rep DeleteWorkteamResponse x
Prelude.Generic)
newDeleteWorkteamResponse ::
Prelude.Int ->
Prelude.Bool ->
DeleteWorkteamResponse
newDeleteWorkteamResponse :: Int -> Bool -> DeleteWorkteamResponse
newDeleteWorkteamResponse Int
pHttpStatus_ Bool
pSuccess_ =
DeleteWorkteamResponse' :: Int -> Bool -> DeleteWorkteamResponse
DeleteWorkteamResponse'
{ $sel:httpStatus:DeleteWorkteamResponse' :: Int
httpStatus = Int
pHttpStatus_,
$sel:success:DeleteWorkteamResponse' :: Bool
success = Bool
pSuccess_
}
deleteWorkteamResponse_httpStatus :: Lens.Lens' DeleteWorkteamResponse Prelude.Int
deleteWorkteamResponse_httpStatus :: (Int -> f Int)
-> DeleteWorkteamResponse -> f DeleteWorkteamResponse
deleteWorkteamResponse_httpStatus = (DeleteWorkteamResponse -> Int)
-> (DeleteWorkteamResponse -> Int -> DeleteWorkteamResponse)
-> Lens DeleteWorkteamResponse DeleteWorkteamResponse Int Int
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeleteWorkteamResponse' {Int
httpStatus :: Int
$sel:httpStatus:DeleteWorkteamResponse' :: DeleteWorkteamResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: DeleteWorkteamResponse
s@DeleteWorkteamResponse' {} Int
a -> DeleteWorkteamResponse
s {$sel:httpStatus:DeleteWorkteamResponse' :: Int
httpStatus = Int
a} :: DeleteWorkteamResponse)
deleteWorkteamResponse_success :: Lens.Lens' DeleteWorkteamResponse Prelude.Bool
deleteWorkteamResponse_success :: (Bool -> f Bool)
-> DeleteWorkteamResponse -> f DeleteWorkteamResponse
deleteWorkteamResponse_success = (DeleteWorkteamResponse -> Bool)
-> (DeleteWorkteamResponse -> Bool -> DeleteWorkteamResponse)
-> Lens DeleteWorkteamResponse DeleteWorkteamResponse Bool Bool
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeleteWorkteamResponse' {Bool
success :: Bool
$sel:success:DeleteWorkteamResponse' :: DeleteWorkteamResponse -> Bool
success} -> Bool
success) (\s :: DeleteWorkteamResponse
s@DeleteWorkteamResponse' {} Bool
a -> DeleteWorkteamResponse
s {$sel:success:DeleteWorkteamResponse' :: Bool
success = Bool
a} :: DeleteWorkteamResponse)
instance Prelude.NFData DeleteWorkteamResponse