{-# 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.SageMaker.Types.DebugRuleConfiguration
-- 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.SageMaker.Types.DebugRuleConfiguration where

import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
import Amazonka.SageMaker.Types.ProcessingInstanceType

-- | Configuration information for SageMaker Debugger rules for debugging. To
-- learn more about how to configure the @DebugRuleConfiguration@
-- parameter, see
-- <https://docs.aws.amazon.com/sagemaker/latest/dg/debugger-createtrainingjob-api.html Use the SageMaker and Debugger Configuration API Operations to Create, Update, and Debug Your Training Job>.
--
-- /See:/ 'newDebugRuleConfiguration' smart constructor.
data DebugRuleConfiguration = DebugRuleConfiguration'
  { -- | Runtime configuration for rule container.
    DebugRuleConfiguration -> Maybe (HashMap Text Text)
ruleParameters :: Prelude.Maybe (Prelude.HashMap Prelude.Text Prelude.Text),
    -- | Path to Amazon S3 storage location for rules.
    DebugRuleConfiguration -> Maybe Text
s3OutputPath :: Prelude.Maybe Prelude.Text,
    -- | Path to local storage location for output of rules. Defaults to
    -- @\/opt\/ml\/processing\/output\/rule\/@.
    DebugRuleConfiguration -> Maybe Text
localPath :: Prelude.Maybe Prelude.Text,
    -- | The instance type to deploy a Debugger custom rule for debugging a
    -- training job.
    DebugRuleConfiguration -> Maybe ProcessingInstanceType
instanceType :: Prelude.Maybe ProcessingInstanceType,
    -- | The size, in GB, of the ML storage volume attached to the processing
    -- instance.
    DebugRuleConfiguration -> Maybe Natural
volumeSizeInGB :: Prelude.Maybe Prelude.Natural,
    -- | The name of the rule configuration. It must be unique relative to other
    -- rule configuration names.
    DebugRuleConfiguration -> Text
ruleConfigurationName :: Prelude.Text,
    -- | The Amazon Elastic Container (ECR) Image for the managed rule
    -- evaluation.
    DebugRuleConfiguration -> Text
ruleEvaluatorImage :: Prelude.Text
  }
  deriving (DebugRuleConfiguration -> DebugRuleConfiguration -> Bool
(DebugRuleConfiguration -> DebugRuleConfiguration -> Bool)
-> (DebugRuleConfiguration -> DebugRuleConfiguration -> Bool)
-> Eq DebugRuleConfiguration
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DebugRuleConfiguration -> DebugRuleConfiguration -> Bool
$c/= :: DebugRuleConfiguration -> DebugRuleConfiguration -> Bool
== :: DebugRuleConfiguration -> DebugRuleConfiguration -> Bool
$c== :: DebugRuleConfiguration -> DebugRuleConfiguration -> Bool
Prelude.Eq, ReadPrec [DebugRuleConfiguration]
ReadPrec DebugRuleConfiguration
Int -> ReadS DebugRuleConfiguration
ReadS [DebugRuleConfiguration]
(Int -> ReadS DebugRuleConfiguration)
-> ReadS [DebugRuleConfiguration]
-> ReadPrec DebugRuleConfiguration
-> ReadPrec [DebugRuleConfiguration]
-> Read DebugRuleConfiguration
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DebugRuleConfiguration]
$creadListPrec :: ReadPrec [DebugRuleConfiguration]
readPrec :: ReadPrec DebugRuleConfiguration
$creadPrec :: ReadPrec DebugRuleConfiguration
readList :: ReadS [DebugRuleConfiguration]
$creadList :: ReadS [DebugRuleConfiguration]
readsPrec :: Int -> ReadS DebugRuleConfiguration
$creadsPrec :: Int -> ReadS DebugRuleConfiguration
Prelude.Read, Int -> DebugRuleConfiguration -> ShowS
[DebugRuleConfiguration] -> ShowS
DebugRuleConfiguration -> String
(Int -> DebugRuleConfiguration -> ShowS)
-> (DebugRuleConfiguration -> String)
-> ([DebugRuleConfiguration] -> ShowS)
-> Show DebugRuleConfiguration
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DebugRuleConfiguration] -> ShowS
$cshowList :: [DebugRuleConfiguration] -> ShowS
show :: DebugRuleConfiguration -> String
$cshow :: DebugRuleConfiguration -> String
showsPrec :: Int -> DebugRuleConfiguration -> ShowS
$cshowsPrec :: Int -> DebugRuleConfiguration -> ShowS
Prelude.Show, (forall x. DebugRuleConfiguration -> Rep DebugRuleConfiguration x)
-> (forall x.
    Rep DebugRuleConfiguration x -> DebugRuleConfiguration)
