{-# 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.SourceAlgorithmSpecification where
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
import Amazonka.SageMaker.Types.SourceAlgorithm
data SourceAlgorithmSpecification = SourceAlgorithmSpecification'
{
SourceAlgorithmSpecification -> NonEmpty SourceAlgorithm
sourceAlgorithms :: Prelude.NonEmpty SourceAlgorithm
}
deriving (SourceAlgorithmSpecification
-> SourceAlgorithmSpecification -> Bool
(SourceAlgorithmSpecification
-> SourceAlgorithmSpecification -> Bool)
-> (SourceAlgorithmSpecification
-> SourceAlgorithmSpecification -> Bool)
-> Eq SourceAlgorithmSpecification
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: SourceAlgorithmSpecification
-> SourceAlgorithmSpecification -> Bool
$c/= :: SourceAlgorithmSpecification
-> SourceAlgorithmSpecification -> Bool
== :: SourceAlgorithmSpecification
-> SourceAlgorithmSpecification -> Bool
$c== :: SourceAlgorithmSpecification
-> SourceAlgorithmSpecification -> Bool
Prelude.Eq, ReadPrec [SourceAlgorithmSpecification]
ReadPrec SourceAlgorithmSpecification
Int -> ReadS SourceAlgorithmSpecification
ReadS [SourceAlgorithmSpecification]
(Int -> ReadS SourceAlgorithmSpecification)
-> ReadS [SourceAlgorithmSpecification]
-> ReadPrec SourceAlgorithmSpecification
-> ReadPrec [SourceAlgorithmSpecification]
-> Read SourceAlgorithmSpecification
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [SourceAlgorithmSpecification]
$creadListPrec :: ReadPrec [SourceAlgorithmSpecification]
readPrec :: ReadPrec SourceAlgorithmSpecification
$creadPrec :: ReadPrec SourceAlgorithmSpecification
readList :: ReadS [SourceAlgorithmSpecification]
$creadList :: ReadS [SourceAlgorithmSpecification]
readsPrec :: Int -> ReadS SourceAlgorithmSpecification
$creadsPrec :: Int -> ReadS SourceAlgorithmSpecification
Prelude.Read, Int -> SourceAlgorithmSpecification -> ShowS
[SourceAlgorithmSpecification] -> ShowS
SourceAlgorithmSpecification -> String
(Int -> SourceAlgorithmSpecification -> ShowS)
-> (SourceAlgorithmSpecification -> String)
-> ([SourceAlgorithmSpecification] -> ShowS)
-> Show SourceAlgorithmSpecification
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [SourceAlgorithmSpecification] -> ShowS
$cshowList :: [SourceAlgorithmSpecification] -> ShowS
show :: SourceAlgorithmSpecification -> String
$cshow :: SourceAlgorithmSpecification -> String
showsPrec :: Int -> SourceAlgorithmSpecification -> ShowS
$cshowsPrec :: Int -> SourceAlgorithmSpecification -> ShowS
Prelude.Show, (forall x.
SourceAlgorithmSpecification -> Rep SourceAlgorithmSpecification x)
-> (forall x.
Rep SourceAlgorithmSpecification x -> SourceAlgorithmSpecification)
-> Generic SourceAlgorithmSpecification
forall x.
Rep SourceAlgorithmSpecification x -> SourceAlgorithmSpecification
forall x.
SourceAlgorithmSpecification -> Rep SourceAlgorithmSpecification x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep SourceAlgorithmSpecification x -> SourceAlgorithmSpecification
$cfrom :: forall x.
SourceAlgorithmSpecification -> Rep SourceAlgorithmSpecification x
Prelude.Generic)
newSourceAlgorithmSpecification ::
Prelude.NonEmpty SourceAlgorithm ->
SourceAlgorithmSpecification
newSourceAlgorithmSpecification :: NonEmpty SourceAlgorithm -> SourceAlgorithmSpecification
newSourceAlgorithmSpecification NonEmpty SourceAlgorithm
pSourceAlgorithms_ =
SourceAlgorithmSpecification' :: NonEmpty SourceAlgorithm -> SourceAlgorithmSpecification
SourceAlgorithmSpecification'
{ $sel:sourceAlgorithms:SourceAlgorithmSpecification' :: NonEmpty SourceAlgorithm
sourceAlgorithms =
Tagged
(NonEmpty SourceAlgorithm) (Identity (NonEmpty SourceAlgorithm))
-> Tagged
(NonEmpty SourceAlgorithm) (Identity (NonEmpty SourceAlgorithm))
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced (Tagged
(NonEmpty SourceAlgorithm) (Identity (NonEmpty SourceAlgorithm))
-> Tagged
(NonEmpty SourceAlgorithm) (Identity (NonEmpty SourceAlgorithm)))
-> NonEmpty SourceAlgorithm -> NonEmpty SourceAlgorithm
forall t b. AReview t b -> b -> t
Lens.# NonEmpty SourceAlgorithm
pSourceAlgorithms_
}
sourceAlgorithmSpecification_sourceAlgorithms :: Lens.Lens' SourceAlgorithmSpecification (Prelude.NonEmpty SourceAlgorithm)
sourceAlgorithmSpecification_sourceAlgorithms :: (NonEmpty SourceAlgorithm -> f (NonEmpty SourceAlgorithm))
-> SourceAlgorithmSpecification -> f SourceAlgorithmSpecification
sourceAlgorithmSpecification_sourceAlgorithms = (SourceAlgorithmSpecification -> NonEmpty SourceAlgorithm)
-> (SourceAlgorithmSpecification
-> NonEmpty SourceAlgorithm -> SourceAlgorithmSpecification)
-> Lens
SourceAlgorithmSpecification
SourceAlgorithmSpecification
(NonEmpty SourceAlgorithm)
(NonEmpty SourceAlgorithm)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SourceAlgorithmSpecification' {NonEmpty SourceAlgorithm
sourceAlgorithms :: NonEmpty SourceAlgorithm
$sel:sourceAlgorithms:SourceAlgorithmSpecification' :: SourceAlgorithmSpecification -> NonEmpty SourceAlgorithm
sourceAlgorithms} -> NonEmpty SourceAlgorithm
sourceAlgorithms) (\s :: SourceAlgorithmSpecification
s@SourceAlgorithmSpecification' {} NonEmpty SourceAlgorithm
a -> SourceAlgorithmSpecification
s {$sel:sourceAlgorithms:SourceAlgorithmSpecification' :: NonEmpty SourceAlgorithm
sourceAlgorithms = NonEmpty SourceAlgorithm
a} :: SourceAlgorithmSpecification) ((NonEmpty SourceAlgorithm -> f (NonEmpty SourceAlgorithm))
-> SourceAlgorithmSpecification -> f SourceAlgorithmSpecification)
-> ((NonEmpty SourceAlgorithm -> f (NonEmpty SourceAlgorithm))
-> NonEmpty SourceAlgorithm -> f (NonEmpty SourceAlgorithm))
-> (NonEmpty SourceAlgorithm -> f (NonEmpty SourceAlgorithm))
-> SourceAlgorithmSpecification
-> f SourceAlgorithmSpecification
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. (NonEmpty SourceAlgorithm -> f (NonEmpty SourceAlgorithm))
-> NonEmpty SourceAlgorithm -> f (NonEmpty SourceAlgorithm)
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced
instance Core.FromJSON SourceAlgorithmSpecification where
parseJSON :: Value -> Parser SourceAlgorithmSpecification
parseJSON =
String
-> (Object -> Parser SourceAlgorithmSpecification)
-> Value
-> Parser SourceAlgorithmSpecification
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
String
"SourceAlgorithmSpecification"
( \Object
x ->
NonEmpty SourceAlgorithm -> SourceAlgorithmSpecification
SourceAlgorithmSpecification'
(NonEmpty SourceAlgorithm -> SourceAlgorithmSpecification)
-> Parser (NonEmpty SourceAlgorithm)
-> Parser SourceAlgorithmSpecification
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Parser (NonEmpty SourceAlgorithm)
forall a. FromJSON a => Object -> Text -> Parser a
Core..: Text
"SourceAlgorithms")
)
instance
Prelude.Hashable
SourceAlgorithmSpecification
instance Prelude.NFData SourceAlgorithmSpecification
instance Core.ToJSON SourceAlgorithmSpecification where
toJSON :: SourceAlgorithmSpecification -> Value
toJSON SourceAlgorithmSpecification' {NonEmpty SourceAlgorithm
sourceAlgorithms :: NonEmpty SourceAlgorithm
$sel:sourceAlgorithms:SourceAlgorithmSpecification' :: SourceAlgorithmSpecification -> NonEmpty SourceAlgorithm
..} =
[Pair] -> Value
Core.object
( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just
(Text
"SourceAlgorithms" Text -> NonEmpty SourceAlgorithm -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= NonEmpty SourceAlgorithm
sourceAlgorithms)
]
)