{-# 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.SageMaker.Types.ModelQuality where
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
import Amazonka.SageMaker.Types.MetricsSource
data ModelQuality = ModelQuality'
{
ModelQuality -> Maybe MetricsSource
constraints :: Prelude.Maybe MetricsSource,
ModelQuality -> Maybe MetricsSource
statistics :: Prelude.Maybe MetricsSource
}
deriving (ModelQuality -> ModelQuality -> Bool
(ModelQuality -> ModelQuality -> Bool)
-> (ModelQuality -> ModelQuality -> Bool) -> Eq ModelQuality
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ModelQuality -> ModelQuality -> Bool
$c/= :: ModelQuality -> ModelQuality -> Bool
== :: ModelQuality -> ModelQuality -> Bool
$c== :: ModelQuality -> ModelQuality -> Bool
Prelude.Eq, ReadPrec [ModelQuality]
ReadPrec ModelQuality
Int -> ReadS ModelQuality
ReadS [ModelQuality]
(Int -> ReadS ModelQuality)
-> ReadS [ModelQuality]
-> ReadPrec ModelQuality
-> ReadPrec [ModelQuality]
-> Read ModelQuality
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ModelQuality]
$creadListPrec :: ReadPrec [ModelQuality]
readPrec :: ReadPrec ModelQuality
$creadPrec :: ReadPrec ModelQuality
readList :: ReadS [ModelQuality]
$creadList :: ReadS [ModelQuality]
readsPrec :: Int -> ReadS ModelQuality
$creadsPrec :: Int -> ReadS ModelQuality
Prelude.Read, Int -> ModelQuality -> ShowS
[ModelQuality] -> ShowS
ModelQuality -> String
(Int -> ModelQuality -> ShowS)
-> (ModelQuality -> String)
-> ([ModelQuality] -> ShowS)
-> Show ModelQuality
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ModelQuality] -> ShowS
$cshowList :: [ModelQuality] -> ShowS
show :: ModelQuality -> String
$cshow :: ModelQuality -> String
showsPrec :: Int -> ModelQuality -> ShowS
$cshowsPrec :: Int -> ModelQuality -> ShowS
Prelude.Show, (forall x. ModelQuality -> Rep ModelQuality x)
-> (forall x. Rep ModelQuality x -> ModelQuality)
-> Generic ModelQuality
forall x. Rep ModelQuality x -> ModelQuality
forall x. ModelQuality -> Rep ModelQuality x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ModelQuality x -> ModelQuality
$cfrom :: forall x. ModelQuality -> Rep ModelQuality x
Prelude.Generic)
newModelQuality ::
ModelQuality
newModelQuality :: ModelQuality
newModelQuality =
ModelQuality' :: Maybe MetricsSource -> Maybe MetricsSource -> ModelQuality
ModelQuality'
{ $sel:constraints:ModelQuality' :: Maybe MetricsSource
constraints = Maybe MetricsSource
forall a. Maybe a
Prelude.Nothing,
$sel:statistics:ModelQuality' :: Maybe MetricsSource
statistics = Maybe MetricsSource
forall a. Maybe a
Prelude.Nothing
}
modelQuality_constraints :: Lens.Lens' ModelQuality (Prelude.Maybe MetricsSource)
modelQuality_constraints :: (Maybe MetricsSource -> f (Maybe MetricsSource))
-> ModelQuality -> f ModelQuality
modelQuality_constraints = (ModelQuality -> Maybe MetricsSource)
-> (ModelQuality -> Maybe MetricsSource -> ModelQuality)
-> Lens
ModelQuality
ModelQuality
(Maybe MetricsSource)
(Maybe MetricsSource)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ModelQuality' {Maybe MetricsSource
constraints :: Maybe MetricsSource
$sel:constraints:ModelQuality' :: ModelQuality -> Maybe MetricsSource
constraints} -> Maybe MetricsSource
constraints) (\s :: ModelQuality
s@ModelQuality' {} Maybe MetricsSource
a -> ModelQuality
s {$sel:constraints:ModelQuality' :: Maybe MetricsSource
constraints = Maybe MetricsSource
a} :: ModelQuality)
modelQuality_statistics :: Lens.Lens' ModelQuality (Prelude.Maybe MetricsSource)
modelQuality_statistics :: (Maybe MetricsSource -> f (Maybe MetricsSource))
-> ModelQuality -> f ModelQuality
modelQuality_statistics = (ModelQuality -> Maybe MetricsSource)
-> (ModelQuality -> Maybe MetricsSource -> ModelQuality)
-> Lens
ModelQuality
ModelQuality
(Maybe MetricsSource)
(Maybe MetricsSource)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ModelQuality' {Maybe MetricsSource
statistics :: Maybe MetricsSource
$sel:statistics:ModelQuality' :: ModelQuality -> Maybe MetricsSource
statistics} -> Maybe MetricsSource
statistics) (\s :: ModelQuality
s@ModelQuality' {} Maybe MetricsSource
a -> ModelQuality
s {$sel:statistics:ModelQuality' :: Maybe MetricsSource
statistics = Maybe MetricsSource
a} :: ModelQuality)
instance Core.FromJSON ModelQuality where
parseJSON :: Value -> Parser ModelQuality
parseJSON =
String
-> (Object -> Parser ModelQuality) -> Value -> Parser ModelQuality
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
String
"ModelQuality"
( \Object
x ->
Maybe MetricsSource -> Maybe MetricsSource -> ModelQuality
ModelQuality'
(Maybe MetricsSource -> Maybe MetricsSource -> ModelQuality)
-> Parser (Maybe MetricsSource)
-> Parser (Maybe MetricsSource -> ModelQuality)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Parser (Maybe MetricsSource)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"Constraints")
Parser (Maybe MetricsSource -> ModelQuality)
-> Parser (Maybe MetricsSource) -> Parser ModelQuality
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe MetricsSource)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"Statistics")
)
instance Prelude.Hashable ModelQuality
instance Prelude.NFData ModelQuality
instance Core.ToJSON ModelQuality where
toJSON :: ModelQuality -> Value
toJSON ModelQuality' {Maybe MetricsSource
statistics :: Maybe MetricsSource
constraints :: Maybe MetricsSource
$sel:statistics:ModelQuality' :: ModelQuality -> Maybe MetricsSource
$sel:constraints:ModelQuality' :: ModelQuality -> Maybe MetricsSource
..} =
[Pair] -> Value
Core.object
( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ (Text
"Constraints" Text -> MetricsSource -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (MetricsSource -> Pair) -> Maybe MetricsSource -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe MetricsSource
constraints,
(Text
"Statistics" Text -> MetricsSource -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (MetricsSource -> Pair) -> Maybe MetricsSource -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe MetricsSource
statistics
]
)