{-# 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.DataQualityAppSpecification
-- 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.DataQualityAppSpecification where

import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude

-- | Information about the container that a data quality monitoring job runs.
--
-- /See:/ 'newDataQualityAppSpecification' smart constructor.
data DataQualityAppSpecification = DataQualityAppSpecification'
  { -- | The arguments to send to the container that the monitoring job runs.
    DataQualityAppSpecification -> Maybe (NonEmpty Text)
containerArguments :: Prelude.Maybe (Prelude.NonEmpty Prelude.Text),
    -- | An Amazon S3 URI to a script that is called per row prior to running
    -- analysis. It can base64 decode the payload and convert it into a flatted
    -- json so that the built-in container can use the converted data.
    -- Applicable only for the built-in (first party) containers.
    DataQualityAppSpecification -> Maybe Text
recordPreprocessorSourceUri :: Prelude.Maybe Prelude.Text,
    -- | Sets the environment variables in the container that the monitoring job
    -- runs.
    DataQualityAppSpecification -> Maybe (HashMap Text Text)
environment :: Prelude.Maybe (Prelude.HashMap Prelude.Text Prelude.Text),
    -- | The entrypoint for a container used to run a monitoring job.
    DataQualityAppSpecification -> Maybe (NonEmpty Text)
containerEntrypoint :: Prelude.Maybe (Prelude.NonEmpty Prelude.Text),
    -- | An Amazon S3 URI to a script that is called after analysis has been
    -- performed. Applicable only for the built-in (first party) containers.
    DataQualityAppSpecification -> Maybe Text
postAnalyticsProcessorSourceUri :: Prelude.Maybe Prelude.Text,
    -- | The container image that the data quality monitoring job runs.
    DataQualityAppSpecification -> Text
imageUri :: Prelude.Text
  }
  deriving (DataQualityAppSpecification -> DataQualityAppSpecification -> Bool
(DataQualityAppSpecification
 -> DataQualityAppSpecification -> Bool)
-> (DataQualityAppSpecification
    -> DataQualityAppSpecification -> Bool)
-> Eq DataQualityAppSpecification
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DataQualityAppSpecification -> DataQualityAppSpecification -> Bool
$c/= :: DataQualityAppSpecification -> DataQualityAppSpecification -> Bool
== :: DataQualityAppSpecification -> DataQualityAppSpecification -> Bool
$c== :: DataQualityAppSpecification -> DataQualityAppSpecification -> Bool
Prelude.Eq, ReadPrec [DataQualityAppSpecification]
ReadPrec DataQualityAppSpecification
Int -> ReadS DataQualityAppSpecification
ReadS [DataQualityAppSpecification]
(Int -> ReadS DataQualityAppSpecification)
-> ReadS [DataQualityAppSpecification]
-> ReadPrec DataQualityAppSpecification
-> ReadPrec [DataQualityAppSpecification]
-> Read DataQualityAppSpecification
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DataQualityAppSpecification]
$creadListPrec :: ReadPrec [DataQualityAppSpecification]
readPrec :: ReadPrec DataQualityAppSpecification
$creadPrec :: ReadPrec DataQualityAppSpecification
readList :: ReadS [DataQualityAppSpecification]
$creadList :: ReadS [DataQualityAppSpecification]
readsPrec :: Int -> ReadS DataQualityAppSpecification
$creadsPrec :: Int -> ReadS DataQualityAppSpecification
Prelude.Read, Int -> DataQualityAppSpecification -> ShowS
[DataQualityAppSpecification] -> ShowS
DataQualityAppSpecification -> String
(Int -> DataQualityAppSpecification -> ShowS)
-> (DataQualityAppSpecification -> String)
-> ([DataQualityAppSpecification] -> ShowS)
-> Show DataQualityAppSpecification
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DataQualityAppSpecification] -> ShowS
$cshowList :: [DataQualityAppSpecification] -> ShowS
show :: DataQualityAppSpecification -> String
$cshow :: DataQualityAppSpecification -> String
showsPrec :: Int -> DataQualityAppSpecification -> ShowS
$cshowsPrec :: Int -> DataQualityAppSpecification -> ShowS
Prelude.Show, (forall x.
 DataQualityAppSpecification -> Rep DataQualityAppSpecification x)
-> (forall x.
    Rep DataQualityAppSpecification x -> DataQualityAppSpecification)
-> Generic DataQualityAppSpecification
forall x.
Rep DataQualityAppSpecification x -> DataQualityAppSpecification
forall x.
DataQualityAppSpecification -> Rep DataQualityAppSpecification x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep DataQualityAppSpecification x -> DataQualityAppSpecification
$cfrom :: forall x.
DataQualityAppSpecification -> Rep DataQualityAppSpecification x
Prelude.Generic)