-> Generic DebugRuleConfiguration
forall x. Rep DebugRuleConfiguration x -> DebugRuleConfiguration
forall x. DebugRuleConfiguration -> Rep DebugRuleConfiguration x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep DebugRuleConfiguration x -> DebugRuleConfiguration
$cfrom :: forall x. DebugRuleConfiguration -> Rep DebugRuleConfiguration x
Prelude.Generic)

-- |
-- Create a value of 'DebugRuleConfiguration' 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:
--
-- 'ruleParameters', 'debugRuleConfiguration_ruleParameters' - Runtime configuration for rule container.
--
-- 's3OutputPath', 'debugRuleConfiguration_s3OutputPath' - Path to Amazon S3 storage location for rules.
--
-- 'localPath', 'debugRuleConfiguration_localPath' - Path to local storage location for output of rules. Defaults to
-- @\/opt\/ml\/processing\/output\/rule\/@.
--
-- 'instanceType', 'debugRuleConfiguration_instanceType' - The instance type to deploy a Debugger custom rule for debugging a
-- training job.
--
-- 'volumeSizeInGB', 'debugRuleConfiguration_volumeSizeInGB' - The size, in GB, of the ML storage volume attached to the processing
-- instance.
--
-- 'ruleConfigurationName', 'debugRuleConfiguration_ruleConfigurationName' - The name of the rule configuration. It must be unique relative to other
-- rule configuration names.
--
-- 'ruleEvaluatorImage', 'debugRuleConfiguration_ruleEvaluatorImage' - The Amazon Elastic Container (ECR) Image for the managed rule
-- evaluation.
newDebugRuleConfiguration ::
  -- | 'ruleConfigurationName'
  Prelude.Text ->
  -- | 'ruleEvaluatorImage'
  Prelude.Text ->
  DebugRuleConfiguration
newDebugRuleConfiguration :: Text -> Text -> DebugRuleConfiguration
newDebugRuleConfiguration
  Text
pRuleConfigurationName_
  Text
pRuleEvaluatorImage_ =
    DebugRuleConfiguration' :: Maybe (HashMap Text Text)
-> Maybe Text
-> Maybe Text
-> Maybe ProcessingInstanceType
-> Maybe Natural
-> Text
-> Text
-> DebugRuleConfiguration
DebugRuleConfiguration'
      { $sel:ruleParameters:DebugRuleConfiguration' :: Maybe (HashMap Text Text)
ruleParameters =
          Maybe (HashMap Text Text)
forall a. Maybe a
Prelude.Nothing,
        $sel:s3OutputPath:DebugRuleConfiguration' :: Maybe Text
s3OutputPath = Maybe Text
forall a. Maybe a
Prelude.Nothing,
        $sel:localPath:DebugRuleConfiguration' :: Maybe Text
localPath = Maybe Text
forall a. Maybe a
Prelude.Nothing,
        $sel:instanceType:DebugRuleConfiguration' :: Maybe ProcessingInstanceType
instanceType = Maybe ProcessingInstanceType
forall a. Maybe a
Prelude.Nothing,
        $sel:volumeSizeInGB:DebugRuleConfiguration' :: Maybe Natural
volumeSizeInGB = Maybe Natural
forall a. Maybe a
Prelude.Nothing,
        $sel:ruleConfigurationName:DebugRuleConfiguration' :: Text
ruleConfigurationName = Text
pRuleConfigurationName_,
        $sel:ruleEvaluatorImage:DebugRuleConfiguration' :: Text
ruleEvaluatorImage = Text
pRuleEvaluatorImage_
      }

