{-# 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.UpdateAction
(
UpdateAction (..),
newUpdateAction,
updateAction_status,
updateAction_propertiesToRemove,
updateAction_description,
updateAction_properties,
updateAction_actionName,
UpdateActionResponse (..),
newUpdateActionResponse,
updateActionResponse_actionArn,
updateActionResponse_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 UpdateAction = UpdateAction'
{
UpdateAction -> Maybe ActionStatus
status :: Prelude.Maybe ActionStatus,
UpdateAction -> Maybe [Text]
propertiesToRemove :: Prelude.Maybe [Prelude.Text],
UpdateAction -> Maybe Text
description :: Prelude.Maybe Prelude.Text,
UpdateAction -> Maybe (HashMap Text Text)
properties :: Prelude.Maybe (Prelude.HashMap Prelude.Text Prelude.Text),
UpdateAction -> Text
actionName :: Prelude.Text
}
deriving (UpdateAction -> UpdateAction -> Bool
(UpdateAction -> UpdateAction -> Bool)
-> (UpdateAction -> UpdateAction -> Bool) -> Eq UpdateAction
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: UpdateAction -> UpdateAction -> Bool
$c/= :: UpdateAction -> UpdateAction -> Bool
== :: UpdateAction -> UpdateAction -> Bool
$c== :: UpdateAction -> UpdateAction -> Bool
Prelude.Eq, ReadPrec [UpdateAction]
ReadPrec UpdateAction
Int -> ReadS UpdateAction
ReadS [UpdateAction]
(Int -> ReadS UpdateAction)
-> ReadS [UpdateAction]
-> ReadPrec UpdateAction
-> ReadPrec [UpdateAction]
-> Read UpdateAction
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [UpdateAction]
$creadListPrec :: ReadPrec [UpdateAction]
readPrec :: ReadPrec UpdateAction
$creadPrec :: ReadPrec UpdateAction
readList :: ReadS [UpdateAction]
$creadList :: ReadS [UpdateAction]
readsPrec :: Int -> ReadS UpdateAction
$creadsPrec :: Int -> ReadS UpdateAction
Prelude.Read, Int -> UpdateAction -> ShowS
[UpdateAction] -> ShowS
UpdateAction -> String
(Int -> UpdateAction -> ShowS)
-> (UpdateAction -> String)
-> ([UpdateAction] -> ShowS)
-> Show UpdateAction
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [UpdateAction] -> ShowS
$cshowList :: [UpdateAction] -> ShowS
show :: UpdateAction -> String
$cshow :: UpdateAction -> String
showsPrec :: Int -> UpdateAction -> ShowS
$cshowsPrec :: Int -> UpdateAction -> ShowS
Prelude.Show, (forall x. UpdateAction -> Rep UpdateAction x)
-> (forall x. Rep UpdateAction x -> UpdateAction)
-> Generic UpdateAction
forall x. Rep UpdateAction x -> UpdateAction
forall x. UpdateAction -> Rep UpdateAction x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep UpdateAction x -> UpdateAction
$cfrom :: forall x. UpdateAction -> Rep UpdateAction x
Prelude.Generic)
newUpdateAction ::
Prelude.Text ->
UpdateAction
newUpdateAction :: Text -> UpdateAction
newUpdateAction Text
pActionName_ =
UpdateAction' :: Maybe ActionStatus
-> Maybe [Text]
-> Maybe Text
-> Maybe (HashMap Text Text)
-> Text
-> UpdateAction
UpdateAction'
{ $sel:status:UpdateAction' :: Maybe ActionStatus
status = Maybe ActionStatus
forall a. Maybe a
Prelude.Nothing,
$sel:propertiesToRemove:UpdateAction' :: Maybe [Text]
propertiesToRemove = Maybe [Text]
forall a. Maybe a
Prelude.Nothing,
$sel:description:UpdateAction' :: Maybe Text
description = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:properties:UpdateAction' :: Maybe (HashMap Text Text)
properties = Maybe (HashMap Text Text)
forall a. Maybe a
Prelude.Nothing,
$sel:actionName:UpdateAction' :: Text
actionName = Text
pActionName_
}
updateAction_status :: Lens.Lens' UpdateAction (Prelude.Maybe ActionStatus)
updateAction_status :: (Maybe ActionStatus -> f (Maybe ActionStatus))
-> UpdateAction -> f UpdateAction
updateAction_status = (UpdateAction -> Maybe ActionStatus)
-> (UpdateAction -> Maybe ActionStatus -> UpdateAction)
-> Lens
UpdateAction UpdateAction (Maybe ActionStatus) (Maybe ActionStatus)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateAction' {Maybe ActionStatus
status :: Maybe ActionStatus
$sel:status:UpdateAction' :: UpdateAction -> Maybe ActionStatus
status} -> Maybe ActionStatus
status) (\s :: UpdateAction
s@UpdateAction' {} Maybe ActionStatus
a -> UpdateAction
s {$sel:status:UpdateAction' :: Maybe ActionStatus
status = Maybe ActionStatus
a} :: UpdateAction)
updateAction_propertiesToRemove :: Lens.Lens' UpdateAction (Prelude.Maybe [Prelude.Text])
updateAction_propertiesToRemove :: (Maybe [Text] -> f (Maybe [Text]))
-> UpdateAction -> f UpdateAction
updateAction_propertiesToRemove = (UpdateAction -> Maybe [Text])
-> (UpdateAction -> Maybe [Text] -> UpdateAction)
-> Lens UpdateAction UpdateAction (Maybe [Text]) (Maybe [Text])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateAction' {Maybe [Text]
propertiesToRemove :: Maybe [Text]
$sel:propertiesToRemove:UpdateAction' :: UpdateAction -> Maybe [Text]
propertiesToRemove} -> Maybe [Text]
propertiesToRemove) (\s :: UpdateAction
s@UpdateAction' {} Maybe [Text]
a -> UpdateAction
s {$sel:propertiesToRemove:UpdateAction' :: Maybe [Text]
propertiesToRemove = Maybe [Text]
a} :: UpdateAction) ((Maybe [Text] -> f (Maybe [Text]))
-> UpdateAction -> f UpdateAction)
-> ((Maybe [Text] -> f (Maybe [Text]))
-> Maybe [Text] -> f (Maybe [Text]))
-> (Maybe [Text] -> f (Maybe [Text]))
-> UpdateAction
-> f UpdateAction
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
updateAction_description :: Lens.Lens' UpdateAction (Prelude.Maybe Prelude.Text)
updateAction_description :: (Maybe Text -> f (Maybe Text)) -> UpdateAction -> f UpdateAction
updateAction_description = (UpdateAction -> Maybe Text)
-> (UpdateAction -> Maybe Text -> UpdateAction)
-> Lens UpdateAction UpdateAction (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateAction' {Maybe Text
description :: Maybe Text
$sel:description:UpdateAction' :: UpdateAction -> Maybe Text
description} -> Maybe Text
description) (\s :: UpdateAction
s@UpdateAction' {} Maybe Text
a -> UpdateAction
s {$sel:description:UpdateAction' :: Maybe Text
description = Maybe Text
a} :: UpdateAction)
updateAction_properties :: Lens.Lens' UpdateAction (Prelude.Maybe (Prelude.HashMap Prelude.Text Prelude.Text))
updateAction_properties :: (Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
-> UpdateAction -> f UpdateAction
updateAction_properties = (UpdateAction -> Maybe (HashMap Text Text))
-> (UpdateAction -> Maybe (HashMap Text Text) -> UpdateAction)
-> Lens
UpdateAction
UpdateAction
(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 (\UpdateAction' {Maybe (HashMap Text Text)
properties :: Maybe (HashMap Text Text)
$sel:properties:UpdateAction' :: UpdateAction -> Maybe (HashMap Text Text)
properties} -> Maybe (HashMap Text Text)
properties) (\s :: UpdateAction
s@UpdateAction' {} Maybe (HashMap Text Text)
a -> UpdateAction
s {$sel:properties:UpdateAction' :: Maybe (HashMap Text Text)
properties = Maybe (HashMap Text Text)
a} :: UpdateAction) ((Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
-> UpdateAction -> f UpdateAction)
-> ((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)))
-> UpdateAction
-> f UpdateAction
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
updateAction_actionName :: Lens.Lens' UpdateAction Prelude.Text
updateAction_actionName :: (Text -> f Text) -> UpdateAction -> f UpdateAction
updateAction_actionName = (UpdateAction -> Text)
-> (UpdateAction -> Text -> UpdateAction)
-> Lens UpdateAction UpdateAction Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateAction' {Text
actionName :: Text
$sel:actionName:UpdateAction' :: UpdateAction -> Text
actionName} -> Text
actionName) (\s :: UpdateAction
s@UpdateAction' {} Text
a -> UpdateAction
s {$sel:actionName:UpdateAction' :: Text
actionName = Text
a} :: UpdateAction)
instance Core.AWSRequest UpdateAction where
type AWSResponse UpdateAction = UpdateActionResponse
request :: UpdateAction -> Request UpdateAction
request = Service -> UpdateAction -> Request UpdateAction
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON Service
defaultService
response :: Logger
-> Service
-> Proxy UpdateAction
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse UpdateAction)))
response =
(Int
-> ResponseHeaders
-> Object
-> Either String (AWSResponse UpdateAction))
-> Logger
-> Service
-> Proxy UpdateAction
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse UpdateAction)))
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 -> UpdateActionResponse
UpdateActionResponse'
(Maybe Text -> Int -> UpdateActionResponse)
-> Either String (Maybe Text)
-> Either String (Int -> UpdateActionResponse)
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
"ActionArn")
Either String (Int -> UpdateActionResponse)
-> Either String Int -> Either String UpdateActionResponse
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 UpdateAction
instance Prelude.NFData UpdateAction
instance Core.ToHeaders UpdateAction where
toHeaders :: UpdateAction -> ResponseHeaders
toHeaders =
ResponseHeaders -> UpdateAction -> 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.UpdateAction" :: 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 UpdateAction where
toJSON :: UpdateAction -> Value
toJSON UpdateAction' {Maybe [Text]
Maybe Text
Maybe (HashMap Text Text)
Maybe ActionStatus
Text
actionName :: Text
properties :: Maybe (HashMap Text Text)
description :: Maybe Text
propertiesToRemove :: Maybe [Text]
status :: Maybe ActionStatus
$sel:actionName:UpdateAction' :: UpdateAction -> Text
$sel:properties:UpdateAction' :: UpdateAction -> Maybe (HashMap Text Text)
$sel:description:UpdateAction' :: UpdateAction -> Maybe Text
$sel:propertiesToRemove:UpdateAction' :: UpdateAction -> Maybe [Text]
$sel:status:UpdateAction' :: UpdateAction -> Maybe ActionStatus
..} =
[Pair] -> Value
Core.object
( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ (Text
"Status" Text -> ActionStatus -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (ActionStatus -> Pair) -> Maybe ActionStatus -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe ActionStatus
status,
(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
"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
"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
"ActionName" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
actionName)
]
)
instance Core.ToPath UpdateAction where
toPath :: UpdateAction -> ByteString
toPath = ByteString -> UpdateAction -> ByteString
forall a b. a -> b -> a
Prelude.const ByteString
"/"
instance Core.ToQuery UpdateAction where
toQuery :: UpdateAction -> QueryString
toQuery = QueryString -> UpdateAction -> QueryString
forall a b. a -> b -> a
Prelude.const QueryString
forall a. Monoid a => a
Prelude.mempty
data UpdateActionResponse = UpdateActionResponse'
{
UpdateActionResponse -> Maybe Text
actionArn :: Prelude.Maybe Prelude.Text,
UpdateActionResponse -> Int
httpStatus :: Prelude.Int
}
deriving (UpdateActionResponse -> UpdateActionResponse -> Bool
(UpdateActionResponse -> UpdateActionResponse -> Bool)
-> (UpdateActionResponse -> UpdateActionResponse -> Bool)
-> Eq UpdateActionResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: UpdateActionResponse -> UpdateActionResponse -> Bool
$c/= :: UpdateActionResponse -> UpdateActionResponse -> Bool
== :: UpdateActionResponse -> UpdateActionResponse -> Bool
$c== :: UpdateActionResponse -> UpdateActionResponse -> Bool
Prelude.Eq, ReadPrec [UpdateActionResponse]
ReadPrec UpdateActionResponse
Int -> ReadS UpdateActionResponse
ReadS [UpdateActionResponse]
(Int -> ReadS UpdateActionResponse)
-> ReadS [UpdateActionResponse]
-> ReadPrec UpdateActionResponse
-> ReadPrec [UpdateActionResponse]
-> Read UpdateActionResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [UpdateActionResponse]
$creadListPrec :: ReadPrec [UpdateActionResponse]
readPrec :: ReadPrec UpdateActionResponse
$creadPrec :: ReadPrec UpdateActionResponse
readList :: ReadS [UpdateActionResponse]
$creadList :: ReadS [UpdateActionResponse]
readsPrec :: Int -> ReadS UpdateActionResponse
$creadsPrec :: Int -> ReadS UpdateActionResponse
Prelude.Read, Int -> UpdateActionResponse -> ShowS
[UpdateActionResponse] -> ShowS
UpdateActionResponse -> String
(Int -> UpdateActionResponse -> ShowS)
-> (UpdateActionResponse -> String)
-> ([UpdateActionResponse] -> ShowS)
-> Show UpdateActionResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [UpdateActionResponse] -> ShowS
$cshowList :: [UpdateActionResponse] -> ShowS
show :: UpdateActionResponse -> String
$cshow :: UpdateActionResponse -> String
showsPrec :: Int -> UpdateActionResponse -> ShowS
$cshowsPrec :: Int -> UpdateActionResponse -> ShowS
Prelude.Show, (forall x. UpdateActionResponse -> Rep UpdateActionResponse x)
-> (forall x. Rep UpdateActionResponse x -> UpdateActionResponse)
-> Generic UpdateActionResponse
forall x. Rep UpdateActionResponse x -> UpdateActionResponse
forall x. UpdateActionResponse -> Rep UpdateActionResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep UpdateActionResponse x -> UpdateActionResponse
$cfrom :: forall x. UpdateActionResponse -> Rep UpdateActionResponse x
Prelude.Generic)
newUpdateActionResponse ::
Prelude.Int ->
UpdateActionResponse
newUpdateActionResponse :: Int -> UpdateActionResponse
newUpdateActionResponse Int
pHttpStatus_ =
UpdateActionResponse' :: Maybe Text -> Int -> UpdateActionResponse
UpdateActionResponse'
{ $sel:actionArn:UpdateActionResponse' :: Maybe Text
actionArn = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:httpStatus:UpdateActionResponse' :: Int
httpStatus = Int
pHttpStatus_
}
updateActionResponse_actionArn :: Lens.Lens' UpdateActionResponse (Prelude.Maybe Prelude.Text)
updateActionResponse_actionArn :: (Maybe Text -> f (Maybe Text))
-> UpdateActionResponse -> f UpdateActionResponse
updateActionResponse_actionArn = (UpdateActionResponse -> Maybe Text)
-> (UpdateActionResponse -> Maybe Text -> UpdateActionResponse)
-> Lens
UpdateActionResponse UpdateActionResponse (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateActionResponse' {Maybe Text
actionArn :: Maybe Text
$sel:actionArn:UpdateActionResponse' :: UpdateActionResponse -> Maybe Text
actionArn} -> Maybe Text
actionArn) (\s :: UpdateActionResponse
s@UpdateActionResponse' {} Maybe Text
a -> UpdateActionResponse
s {$sel:actionArn:UpdateActionResponse' :: Maybe Text
actionArn = Maybe Text
a} :: UpdateActionResponse)
updateActionResponse_httpStatus :: Lens.Lens' UpdateActionResponse Prelude.Int
updateActionResponse_httpStatus :: (Int -> f Int) -> UpdateActionResponse -> f UpdateActionResponse
updateActionResponse_httpStatus = (UpdateActionResponse -> Int)
-> (UpdateActionResponse -> Int -> UpdateActionResponse)
-> Lens UpdateActionResponse UpdateActionResponse Int Int
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateActionResponse' {Int
httpStatus :: Int
$sel:httpStatus:UpdateActionResponse' :: UpdateActionResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: UpdateActionResponse
s@UpdateActionResponse' {} Int
a -> UpdateActionResponse
s {$sel:httpStatus:UpdateActionResponse' :: Int
httpStatus = Int
a} :: UpdateActionResponse)
instance Prelude.NFData UpdateActionResponse