-- |
-- Create a value of 'DataQualityAppSpecification' 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:
--
-- 'containerArguments', 'dataQualityAppSpecification_containerArguments' - The arguments to send to the container that the monitoring job runs.
--
-- 'recordPreprocessorSourceUri', 'dataQualityAppSpecification_recordPreprocessorSourceUri' - An Amazon S3 URI to a script that is called per row prior to running
-- analysis. It can base64 decode the payload and convert it into a flatted
-- json so that the built-in container can use the converted data.
-- Applicable only for the built-in (first party) containers.
--
-- 'environment', 'dataQualityAppSpecification_environment' - Sets the environment variables in the container that the monitoring job
-- runs.
--
-- 'containerEntrypoint', 'dataQualityAppSpecification_containerEntrypoint' - The entrypoint for a container used to run a monitoring job.
--
-- 'postAnalyticsProcessorSourceUri', 'dataQualityAppSpecification_postAnalyticsProcessorSourceUri' - An Amazon S3 URI to a script that is called after analysis has been
-- performed. Applicable only for the built-in (first party) containers.
--
-- 'imageUri', 'dataQualityAppSpecification_imageUri' - The container image that the data quality monitoring job runs.
newDataQualityAppSpecification ::
  -- | 'imageUri'
  Prelude.Text ->
  DataQualityAppSpecification
newDataQualityAppSpecification :: Text -> DataQualityAppSpecification
newDataQualityAppSpecification Text
pImageUri_ =
  DataQualityAppSpecification' :: Maybe (NonEmpty Text)
-> Maybe Text
-> Maybe (HashMap Text Text)
-> Maybe (NonEmpty Text)
-> Maybe Text
-> Text
-> DataQualityAppSpecification
DataQualityAppSpecification'
    { $sel:containerArguments:DataQualityAppSpecification' :: Maybe (NonEmpty Text)
containerArguments =
        Maybe (NonEmpty Text)
forall a. Maybe a
Prelude.Nothing,
      $sel:recordPreprocessorSourceUri:DataQualityAppSpecification' :: Maybe Text
recordPreprocessorSourceUri = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:environment:DataQualityAppSpecification' :: Maybe (HashMap Text Text)
environment = Maybe (HashMap Text Text)
forall a. Maybe a
Prelude.Nothing,
      $sel:containerEntrypoint:DataQualityAppSpecification' :: Maybe (NonEmpty Text)
containerEntrypoint = Maybe (NonEmpty Text)
forall a. Maybe a
Prelude.Nothing,
      $sel:postAnalyticsProcessorSourceUri:DataQualityAppSpecification' :: Maybe Text
postAnalyticsProcessorSourceUri =
        Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:imageUri:DataQualityAppSpecification' :: Text
imageUri = Text
pImageUri_
    }

-- | The arguments to send to the container that the monitoring job runs.
dataQualityAppSpecification_containerArguments :: Lens.Lens' DataQualityAppSpecification (Prelude.Maybe (Prelude.NonEmpty Prelude.Text))
dataQualityAppSpecification_containerArguments :: (Maybe (NonEmpty Text) -> f (Maybe (NonEmpty Text)))
-> DataQualityAppSpecification -> f DataQualityAppSpecification
dataQualityAppSpecification_containerArguments = (DataQualityAppSpecification -> Maybe (NonEmpty Text))
-> (DataQualityAppSpecification
    -> Maybe (NonEmpty Text) -> DataQualityAppSpecification)
-> Lens
     DataQualityAppSpecification
     DataQualityAppSpecification
     (Maybe (NonEmpty Text))
     (Maybe (NonEmpty Text))
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DataQualityAppSpecification' {Maybe (NonEmpty Text)
containerArguments :: Maybe (NonEmpty Text)
$sel:containerArguments:DataQualityAppSpecification' :: DataQualityAppSpecification -> Maybe (NonEmpty Text)
containerArguments} -> Maybe (NonEmpty Text)
containerArguments) (\s :: DataQualityAppSpecification
s@DataQualityAppSpecification' {} Maybe (NonEmpty Text)
a -> DataQualityAppSpecification
s {$sel:containerArguments:DataQualityAppSpecification' :: Maybe (NonEmpty Text)
containerArguments = Maybe (NonEmpty Text)
a} :: DataQualityAppSpecification) ((Maybe (NonEmpty Text) -> f (Maybe (NonEmpty Text)))
 -> DataQualityAppSpecification -> f DataQualityAppSpecification)
