{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE DuplicateRecordFields #-}
{-# LANGUAGE NamedFieldPuns #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE RecordWildCards #-}
{-# LANGUAGE StrictData #-}
{-# LANGUAGE NoImplicitPrelude #-}
{-# OPTIONS_GHC -fno-warn-unused-imports #-}
{-# OPTIONS_GHC -fno-warn-unused-matches #-}
module Amazonka.SageMakerMetrics.Types.BatchPutMetricsError where
import qualified Amazonka.Core as Core
import qualified Amazonka.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
import qualified Amazonka.Prelude as Prelude
import Amazonka.SageMakerMetrics.Types.PutMetricsErrorCode
data BatchPutMetricsError = BatchPutMetricsError'
{
BatchPutMetricsError -> Maybe PutMetricsErrorCode
code :: Prelude.Maybe PutMetricsErrorCode,
BatchPutMetricsError -> Maybe Int
metricIndex :: Prelude.Maybe Prelude.Int
}
deriving (BatchPutMetricsError -> BatchPutMetricsError -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: BatchPutMetricsError -> BatchPutMetricsError -> Bool
$c/= :: BatchPutMetricsError -> BatchPutMetricsError -> Bool
== :: BatchPutMetricsError -> BatchPutMetricsError -> Bool
$c== :: BatchPutMetricsError -> BatchPutMetricsError -> Bool
Prelude.Eq, ReadPrec [BatchPutMetricsError]
ReadPrec BatchPutMetricsError
Int -> ReadS BatchPutMetricsError
ReadS [BatchPutMetricsError]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [BatchPutMetricsError]
$creadListPrec :: ReadPrec [BatchPutMetricsError]
readPrec :: ReadPrec BatchPutMetricsError
$creadPrec :: ReadPrec BatchPutMetricsError
readList :: ReadS [BatchPutMetricsError]
$creadList :: ReadS [BatchPutMetricsError]
readsPrec :: Int -> ReadS BatchPutMetricsError
$creadsPrec :: Int -> ReadS BatchPutMetricsError
Prelude.Read, Int -> BatchPutMetricsError -> ShowS
[BatchPutMetricsError] -> ShowS
BatchPutMetricsError -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [BatchPutMetricsError] -> ShowS
$cshowList :: [BatchPutMetricsError] -> ShowS
show :: BatchPutMetricsError -> String
$cshow :: BatchPutMetricsError -> String
showsPrec :: Int -> BatchPutMetricsError -> ShowS
$cshowsPrec :: Int -> BatchPutMetricsError -> ShowS
Prelude.Show, forall x. Rep BatchPutMetricsError x -> BatchPutMetricsError
forall x. BatchPutMetricsError -> Rep BatchPutMetricsError x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep BatchPutMetricsError x -> BatchPutMetricsError
$cfrom :: forall x. BatchPutMetricsError -> Rep BatchPutMetricsError x
Prelude.Generic)
newBatchPutMetricsError ::
BatchPutMetricsError
newBatchPutMetricsError :: BatchPutMetricsError
newBatchPutMetricsError =
BatchPutMetricsError'
{ $sel:code:BatchPutMetricsError' :: Maybe PutMetricsErrorCode
code = forall a. Maybe a
Prelude.Nothing,
$sel:metricIndex:BatchPutMetricsError' :: Maybe Int
metricIndex = forall a. Maybe a
Prelude.Nothing
}
batchPutMetricsError_code :: Lens.Lens' BatchPutMetricsError (Prelude.Maybe PutMetricsErrorCode)
batchPutMetricsError_code :: Lens' BatchPutMetricsError (Maybe PutMetricsErrorCode)
batchPutMetricsError_code = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\BatchPutMetricsError' {Maybe PutMetricsErrorCode
code :: Maybe PutMetricsErrorCode
$sel:code:BatchPutMetricsError' :: BatchPutMetricsError -> Maybe PutMetricsErrorCode
code} -> Maybe PutMetricsErrorCode
code) (\s :: BatchPutMetricsError
s@BatchPutMetricsError' {} Maybe PutMetricsErrorCode
a -> BatchPutMetricsError
s {$sel:code:BatchPutMetricsError' :: Maybe PutMetricsErrorCode
code = Maybe PutMetricsErrorCode
a} :: BatchPutMetricsError)
batchPutMetricsError_metricIndex :: Lens.Lens' BatchPutMetricsError (Prelude.Maybe Prelude.Int)
batchPutMetricsError_metricIndex :: Lens' BatchPutMetricsError (Maybe Int)
batchPutMetricsError_metricIndex = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\BatchPutMetricsError' {Maybe Int
metricIndex :: Maybe Int
$sel:metricIndex:BatchPutMetricsError' :: BatchPutMetricsError -> Maybe Int
metricIndex} -> Maybe Int
metricIndex) (\s :: BatchPutMetricsError
s@BatchPutMetricsError' {} Maybe Int
a -> BatchPutMetricsError
s {$sel:metricIndex:BatchPutMetricsError' :: Maybe Int
metricIndex = Maybe Int
a} :: BatchPutMetricsError)
instance Data.FromJSON BatchPutMetricsError where
parseJSON :: Value -> Parser BatchPutMetricsError
parseJSON =
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
String
"BatchPutMetricsError"
( \Object
x ->
Maybe PutMetricsErrorCode -> Maybe Int -> BatchPutMetricsError
BatchPutMetricsError'
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"Code")
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"MetricIndex")
)
instance Prelude.Hashable BatchPutMetricsError where
hashWithSalt :: Int -> BatchPutMetricsError -> Int
hashWithSalt Int
_salt BatchPutMetricsError' {Maybe Int
Maybe PutMetricsErrorCode
metricIndex :: Maybe Int
code :: Maybe PutMetricsErrorCode
$sel:metricIndex:BatchPutMetricsError' :: BatchPutMetricsError -> Maybe Int
$sel:code:BatchPutMetricsError' :: BatchPutMetricsError -> Maybe PutMetricsErrorCode
..} =
Int
_salt
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe PutMetricsErrorCode
code
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Int
metricIndex
instance Prelude.NFData BatchPutMetricsError where
rnf :: BatchPutMetricsError -> ()
rnf BatchPutMetricsError' {Maybe Int
Maybe PutMetricsErrorCode
metricIndex :: Maybe Int
code :: Maybe PutMetricsErrorCode
$sel:metricIndex:BatchPutMetricsError' :: BatchPutMetricsError -> Maybe Int
$sel:code:BatchPutMetricsError' :: BatchPutMetricsError -> Maybe PutMetricsErrorCode
..} =
forall a. NFData a => a -> ()
Prelude.rnf Maybe PutMetricsErrorCode
code
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Int
metricIndex