-- | Runtime configuration for rule container.
debugRuleConfiguration_ruleParameters :: Lens.Lens' DebugRuleConfiguration (Prelude.Maybe (Prelude.HashMap Prelude.Text Prelude.Text))
debugRuleConfiguration_ruleParameters :: (Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
-> DebugRuleConfiguration -> f DebugRuleConfiguration
debugRuleConfiguration_ruleParameters = (DebugRuleConfiguration -> Maybe (HashMap Text Text))
-> (DebugRuleConfiguration
    -> Maybe (HashMap Text Text) -> DebugRuleConfiguration)
-> Lens
     DebugRuleConfiguration
     DebugRuleConfiguration
     (Maybe (HashMap Text Text))
     (Maybe (HashMap Text Text))
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DebugRuleConfiguration' {Maybe (HashMap Text Text)
ruleParameters :: Maybe (HashMap Text Text)
$sel:ruleParameters:DebugRuleConfiguration' :: DebugRuleConfiguration -> Maybe (HashMap Text Text)
ruleParameters} -> Maybe (HashMap Text Text)
ruleParameters) (\s :: DebugRuleConfiguration
s@DebugRuleConfiguration' {} Maybe (HashMap Text Text)
a -> DebugRuleConfiguration
s {$sel:ruleParameters:DebugRuleConfiguration' :: Maybe (HashMap Text Text)
ruleParameters = Maybe (HashMap Text Text)
a} :: DebugRuleConfiguration) ((Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
 -> DebugRuleConfiguration -> f DebugRuleConfiguration)
-> ((Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
    -> Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
-> (Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
-> DebugRuleConfiguration
-> f DebugRuleConfiguration
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
  (HashMap Text Text)
  (HashMap Text Text)
  (HashMap Text Text)
  (HashMap Text Text)
-> Iso
     (Maybe (HashMap Text Text))
     (Maybe (HashMap Text Text))
     (Maybe (HashMap Text Text))
     (Maybe (HashMap Text Text))
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
  (HashMap Text Text)
  (HashMap Text Text)
  (HashMap Text Text)
  (HashMap Text Text)
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | Path to Amazon S3 storage location for rules.
debugRuleConfiguration_s3OutputPath :: Lens.Lens' DebugRuleConfiguration (Prelude.Maybe Prelude.Text)
debugRuleConfiguration_s3OutputPath :: (Maybe Text -> f (Maybe Text))
-> DebugRuleConfiguration -> f DebugRuleConfiguration
debugRuleConfiguration_s3OutputPath = (DebugRuleConfiguration -> Maybe Text)
-> (DebugRuleConfiguration -> Maybe Text -> DebugRuleConfiguration)
-> Lens
     DebugRuleConfiguration
     DebugRuleConfiguration
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DebugRuleConfiguration' {Maybe Text
s3OutputPath :: Maybe Text
$sel:s3OutputPath:DebugRuleConfiguration' :: DebugRuleConfiguration -> Maybe Text
s3OutputPath} -> Maybe Text
s3OutputPath) (\s :: DebugRuleConfiguration
s@DebugRuleConfiguration' {} Maybe Text
a -> DebugRuleConfiguration
s {$sel:s3OutputPath:DebugRuleConfiguration' :: Maybe Text
s3OutputPath = Maybe Text
a} :: DebugRuleConfiguration)

-- | Path to local storage location for output of rules. Defaults to
-- @\/opt\/ml\/processing\/output\/rule\/@.
debugRuleConfiguration_localPath :: Lens.Lens' DebugRuleConfiguration (Prelude.Maybe Prelude.Text)
debugRuleConfiguration_localPath :: (Maybe Text -> f (Maybe Text))
-> DebugRuleConfiguration -> f DebugRuleConfiguration
debugRuleConfiguration_localPath = (DebugRuleConfiguration -> Maybe Text)
-> (DebugRuleConfiguration -> Maybe Text -> DebugRuleConfiguration)
-> Lens
     DebugRuleConfiguration
     DebugRuleConfiguration
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DebugRuleConfiguration' {Maybe Text
localPath :: Maybe Text
$sel:localPath:DebugRuleConfiguration' :: DebugRuleConfiguration -> Maybe Text
localPath} -> Maybe Text
localPath) (\s :: DebugRuleConfiguration
s@DebugRuleConfiguration' {} Maybe Text
a -> DebugRuleConfiguration
s {$sel:localPath:DebugRuleConfiguration' :: Maybe Text
localPath = Maybe Text
a} :: DebugRuleConfiguration)

