{-# 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 #-}

-- Derived from AWS service descriptions, licensed under Apache 2.0.

-- |
-- Module      : Amazonka.CloudWatchEvents.Types.SageMakerPipelineParameters
-- Copyright   : (c) 2013-2021 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay <brendan.g.hay+amazonka@gmail.com>
-- Stability   : auto-generated
-- Portability : non-portable (GHC extensions)
module Amazonka.CloudWatchEvents.Types.SageMakerPipelineParameters where

import Amazonka.CloudWatchEvents.Types.SageMakerPipelineParameter
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude

-- | These are custom parameters to use when the target is a SageMaker Model
-- Building Pipeline that starts based on EventBridge events.
--
-- /See:/ 'newSageMakerPipelineParameters' smart constructor.
data SageMakerPipelineParameters = SageMakerPipelineParameters'
  { -- | List of Parameter names and values for SageMaker Model Building Pipeline
    -- execution.
    SageMakerPipelineParameters -> Maybe [SageMakerPipelineParameter]
pipelineParameterList :: Prelude.Maybe [SageMakerPipelineParameter]
  }
  deriving (SageMakerPipelineParameters -> SageMakerPipelineParameters -> Bool
(SageMakerPipelineParameters
 -> SageMakerPipelineParameters -> Bool)
-> (SageMakerPipelineParameters
    -> SageMakerPipelineParameters -> Bool)
-> Eq SageMakerPipelineParameters
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: SageMakerPipelineParameters -> SageMakerPipelineParameters -> Bool
$c/= :: SageMakerPipelineParameters -> SageMakerPipelineParameters -> Bool
== :: SageMakerPipelineParameters -> SageMakerPipelineParameters -> Bool
$c== :: SageMakerPipelineParameters -> SageMakerPipelineParameters -> Bool
Prelude.Eq, ReadPrec [SageMakerPipelineParameters]
ReadPrec SageMakerPipelineParameters
Int -> ReadS SageMakerPipelineParameters
ReadS [SageMakerPipelineParameters]
(Int -> ReadS SageMakerPipelineParameters)
-> ReadS [SageMakerPipelineParameters]
-> ReadPrec SageMakerPipelineParameters
-> ReadPrec [SageMakerPipelineParameters]
-> Read SageMakerPipelineParameters
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [SageMakerPipelineParameters]
$creadListPrec :: ReadPrec [SageMakerPipelineParameters]
readPrec :: ReadPrec SageMakerPipelineParameters
$creadPrec :: ReadPrec SageMakerPipelineParameters
readList :: ReadS [SageMakerPipelineParameters]
$creadList :: ReadS [SageMakerPipelineParameters]
readsPrec :: Int -> ReadS SageMakerPipelineParameters
$creadsPrec :: Int -> ReadS SageMakerPipelineParameters
Prelude.Read, Int -> SageMakerPipelineParameters -> ShowS
[SageMakerPipelineParameters] -> ShowS
SageMakerPipelineParameters -> String
(Int -> SageMakerPipelineParameters -> ShowS)
-> (SageMakerPipelineParameters -> String)
-> ([SageMakerPipelineParameters] -> ShowS)
-> Show SageMakerPipelineParameters
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [SageMakerPipelineParameters] -> ShowS
$cshowList :: [SageMakerPipelineParameters] -> ShowS
show :: SageMakerPipelineParameters -> String
$cshow :: SageMakerPipelineParameters -> String
showsPrec :: Int -> SageMakerPipelineParameters -> ShowS
$cshowsPrec :: Int -> SageMakerPipelineParameters -> ShowS
Prelude.Show, (forall x.
 SageMakerPipelineParameters -> Rep SageMakerPipelineParameters x)
-> (forall x.
    Rep SageMakerPipelineParameters x -> SageMakerPipelineParameters)
-> Generic SageMakerPipelineParameters
forall x.
Rep SageMakerPipelineParameters x -> SageMakerPipelineParameters
forall x.
SageMakerPipelineParameters -> Rep SageMakerPipelineParameters x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep SageMakerPipelineParameters x -> SageMakerPipelineParameters
$cfrom :: forall x.
SageMakerPipelineParameters -> Rep SageMakerPipelineParameters x
Prelude.Generic)

-- |
-- Create a value of 'SageMakerPipelineParameters' with all optional fields omitted.
--
-- Use <https://hackage.haskell.org/package/generic-lens generic-lens> or <https://hackage.haskell.org/package/optics optics> to modify other optional fields.
--
-- The following record fields are available, with the corresponding lenses provided
-- for backwards compatibility:
--
-- 'pipelineParameterList', 'sageMakerPipelineParameters_pipelineParameterList' - List of Parameter names and values for SageMaker Model Building Pipeline
-- execution.
newSageMakerPipelineParameters ::
  SageMakerPipelineParameters
newSageMakerPipelineParameters :: SageMakerPipelineParameters
newSageMakerPipelineParameters =
  SageMakerPipelineParameters' :: Maybe [SageMakerPipelineParameter] -> SageMakerPipelineParameters
SageMakerPipelineParameters'
    { $sel:pipelineParameterList:SageMakerPipelineParameters' :: Maybe [SageMakerPipelineParameter]
pipelineParameterList =
        Maybe [SageMakerPipelineParameter]
forall a. Maybe a
Prelude.Nothing
    }

-- | List of Parameter names and values for SageMaker Model Building Pipeline
-- execution.
sageMakerPipelineParameters_pipelineParameterList :: Lens.Lens' SageMakerPipelineParameters (Prelude.Maybe [SageMakerPipelineParameter])
sageMakerPipelineParameters_pipelineParameterList :: (Maybe [SageMakerPipelineParameter]
 -> f (Maybe [SageMakerPipelineParameter]))
-> SageMakerPipelineParameters -> f SageMakerPipelineParameters
sageMakerPipelineParameters_pipelineParameterList = (SageMakerPipelineParameters -> Maybe [SageMakerPipelineParameter])
-> (SageMakerPipelineParameters
    -> Maybe [SageMakerPipelineParameter]
    -> SageMakerPipelineParameters)
-> Lens
     SageMakerPipelineParameters
     SageMakerPipelineParameters
     (Maybe [SageMakerPipelineParameter])
     (Maybe [SageMakerPipelineParameter])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SageMakerPipelineParameters' {Maybe [SageMakerPipelineParameter]
pipelineParameterList :: Maybe [SageMakerPipelineParameter]
$sel:pipelineParameterList:SageMakerPipelineParameters' :: SageMakerPipelineParameters -> Maybe [SageMakerPipelineParameter]
pipelineParameterList} -> Maybe [SageMakerPipelineParameter]
pipelineParameterList) (\s :: SageMakerPipelineParameters
s@SageMakerPipelineParameters' {} Maybe [SageMakerPipelineParameter]
a -> SageMakerPipelineParameters
s {$sel:pipelineParameterList:SageMakerPipelineParameters' :: Maybe [SageMakerPipelineParameter]
pipelineParameterList = Maybe [SageMakerPipelineParameter]
a} :: SageMakerPipelineParameters) ((Maybe [SageMakerPipelineParameter]
  -> f (Maybe [SageMakerPipelineParameter]))
 -> SageMakerPipelineParameters -> f SageMakerPipelineParameters)