-> ((Maybe (NonEmpty Text) -> f (Maybe (NonEmpty Text)))
    -> Maybe (NonEmpty Text) -> f (Maybe (NonEmpty Text)))
-> (Maybe (NonEmpty Text) -> f (Maybe (NonEmpty Text)))
-> DataQualityAppSpecification
-> f DataQualityAppSpecification
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
  (NonEmpty Text) (NonEmpty Text) (NonEmpty Text) (NonEmpty Text)
-> Iso
     (Maybe (NonEmpty Text))
     (Maybe (NonEmpty Text))
     (Maybe (NonEmpty Text))
     (Maybe (NonEmpty 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
  (NonEmpty Text) (NonEmpty Text) (NonEmpty Text) (NonEmpty Text)
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | An Amazon S3 URI to a script that is called per row prior to running
-- analysis. It can base64 decode the payload and convert it into a flatted
-- json so that the built-in container can use the converted data.
-- Applicable only for the built-in (first party) containers.
dataQualityAppSpecification_recordPreprocessorSourceUri :: Lens.Lens' DataQualityAppSpecification (Prelude.Maybe Prelude.Text)
dataQualityAppSpecification_recordPreprocessorSourceUri :: (Maybe Text -> f (Maybe Text))
-> DataQualityAppSpecification -> f DataQualityAppSpecification
dataQualityAppSpecification_recordPreprocessorSourceUri = (DataQualityAppSpecification -> Maybe Text)
-> (DataQualityAppSpecification
    -> Maybe Text -> DataQualityAppSpecification)
-> Lens
     DataQualityAppSpecification
     DataQualityAppSpecification
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DataQualityAppSpecification' {Maybe Text
recordPreprocessorSourceUri :: Maybe Text
$sel:recordPreprocessorSourceUri:DataQualityAppSpecification' :: DataQualityAppSpecification -> Maybe Text
recordPreprocessorSourceUri} -> Maybe Text
recordPreprocessorSourceUri) (\s :: DataQualityAppSpecification
s@DataQualityAppSpecification' {} Maybe Text
a -> DataQualityAppSpecification
s {$sel:recordPreprocessorSourceUri:DataQualityAppSpecification' :: Maybe Text
recordPreprocessorSourceUri = Maybe Text
a} :: DataQualityAppSpecification)

-- | Sets the environment variables in the container that the monitoring job
-- runs.
dataQualityAppSpecification_environment :: Lens.Lens' DataQualityAppSpecification (Prelude.Maybe (Prelude.HashMap Prelude.Text Prelude.Text))
dataQualityAppSpecification_environment :: (Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
-> DataQualityAppSpecification -> f DataQualityAppSpecification
dataQualityAppSpecification_environment = (DataQualityAppSpecification -> Maybe (HashMap Text Text))
-> (DataQualityAppSpecification
    -> Maybe (HashMap Text Text) -> DataQualityAppSpecification)
-> Lens
     DataQualityAppSpecification
     DataQualityAppSpecification
     (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 (\DataQualityAppSpecification' {Maybe (HashMap Text Text)
environment :: Maybe (HashMap Text Text)
$sel:environment:DataQualityAppSpecification' :: DataQualityAppSpecification -> Maybe (HashMap Text Text)
environment} -> Maybe (HashMap Text Text)
environment) (\s :: DataQualityAppSpecification
s@DataQualityAppSpecification' {} Maybe (HashMap Text Text)
a -> DataQualityAppSpecification
s {$sel:environment:DataQualityAppSpecification' :: Maybe (HashMap Text Text)
environment = Maybe (HashMap Text Text)
a} :: DataQualityAppSpecification) ((Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
 -> DataQualityAppSpecification -> f DataQualityAppSpecification)
-> ((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)))
-> DataQualityAppSpecification
-> f DataQualityAppSpecification
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

-- | The entrypoint for a container used to run a monitoring job.
dataQualityAppSpecification_containerEntrypoint :: Lens.Lens' DataQualityAppSpecification (Prelude.Maybe (Prelude.NonEmpty Prelude.Text))
dataQualityAppSpecification_containerEntrypoint :: (Maybe (NonEmpty Text) -> f (Maybe (NonEmpty Text)))
-> DataQualityAppSpecification -> f DataQualityAppSpecification
dataQualityAppSpecification_containerEntrypoint = (DataQualityAppSpecification -> Maybe (NonEmpty Text))
-> (DataQualityAppSpecification
    -> Maybe (NonEmpty Text) -> DataQualityAppSpecification)
-> Lens
     DataQualityAppSpecification
     DataQualityAppSpecification
     (Maybe (NonEmpty Text))
     (Maybe (NonEmpty Text))
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DataQualityAppSpecification' {Maybe (NonEmpty Text)
containerEntrypoint :: Maybe (NonEmpty Text)
$sel:containerEntrypoint:DataQualityAppSpecification' :: DataQualityAppSpecification -> Maybe (NonEmpty Text)
containerEntrypoint} -> Maybe (NonEmpty Text)
containerEntrypoint) (\s :: DataQualityAppSpecification
s@DataQualityAppSpecification' {} Maybe (NonEmpty Text)
a -> DataQualityAppSpecification
s {$sel:containerEntrypoint:DataQualityAppSpecification' :: Maybe (NonEmpty Text)
containerEntrypoint = Maybe (NonEmpty Text)
a} :: DataQualityAppSpecification) ((Maybe (NonEmpty Text) -> f (Maybe (NonEmpty Text)))
 -> DataQualityAppSpecification -> f DataQualityAppSpecification)