-- | The instance type to deploy a Debugger custom rule for debugging a
-- training job.
debugRuleConfiguration_instanceType :: Lens.Lens' DebugRuleConfiguration (Prelude.Maybe ProcessingInstanceType)
debugRuleConfiguration_instanceType :: (Maybe ProcessingInstanceType -> f (Maybe ProcessingInstanceType))
-> DebugRuleConfiguration -> f DebugRuleConfiguration
debugRuleConfiguration_instanceType = (DebugRuleConfiguration -> Maybe ProcessingInstanceType)
-> (DebugRuleConfiguration
    -> Maybe ProcessingInstanceType -> DebugRuleConfiguration)
-> Lens
     DebugRuleConfiguration
     DebugRuleConfiguration
     (Maybe ProcessingInstanceType)
     (Maybe ProcessingInstanceType)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DebugRuleConfiguration' {Maybe ProcessingInstanceType
instanceType :: Maybe ProcessingInstanceType
$sel:instanceType:DebugRuleConfiguration' :: DebugRuleConfiguration -> Maybe ProcessingInstanceType
instanceType} -> Maybe ProcessingInstanceType
instanceType) (\s :: DebugRuleConfiguration
s@DebugRuleConfiguration' {} Maybe ProcessingInstanceType
a -> DebugRuleConfiguration
s {$sel:instanceType:DebugRuleConfiguration' :: Maybe ProcessingInstanceType
instanceType = Maybe ProcessingInstanceType
a} :: DebugRuleConfiguration)

-- | The size, in GB, of the ML storage volume attached to the processing
-- instance.
debugRuleConfiguration_volumeSizeInGB :: Lens.Lens' DebugRuleConfiguration (Prelude.Maybe Prelude.Natural)
debugRuleConfiguration_volumeSizeInGB :: (Maybe Natural -> f (Maybe Natural))
-> DebugRuleConfiguration -> f DebugRuleConfiguration
debugRuleConfiguration_volumeSizeInGB = (DebugRuleConfiguration -> Maybe Natural)
-> (DebugRuleConfiguration
    -> Maybe Natural -> DebugRuleConfiguration)
-> Lens
     DebugRuleConfiguration
     DebugRuleConfiguration
     (Maybe Natural)
     (Maybe Natural)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DebugRuleConfiguration' {Maybe Natural
volumeSizeInGB :: Maybe Natural
$sel:volumeSizeInGB:DebugRuleConfiguration' :: DebugRuleConfiguration -> Maybe Natural
volumeSizeInGB} -> Maybe Natural
volumeSizeInGB) (\s :: DebugRuleConfiguration
s@DebugRuleConfiguration' {} Maybe Natural
a -> DebugRuleConfiguration
s {$sel:volumeSizeInGB:DebugRuleConfiguration' :: Maybe Natural
volumeSizeInGB = Maybe Natural
a} :: DebugRuleConfiguration)