-> ((Maybe [SageMakerPipelineParameter]
     -> f (Maybe [SageMakerPipelineParameter]))
    -> Maybe [SageMakerPipelineParameter]
    -> f (Maybe [SageMakerPipelineParameter]))
-> (Maybe [SageMakerPipelineParameter]
    -> f (Maybe [SageMakerPipelineParameter]))
-> SageMakerPipelineParameters
-> f SageMakerPipelineParameters
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
  [SageMakerPipelineParameter]
  [SageMakerPipelineParameter]
  [SageMakerPipelineParameter]
  [SageMakerPipelineParameter]
-> Iso
     (Maybe [SageMakerPipelineParameter])
     (Maybe [SageMakerPipelineParameter])
     (Maybe [SageMakerPipelineParameter])
     (Maybe [SageMakerPipelineParameter])
forall (f :: * -> *) (g :: * -> *) s t a b.
(Functor f, Functor g) =>
AnIso s t a b -> Iso (f s) (g t) (f a) (g b)
Lens.mapping AnIso
  [SageMakerPipelineParameter]
  [SageMakerPipelineParameter]
  [SageMakerPipelineParameter]
  [SageMakerPipelineParameter]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

instance Core.FromJSON SageMakerPipelineParameters where
  parseJSON :: Value -> Parser SageMakerPipelineParameters
parseJSON =
    String
-> (Object -> Parser SageMakerPipelineParameters)
-> Value
-> Parser SageMakerPipelineParameters
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
      String
"SageMakerPipelineParameters"
      ( \Object
x ->
          Maybe [SageMakerPipelineParameter] -> SageMakerPipelineParameters
SageMakerPipelineParameters'
            (Maybe [SageMakerPipelineParameter] -> SageMakerPipelineParameters)
-> Parser (Maybe [SageMakerPipelineParameter])
-> Parser SageMakerPipelineParameters
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> ( Object
x Object
-> Text -> Parser (Maybe (Maybe [SageMakerPipelineParameter]))
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"PipelineParameterList"
                            Parser (Maybe (Maybe [SageMakerPipelineParameter]))
-> Maybe [SageMakerPipelineParameter]
-> Parser (Maybe [SageMakerPipelineParameter])
forall a. Parser (Maybe a) -> a -> Parser a
Core..!= Maybe [SageMakerPipelineParameter]
forall a. Monoid a => a
Prelude.mempty
                        )
      )

instance Prelude.Hashable SageMakerPipelineParameters

instance Prelude.NFData SageMakerPipelineParameters

instance Core.ToJSON SageMakerPipelineParameters where
  toJSON :: SageMakerPipelineParameters -> Value
toJSON SageMakerPipelineParameters' {Maybe [SageMakerPipelineParameter]
pipelineParameterList :: Maybe [SageMakerPipelineParameter]
$sel:pipelineParameterList:SageMakerPipelineParameters' :: SageMakerPipelineParameters -> Maybe [SageMakerPipelineParameter]
..} =
    [Pair] -> Value
Core.object
      ( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ (Text
"PipelineParameterList" Text -> [SageMakerPipelineParameter] -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
              ([SageMakerPipelineParameter] -> Pair)
-> Maybe [SageMakerPipelineParameter] -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe [SageMakerPipelineParameter]
pipelineParameterList
          ]
      )