{-# 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.DeleteTrialComponent
(
DeleteTrialComponent (..),
newDeleteTrialComponent,
deleteTrialComponent_trialComponentName,
DeleteTrialComponentResponse (..),
newDeleteTrialComponentResponse,
deleteTrialComponentResponse_trialComponentArn,
deleteTrialComponentResponse_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 DeleteTrialComponent = DeleteTrialComponent'
{
DeleteTrialComponent -> Text
trialComponentName :: Prelude.Text
}
deriving (DeleteTrialComponent -> DeleteTrialComponent -> Bool
(DeleteTrialComponent -> DeleteTrialComponent -> Bool)
-> (DeleteTrialComponent -> DeleteTrialComponent -> Bool)
-> Eq DeleteTrialComponent
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DeleteTrialComponent -> DeleteTrialComponent -> Bool
$c/= :: DeleteTrialComponent -> DeleteTrialComponent -> Bool
== :: DeleteTrialComponent -> DeleteTrialComponent -> Bool
$c== :: DeleteTrialComponent -> DeleteTrialComponent -> Bool
Prelude.Eq, ReadPrec [DeleteTrialComponent]
ReadPrec DeleteTrialComponent
Int -> ReadS DeleteTrialComponent
ReadS [DeleteTrialComponent]
(Int -> ReadS DeleteTrialComponent)
-> ReadS [DeleteTrialComponent]
-> ReadPrec DeleteTrialComponent
-> ReadPrec [DeleteTrialComponent]
-> Read DeleteTrialComponent
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DeleteTrialComponent]
$creadListPrec :: ReadPrec [DeleteTrialComponent]
readPrec :: ReadPrec DeleteTrialComponent
$creadPrec :: ReadPrec DeleteTrialComponent
readList :: ReadS [DeleteTrialComponent]
$creadList :: ReadS [DeleteTrialComponent]
readsPrec :: Int -> ReadS DeleteTrialComponent
$creadsPrec :: Int -> ReadS DeleteTrialComponent
Prelude.Read, Int -> DeleteTrialComponent -> ShowS
[DeleteTrialComponent] -> ShowS
DeleteTrialComponent -> String
(Int -> DeleteTrialComponent -> ShowS)
-> (DeleteTrialComponent -> String)
-> ([DeleteTrialComponent] -> ShowS)
-> Show DeleteTrialComponent
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DeleteTrialComponent] -> ShowS
$cshowList :: [DeleteTrialComponent] -> ShowS
show :: DeleteTrialComponent -> String
$cshow :: DeleteTrialComponent -> String
showsPrec :: Int -> DeleteTrialComponent -> ShowS
$cshowsPrec :: Int -> DeleteTrialComponent -> ShowS
Prelude.Show, (forall x. DeleteTrialComponent -> Rep DeleteTrialComponent x)
-> (forall x. Rep DeleteTrialComponent x -> DeleteTrialComponent)
-> Generic DeleteTrialComponent
forall x. Rep DeleteTrialComponent x -> DeleteTrialComponent
forall x. DeleteTrialComponent -> Rep DeleteTrialComponent x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep DeleteTrialComponent x -> DeleteTrialComponent
$cfrom :: forall x. DeleteTrialComponent -> Rep DeleteTrialComponent x
Prelude.Generic)
newDeleteTrialComponent ::
Prelude.Text ->
DeleteTrialComponent
newDeleteTrialComponent :: Text -> DeleteTrialComponent
newDeleteTrialComponent Text
pTrialComponentName_ =
DeleteTrialComponent' :: Text -> DeleteTrialComponent
DeleteTrialComponent'
{ $sel:trialComponentName:DeleteTrialComponent' :: Text
trialComponentName =
Text
pTrialComponentName_
}
deleteTrialComponent_trialComponentName :: Lens.Lens' DeleteTrialComponent Prelude.Text
deleteTrialComponent_trialComponentName :: (Text -> f Text) -> DeleteTrialComponent -> f DeleteTrialComponent
deleteTrialComponent_trialComponentName = (DeleteTrialComponent -> Text)
-> (DeleteTrialComponent -> Text -> DeleteTrialComponent)
-> Lens DeleteTrialComponent DeleteTrialComponent Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeleteTrialComponent' {Text
trialComponentName :: Text
$sel:trialComponentName:DeleteTrialComponent' :: DeleteTrialComponent -> Text
trialComponentName} -> Text
trialComponentName) (\s :: DeleteTrialComponent
s@DeleteTrialComponent' {} Text
a -> DeleteTrialComponent
s {$sel:trialComponentName:DeleteTrialComponent' :: Text
trialComponentName = Text
a} :: DeleteTrialComponent)
instance Core.AWSRequest DeleteTrialComponent where
type
AWSResponse DeleteTrialComponent =
DeleteTrialComponentResponse
request :: DeleteTrialComponent -> Request DeleteTrialComponent
request = Service -> DeleteTrialComponent -> Request DeleteTrialComponent
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON Service
defaultService
response :: Logger
-> Service
-> Proxy DeleteTrialComponent
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse DeleteTrialComponent)))
response =
(Int
-> ResponseHeaders
-> Object
-> Either String (AWSResponse DeleteTrialComponent))
-> Logger
-> Service
-> Proxy DeleteTrialComponent
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse DeleteTrialComponent)))
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 Text -> Int -> DeleteTrialComponentResponse
DeleteTrialComponentResponse'
(Maybe Text -> Int -> DeleteTrialComponentResponse)
-> Either String (Maybe Text)
-> Either String (Int -> DeleteTrialComponentResponse)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Either String (Maybe Text)
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"TrialComponentArn")
Either String (Int -> DeleteTrialComponentResponse)
-> Either String Int -> Either String DeleteTrialComponentResponse
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 DeleteTrialComponent
instance Prelude.NFData DeleteTrialComponent
instance Core.ToHeaders DeleteTrialComponent where
toHeaders :: DeleteTrialComponent -> ResponseHeaders
toHeaders =
ResponseHeaders -> DeleteTrialComponent -> 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.DeleteTrialComponent" ::
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 DeleteTrialComponent where
toJSON :: DeleteTrialComponent -> Value
toJSON DeleteTrialComponent' {Text
trialComponentName :: Text
$sel:trialComponentName:DeleteTrialComponent' :: DeleteTrialComponent -> 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
"TrialComponentName" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
trialComponentName)
]
)
instance Core.ToPath DeleteTrialComponent where
toPath :: DeleteTrialComponent -> ByteString
toPath = ByteString -> DeleteTrialComponent -> ByteString
forall a b. a -> b -> a
Prelude.const ByteString
"/"
instance Core.ToQuery DeleteTrialComponent where
toQuery :: DeleteTrialComponent -> QueryString
toQuery = QueryString -> DeleteTrialComponent -> QueryString
forall a b. a -> b -> a
Prelude.const QueryString
forall a. Monoid a => a
Prelude.mempty
data DeleteTrialComponentResponse = DeleteTrialComponentResponse'
{
DeleteTrialComponentResponse -> Maybe Text
trialComponentArn :: Prelude.Maybe Prelude.Text,
DeleteTrialComponentResponse -> Int
httpStatus :: Prelude.Int
}
deriving (DeleteTrialComponentResponse
-> DeleteTrialComponentResponse -> Bool
(DeleteTrialComponentResponse
-> DeleteTrialComponentResponse -> Bool)
-> (DeleteTrialComponentResponse
-> DeleteTrialComponentResponse -> Bool)
-> Eq DeleteTrialComponentResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DeleteTrialComponentResponse
-> DeleteTrialComponentResponse -> Bool
$c/= :: DeleteTrialComponentResponse
-> DeleteTrialComponentResponse -> Bool
== :: DeleteTrialComponentResponse
-> DeleteTrialComponentResponse -> Bool
$c== :: DeleteTrialComponentResponse
-> DeleteTrialComponentResponse -> Bool
Prelude.Eq, ReadPrec [DeleteTrialComponentResponse]
ReadPrec DeleteTrialComponentResponse
Int -> ReadS DeleteTrialComponentResponse
ReadS [DeleteTrialComponentResponse]
(Int -> ReadS DeleteTrialComponentResponse)
-> ReadS [DeleteTrialComponentResponse]
-> ReadPrec DeleteTrialComponentResponse
-> ReadPrec [DeleteTrialComponentResponse]
-> Read DeleteTrialComponentResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DeleteTrialComponentResponse]
$creadListPrec :: ReadPrec [DeleteTrialComponentResponse]
readPrec :: ReadPrec DeleteTrialComponentResponse
$creadPrec :: ReadPrec DeleteTrialComponentResponse
readList :: ReadS [DeleteTrialComponentResponse]
$creadList :: ReadS [DeleteTrialComponentResponse]
readsPrec :: Int -> ReadS DeleteTrialComponentResponse
$creadsPrec :: Int -> ReadS DeleteTrialComponentResponse
Prelude.Read, Int -> DeleteTrialComponentResponse -> ShowS
[DeleteTrialComponentResponse] -> ShowS
DeleteTrialComponentResponse -> String
(Int -> DeleteTrialComponentResponse -> ShowS)
-> (DeleteTrialComponentResponse -> String)
-> ([DeleteTrialComponentResponse] -> ShowS)
-> Show DeleteTrialComponentResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DeleteTrialComponentResponse] -> ShowS
$cshowList :: [DeleteTrialComponentResponse] -> ShowS
show :: DeleteTrialComponentResponse -> String
$cshow :: DeleteTrialComponentResponse -> String
showsPrec :: Int -> DeleteTrialComponentResponse -> ShowS
$cshowsPrec :: Int -> DeleteTrialComponentResponse -> ShowS
Prelude.Show, (forall x.
DeleteTrialComponentResponse -> Rep DeleteTrialComponentResponse x)
-> (forall x.
Rep DeleteTrialComponentResponse x -> DeleteTrialComponentResponse)
-> Generic DeleteTrialComponentResponse
forall x.
Rep DeleteTrialComponentResponse x -> DeleteTrialComponentResponse
forall x.
DeleteTrialComponentResponse -> Rep DeleteTrialComponentResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep DeleteTrialComponentResponse x -> DeleteTrialComponentResponse
$cfrom :: forall x.
DeleteTrialComponentResponse -> Rep DeleteTrialComponentResponse x
Prelude.Generic)
newDeleteTrialComponentResponse ::
Prelude.Int ->
DeleteTrialComponentResponse
newDeleteTrialComponentResponse :: Int -> DeleteTrialComponentResponse
newDeleteTrialComponentResponse Int
pHttpStatus_ =
DeleteTrialComponentResponse' :: Maybe Text -> Int -> DeleteTrialComponentResponse
DeleteTrialComponentResponse'
{ $sel:trialComponentArn:DeleteTrialComponentResponse' :: Maybe Text
trialComponentArn =
Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:httpStatus:DeleteTrialComponentResponse' :: Int
httpStatus = Int
pHttpStatus_
}
deleteTrialComponentResponse_trialComponentArn :: Lens.Lens' DeleteTrialComponentResponse (Prelude.Maybe Prelude.Text)
deleteTrialComponentResponse_trialComponentArn :: (Maybe Text -> f (Maybe Text))
-> DeleteTrialComponentResponse -> f DeleteTrialComponentResponse
deleteTrialComponentResponse_trialComponentArn = (DeleteTrialComponentResponse -> Maybe Text)
-> (DeleteTrialComponentResponse
-> Maybe Text -> DeleteTrialComponentResponse)
-> Lens
DeleteTrialComponentResponse
DeleteTrialComponentResponse
(Maybe Text)
(Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeleteTrialComponentResponse' {Maybe Text
trialComponentArn :: Maybe Text
$sel:trialComponentArn:DeleteTrialComponentResponse' :: DeleteTrialComponentResponse -> Maybe Text
trialComponentArn} -> Maybe Text
trialComponentArn) (\s :: DeleteTrialComponentResponse
s@DeleteTrialComponentResponse' {} Maybe Text
a -> DeleteTrialComponentResponse
s {$sel:trialComponentArn:DeleteTrialComponentResponse' :: Maybe Text
trialComponentArn = Maybe Text
a} :: DeleteTrialComponentResponse)
deleteTrialComponentResponse_httpStatus :: Lens.Lens' DeleteTrialComponentResponse Prelude.Int
deleteTrialComponentResponse_httpStatus :: (Int -> f Int)
-> DeleteTrialComponentResponse -> f DeleteTrialComponentResponse
deleteTrialComponentResponse_httpStatus = (DeleteTrialComponentResponse -> Int)
-> (DeleteTrialComponentResponse
-> Int -> DeleteTrialComponentResponse)
-> Lens
DeleteTrialComponentResponse DeleteTrialComponentResponse Int Int
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeleteTrialComponentResponse' {Int
httpStatus :: Int
$sel:httpStatus:DeleteTrialComponentResponse' :: DeleteTrialComponentResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: DeleteTrialComponentResponse
s@DeleteTrialComponentResponse' {} Int
a -> DeleteTrialComponentResponse
s {$sel:httpStatus:DeleteTrialComponentResponse' :: Int
httpStatus = Int
a} :: DeleteTrialComponentResponse)
instance Prelude.NFData DeleteTrialComponentResponse