{-# 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.SageMakerEdge.Types.Definition 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.SageMakerEdge.Types.Checksum
import Amazonka.SageMakerEdge.Types.ModelState
data Definition = Definition'
{
Definition -> Maybe Checksum
checksum :: Prelude.Maybe Checksum,
Definition -> Maybe Text
modelHandle :: Prelude.Maybe Prelude.Text,
Definition -> Maybe Text
s3Url :: Prelude.Maybe Prelude.Text,
Definition -> Maybe ModelState
state :: Prelude.Maybe ModelState
}
deriving (Definition -> Definition -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: Definition -> Definition -> Bool
$c/= :: Definition -> Definition -> Bool
== :: Definition -> Definition -> Bool
$c== :: Definition -> Definition -> Bool
Prelude.Eq, ReadPrec [Definition]
ReadPrec Definition
Int -> ReadS Definition
ReadS [Definition]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [Definition]
$creadListPrec :: ReadPrec [Definition]
readPrec :: ReadPrec Definition
$creadPrec :: ReadPrec Definition
readList :: ReadS [Definition]
$creadList :: ReadS [Definition]
readsPrec :: Int -> ReadS Definition
$creadsPrec :: Int -> ReadS Definition
Prelude.Read, Int -> Definition -> ShowS
[Definition] -> ShowS
Definition -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [Definition] -> ShowS
$cshowList :: [Definition] -> ShowS
show :: Definition -> String
$cshow :: Definition -> String
showsPrec :: Int -> Definition -> ShowS
$cshowsPrec :: Int -> Definition -> ShowS
Prelude.Show, forall x. Rep Definition x -> Definition
forall x. Definition -> Rep Definition x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep Definition x -> Definition
$cfrom :: forall x. Definition -> Rep Definition x
Prelude.Generic)
newDefinition ::
Definition
newDefinition :: Definition
newDefinition =
Definition'
{ $sel:checksum:Definition' :: Maybe Checksum
checksum = forall a. Maybe a
Prelude.Nothing,
$sel:modelHandle:Definition' :: Maybe Text
modelHandle = forall a. Maybe a
Prelude.Nothing,
$sel:s3Url:Definition' :: Maybe Text
s3Url = forall a. Maybe a
Prelude.Nothing,
$sel:state:Definition' :: Maybe ModelState
state = forall a. Maybe a
Prelude.Nothing
}
definition_checksum :: Lens.Lens' Definition (Prelude.Maybe Checksum)
definition_checksum :: Lens' Definition (Maybe Checksum)
definition_checksum = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Definition' {Maybe Checksum
checksum :: Maybe Checksum
$sel:checksum:Definition' :: Definition -> Maybe Checksum
checksum} -> Maybe Checksum
checksum) (\s :: Definition
s@Definition' {} Maybe Checksum
a -> Definition
s {$sel:checksum:Definition' :: Maybe Checksum
checksum = Maybe Checksum
a} :: Definition)
definition_modelHandle :: Lens.Lens' Definition (Prelude.Maybe Prelude.Text)
definition_modelHandle :: Lens' Definition (Maybe Text)
definition_modelHandle = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Definition' {Maybe Text
modelHandle :: Maybe Text
$sel:modelHandle:Definition' :: Definition -> Maybe Text
modelHandle} -> Maybe Text
modelHandle) (\s :: Definition
s@Definition' {} Maybe Text
a -> Definition
s {$sel:modelHandle:Definition' :: Maybe Text
modelHandle = Maybe Text
a} :: Definition)
definition_s3Url :: Lens.Lens' Definition (Prelude.Maybe Prelude.Text)
definition_s3Url :: Lens' Definition (Maybe Text)
definition_s3Url = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Definition' {Maybe Text
s3Url :: Maybe Text
$sel:s3Url:Definition' :: Definition -> Maybe Text
s3Url} -> Maybe Text
s3Url) (\s :: Definition
s@Definition' {} Maybe Text
a -> Definition
s {$sel:s3Url:Definition' :: Maybe Text
s3Url = Maybe Text
a} :: Definition)
definition_state :: Lens.Lens' Definition (Prelude.Maybe ModelState)
definition_state :: Lens' Definition (Maybe ModelState)
definition_state = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Definition' {Maybe ModelState
state :: Maybe ModelState
$sel:state:Definition' :: Definition -> Maybe ModelState
state} -> Maybe ModelState
state) (\s :: Definition
s@Definition' {} Maybe ModelState
a -> Definition
s {$sel:state:Definition' :: Maybe ModelState
state = Maybe ModelState
a} :: Definition)
instance Data.FromJSON Definition where
parseJSON :: Value -> Parser Definition
parseJSON =
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
String
"Definition"
( \Object
x ->
Maybe Checksum
-> Maybe Text -> Maybe Text -> Maybe ModelState -> Definition
Definition'
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
"Checksum")
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
"ModelHandle")
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
"S3Url")
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
"State")
)
instance Prelude.Hashable Definition where
hashWithSalt :: Int -> Definition -> Int
hashWithSalt Int
_salt Definition' {Maybe Text
Maybe Checksum
Maybe ModelState
state :: Maybe ModelState
s3Url :: Maybe Text
modelHandle :: Maybe Text
checksum :: Maybe Checksum
$sel:state:Definition' :: Definition -> Maybe ModelState
$sel:s3Url:Definition' :: Definition -> Maybe Text
$sel:modelHandle:Definition' :: Definition -> Maybe Text
$sel:checksum:Definition' :: Definition -> Maybe Checksum
..} =
Int
_salt
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Checksum
checksum
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
modelHandle
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
s3Url
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe ModelState
state
instance Prelude.NFData Definition where
rnf :: Definition -> ()
rnf Definition' {Maybe Text
Maybe Checksum
Maybe ModelState
state :: Maybe ModelState
s3Url :: Maybe Text
modelHandle :: Maybe Text
checksum :: Maybe Checksum
$sel:state:Definition' :: Definition -> Maybe ModelState
$sel:s3Url:Definition' :: Definition -> Maybe Text
$sel:modelHandle:Definition' :: Definition -> Maybe Text
$sel:checksum:Definition' :: Definition -> Maybe Checksum
..} =
forall a. NFData a => a -> ()
Prelude.rnf Maybe Checksum
checksum
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
modelHandle
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
s3Url
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe ModelState
state