{-# 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.UpdateArtifact
(
UpdateArtifact (..),
newUpdateArtifact,
updateArtifact_propertiesToRemove,
updateArtifact_artifactName,
updateArtifact_properties,
updateArtifact_artifactArn,
UpdateArtifactResponse (..),
newUpdateArtifactResponse,
updateArtifactResponse_artifactArn,
updateArtifactResponse_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 UpdateArtifact = UpdateArtifact'
{
UpdateArtifact -> Maybe [Text]
propertiesToRemove :: Prelude.Maybe [Prelude.Text],
UpdateArtifact -> Maybe Text
artifactName :: Prelude.Maybe Prelude.Text,
UpdateArtifact -> Maybe (HashMap Text Text)
properties :: Prelude.Maybe (Prelude.HashMap Prelude.Text Prelude.Text),
UpdateArtifact -> Text
artifactArn :: Prelude.Text
}
deriving (UpdateArtifact -> UpdateArtifact -> Bool
(UpdateArtifact -> UpdateArtifact -> Bool)
-> (UpdateArtifact -> UpdateArtifact -> Bool) -> Eq UpdateArtifact
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: UpdateArtifact -> UpdateArtifact -> Bool
$c/= :: UpdateArtifact -> UpdateArtifact -> Bool
== :: UpdateArtifact -> UpdateArtifact -> Bool
$c== :: UpdateArtifact -> UpdateArtifact -> Bool
Prelude.Eq, ReadPrec [UpdateArtifact]
ReadPrec UpdateArtifact
Int -> ReadS UpdateArtifact
ReadS [UpdateArtifact]
(Int -> ReadS UpdateArtifact)
-> ReadS [UpdateArtifact]
-> ReadPrec UpdateArtifact
-> ReadPrec [UpdateArtifact]
-> Read UpdateArtifact
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [UpdateArtifact]
$creadListPrec :: ReadPrec [UpdateArtifact]
readPrec :: ReadPrec UpdateArtifact
$creadPrec :: ReadPrec UpdateArtifact
readList :: ReadS [UpdateArtifact]
$creadList :: ReadS [UpdateArtifact]
readsPrec :: Int -> ReadS UpdateArtifact
$creadsPrec :: Int -> ReadS UpdateArtifact
Prelude.Read, Int -> UpdateArtifact -> ShowS
[UpdateArtifact] -> ShowS
UpdateArtifact -> String
(Int -> UpdateArtifact -> ShowS)
-> (UpdateArtifact -> String)
-> ([UpdateArtifact] -> ShowS)
-> Show UpdateArtifact
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [UpdateArtifact] -> ShowS
$cshowList :: [UpdateArtifact] -> ShowS
show :: UpdateArtifact -> String
$cshow :: UpdateArtifact -> String
showsPrec :: Int -> UpdateArtifact -> ShowS
$cshowsPrec :: Int -> UpdateArtifact -> ShowS
Prelude.Show, (forall x. UpdateArtifact -> Rep UpdateArtifact x)
-> (forall x. Rep UpdateArtifact x -> UpdateArtifact)
-> Generic UpdateArtifact
forall x. Rep UpdateArtifact x -> UpdateArtifact
forall x. UpdateArtifact -> Rep UpdateArtifact x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep UpdateArtifact x -> UpdateArtifact
$cfrom :: forall x. UpdateArtifact -> Rep UpdateArtifact x
Prelude.Generic)
newUpdateArtifact ::
Prelude.Text ->
UpdateArtifact
newUpdateArtifact :: Text -> UpdateArtifact
newUpdateArtifact Text
pArtifactArn_ =
UpdateArtifact' :: Maybe [Text]
-> Maybe Text
-> Maybe (HashMap Text Text)
-> Text
-> UpdateArtifact
UpdateArtifact'
{ $sel:propertiesToRemove:UpdateArtifact' :: Maybe [Text]
propertiesToRemove =
Maybe [Text]
forall a. Maybe a
Prelude.Nothing,
$sel:artifactName:UpdateArtifact' :: Maybe Text
artifactName = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:properties:UpdateArtifact' :: Maybe (HashMap Text Text)
properties = Maybe (HashMap Text Text)
forall a. Maybe a
Prelude.Nothing,
$sel:artifactArn:UpdateArtifact' :: Text
artifactArn = Text
pArtifactArn_
}
updateArtifact_propertiesToRemove :: Lens.Lens' UpdateArtifact (Prelude.Maybe [Prelude.Text])
updateArtifact_propertiesToRemove :: (Maybe [Text] -> f (Maybe [Text]))
-> UpdateArtifact -> f UpdateArtifact
updateArtifact_propertiesToRemove = (UpdateArtifact -> Maybe [Text])
-> (UpdateArtifact -> Maybe [Text] -> UpdateArtifact)
-> Lens UpdateArtifact UpdateArtifact (Maybe [Text]) (Maybe [Text])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateArtifact' {Maybe [Text]
propertiesToRemove :: Maybe [Text]
$sel:propertiesToRemove:UpdateArtifact' :: UpdateArtifact -> Maybe [Text]
propertiesToRemove} -> Maybe [Text]
propertiesToRemove) (\s :: UpdateArtifact
s@UpdateArtifact' {} Maybe [Text]
a -> UpdateArtifact
s {$sel:propertiesToRemove:UpdateArtifact' :: Maybe [Text]
propertiesToRemove = Maybe [Text]
a} :: UpdateArtifact) ((Maybe [Text] -> f (Maybe [Text]))
-> UpdateArtifact -> f UpdateArtifact)
-> ((Maybe [Text] -> f (Maybe [Text]))
-> Maybe [Text] -> f (Maybe [Text]))
-> (Maybe [Text] -> f (Maybe [Text]))
-> UpdateArtifact
-> f UpdateArtifact
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso [Text] [Text] [Text] [Text]
-> Iso (Maybe [Text]) (Maybe [Text]) (Maybe [Text]) (Maybe [Text])
forall (f :: * -> *) (g :: * -> *) s t a b.
(Functor f, Functor g) =>
AnIso s t a b -> Iso (f s) (g t) (f a) (g b)
Lens.mapping AnIso [Text] [Text] [Text] [Text]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced
updateArtifact_artifactName :: Lens.Lens' UpdateArtifact (Prelude.Maybe Prelude.Text)
updateArtifact_artifactName :: (Maybe Text -> f (Maybe Text))
-> UpdateArtifact -> f UpdateArtifact
updateArtifact_artifactName = (UpdateArtifact -> Maybe Text)
-> (UpdateArtifact -> Maybe Text -> UpdateArtifact)
-> Lens UpdateArtifact UpdateArtifact (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateArtifact' {Maybe Text
artifactName :: Maybe Text
$sel:artifactName:UpdateArtifact' :: UpdateArtifact -> Maybe Text
artifactName} -> Maybe Text
artifactName) (\s :: UpdateArtifact
s@UpdateArtifact' {} Maybe Text
a -> UpdateArtifact
s {$sel:artifactName:UpdateArtifact' :: Maybe Text
artifactName = Maybe Text
a} :: UpdateArtifact)
updateArtifact_properties :: Lens.Lens' UpdateArtifact (Prelude.Maybe (Prelude.HashMap Prelude.Text Prelude.Text))
updateArtifact_properties :: (Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
-> UpdateArtifact -> f UpdateArtifact
updateArtifact_properties = (UpdateArtifact -> Maybe (HashMap Text Text))
-> (UpdateArtifact -> Maybe (HashMap Text Text) -> UpdateArtifact)
-> Lens
UpdateArtifact
UpdateArtifact
(Maybe (HashMap Text Text))
(Maybe (HashMap Text Text))
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateArtifact' {Maybe (HashMap Text Text)
properties :: Maybe (HashMap Text Text)
$sel:properties:UpdateArtifact' :: UpdateArtifact -> Maybe (HashMap Text Text)
properties} -> Maybe (HashMap Text Text)
properties) (\s :: UpdateArtifact
s@UpdateArtifact' {} Maybe (HashMap Text Text)
a -> UpdateArtifact
s {$sel:properties:UpdateArtifact' :: Maybe (HashMap Text Text)
properties = Maybe (HashMap Text Text)
a} :: UpdateArtifact) ((Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
-> UpdateArtifact -> f UpdateArtifact)
-> ((Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
-> Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
-> (Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
-> UpdateArtifact
-> f UpdateArtifact
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
(HashMap Text Text)
(HashMap Text Text)
(HashMap Text Text)
(HashMap Text Text)
-> Iso
(Maybe (HashMap Text Text))
(Maybe (HashMap Text Text))
(Maybe (HashMap Text Text))
(Maybe (HashMap Text Text))
forall (f :: * -> *) (g :: * -> *) s t a b.
(Functor f, Functor g) =>
AnIso s t a b -> Iso (f s) (g t) (f a) (g b)
Lens.mapping AnIso
(HashMap Text Text)
(HashMap Text Text)
(HashMap Text Text)
(HashMap Text Text)
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced
updateArtifact_artifactArn :: Lens.Lens' UpdateArtifact Prelude.Text
updateArtifact_artifactArn :: (Text -> f Text) -> UpdateArtifact -> f UpdateArtifact
updateArtifact_artifactArn = (UpdateArtifact -> Text)
-> (UpdateArtifact -> Text -> UpdateArtifact)
-> Lens UpdateArtifact UpdateArtifact Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateArtifact' {Text
artifactArn :: Text
$sel:artifactArn:UpdateArtifact' :: UpdateArtifact -> Text
artifactArn} -> Text
artifactArn) (\s :: UpdateArtifact
s@UpdateArtifact' {} Text
a -> UpdateArtifact
s {$sel:artifactArn:UpdateArtifact' :: Text
artifactArn = Text
a} :: UpdateArtifact)
instance Core.AWSRequest UpdateArtifact where
type
AWSResponse UpdateArtifact =
UpdateArtifactResponse
request :: UpdateArtifact -> Request UpdateArtifact
request = Service -> UpdateArtifact -> Request UpdateArtifact
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON Service
defaultService
response :: Logger
-> Service
-> Proxy UpdateArtifact
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse UpdateArtifact)))
response =
(Int
-> ResponseHeaders
-> Object
-> Either String (AWSResponse UpdateArtifact))
-> Logger
-> Service
-> Proxy UpdateArtifact
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse UpdateArtifact)))
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 -> UpdateArtifactResponse
UpdateArtifactResponse'
(Maybe Text -> Int -> UpdateArtifactResponse)
-> Either String (Maybe Text)
-> Either String (Int -> UpdateArtifactResponse)
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 -> UpdateArtifactResponse)
-> Either String Int -> Either String UpdateArtifactResponse
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 UpdateArtifact
instance Prelude.NFData UpdateArtifact
instance Core.ToHeaders UpdateArtifact where
toHeaders :: UpdateArtifact -> ResponseHeaders
toHeaders =
ResponseHeaders -> UpdateArtifact -> 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.UpdateArtifact" :: 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 UpdateArtifact where
toJSON :: UpdateArtifact -> Value
toJSON UpdateArtifact' {Maybe [Text]
Maybe Text
Maybe (HashMap Text Text)
Text
artifactArn :: Text
properties :: Maybe (HashMap Text Text)
artifactName :: Maybe Text
propertiesToRemove :: Maybe [Text]
$sel:artifactArn:UpdateArtifact' :: UpdateArtifact -> Text
$sel:properties:UpdateArtifact' :: UpdateArtifact -> Maybe (HashMap Text Text)
$sel:artifactName:UpdateArtifact' :: UpdateArtifact -> Maybe Text
$sel:propertiesToRemove:UpdateArtifact' :: UpdateArtifact -> Maybe [Text]
..} =
[Pair] -> Value
Core.object
( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ (Text
"PropertiesToRemove" 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]
propertiesToRemove,
(Text
"ArtifactName" 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
artifactName,
(Text
"Properties" Text -> HashMap Text Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (HashMap Text Text -> Pair)
-> Maybe (HashMap Text Text) -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe (HashMap Text Text)
properties,
Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"ArtifactArn" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
artifactArn)
]
)
instance Core.ToPath UpdateArtifact where
toPath :: UpdateArtifact -> ByteString
toPath = ByteString -> UpdateArtifact -> ByteString
forall a b. a -> b -> a
Prelude.const ByteString
"/"
instance Core.ToQuery UpdateArtifact where
toQuery :: UpdateArtifact -> QueryString
toQuery = QueryString -> UpdateArtifact -> QueryString
forall a b. a -> b -> a
Prelude.const QueryString
forall a. Monoid a => a
Prelude.mempty
data UpdateArtifactResponse = UpdateArtifactResponse'
{
UpdateArtifactResponse -> Maybe Text
artifactArn :: Prelude.Maybe Prelude.Text,
UpdateArtifactResponse -> Int
httpStatus :: Prelude.Int
}
deriving (UpdateArtifactResponse -> UpdateArtifactResponse -> Bool
(UpdateArtifactResponse -> UpdateArtifactResponse -> Bool)
-> (UpdateArtifactResponse -> UpdateArtifactResponse -> Bool)
-> Eq UpdateArtifactResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: UpdateArtifactResponse -> UpdateArtifactResponse -> Bool
$c/= :: UpdateArtifactResponse -> UpdateArtifactResponse -> Bool
== :: UpdateArtifactResponse -> UpdateArtifactResponse -> Bool
$c== :: UpdateArtifactResponse -> UpdateArtifactResponse -> Bool
Prelude.Eq, ReadPrec [UpdateArtifactResponse]
ReadPrec UpdateArtifactResponse
Int -> ReadS UpdateArtifactResponse
ReadS [UpdateArtifactResponse]
(Int -> ReadS UpdateArtifactResponse)
-> ReadS [UpdateArtifactResponse]
-> ReadPrec UpdateArtifactResponse
-> ReadPrec [UpdateArtifactResponse]
-> Read UpdateArtifactResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [UpdateArtifactResponse]
$creadListPrec :: ReadPrec [UpdateArtifactResponse]
readPrec :: ReadPrec UpdateArtifactResponse
$creadPrec :: ReadPrec UpdateArtifactResponse
readList :: ReadS [UpdateArtifactResponse]
$creadList :: ReadS [UpdateArtifactResponse]
readsPrec :: Int -> ReadS UpdateArtifactResponse
$creadsPrec :: Int -> ReadS UpdateArtifactResponse
Prelude.Read, Int -> UpdateArtifactResponse -> ShowS
[UpdateArtifactResponse] -> ShowS
UpdateArtifactResponse -> String
(Int -> UpdateArtifactResponse -> ShowS)
-> (UpdateArtifactResponse -> String)
-> ([UpdateArtifactResponse] -> ShowS)
-> Show UpdateArtifactResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [UpdateArtifactResponse] -> ShowS
$cshowList :: [UpdateArtifactResponse] -> ShowS
show :: UpdateArtifactResponse -> String
$cshow :: UpdateArtifactResponse -> String
showsPrec :: Int -> UpdateArtifactResponse -> ShowS
$cshowsPrec :: Int -> UpdateArtifactResponse -> ShowS
Prelude.Show, (forall x. UpdateArtifactResponse -> Rep UpdateArtifactResponse x)
-> (forall x.
Rep UpdateArtifactResponse x -> UpdateArtifactResponse)
-> Generic UpdateArtifactResponse
forall x. Rep UpdateArtifactResponse x -> UpdateArtifactResponse
forall x. UpdateArtifactResponse -> Rep UpdateArtifactResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep UpdateArtifactResponse x -> UpdateArtifactResponse
$cfrom :: forall x. UpdateArtifactResponse -> Rep UpdateArtifactResponse x
Prelude.Generic)
newUpdateArtifactResponse ::
Prelude.Int ->
UpdateArtifactResponse
newUpdateArtifactResponse :: Int -> UpdateArtifactResponse
newUpdateArtifactResponse Int
pHttpStatus_ =
UpdateArtifactResponse' :: Maybe Text -> Int -> UpdateArtifactResponse
UpdateArtifactResponse'
{ $sel:artifactArn:UpdateArtifactResponse' :: Maybe Text
artifactArn =
Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:httpStatus:UpdateArtifactResponse' :: Int
httpStatus = Int
pHttpStatus_
}
updateArtifactResponse_artifactArn :: Lens.Lens' UpdateArtifactResponse (Prelude.Maybe Prelude.Text)
updateArtifactResponse_artifactArn :: (Maybe Text -> f (Maybe Text))
-> UpdateArtifactResponse -> f UpdateArtifactResponse
updateArtifactResponse_artifactArn = (UpdateArtifactResponse -> Maybe Text)
-> (UpdateArtifactResponse -> Maybe Text -> UpdateArtifactResponse)
-> Lens
UpdateArtifactResponse
UpdateArtifactResponse
(Maybe Text)
(Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateArtifactResponse' {Maybe Text
artifactArn :: Maybe Text
$sel:artifactArn:UpdateArtifactResponse' :: UpdateArtifactResponse -> Maybe Text
artifactArn} -> Maybe Text
artifactArn) (\s :: UpdateArtifactResponse
s@UpdateArtifactResponse' {} Maybe Text
a -> UpdateArtifactResponse
s {$sel:artifactArn:UpdateArtifactResponse' :: Maybe Text
artifactArn = Maybe Text
a} :: UpdateArtifactResponse)
updateArtifactResponse_httpStatus :: Lens.Lens' UpdateArtifactResponse Prelude.Int
updateArtifactResponse_httpStatus :: (Int -> f Int)
-> UpdateArtifactResponse -> f UpdateArtifactResponse
updateArtifactResponse_httpStatus = (UpdateArtifactResponse -> Int)
-> (UpdateArtifactResponse -> Int -> UpdateArtifactResponse)
-> Lens UpdateArtifactResponse UpdateArtifactResponse Int Int
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateArtifactResponse' {Int
httpStatus :: Int
$sel:httpStatus:UpdateArtifactResponse' :: UpdateArtifactResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: UpdateArtifactResponse
s@UpdateArtifactResponse' {} Int
a -> UpdateArtifactResponse
s {$sel:httpStatus:UpdateArtifactResponse' :: Int
httpStatus = Int
a} :: UpdateArtifactResponse)
instance Prelude.NFData UpdateArtifactResponse