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