{-# 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.DeleteArtifact
(
DeleteArtifact (..),
newDeleteArtifact,
deleteArtifact_source,
deleteArtifact_artifactArn,
DeleteArtifactResponse (..),
newDeleteArtifactResponse,
deleteArtifactResponse_artifactArn,
deleteArtifactResponse_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 DeleteArtifact = DeleteArtifact'
{
DeleteArtifact -> Maybe ArtifactSource
source :: Prelude.Maybe ArtifactSource,
DeleteArtifact -> Maybe Text
artifactArn :: Prelude.Maybe Prelude.Text
}
deriving (DeleteArtifact -> DeleteArtifact -> Bool
(DeleteArtifact -> DeleteArtifact -> Bool)
-> (DeleteArtifact -> DeleteArtifact -> Bool) -> Eq DeleteArtifact
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DeleteArtifact -> DeleteArtifact -> Bool
$c/= :: DeleteArtifact -> DeleteArtifact -> Bool
== :: DeleteArtifact -> DeleteArtifact -> Bool
$c== :: DeleteArtifact -> DeleteArtifact -> Bool
Prelude.Eq, ReadPrec [DeleteArtifact]
ReadPrec DeleteArtifact
Int -> ReadS DeleteArtifact
ReadS [DeleteArtifact]
(Int -> ReadS DeleteArtifact)
-> ReadS [DeleteArtifact]
-> ReadPrec DeleteArtifact
-> ReadPrec [DeleteArtifact]
-> Read DeleteArtifact
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DeleteArtifact]
$creadListPrec :: ReadPrec [DeleteArtifact]
readPrec :: ReadPrec DeleteArtifact
$creadPrec :: ReadPrec DeleteArtifact
readList :: ReadS [DeleteArtifact]
$creadList :: ReadS [DeleteArtifact]
readsPrec :: Int -> ReadS DeleteArtifact
$creadsPrec :: Int -> ReadS DeleteArtifact
Prelude.Read, Int -> DeleteArtifact -> ShowS
[DeleteArtifact] -> ShowS
DeleteArtifact -> String
(Int -> DeleteArtifact -> ShowS)
-> (DeleteArtifact -> String)
-> ([DeleteArtifact] -> ShowS)
-> Show DeleteArtifact
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DeleteArtifact] -> ShowS
$cshowList :: [DeleteArtifact] -> ShowS
show :: DeleteArtifact -> String
$cshow :: DeleteArtifact -> String
showsPrec :: Int -> DeleteArtifact -> ShowS
$cshowsPrec :: Int -> DeleteArtifact -> ShowS
Prelude.Show, (forall x. DeleteArtifact -> Rep DeleteArtifact x)
-> (forall x. Rep DeleteArtifact x -> DeleteArtifact)
-> Generic DeleteArtifact
forall x. Rep DeleteArtifact x -> DeleteArtifact
forall x. DeleteArtifact -> Rep DeleteArtifact x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep DeleteArtifact x -> DeleteArtifact
$cfrom :: forall x. DeleteArtifact -> Rep DeleteArtifact x
Prelude.Generic)
newDeleteArtifact ::
DeleteArtifact
newDeleteArtifact :: DeleteArtifact
newDeleteArtifact =
DeleteArtifact' :: Maybe ArtifactSource -> Maybe Text -> DeleteArtifact
DeleteArtifact'
{ $sel:source:DeleteArtifact' :: Maybe ArtifactSource
source = Maybe ArtifactSource
forall a. Maybe a
Prelude.Nothing,
$sel:artifactArn:DeleteArtifact' :: Maybe Text
artifactArn = Maybe Text
forall a. Maybe a
Prelude.Nothing
}
deleteArtifact_source :: Lens.Lens' DeleteArtifact (Prelude.Maybe ArtifactSource)
deleteArtifact_source :: (Maybe ArtifactSource -> f (Maybe ArtifactSource))
-> DeleteArtifact -> f DeleteArtifact
deleteArtifact_source = (DeleteArtifact -> Maybe ArtifactSource)
-> (DeleteArtifact -> Maybe ArtifactSource -> DeleteArtifact)
-> Lens
DeleteArtifact
DeleteArtifact
(Maybe ArtifactSource)
(Maybe ArtifactSource)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeleteArtifact' {Maybe ArtifactSource
source :: Maybe ArtifactSource
$sel:source:DeleteArtifact' :: DeleteArtifact -> Maybe ArtifactSource
source} -> Maybe ArtifactSource
source) (\s :: DeleteArtifact
s@DeleteArtifact' {} Maybe ArtifactSource
a -> DeleteArtifact
s {$sel:source:DeleteArtifact' :: Maybe ArtifactSource
source = Maybe ArtifactSource
a} :: DeleteArtifact)
deleteArtifact_artifactArn :: Lens.Lens' DeleteArtifact (Prelude.Maybe Prelude.Text)
deleteArtifact_artifactArn :: (Maybe Text -> f (Maybe Text))
-> DeleteArtifact -> f DeleteArtifact
deleteArtifact_artifactArn = (DeleteArtifact -> Maybe Text)
-> (DeleteArtifact -> Maybe Text -> DeleteArtifact)
-> Lens DeleteArtifact DeleteArtifact (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeleteArtifact' {Maybe Text
artifactArn :: Maybe Text
$sel:artifactArn:DeleteArtifact' :: DeleteArtifact -> Maybe Text
artifactArn} -> Maybe Text
artifactArn) (\s :: DeleteArtifact
s@DeleteArtifact' {} Maybe Text
a -> DeleteArtifact
s {$sel:artifactArn:DeleteArtifact' :: Maybe Text
artifactArn = Maybe Text
a} :: DeleteArtifact)
instance Core.AWSRequest DeleteArtifact where
type
AWSResponse DeleteArtifact =
DeleteArtifactResponse
request :: DeleteArtifact -> Request DeleteArtifact
request = Service -> DeleteArtifact -> Request DeleteArtifact
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON Service
defaultService
response :: Logger
-> Service
-> Proxy DeleteArtifact
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse DeleteArtifact)))
response =
(Int
-> ResponseHeaders
-> Object
-> Either String (AWSResponse DeleteArtifact))
-> Logger
-> Service
-> Proxy DeleteArtifact
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse DeleteArtifact)))
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 -> DeleteArtifactResponse
DeleteArtifactResponse'
(Maybe Text -> Int -> DeleteArtifactResponse)
-> Either String (Maybe Text)
-> Either String (Int -> DeleteArtifactResponse)
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
"ArtifactArn")
Either String (Int -> DeleteArtifactResponse)
-> Either String Int -> Either String DeleteArtifactResponse
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 DeleteArtifact
instance Prelude.NFData DeleteArtifact
instance Core.ToHeaders DeleteArtifact where
toHeaders :: DeleteArtifact -> ResponseHeaders
toHeaders =
ResponseHeaders -> DeleteArtifact -> 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.DeleteArtifact" :: 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 DeleteArtifact where
toJSON :: DeleteArtifact -> Value
toJSON DeleteArtifact' {Maybe Text
Maybe ArtifactSource
artifactArn :: Maybe Text
source :: Maybe ArtifactSource
$sel:artifactArn:DeleteArtifact' :: DeleteArtifact -> Maybe Text
$sel:source:DeleteArtifact' :: DeleteArtifact -> Maybe ArtifactSource
..} =
[Pair] -> Value
Core.object
( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ (Text
"Source" Text -> ArtifactSource -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (ArtifactSource -> Pair) -> Maybe ArtifactSource -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe ArtifactSource
source,
(Text
"ArtifactArn" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (Text -> Pair) -> Maybe Text -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
artifactArn
]
)
instance Core.ToPath DeleteArtifact where
toPath :: DeleteArtifact -> ByteString
toPath = ByteString -> DeleteArtifact -> ByteString
forall a b. a -> b -> a
Prelude.const ByteString
"/"
instance Core.ToQuery DeleteArtifact where
toQuery :: DeleteArtifact -> QueryString
toQuery = QueryString -> DeleteArtifact -> QueryString
forall a b. a -> b -> a
Prelude.const QueryString
forall a. Monoid a => a
Prelude.mempty
data DeleteArtifactResponse = DeleteArtifactResponse'
{
DeleteArtifactResponse -> Maybe Text
artifactArn :: Prelude.Maybe Prelude.Text,
DeleteArtifactResponse -> Int
httpStatus :: Prelude.Int
}
deriving (DeleteArtifactResponse -> DeleteArtifactResponse -> Bool
(DeleteArtifactResponse -> DeleteArtifactResponse -> Bool)
-> (DeleteArtifactResponse -> DeleteArtifactResponse -> Bool)
-> Eq DeleteArtifactResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DeleteArtifactResponse -> DeleteArtifactResponse -> Bool
$c/= :: DeleteArtifactResponse -> DeleteArtifactResponse -> Bool
== :: DeleteArtifactResponse -> DeleteArtifactResponse -> Bool
$c== :: DeleteArtifactResponse -> DeleteArtifactResponse -> Bool
Prelude.Eq, ReadPrec [DeleteArtifactResponse]
ReadPrec DeleteArtifactResponse
Int -> ReadS DeleteArtifactResponse
ReadS [DeleteArtifactResponse]
(Int -> ReadS DeleteArtifactResponse)
-> ReadS [DeleteArtifactResponse]
-> ReadPrec DeleteArtifactResponse
-> ReadPrec [DeleteArtifactResponse]
-> Read DeleteArtifactResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DeleteArtifactResponse]
$creadListPrec :: ReadPrec [DeleteArtifactResponse]
readPrec :: ReadPrec DeleteArtifactResponse
$creadPrec :: ReadPrec DeleteArtifactResponse
readList :: ReadS [DeleteArtifactResponse]
$creadList :: ReadS [DeleteArtifactResponse]
readsPrec :: Int -> ReadS DeleteArtifactResponse
$creadsPrec :: Int -> ReadS DeleteArtifactResponse
Prelude.Read, Int -> DeleteArtifactResponse -> ShowS
[DeleteArtifactResponse] -> ShowS
DeleteArtifactResponse -> String
(Int -> DeleteArtifactResponse -> ShowS)
-> (DeleteArtifactResponse -> String)
-> ([DeleteArtifactResponse] -> ShowS)
-> Show DeleteArtifactResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DeleteArtifactResponse] -> ShowS
$cshowList :: [DeleteArtifactResponse] -> ShowS
show :: DeleteArtifactResponse -> String
$cshow :: DeleteArtifactResponse -> String
showsPrec :: Int -> DeleteArtifactResponse -> ShowS
$cshowsPrec :: Int -> DeleteArtifactResponse -> ShowS
Prelude.Show, (forall x. DeleteArtifactResponse -> Rep DeleteArtifactResponse x)
-> (forall x.
Rep DeleteArtifactResponse x -> DeleteArtifactResponse)
-> Generic DeleteArtifactResponse
forall x. Rep DeleteArtifactResponse x -> DeleteArtifactResponse
forall x. DeleteArtifactResponse -> Rep DeleteArtifactResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep DeleteArtifactResponse x -> DeleteArtifactResponse
$cfrom :: forall x. DeleteArtifactResponse -> Rep DeleteArtifactResponse x
Prelude.Generic)
newDeleteArtifactResponse ::
Prelude.Int ->
DeleteArtifactResponse
newDeleteArtifactResponse :: Int -> DeleteArtifactResponse
newDeleteArtifactResponse Int
pHttpStatus_ =
DeleteArtifactResponse' :: Maybe Text -> Int -> DeleteArtifactResponse
DeleteArtifactResponse'
{ $sel:artifactArn:DeleteArtifactResponse' :: Maybe Text
artifactArn =
Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:httpStatus:DeleteArtifactResponse' :: Int
httpStatus = Int
pHttpStatus_
}
deleteArtifactResponse_artifactArn :: Lens.Lens' DeleteArtifactResponse (Prelude.Maybe Prelude.Text)
deleteArtifactResponse_artifactArn :: (Maybe Text -> f (Maybe Text))
-> DeleteArtifactResponse -> f DeleteArtifactResponse
deleteArtifactResponse_artifactArn = (DeleteArtifactResponse -> Maybe Text)
-> (DeleteArtifactResponse -> Maybe Text -> DeleteArtifactResponse)
-> Lens
DeleteArtifactResponse
DeleteArtifactResponse
(Maybe Text)
(Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeleteArtifactResponse' {Maybe Text
artifactArn :: Maybe Text
$sel:artifactArn:DeleteArtifactResponse' :: DeleteArtifactResponse -> Maybe Text
artifactArn} -> Maybe Text
artifactArn) (\s :: DeleteArtifactResponse
s@DeleteArtifactResponse' {} Maybe Text
a -> DeleteArtifactResponse
s {$sel:artifactArn:DeleteArtifactResponse' :: Maybe Text
artifactArn = Maybe Text
a} :: DeleteArtifactResponse)
deleteArtifactResponse_httpStatus :: Lens.Lens' DeleteArtifactResponse Prelude.Int
deleteArtifactResponse_httpStatus :: (Int -> f Int)
-> DeleteArtifactResponse -> f DeleteArtifactResponse
deleteArtifactResponse_httpStatus = (DeleteArtifactResponse -> Int)
-> (DeleteArtifactResponse -> Int -> DeleteArtifactResponse)
-> Lens DeleteArtifactResponse DeleteArtifactResponse Int Int
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeleteArtifactResponse' {Int
httpStatus :: Int
$sel:httpStatus:DeleteArtifactResponse' :: DeleteArtifactResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: DeleteArtifactResponse
s@DeleteArtifactResponse' {} Int
a -> DeleteArtifactResponse
s {$sel:httpStatus:DeleteArtifactResponse' :: Int
httpStatus = Int
a} :: DeleteArtifactResponse)
instance Prelude.NFData DeleteArtifactResponse