-- | The name of the rule configuration. It must be unique relative to other
-- rule configuration names.
debugRuleConfiguration_ruleConfigurationName :: Lens.Lens' DebugRuleConfiguration Prelude.Text
debugRuleConfiguration_ruleConfigurationName :: (Text -> f Text)
-> DebugRuleConfiguration -> f DebugRuleConfiguration
debugRuleConfiguration_ruleConfigurationName = (DebugRuleConfiguration -> Text)
-> (DebugRuleConfiguration -> Text -> DebugRuleConfiguration)
-> Lens DebugRuleConfiguration DebugRuleConfiguration Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DebugRuleConfiguration' {Text
ruleConfigurationName :: Text
$sel:ruleConfigurationName:DebugRuleConfiguration' :: DebugRuleConfiguration -> Text
ruleConfigurationName} -> Text
ruleConfigurationName) (\s :: DebugRuleConfiguration
s@DebugRuleConfiguration' {} Text
a -> DebugRuleConfiguration
s {$sel:ruleConfigurationName:DebugRuleConfiguration' :: Text
ruleConfigurationName = Text
a} :: DebugRuleConfiguration)

-- | The Amazon Elastic Container (ECR) Image for the managed rule
-- evaluation.
debugRuleConfiguration_ruleEvaluatorImage :: Lens.Lens' DebugRuleConfiguration Prelude.Text
debugRuleConfiguration_ruleEvaluatorImage :: (Text -> f Text)
-> DebugRuleConfiguration -> f DebugRuleConfiguration
debugRuleConfiguration_ruleEvaluatorImage = (DebugRuleConfiguration -> Text)
-> (DebugRuleConfiguration -> Text -> DebugRuleConfiguration)
-> Lens DebugRuleConfiguration DebugRuleConfiguration Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DebugRuleConfiguration' {Text
ruleEvaluatorImage :: Text
$sel:ruleEvaluatorImage:DebugRuleConfiguration' :: DebugRuleConfiguration -> Text
ruleEvaluatorImage} -> Text
ruleEvaluatorImage) (\s :: DebugRuleConfiguration
s@DebugRuleConfiguration' {} Text
a -> DebugRuleConfiguration
s {$sel:ruleEvaluatorImage:DebugRuleConfiguration' :: Text
ruleEvaluatorImage = Text
a} :: DebugRuleConfiguration)

instance Core.FromJSON DebugRuleConfiguration where
  parseJSON :: Value -> Parser DebugRuleConfiguration
parseJSON =
    String
-> (Object -> Parser DebugRuleConfiguration)
-> Value
-> Parser DebugRuleConfiguration
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
      String
"DebugRuleConfiguration"
      ( \Object
x ->
          Maybe (HashMap Text Text)
-> Maybe Text
-> Maybe Text
-> Maybe ProcessingInstanceType
-> Maybe Natural
-> Text
-> Text
-> DebugRuleConfiguration
DebugRuleConfiguration'
            (Maybe (HashMap Text Text)
 -> Maybe Text
 -> Maybe Text
 -> Maybe ProcessingInstanceType
 -> Maybe Natural
 -> Text
 -> Text
 -> DebugRuleConfiguration)
-> Parser (Maybe (HashMap Text Text))
-> Parser
     (Maybe Text
      -> Maybe Text
      -> Maybe ProcessingInstanceType
      -> Maybe Natural
      -> Text
      -> Text
      -> DebugRuleConfiguration)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Parser (Maybe (Maybe (HashMap Text Text)))
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"RuleParameters" Parser (Maybe (Maybe (HashMap Text Text)))
-> Maybe (HashMap Text Text) -> Parser (Maybe (HashMap Text Text))
forall a. Parser (Maybe a) -> a -> Parser a
Core..!= Maybe (HashMap Text Text)
forall a. Monoid a => a
Prelude.mempty)
            Parser
  (Maybe Text
   -> Maybe Text
   -> Maybe ProcessingInstanceType
   -> Maybe Natural
   -> Text
   -> Text
   -> DebugRuleConfiguration)
-> Parser (Maybe Text)
-> Parser
     (Maybe Text
      -> Maybe ProcessingInstanceType
      -> Maybe Natural
      -> Text
      -> Text
      -> DebugRuleConfiguration)
