{-# 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.MachineLearning.UpdateEvaluation
(
UpdateEvaluation (..),
newUpdateEvaluation,
updateEvaluation_evaluationId,
updateEvaluation_evaluationName,
UpdateEvaluationResponse (..),
newUpdateEvaluationResponse,
updateEvaluationResponse_evaluationId,
updateEvaluationResponse_httpStatus,
)
where
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import Amazonka.MachineLearning.Types
import qualified Amazonka.Prelude as Prelude
import qualified Amazonka.Request as Request
import qualified Amazonka.Response as Response
data UpdateEvaluation = UpdateEvaluation'
{
UpdateEvaluation -> Text
evaluationId :: Prelude.Text,
UpdateEvaluation -> Text
evaluationName :: Prelude.Text
}
deriving (UpdateEvaluation -> UpdateEvaluation -> Bool
(UpdateEvaluation -> UpdateEvaluation -> Bool)
-> (UpdateEvaluation -> UpdateEvaluation -> Bool)
-> Eq UpdateEvaluation
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: UpdateEvaluation -> UpdateEvaluation -> Bool
$c/= :: UpdateEvaluation -> UpdateEvaluation -> Bool
== :: UpdateEvaluation -> UpdateEvaluation -> Bool
$c== :: UpdateEvaluation -> UpdateEvaluation -> Bool
Prelude.Eq, ReadPrec [UpdateEvaluation]
ReadPrec UpdateEvaluation
Int -> ReadS UpdateEvaluation
ReadS [UpdateEvaluation]
(Int -> ReadS UpdateEvaluation)
-> ReadS [UpdateEvaluation]
-> ReadPrec UpdateEvaluation
-> ReadPrec [UpdateEvaluation]
-> Read UpdateEvaluation
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [UpdateEvaluation]
$creadListPrec :: ReadPrec [UpdateEvaluation]
readPrec :: ReadPrec UpdateEvaluation
$creadPrec :: ReadPrec UpdateEvaluation
readList :: ReadS [UpdateEvaluation]
$creadList :: ReadS [UpdateEvaluation]
readsPrec :: Int -> ReadS UpdateEvaluation
$creadsPrec :: Int -> ReadS UpdateEvaluation
Prelude.Read, Int -> UpdateEvaluation -> ShowS
[UpdateEvaluation] -> ShowS
UpdateEvaluation -> String
(Int -> UpdateEvaluation -> ShowS)
-> (UpdateEvaluation -> String)
-> ([UpdateEvaluation] -> ShowS)
-> Show UpdateEvaluation
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [UpdateEvaluation] -> ShowS
$cshowList :: [UpdateEvaluation] -> ShowS
show :: UpdateEvaluation -> String
$cshow :: UpdateEvaluation -> String
showsPrec :: Int -> UpdateEvaluation -> ShowS
$cshowsPrec :: Int -> UpdateEvaluation -> ShowS
Prelude.Show, (forall x. UpdateEvaluation -> Rep UpdateEvaluation x)
-> (forall x. Rep UpdateEvaluation x -> UpdateEvaluation)
-> Generic UpdateEvaluation
forall x. Rep UpdateEvaluation x -> UpdateEvaluation
forall x. UpdateEvaluation -> Rep UpdateEvaluation x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep UpdateEvaluation x -> UpdateEvaluation
$cfrom :: forall x. UpdateEvaluation -> Rep UpdateEvaluation x
Prelude.Generic)
newUpdateEvaluation ::
Prelude.Text ->
Prelude.Text ->
UpdateEvaluation
newUpdateEvaluation :: Text -> Text -> UpdateEvaluation
newUpdateEvaluation Text
pEvaluationId_ Text
pEvaluationName_ =
UpdateEvaluation' :: Text -> Text -> UpdateEvaluation
UpdateEvaluation'
{ $sel:evaluationId:UpdateEvaluation' :: Text
evaluationId = Text
pEvaluationId_,
$sel:evaluationName:UpdateEvaluation' :: Text
evaluationName = Text
pEvaluationName_
}
updateEvaluation_evaluationId :: Lens.Lens' UpdateEvaluation Prelude.Text
updateEvaluation_evaluationId :: (Text -> f Text) -> UpdateEvaluation -> f UpdateEvaluation
updateEvaluation_evaluationId = (UpdateEvaluation -> Text)
-> (UpdateEvaluation -> Text -> UpdateEvaluation)
-> Lens UpdateEvaluation UpdateEvaluation Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateEvaluation' {Text
evaluationId :: Text
$sel:evaluationId:UpdateEvaluation' :: UpdateEvaluation -> Text
evaluationId} -> Text
evaluationId) (\s :: UpdateEvaluation
s@UpdateEvaluation' {} Text
a -> UpdateEvaluation
s {$sel:evaluationId:UpdateEvaluation' :: Text
evaluationId = Text
a} :: UpdateEvaluation)
updateEvaluation_evaluationName :: Lens.Lens' UpdateEvaluation Prelude.Text
updateEvaluation_evaluationName :: (Text -> f Text) -> UpdateEvaluation -> f UpdateEvaluation
updateEvaluation_evaluationName = (UpdateEvaluation -> Text)
-> (UpdateEvaluation -> Text -> UpdateEvaluation)
-> Lens UpdateEvaluation UpdateEvaluation Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateEvaluation' {Text
evaluationName :: Text
$sel:evaluationName:UpdateEvaluation' :: UpdateEvaluation -> Text
evaluationName} -> Text
evaluationName) (\s :: UpdateEvaluation
s@UpdateEvaluation' {} Text
a -> UpdateEvaluation
s {$sel:evaluationName:UpdateEvaluation' :: Text
evaluationName = Text
a} :: UpdateEvaluation)
instance Core.AWSRequest UpdateEvaluation where
type
AWSResponse UpdateEvaluation =
UpdateEvaluationResponse
request :: UpdateEvaluation -> Request UpdateEvaluation
request = Service -> UpdateEvaluation -> Request UpdateEvaluation
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON Service
defaultService
response :: Logger
-> Service
-> Proxy UpdateEvaluation
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse UpdateEvaluation)))
response =
(Int
-> ResponseHeaders
-> Object
-> Either String (AWSResponse UpdateEvaluation))
-> Logger
-> Service
-> Proxy UpdateEvaluation
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse UpdateEvaluation)))
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 -> UpdateEvaluationResponse
UpdateEvaluationResponse'
(Maybe Text -> Int -> UpdateEvaluationResponse)
-> Either String (Maybe Text)
-> Either String (Int -> UpdateEvaluationResponse)
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
"EvaluationId")
Either String (Int -> UpdateEvaluationResponse)
-> Either String Int -> Either String UpdateEvaluationResponse
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 UpdateEvaluation
instance Prelude.NFData UpdateEvaluation
instance Core.ToHeaders UpdateEvaluation where
toHeaders :: UpdateEvaluation -> ResponseHeaders
toHeaders =
ResponseHeaders -> UpdateEvaluation -> 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
"AmazonML_20141212.UpdateEvaluation" ::
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 UpdateEvaluation where
toJSON :: UpdateEvaluation -> Value
toJSON UpdateEvaluation' {Text
evaluationName :: Text
evaluationId :: Text
$sel:evaluationName:UpdateEvaluation' :: UpdateEvaluation -> Text
$sel:evaluationId:UpdateEvaluation' :: UpdateEvaluation -> 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
"EvaluationId" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
evaluationId),
Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just
(Text
"EvaluationName" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
evaluationName)
]
)
instance Core.ToPath UpdateEvaluation where
toPath :: UpdateEvaluation -> ByteString
toPath = ByteString -> UpdateEvaluation -> ByteString
forall a b. a -> b -> a
Prelude.const ByteString
"/"
instance Core.ToQuery UpdateEvaluation where
toQuery :: UpdateEvaluation -> QueryString
toQuery = QueryString -> UpdateEvaluation -> QueryString
forall a b. a -> b -> a
Prelude.const QueryString
forall a. Monoid a => a
Prelude.mempty
data UpdateEvaluationResponse = UpdateEvaluationResponse'
{
UpdateEvaluationResponse -> Maybe Text
evaluationId :: Prelude.Maybe Prelude.Text,
UpdateEvaluationResponse -> Int
httpStatus :: Prelude.Int
}
deriving (UpdateEvaluationResponse -> UpdateEvaluationResponse -> Bool
(UpdateEvaluationResponse -> UpdateEvaluationResponse -> Bool)
-> (UpdateEvaluationResponse -> UpdateEvaluationResponse -> Bool)
-> Eq UpdateEvaluationResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: UpdateEvaluationResponse -> UpdateEvaluationResponse -> Bool
$c/= :: UpdateEvaluationResponse -> UpdateEvaluationResponse -> Bool
== :: UpdateEvaluationResponse -> UpdateEvaluationResponse -> Bool
$c== :: UpdateEvaluationResponse -> UpdateEvaluationResponse -> Bool
Prelude.Eq, ReadPrec [UpdateEvaluationResponse]
ReadPrec UpdateEvaluationResponse
Int -> ReadS UpdateEvaluationResponse
ReadS [UpdateEvaluationResponse]
(Int -> ReadS UpdateEvaluationResponse)
-> ReadS [UpdateEvaluationResponse]
-> ReadPrec UpdateEvaluationResponse
-> ReadPrec [UpdateEvaluationResponse]
-> Read UpdateEvaluationResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [UpdateEvaluationResponse]
$creadListPrec :: ReadPrec [UpdateEvaluationResponse]
readPrec :: ReadPrec UpdateEvaluationResponse
$creadPrec :: ReadPrec UpdateEvaluationResponse
readList :: ReadS [UpdateEvaluationResponse]
$creadList :: ReadS [UpdateEvaluationResponse]
readsPrec :: Int -> ReadS UpdateEvaluationResponse
$creadsPrec :: Int -> ReadS UpdateEvaluationResponse
Prelude.Read, Int -> UpdateEvaluationResponse -> ShowS
[UpdateEvaluationResponse] -> ShowS
UpdateEvaluationResponse -> String
(Int -> UpdateEvaluationResponse -> ShowS)
-> (UpdateEvaluationResponse -> String)
-> ([UpdateEvaluationResponse] -> ShowS)
-> Show UpdateEvaluationResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [UpdateEvaluationResponse] -> ShowS
$cshowList :: [UpdateEvaluationResponse] -> ShowS
show :: UpdateEvaluationResponse -> String
$cshow :: UpdateEvaluationResponse -> String
showsPrec :: Int -> UpdateEvaluationResponse -> ShowS
$cshowsPrec :: Int -> UpdateEvaluationResponse -> ShowS
Prelude.Show, (forall x.
UpdateEvaluationResponse -> Rep UpdateEvaluationResponse x)
-> (forall x.
Rep UpdateEvaluationResponse x -> UpdateEvaluationResponse)
-> Generic UpdateEvaluationResponse
forall x.
Rep UpdateEvaluationResponse x -> UpdateEvaluationResponse
forall x.
UpdateEvaluationResponse -> Rep UpdateEvaluationResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep UpdateEvaluationResponse x -> UpdateEvaluationResponse
$cfrom :: forall x.
UpdateEvaluationResponse -> Rep UpdateEvaluationResponse x
Prelude.Generic)
newUpdateEvaluationResponse ::
Prelude.Int ->
UpdateEvaluationResponse
newUpdateEvaluationResponse :: Int -> UpdateEvaluationResponse
newUpdateEvaluationResponse Int
pHttpStatus_ =
UpdateEvaluationResponse' :: Maybe Text -> Int -> UpdateEvaluationResponse
UpdateEvaluationResponse'
{ $sel:evaluationId:UpdateEvaluationResponse' :: Maybe Text
evaluationId =
Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:httpStatus:UpdateEvaluationResponse' :: Int
httpStatus = Int
pHttpStatus_
}
updateEvaluationResponse_evaluationId :: Lens.Lens' UpdateEvaluationResponse (Prelude.Maybe Prelude.Text)
updateEvaluationResponse_evaluationId :: (Maybe Text -> f (Maybe Text))
-> UpdateEvaluationResponse -> f UpdateEvaluationResponse
updateEvaluationResponse_evaluationId = (UpdateEvaluationResponse -> Maybe Text)
-> (UpdateEvaluationResponse
-> Maybe Text -> UpdateEvaluationResponse)
-> Lens
UpdateEvaluationResponse
UpdateEvaluationResponse
(Maybe Text)
(Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateEvaluationResponse' {Maybe Text
evaluationId :: Maybe Text
$sel:evaluationId:UpdateEvaluationResponse' :: UpdateEvaluationResponse -> Maybe Text
evaluationId} -> Maybe Text
evaluationId) (\s :: UpdateEvaluationResponse
s@UpdateEvaluationResponse' {} Maybe Text
a -> UpdateEvaluationResponse
s {$sel:evaluationId:UpdateEvaluationResponse' :: Maybe Text
evaluationId = Maybe Text
a} :: UpdateEvaluationResponse)
updateEvaluationResponse_httpStatus :: Lens.Lens' UpdateEvaluationResponse Prelude.Int
updateEvaluationResponse_httpStatus :: (Int -> f Int)
-> UpdateEvaluationResponse -> f UpdateEvaluationResponse
updateEvaluationResponse_httpStatus = (UpdateEvaluationResponse -> Int)
-> (UpdateEvaluationResponse -> Int -> UpdateEvaluationResponse)
-> Lens UpdateEvaluationResponse UpdateEvaluationResponse Int Int
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateEvaluationResponse' {Int
httpStatus :: Int
$sel:httpStatus:UpdateEvaluationResponse' :: UpdateEvaluationResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: UpdateEvaluationResponse
s@UpdateEvaluationResponse' {} Int
a -> UpdateEvaluationResponse
s {$sel:httpStatus:UpdateEvaluationResponse' :: Int
httpStatus = Int
a} :: UpdateEvaluationResponse)
instance Prelude.NFData UpdateEvaluationResponse