-> ((Maybe (NonEmpty Text) -> f (Maybe (NonEmpty Text)))
    -> Maybe (NonEmpty Text) -> f (Maybe (NonEmpty Text)))
-> (Maybe (NonEmpty Text) -> f (Maybe (NonEmpty Text)))
-> DataQualityAppSpecification
-> f DataQualityAppSpecification
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
  (NonEmpty Text) (NonEmpty Text) (NonEmpty Text) (NonEmpty Text)
-> Iso
     (Maybe (NonEmpty Text))
     (Maybe (NonEmpty Text))
     (Maybe (NonEmpty Text))
     (Maybe (NonEmpty 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
  (NonEmpty Text) (NonEmpty Text) (NonEmpty Text) (NonEmpty Text)
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | An Amazon S3 URI to a script that is called after analysis has been
-- performed. Applicable only for the built-in (first party) containers.
dataQualityAppSpecification_postAnalyticsProcessorSourceUri :: Lens.Lens' DataQualityAppSpecification (Prelude.Maybe Prelude.Text)
dataQualityAppSpecification_postAnalyticsProcessorSourceUri :: (Maybe Text -> f (Maybe Text))
-> DataQualityAppSpecification -> f DataQualityAppSpecification
dataQualityAppSpecification_postAnalyticsProcessorSourceUri = (DataQualityAppSpecification -> Maybe Text)
-> (DataQualityAppSpecification
    -> Maybe Text -> DataQualityAppSpecification)
-> Lens
     DataQualityAppSpecification
     DataQualityAppSpecification
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DataQualityAppSpecification' {Maybe Text
postAnalyticsProcessorSourceUri :: Maybe Text
$sel:postAnalyticsProcessorSourceUri:DataQualityAppSpecification' :: DataQualityAppSpecification -> Maybe Text
postAnalyticsProcessorSourceUri} -> Maybe Text
postAnalyticsProcessorSourceUri) (\s :: DataQualityAppSpecification
s@DataQualityAppSpecification' {} Maybe Text
a -> DataQualityAppSpecification
s {$sel:postAnalyticsProcessorSourceUri:DataQualityAppSpecification' :: Maybe Text
postAnalyticsProcessorSourceUri = Maybe Text
a} :: DataQualityAppSpecification)

-- | The container image that the data quality monitoring job runs.
dataQualityAppSpecification_imageUri :: Lens.Lens' DataQualityAppSpecification Prelude.Text
dataQualityAppSpecification_imageUri :: (Text -> f Text)
-> DataQualityAppSpecification -> f DataQualityAppSpecification
dataQualityAppSpecification_imageUri = (DataQualityAppSpecification -> Text)
-> (DataQualityAppSpecification
    -> Text -> DataQualityAppSpecification)
-> Lens
     DataQualityAppSpecification DataQualityAppSpecification Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DataQualityAppSpecification' {Text
imageUri :: Text
$sel:imageUri:DataQualityAppSpecification' :: DataQualityAppSpecification -> Text
imageUri} -> Text
imageUri) (\s :: DataQualityAppSpecification
s@DataQualityAppSpecification' {} Text
a -> DataQualityAppSpecification
s {$sel:imageUri:DataQualityAppSpecification' :: Text
imageUri = Text
a} :: DataQualityAppSpecification)

instance Core.FromJSON DataQualityAppSpecification where
  parseJSON :: Value -> Parser DataQualityAppSpecification
parseJSON =
    String
-> (Object -> Parser DataQualityAppSpecification)
-> Value
-> Parser DataQualityAppSpecification
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
      String