forall (f :: * -> *) a b. Applicative f => 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
"S3OutputPath")
            Parser
  (Maybe Text
   -> Maybe ProcessingInstanceType
   -> Maybe Natural
   -> Text
   -> Text
   -> DebugRuleConfiguration)
-> Parser (Maybe Text)
-> Parser
     (Maybe ProcessingInstanceType
      -> Maybe Natural -> Text -> Text -> DebugRuleConfiguration)
forall (f :: * -> *) a b. Applicative f => 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
"LocalPath")
            Parser
  (Maybe ProcessingInstanceType
   -> Maybe Natural -> Text -> Text -> DebugRuleConfiguration)
-> Parser (Maybe ProcessingInstanceType)
-> Parser (Maybe Natural -> Text -> Text -> DebugRuleConfiguration)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe ProcessingInstanceType)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"InstanceType")
            Parser (Maybe Natural -> Text -> Text -> DebugRuleConfiguration)
-> Parser (Maybe Natural)
-> Parser (Text -> Text -> DebugRuleConfiguration)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Natural)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"VolumeSizeInGB")
            Parser (Text -> Text -> DebugRuleConfiguration)
-> Parser Text -> Parser (Text -> DebugRuleConfiguration)
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
"RuleConfigurationName")
            Parser (Text -> DebugRuleConfiguration)
-> Parser Text -> Parser DebugRuleConfiguration
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
"RuleEvaluatorImage")
      )

instance Prelude.Hashable DebugRuleConfiguration

instance Prelude.NFData DebugRuleConfiguration

instance Core.ToJSON DebugRuleConfiguration where
  toJSON :: DebugRuleConfiguration -> Value
toJSON DebugRuleConfiguration' {Maybe Natural
Maybe Text
Maybe (HashMap Text Text)
Maybe ProcessingInstanceType
Text
ruleEvaluatorImage :: Text
ruleConfigurationName :: Text
volumeSizeInGB :: Maybe Natural
instanceType :: Maybe ProcessingInstanceType
localPath :: Maybe Text
s3OutputPath :: Maybe Text
ruleParameters :: Maybe (HashMap Text Text)
$sel:ruleEvaluatorImage:DebugRuleConfiguration' :: DebugRuleConfiguration -> Text
$sel:ruleConfigurationName:DebugRuleConfiguration' :: DebugRuleConfiguration -> Text
$sel:volumeSizeInGB:DebugRuleConfiguration' :: DebugRuleConfiguration -> Maybe Natural
$sel:instanceType:DebugRuleConfiguration' :: DebugRuleConfiguration -> Maybe ProcessingInstanceType
$sel:localPath:DebugRuleConfiguration' :: DebugRuleConfiguration -> Maybe Text
$sel:s3OutputPath:DebugRuleConfiguration' :: DebugRuleConfiguration -> Maybe Text
$sel:ruleParameters:DebugRuleConfiguration' :: DebugRuleConfiguration -> Maybe (HashMap Text Text)
..} =
    [Pair] -> Value
Core.object
      ( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ (Text
"RuleParameters" Text -> HashMap Text Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
              (HashMap Text Text -> Pair)
-> Maybe (HashMap Text Text) -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe (HashMap Text Text)
ruleParameters,
            (Text
"S3OutputPath" 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
s3OutputPath,
            (Text
"LocalPath" 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
localPath,
            (Text
"InstanceType" Text -> ProcessingInstanceType -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (ProcessingInstanceType -> Pair)
-> Maybe ProcessingInstanceType -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe ProcessingInstanceType
instanceType,
            (Text
"VolumeSizeInGB" Text -> Natural -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
              (Natural -> Pair) -> Maybe Natural -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Natural
volumeSizeInGB,
            Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just
              ( Text
"RuleConfigurationName"
                  Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
ruleConfigurationName
              ),
            Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just
              (Text
"RuleEvaluatorImage" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
ruleEvaluatorImage)
          ]
      )