{-# 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.UpdateImage
(
UpdateImage (..),
newUpdateImage,
updateImage_deleteProperties,
updateImage_displayName,
updateImage_description,
updateImage_roleArn,
updateImage_imageName,
UpdateImageResponse (..),
newUpdateImageResponse,
updateImageResponse_imageArn,
updateImageResponse_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 UpdateImage = UpdateImage'
{
UpdateImage -> Maybe [Text]
deleteProperties :: Prelude.Maybe [Prelude.Text],
UpdateImage -> Maybe Text
displayName :: Prelude.Maybe Prelude.Text,
UpdateImage -> Maybe Text
description :: Prelude.Maybe Prelude.Text,
UpdateImage -> Maybe Text
roleArn :: Prelude.Maybe Prelude.Text,
UpdateImage -> Text
imageName :: Prelude.Text
}
deriving (UpdateImage -> UpdateImage -> Bool
(UpdateImage -> UpdateImage -> Bool)
-> (UpdateImage -> UpdateImage -> Bool) -> Eq UpdateImage
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: UpdateImage -> UpdateImage -> Bool
$c/= :: UpdateImage -> UpdateImage -> Bool
== :: UpdateImage -> UpdateImage -> Bool
$c== :: UpdateImage -> UpdateImage -> Bool
Prelude.Eq, ReadPrec [UpdateImage]
ReadPrec UpdateImage
Int -> ReadS UpdateImage
ReadS [UpdateImage]
(Int -> ReadS UpdateImage)
-> ReadS [UpdateImage]
-> ReadPrec UpdateImage
-> ReadPrec [UpdateImage]
-> Read UpdateImage
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [UpdateImage]
$creadListPrec :: ReadPrec [UpdateImage]
readPrec :: ReadPrec UpdateImage
$creadPrec :: ReadPrec UpdateImage
readList :: ReadS [UpdateImage]
$creadList :: ReadS [UpdateImage]
readsPrec :: Int -> ReadS UpdateImage
$creadsPrec :: Int -> ReadS UpdateImage
Prelude.Read, Int -> UpdateImage -> ShowS
[UpdateImage] -> ShowS
UpdateImage -> String
(Int -> UpdateImage -> ShowS)
-> (UpdateImage -> String)
-> ([UpdateImage] -> ShowS)
-> Show UpdateImage
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [UpdateImage] -> ShowS
$cshowList :: [UpdateImage] -> ShowS
show :: UpdateImage -> String
$cshow :: UpdateImage -> String
showsPrec :: Int -> UpdateImage -> ShowS
$cshowsPrec :: Int -> UpdateImage -> ShowS
Prelude.Show, (forall x. UpdateImage -> Rep UpdateImage x)
-> (forall x. Rep UpdateImage x -> UpdateImage)
-> Generic UpdateImage
forall x. Rep UpdateImage x -> UpdateImage
forall x. UpdateImage -> Rep UpdateImage x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep UpdateImage x -> UpdateImage
$cfrom :: forall x. UpdateImage -> Rep UpdateImage x
Prelude.Generic)
newUpdateImage ::
Prelude.Text ->
UpdateImage
newUpdateImage :: Text -> UpdateImage
newUpdateImage Text
pImageName_ =
UpdateImage' :: Maybe [Text]
-> Maybe Text -> Maybe Text -> Maybe Text -> Text -> UpdateImage
UpdateImage'
{ $sel:deleteProperties:UpdateImage' :: Maybe [Text]
deleteProperties = Maybe [Text]
forall a. Maybe a
Prelude.Nothing,
$sel:displayName:UpdateImage' :: Maybe Text
displayName = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:description:UpdateImage' :: Maybe Text
description = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:roleArn:UpdateImage' :: Maybe Text
roleArn = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:imageName:UpdateImage' :: Text
imageName = Text
pImageName_
}
updateImage_deleteProperties :: Lens.Lens' UpdateImage (Prelude.Maybe [Prelude.Text])
updateImage_deleteProperties :: (Maybe [Text] -> f (Maybe [Text])) -> UpdateImage -> f UpdateImage
updateImage_deleteProperties = (UpdateImage -> Maybe [Text])
-> (UpdateImage -> Maybe [Text] -> UpdateImage)
-> Lens UpdateImage UpdateImage (Maybe [Text]) (Maybe [Text])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateImage' {Maybe [Text]
deleteProperties :: Maybe [Text]
$sel:deleteProperties:UpdateImage' :: UpdateImage -> Maybe [Text]
deleteProperties} -> Maybe [Text]
deleteProperties) (\s :: UpdateImage
s@UpdateImage' {} Maybe [Text]
a -> UpdateImage
s {$sel:deleteProperties:UpdateImage' :: Maybe [Text]
deleteProperties = Maybe [Text]
a} :: UpdateImage) ((Maybe [Text] -> f (Maybe [Text]))
-> UpdateImage -> f UpdateImage)
-> ((Maybe [Text] -> f (Maybe [Text]))
-> Maybe [Text] -> f (Maybe [Text]))
-> (Maybe [Text] -> f (Maybe [Text]))
-> UpdateImage
-> f UpdateImage
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
updateImage_displayName :: Lens.Lens' UpdateImage (Prelude.Maybe Prelude.Text)
updateImage_displayName :: (Maybe Text -> f (Maybe Text)) -> UpdateImage -> f UpdateImage
updateImage_displayName = (UpdateImage -> Maybe Text)
-> (UpdateImage -> Maybe Text -> UpdateImage)
-> Lens UpdateImage UpdateImage (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateImage' {Maybe Text
displayName :: Maybe Text
$sel:displayName:UpdateImage' :: UpdateImage -> Maybe Text
displayName} -> Maybe Text
displayName) (\s :: UpdateImage
s@UpdateImage' {} Maybe Text
a -> UpdateImage
s {$sel:displayName:UpdateImage' :: Maybe Text
displayName = Maybe Text
a} :: UpdateImage)
updateImage_description :: Lens.Lens' UpdateImage (Prelude.Maybe Prelude.Text)
updateImage_description :: (Maybe Text -> f (Maybe Text)) -> UpdateImage -> f UpdateImage
updateImage_description = (UpdateImage -> Maybe Text)
-> (UpdateImage -> Maybe Text -> UpdateImage)
-> Lens UpdateImage UpdateImage (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateImage' {Maybe Text
description :: Maybe Text
$sel:description:UpdateImage' :: UpdateImage -> Maybe Text
description} -> Maybe Text
description) (\s :: UpdateImage
s@UpdateImage' {} Maybe Text
a -> UpdateImage
s {$sel:description:UpdateImage' :: Maybe Text
description = Maybe Text
a} :: UpdateImage)
updateImage_roleArn :: Lens.Lens' UpdateImage (Prelude.Maybe Prelude.Text)
updateImage_roleArn :: (Maybe Text -> f (Maybe Text)) -> UpdateImage -> f UpdateImage
updateImage_roleArn = (UpdateImage -> Maybe Text)
-> (UpdateImage -> Maybe Text -> UpdateImage)
-> Lens UpdateImage UpdateImage (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateImage' {Maybe Text
roleArn :: Maybe Text
$sel:roleArn:UpdateImage' :: UpdateImage -> Maybe Text
roleArn} -> Maybe Text
roleArn) (\s :: UpdateImage
s@UpdateImage' {} Maybe Text
a -> UpdateImage
s {$sel:roleArn:UpdateImage' :: Maybe Text
roleArn = Maybe Text
a} :: UpdateImage)
updateImage_imageName :: Lens.Lens' UpdateImage Prelude.Text
updateImage_imageName :: (Text -> f Text) -> UpdateImage -> f UpdateImage
updateImage_imageName = (UpdateImage -> Text)
-> (UpdateImage -> Text -> UpdateImage)
-> Lens UpdateImage UpdateImage Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateImage' {Text
imageName :: Text
$sel:imageName:UpdateImage' :: UpdateImage -> Text
imageName} -> Text
imageName) (\s :: UpdateImage
s@UpdateImage' {} Text
a -> UpdateImage
s {$sel:imageName:UpdateImage' :: Text
imageName = Text
a} :: UpdateImage)
instance Core.AWSRequest UpdateImage where
type AWSResponse UpdateImage = UpdateImageResponse
request :: UpdateImage -> Request UpdateImage
request = Service -> UpdateImage -> Request UpdateImage
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON Service
defaultService
response :: Logger
-> Service
-> Proxy UpdateImage
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse UpdateImage)))
response =
(Int
-> ResponseHeaders
-> Object
-> Either String (AWSResponse UpdateImage))
-> Logger
-> Service
-> Proxy UpdateImage
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse UpdateImage)))
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 -> UpdateImageResponse
UpdateImageResponse'
(Maybe Text -> Int -> UpdateImageResponse)
-> Either String (Maybe Text)
-> Either String (Int -> UpdateImageResponse)
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
"ImageArn")
Either String (Int -> UpdateImageResponse)
-> Either String Int -> Either String UpdateImageResponse
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 UpdateImage
instance Prelude.NFData UpdateImage
instance Core.ToHeaders UpdateImage where
toHeaders :: UpdateImage -> ResponseHeaders
toHeaders =
ResponseHeaders -> UpdateImage -> 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.UpdateImage" :: 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 UpdateImage where
toJSON :: UpdateImage -> Value
toJSON UpdateImage' {Maybe [Text]
Maybe Text
Text
imageName :: Text
roleArn :: Maybe Text
description :: Maybe Text
displayName :: Maybe Text
deleteProperties :: Maybe [Text]
$sel:imageName:UpdateImage' :: UpdateImage -> Text
$sel:roleArn:UpdateImage' :: UpdateImage -> Maybe Text
$sel:description:UpdateImage' :: UpdateImage -> Maybe Text
$sel:displayName:UpdateImage' :: UpdateImage -> Maybe Text
$sel:deleteProperties:UpdateImage' :: UpdateImage -> Maybe [Text]
..} =
[Pair] -> Value
Core.object
( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ (Text
"DeleteProperties" 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]
deleteProperties,
(Text
"DisplayName" 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
displayName,
(Text
"Description" 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
description,
(Text
"RoleArn" 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
roleArn,
Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"ImageName" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
imageName)
]
)
instance Core.ToPath UpdateImage where
toPath :: UpdateImage -> ByteString
toPath = ByteString -> UpdateImage -> ByteString
forall a b. a -> b -> a
Prelude.const ByteString
"/"
instance Core.ToQuery UpdateImage where
toQuery :: UpdateImage -> QueryString
toQuery = QueryString -> UpdateImage -> QueryString
forall a b. a -> b -> a
Prelude.const QueryString
forall a. Monoid a => a
Prelude.mempty
data UpdateImageResponse = UpdateImageResponse'
{
UpdateImageResponse -> Maybe Text
imageArn :: Prelude.Maybe Prelude.Text,
UpdateImageResponse -> Int
httpStatus :: Prelude.Int
}
deriving (UpdateImageResponse -> UpdateImageResponse -> Bool
(UpdateImageResponse -> UpdateImageResponse -> Bool)
-> (UpdateImageResponse -> UpdateImageResponse -> Bool)
-> Eq UpdateImageResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: UpdateImageResponse -> UpdateImageResponse -> Bool
$c/= :: UpdateImageResponse -> UpdateImageResponse -> Bool
== :: UpdateImageResponse -> UpdateImageResponse -> Bool
$c== :: UpdateImageResponse -> UpdateImageResponse -> Bool
Prelude.Eq, ReadPrec [UpdateImageResponse]
ReadPrec UpdateImageResponse
Int -> ReadS UpdateImageResponse
ReadS [UpdateImageResponse]
(Int -> ReadS UpdateImageResponse)
-> ReadS [UpdateImageResponse]
-> ReadPrec UpdateImageResponse
-> ReadPrec [UpdateImageResponse]
-> Read UpdateImageResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [UpdateImageResponse]
$creadListPrec :: ReadPrec [UpdateImageResponse]
readPrec :: ReadPrec UpdateImageResponse
$creadPrec :: ReadPrec UpdateImageResponse
readList :: ReadS [UpdateImageResponse]
$creadList :: ReadS [UpdateImageResponse]
readsPrec :: Int -> ReadS UpdateImageResponse
$creadsPrec :: Int -> ReadS UpdateImageResponse
Prelude.Read, Int -> UpdateImageResponse -> ShowS
[UpdateImageResponse] -> ShowS
UpdateImageResponse -> String
(Int -> UpdateImageResponse -> ShowS)
-> (UpdateImageResponse -> String)
-> ([UpdateImageResponse] -> ShowS)
-> Show UpdateImageResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [UpdateImageResponse] -> ShowS
$cshowList :: [UpdateImageResponse] -> ShowS
show :: UpdateImageResponse -> String
$cshow :: UpdateImageResponse -> String
showsPrec :: Int -> UpdateImageResponse -> ShowS
$cshowsPrec :: Int -> UpdateImageResponse -> ShowS
Prelude.Show, (forall x. UpdateImageResponse -> Rep UpdateImageResponse x)
-> (forall x. Rep UpdateImageResponse x -> UpdateImageResponse)
-> Generic UpdateImageResponse
forall x. Rep UpdateImageResponse x -> UpdateImageResponse
forall x. UpdateImageResponse -> Rep UpdateImageResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep UpdateImageResponse x -> UpdateImageResponse
$cfrom :: forall x. UpdateImageResponse -> Rep UpdateImageResponse x
Prelude.Generic)
newUpdateImageResponse ::
Prelude.Int ->
UpdateImageResponse
newUpdateImageResponse :: Int -> UpdateImageResponse
newUpdateImageResponse Int
pHttpStatus_ =
UpdateImageResponse' :: Maybe Text -> Int -> UpdateImageResponse
UpdateImageResponse'
{ $sel:imageArn:UpdateImageResponse' :: Maybe Text
imageArn = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:httpStatus:UpdateImageResponse' :: Int
httpStatus = Int
pHttpStatus_
}
updateImageResponse_imageArn :: Lens.Lens' UpdateImageResponse (Prelude.Maybe Prelude.Text)
updateImageResponse_imageArn :: (Maybe Text -> f (Maybe Text))
-> UpdateImageResponse -> f UpdateImageResponse
updateImageResponse_imageArn = (UpdateImageResponse -> Maybe Text)
-> (UpdateImageResponse -> Maybe Text -> UpdateImageResponse)
-> Lens
UpdateImageResponse UpdateImageResponse (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateImageResponse' {Maybe Text
imageArn :: Maybe Text
$sel:imageArn:UpdateImageResponse' :: UpdateImageResponse -> Maybe Text
imageArn} -> Maybe Text
imageArn) (\s :: UpdateImageResponse
s@UpdateImageResponse' {} Maybe Text
a -> UpdateImageResponse
s {$sel:imageArn:UpdateImageResponse' :: Maybe Text
imageArn = Maybe Text
a} :: UpdateImageResponse)
updateImageResponse_httpStatus :: Lens.Lens' UpdateImageResponse Prelude.Int
updateImageResponse_httpStatus :: (Int -> f Int) -> UpdateImageResponse -> f UpdateImageResponse
updateImageResponse_httpStatus = (UpdateImageResponse -> Int)
-> (UpdateImageResponse -> Int -> UpdateImageResponse)
-> Lens UpdateImageResponse UpdateImageResponse Int Int
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateImageResponse' {Int
httpStatus :: Int
$sel:httpStatus:UpdateImageResponse' :: UpdateImageResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: UpdateImageResponse
s@UpdateImageResponse' {} Int
a -> UpdateImageResponse
s {$sel:httpStatus:UpdateImageResponse' :: Int
httpStatus = Int
a} :: UpdateImageResponse)
instance Prelude.NFData UpdateImageResponse