"DataQualityAppSpecification"
      ( \Object
x ->
          Maybe (NonEmpty Text)
-> Maybe Text
-> Maybe (HashMap Text Text)
-> Maybe (NonEmpty Text)
-> Maybe Text
-> Text
-> DataQualityAppSpecification
DataQualityAppSpecification'
            (Maybe (NonEmpty Text)
 -> Maybe Text
 -> Maybe (HashMap Text Text)
 -> Maybe (NonEmpty Text)
 -> Maybe Text
 -> Text
 -> DataQualityAppSpecification)
-> Parser (Maybe (NonEmpty Text))
-> Parser
     (Maybe Text
      -> Maybe (HashMap Text Text)
      -> Maybe (NonEmpty Text)
      -> Maybe Text
      -> Text
      -> DataQualityAppSpecification)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Parser (Maybe (NonEmpty Text))
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"ContainerArguments")
            Parser
  (Maybe Text
   -> Maybe (HashMap Text Text)
   -> Maybe (NonEmpty Text)
   -> Maybe Text
   -> Text
   -> DataQualityAppSpecification)
-> Parser (Maybe Text)
-> Parser
     (Maybe (HashMap Text Text)
      -> Maybe (NonEmpty Text)
      -> Maybe Text
      -> Text
      -> DataQualityAppSpecification)
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
"RecordPreprocessorSourceUri")
            Parser
  (Maybe (HashMap Text Text)
   -> Maybe (NonEmpty Text)
   -> Maybe Text
   -> Text
   -> DataQualityAppSpecification)
-> Parser (Maybe (HashMap Text Text))
-> Parser
     (Maybe (NonEmpty Text)
      -> Maybe Text -> Text -> DataQualityAppSpecification)
forall (f :: * -> *) a b. Applicative f => 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
"Environment" 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 (NonEmpty Text)
   -> Maybe Text -> Text -> DataQualityAppSpecification)
-> Parser (Maybe (NonEmpty Text))
-> Parser (Maybe Text -> Text -> DataQualityAppSpecification)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe (NonEmpty Text))
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"ContainerEntrypoint")
            Parser (Maybe Text -> Text -> DataQualityAppSpecification)
-> Parser (Maybe Text)
-> Parser (Text -> DataQualityAppSpecification)
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
"PostAnalyticsProcessorSourceUri")
            Parser (Text -> DataQualityAppSpecification)
-> Parser Text -> Parser DataQualityAppSpecification
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
"ImageUri")
      )

instance Prelude.Hashable DataQualityAppSpecification

instance Prelude.NFData DataQualityAppSpecification

instance Core.ToJSON DataQualityAppSpecification where
  toJSON :: DataQualityAppSpecification -> Value
toJSON DataQualityAppSpecification' {Maybe (NonEmpty Text)
Maybe Text
Maybe (HashMap Text Text)
Text
imageUri :: Text
postAnalyticsProcessorSourceUri :: Maybe Text
containerEntrypoint :: Maybe (NonEmpty Text)
environment :: Maybe (HashMap Text Text)
recordPreprocessorSourceUri :: Maybe Text
containerArguments :: Maybe (NonEmpty Text)
$sel:imageUri:DataQualityAppSpecification' :: DataQualityAppSpecification -> Text
$sel:postAnalyticsProcessorSourceUri:DataQualityAppSpecification' :: DataQualityAppSpecification -> Maybe Text
$sel:containerEntrypoint:DataQualityAppSpecification' :: DataQualityAppSpecification -> Maybe (NonEmpty Text)
$sel:environment:DataQualityAppSpecification' :: DataQualityAppSpecification -> Maybe (HashMap Text Text)
$sel:recordPreprocessorSourceUri:DataQualityAppSpecification' :: DataQualityAppSpecification -> Maybe Text
$sel:containerArguments:DataQualityAppSpecification' :: DataQualityAppSpecification -> Maybe (NonEmpty Text)
..} =
    [Pair] -> Value
Core.object
      ( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ (Text
"ContainerArguments" Text -> NonEmpty Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
              (NonEmpty Text -> Pair) -> Maybe (NonEmpty Text) -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe (NonEmpty Text)
containerArguments,
            (Text
"RecordPreprocessorSourceUri" 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
recordPreprocessorSourceUri,
            (Text
"Environment" 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)
environment,
            (Text
"ContainerEntrypoint" Text -> NonEmpty Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
              (NonEmpty Text -> Pair) -> Maybe (NonEmpty Text) -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe (NonEmpty Text)
containerEntrypoint,
            (Text
"PostAnalyticsProcessorSourceUri" 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
postAnalyticsProcessorSourceUri,
            Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"ImageUri" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
imageUri)
          ]
      )