{-# 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.MetricsSource where
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
data MetricsSource = MetricsSource'
{ MetricsSource -> Maybe Text
contentDigest :: Prelude.Maybe Prelude.Text,
MetricsSource -> Text
contentType :: Prelude.Text,
MetricsSource -> Text
s3Uri :: Prelude.Text
}
deriving (MetricsSource -> MetricsSource -> Bool
(MetricsSource -> MetricsSource -> Bool)
-> (MetricsSource -> MetricsSource -> Bool) -> Eq MetricsSource
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: MetricsSource -> MetricsSource -> Bool
$c/= :: MetricsSource -> MetricsSource -> Bool
== :: MetricsSource -> MetricsSource -> Bool
$c== :: MetricsSource -> MetricsSource -> Bool
Prelude.Eq, ReadPrec [MetricsSource]
ReadPrec MetricsSource
Int -> ReadS MetricsSource
ReadS [MetricsSource]
(Int -> ReadS MetricsSource)
-> ReadS [MetricsSource]
-> ReadPrec MetricsSource
-> ReadPrec [MetricsSource]
-> Read MetricsSource
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [MetricsSource]
$creadListPrec :: ReadPrec [MetricsSource]
readPrec :: ReadPrec MetricsSource
$creadPrec :: ReadPrec MetricsSource
readList :: ReadS [MetricsSource]
$creadList :: ReadS [MetricsSource]
readsPrec :: Int -> ReadS MetricsSource
$creadsPrec :: Int -> ReadS MetricsSource
Prelude.Read, Int -> MetricsSource -> ShowS
[MetricsSource] -> ShowS
MetricsSource -> String
(Int -> MetricsSource -> ShowS)
-> (MetricsSource -> String)
-> ([MetricsSource] -> ShowS)
-> Show MetricsSource
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [MetricsSource] -> ShowS
$cshowList :: [MetricsSource] -> ShowS
show :: MetricsSource -> String
$cshow :: MetricsSource -> String
showsPrec :: Int -> MetricsSource -> ShowS
$cshowsPrec :: Int -> MetricsSource -> ShowS
Prelude.Show, (forall x. MetricsSource -> Rep MetricsSource x)
-> (forall x. Rep MetricsSource x -> MetricsSource)
-> Generic MetricsSource
forall x. Rep MetricsSource x -> MetricsSource
forall x. MetricsSource -> Rep MetricsSource x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep MetricsSource x -> MetricsSource
$cfrom :: forall x. MetricsSource -> Rep MetricsSource x
Prelude.Generic)
newMetricsSource ::
Prelude.Text ->
Prelude.Text ->
MetricsSource
newMetricsSource :: Text -> Text -> MetricsSource
newMetricsSource Text
pContentType_ Text
pS3Uri_ =
MetricsSource' :: Maybe Text -> Text -> Text -> MetricsSource
MetricsSource'
{ $sel:contentDigest:MetricsSource' :: Maybe Text
contentDigest = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:contentType:MetricsSource' :: Text
contentType = Text
pContentType_,
$sel:s3Uri:MetricsSource' :: Text
s3Uri = Text
pS3Uri_
}
metricsSource_contentDigest :: Lens.Lens' MetricsSource (Prelude.Maybe Prelude.Text)
metricsSource_contentDigest :: (Maybe Text -> f (Maybe Text)) -> MetricsSource -> f MetricsSource
metricsSource_contentDigest = (MetricsSource -> Maybe Text)
-> (MetricsSource -> Maybe Text -> MetricsSource)
-> Lens MetricsSource MetricsSource (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\MetricsSource' {Maybe Text
contentDigest :: Maybe Text
$sel:contentDigest:MetricsSource' :: MetricsSource -> Maybe Text
contentDigest} -> Maybe Text
contentDigest) (\s :: MetricsSource
s@MetricsSource' {} Maybe Text
a -> MetricsSource
s {$sel:contentDigest:MetricsSource' :: Maybe Text
contentDigest = Maybe Text
a} :: MetricsSource)
metricsSource_contentType :: Lens.Lens' MetricsSource Prelude.Text
metricsSource_contentType :: (Text -> f Text) -> MetricsSource -> f MetricsSource
metricsSource_contentType = (MetricsSource -> Text)
-> (MetricsSource -> Text -> MetricsSource)
-> Lens MetricsSource MetricsSource Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\MetricsSource' {Text
contentType :: Text
$sel:contentType:MetricsSource' :: MetricsSource -> Text
contentType} -> Text
contentType) (\s :: MetricsSource
s@MetricsSource' {} Text
a -> MetricsSource
s {$sel:contentType:MetricsSource' :: Text
contentType = Text
a} :: MetricsSource)
metricsSource_s3Uri :: Lens.Lens' MetricsSource Prelude.Text
metricsSource_s3Uri :: (Text -> f Text) -> MetricsSource -> f MetricsSource
metricsSource_s3Uri = (MetricsSource -> Text)
-> (MetricsSource -> Text -> MetricsSource)
-> Lens MetricsSource MetricsSource Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\MetricsSource' {Text
s3Uri :: Text
$sel:s3Uri:MetricsSource' :: MetricsSource -> Text
s3Uri} -> Text
s3Uri) (\s :: MetricsSource
s@MetricsSource' {} Text
a -> MetricsSource
s {$sel:s3Uri:MetricsSource' :: Text
s3Uri = Text
a} :: MetricsSource)
instance Core.FromJSON MetricsSource where
parseJSON :: Value -> Parser MetricsSource
parseJSON =
String
-> (Object -> Parser MetricsSource)
-> Value
-> Parser MetricsSource
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
String
"MetricsSource"
( \Object
x ->
Maybe Text -> Text -> Text -> MetricsSource
MetricsSource'
(Maybe Text -> Text -> Text -> MetricsSource)
-> Parser (Maybe Text) -> Parser (Text -> Text -> MetricsSource)
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
"ContentDigest")
Parser (Text -> Text -> MetricsSource)
-> Parser Text -> Parser (Text -> MetricsSource)
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
"ContentType")
Parser (Text -> MetricsSource)
-> Parser Text -> Parser MetricsSource
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
"S3Uri")
)
instance Prelude.Hashable MetricsSource
instance Prelude.NFData MetricsSource
instance Core.ToJSON MetricsSource where
toJSON :: MetricsSource -> Value
toJSON MetricsSource' {Maybe Text
Text
s3Uri :: Text
contentType :: Text
contentDigest :: Maybe Text
$sel:s3Uri:MetricsSource' :: MetricsSource -> Text
$sel:contentType:MetricsSource' :: MetricsSource -> Text
$sel:contentDigest:MetricsSource' :: MetricsSource -> Maybe Text
..} =
[Pair] -> Value
Core.object
( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ (Text
"ContentDigest" 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
contentDigest,
Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"ContentType" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
contentType),
Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"S3Uri" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
s3Uri)
]
)