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

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

-- | Container image configuration object for the monitoring job.
--
-- /See:/ 'newModelQualityAppSpecification' smart constructor.
data ModelQualityAppSpecification = ModelQualityAppSpecification'
  { -- | An array of arguments for the container used to run the monitoring job.
    ModelQualityAppSpecification -> 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.
    ModelQualityAppSpecification -> Maybe Text
recordPreprocessorSourceUri :: Prelude.Maybe Prelude.Text,
    -- | Sets the environment variables in the container that the monitoring job
    -- runs.
    ModelQualityAppSpecification -> Maybe (HashMap Text Text)
environment :: Prelude.Maybe (Prelude.HashMap Prelude.Text Prelude.Text),
    -- | The machine learning problem type of the model that the monitoring job
    -- monitors.
    ModelQualityAppSpecification -> Maybe MonitoringProblemType
problemType :: Prelude.Maybe MonitoringProblemType,
    -- | Specifies the entrypoint for a container that the monitoring job runs.
    ModelQualityAppSpecification -> 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.
    ModelQualityAppSpecification -> Maybe Text
postAnalyticsProcessorSourceUri :: Prelude.Maybe Prelude.Text,
    -- | The address of the container image that the monitoring job runs.
    ModelQualityAppSpecification -> Text
imageUri :: Prelude.Text
  }
  deriving (ModelQualityAppSpecification
-> ModelQualityAppSpecification -> Bool
(ModelQualityAppSpecification
 -> ModelQualityAppSpecification -> Bool)
-> (ModelQualityAppSpecification
    -> ModelQualityAppSpecification -> Bool)
-> Eq ModelQualityAppSpecification
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ModelQualityAppSpecification
-> ModelQualityAppSpecification -> Bool
$c/= :: ModelQualityAppSpecification
-> ModelQualityAppSpecification -> Bool
== :: ModelQualityAppSpecification
-> ModelQualityAppSpecification -> Bool
$c== :: ModelQualityAppSpecification
-> ModelQualityAppSpecification -> Bool
Prelude.Eq, ReadPrec [ModelQualityAppSpecification]
ReadPrec ModelQualityAppSpecification
Int -> ReadS ModelQualityAppSpecification
ReadS [ModelQualityAppSpecification]
(Int -> ReadS ModelQualityAppSpecification)
-> ReadS [ModelQualityAppSpecification]
-> ReadPrec ModelQualityAppSpecification
-> ReadPrec [ModelQualityAppSpecification]
-> Read ModelQualityAppSpecification
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ModelQualityAppSpecification]
$creadListPrec :: ReadPrec [ModelQualityAppSpecification]
readPrec :: ReadPrec ModelQualityAppSpecification
$creadPrec :: ReadPrec ModelQualityAppSpecification
readList :: ReadS [ModelQualityAppSpecification]
$creadList :: ReadS [ModelQualityAppSpecification]
readsPrec :: Int -> ReadS ModelQualityAppSpecification
$creadsPrec :: Int -> ReadS ModelQualityAppSpecification
Prelude.Read, Int -> ModelQualityAppSpecification -> ShowS
[ModelQualityAppSpecification] -> ShowS
ModelQualityAppSpecification -> String
(Int -> ModelQualityAppSpecification -> ShowS)
-> (ModelQualityAppSpecification -> String)
-> ([ModelQualityAppSpecification] -> ShowS)
-> Show ModelQualityAppSpecification
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ModelQualityAppSpecification] -> ShowS
$cshowList :: [ModelQualityAppSpecification] -> ShowS
show :: ModelQualityAppSpecification -> String
$cshow :: ModelQualityAppSpecification -> String
showsPrec :: Int -> ModelQualityAppSpecification -> ShowS
$cshowsPrec :: Int -> ModelQualityAppSpecification -> ShowS
Prelude.Show, (forall x.
 ModelQualityAppSpecification -> Rep ModelQualityAppSpecification x)
-> (forall x.
    Rep ModelQualityAppSpecification x -> ModelQualityAppSpecification)
-> Generic ModelQualityAppSpecification
forall x.
Rep ModelQualityAppSpecification x -> ModelQualityAppSpecification
forall x.
ModelQualityAppSpecification -> Rep ModelQualityAppSpecification x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep ModelQualityAppSpecification x -> ModelQualityAppSpecification
$cfrom :: forall x.
ModelQualityAppSpecification -> Rep ModelQualityAppSpecification x
Prelude.Generic)

-- |
-- Create a value of 'ModelQualityAppSpecification' 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', 'modelQualityAppSpecification_containerArguments' - An array of arguments for the container used to run the monitoring job.
--
-- 'recordPreprocessorSourceUri', 'modelQualityAppSpecification_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', 'modelQualityAppSpecification_environment' - Sets the environment variables in the container that the monitoring job
-- runs.
--
-- 'problemType', 'modelQualityAppSpecification_problemType' - The machine learning problem type of the model that the monitoring job
-- monitors.
--
-- 'containerEntrypoint', 'modelQualityAppSpecification_containerEntrypoint' - Specifies the entrypoint for a container that the monitoring job runs.
--
-- 'postAnalyticsProcessorSourceUri', 'modelQualityAppSpecification_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', 'modelQualityAppSpecification_imageUri' - The address of the container image that the monitoring job runs.
newModelQualityAppSpecification ::
  -- | 'imageUri'
  Prelude.Text ->
  ModelQualityAppSpecification
newModelQualityAppSpecification :: Text -> ModelQualityAppSpecification
newModelQualityAppSpecification Text
pImageUri_ =
  ModelQualityAppSpecification' :: Maybe (NonEmpty Text)
-> Maybe Text
-> Maybe (HashMap Text Text)
-> Maybe MonitoringProblemType
-> Maybe (NonEmpty Text)
-> Maybe Text
-> Text
-> ModelQualityAppSpecification
ModelQualityAppSpecification'
    { $sel:containerArguments:ModelQualityAppSpecification' :: Maybe (NonEmpty Text)
containerArguments =
        Maybe (NonEmpty Text)
forall a. Maybe a
Prelude.Nothing,
      $sel:recordPreprocessorSourceUri:ModelQualityAppSpecification' :: Maybe Text
recordPreprocessorSourceUri = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:environment:ModelQualityAppSpecification' :: Maybe (HashMap Text Text)
environment = Maybe (HashMap Text Text)
forall a. Maybe a
Prelude.Nothing,
      $sel:problemType:ModelQualityAppSpecification' :: Maybe MonitoringProblemType
problemType = Maybe MonitoringProblemType
forall a. Maybe a
Prelude.Nothing,
      $sel:containerEntrypoint:ModelQualityAppSpecification' :: Maybe (NonEmpty Text)
containerEntrypoint = Maybe (NonEmpty Text)
forall a. Maybe a
Prelude.Nothing,
      $sel:postAnalyticsProcessorSourceUri:ModelQualityAppSpecification' :: Maybe Text
postAnalyticsProcessorSourceUri =
        Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:imageUri:ModelQualityAppSpecification' :: Text
imageUri = Text
pImageUri_
    }

-- | An array of arguments for the container used to run the monitoring job.
modelQualityAppSpecification_containerArguments :: Lens.Lens' ModelQualityAppSpecification (Prelude.Maybe (Prelude.NonEmpty Prelude.Text))
modelQualityAppSpecification_containerArguments :: (Maybe (NonEmpty Text) -> f (Maybe (NonEmpty Text)))
-> ModelQualityAppSpecification -> f ModelQualityAppSpecification
modelQualityAppSpecification_containerArguments = (ModelQualityAppSpecification -> Maybe (NonEmpty Text))
-> (ModelQualityAppSpecification
    -> Maybe (NonEmpty Text) -> ModelQualityAppSpecification)
-> Lens
     ModelQualityAppSpecification
     ModelQualityAppSpecification
     (Maybe (NonEmpty Text))
     (Maybe (NonEmpty Text))
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ModelQualityAppSpecification' {Maybe (NonEmpty Text)
containerArguments :: Maybe (NonEmpty Text)
$sel:containerArguments:ModelQualityAppSpecification' :: ModelQualityAppSpecification -> Maybe (NonEmpty Text)
containerArguments} -> Maybe (NonEmpty Text)
containerArguments) (\s :: ModelQualityAppSpecification
s@ModelQualityAppSpecification' {} Maybe (NonEmpty Text)
a -> ModelQualityAppSpecification
s {$sel:containerArguments:ModelQualityAppSpecification' :: Maybe (NonEmpty Text)
containerArguments = Maybe (NonEmpty Text)
a} :: ModelQualityAppSpecification) ((Maybe (NonEmpty Text) -> f (Maybe (NonEmpty Text)))
 -> ModelQualityAppSpecification -> f ModelQualityAppSpecification)
-> ((Maybe (NonEmpty Text) -> f (Maybe (NonEmpty Text)))
    -> Maybe (NonEmpty Text) -> f (Maybe (NonEmpty Text)))
-> (Maybe (NonEmpty Text) -> f (Maybe (NonEmpty Text)))
-> ModelQualityAppSpecification
-> f ModelQualityAppSpecification
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.
modelQualityAppSpecification_recordPreprocessorSourceUri :: Lens.Lens' ModelQualityAppSpecification (Prelude.Maybe Prelude.Text)
modelQualityAppSpecification_recordPreprocessorSourceUri :: (Maybe Text -> f (Maybe Text))
-> ModelQualityAppSpecification -> f ModelQualityAppSpecification
modelQualityAppSpecification_recordPreprocessorSourceUri = (ModelQualityAppSpecification -> Maybe Text)
-> (ModelQualityAppSpecification
    -> Maybe Text -> ModelQualityAppSpecification)
-> Lens
     ModelQualityAppSpecification
     ModelQualityAppSpecification
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ModelQualityAppSpecification' {Maybe Text
recordPreprocessorSourceUri :: Maybe Text
$sel:recordPreprocessorSourceUri:ModelQualityAppSpecification' :: ModelQualityAppSpecification -> Maybe Text
recordPreprocessorSourceUri} -> Maybe Text
recordPreprocessorSourceUri) (\s :: ModelQualityAppSpecification
s@ModelQualityAppSpecification' {} Maybe Text
a -> ModelQualityAppSpecification
s {$sel:recordPreprocessorSourceUri:ModelQualityAppSpecification' :: Maybe Text
recordPreprocessorSourceUri = Maybe Text
a} :: ModelQualityAppSpecification)

-- | Sets the environment variables in the container that the monitoring job
-- runs.
modelQualityAppSpecification_environment :: Lens.Lens' ModelQualityAppSpecification (Prelude.Maybe (Prelude.HashMap Prelude.Text Prelude.Text))
modelQualityAppSpecification_environment :: (Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
-> ModelQualityAppSpecification -> f ModelQualityAppSpecification
modelQualityAppSpecification_environment = (ModelQualityAppSpecification -> Maybe (HashMap Text Text))
-> (ModelQualityAppSpecification
    -> Maybe (HashMap Text Text) -> ModelQualityAppSpecification)
-> Lens
     ModelQualityAppSpecification
     ModelQualityAppSpecification
     (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 (\ModelQualityAppSpecification' {Maybe (HashMap Text Text)
environment :: Maybe (HashMap Text Text)
$sel:environment:ModelQualityAppSpecification' :: ModelQualityAppSpecification -> Maybe (HashMap Text Text)
environment} -> Maybe (HashMap Text Text)
environment) (\s :: ModelQualityAppSpecification
s@ModelQualityAppSpecification' {} Maybe (HashMap Text Text)
a -> ModelQualityAppSpecification
s {$sel:environment:ModelQualityAppSpecification' :: Maybe (HashMap Text Text)
environment = Maybe (HashMap Text Text)
a} :: ModelQualityAppSpecification) ((Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
 -> ModelQualityAppSpecification -> f ModelQualityAppSpecification)
-> ((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)))
-> ModelQualityAppSpecification
-> f ModelQualityAppSpecification
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 machine learning problem type of the model that the monitoring job
-- monitors.
modelQualityAppSpecification_problemType :: Lens.Lens' ModelQualityAppSpecification (Prelude.Maybe MonitoringProblemType)
modelQualityAppSpecification_problemType :: (Maybe MonitoringProblemType -> f (Maybe MonitoringProblemType))
-> ModelQualityAppSpecification -> f ModelQualityAppSpecification
modelQualityAppSpecification_problemType = (ModelQualityAppSpecification -> Maybe MonitoringProblemType)
-> (ModelQualityAppSpecification
    -> Maybe MonitoringProblemType -> ModelQualityAppSpecification)
-> Lens
     ModelQualityAppSpecification
     ModelQualityAppSpecification
     (Maybe MonitoringProblemType)
     (Maybe MonitoringProblemType)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ModelQualityAppSpecification' {Maybe MonitoringProblemType
problemType :: Maybe MonitoringProblemType
$sel:problemType:ModelQualityAppSpecification' :: ModelQualityAppSpecification -> Maybe MonitoringProblemType
problemType} -> Maybe MonitoringProblemType
problemType) (\s :: ModelQualityAppSpecification
s@ModelQualityAppSpecification' {} Maybe MonitoringProblemType
a -> ModelQualityAppSpecification
s {$sel:problemType:ModelQualityAppSpecification' :: Maybe MonitoringProblemType
problemType = Maybe MonitoringProblemType
a} :: ModelQualityAppSpecification)

-- | Specifies the entrypoint for a container that the monitoring job runs.
modelQualityAppSpecification_containerEntrypoint :: Lens.Lens' ModelQualityAppSpecification (Prelude.Maybe (Prelude.NonEmpty Prelude.Text))
modelQualityAppSpecification_containerEntrypoint :: (Maybe (NonEmpty Text) -> f (Maybe (NonEmpty Text)))
-> ModelQualityAppSpecification -> f ModelQualityAppSpecification
modelQualityAppSpecification_containerEntrypoint = (ModelQualityAppSpecification -> Maybe (NonEmpty Text))
-> (ModelQualityAppSpecification
    -> Maybe (NonEmpty Text) -> ModelQualityAppSpecification)
-> Lens
     ModelQualityAppSpecification
     ModelQualityAppSpecification
     (Maybe (NonEmpty Text))
     (Maybe (NonEmpty Text))
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ModelQualityAppSpecification' {Maybe (NonEmpty Text)
containerEntrypoint :: Maybe (NonEmpty Text)
$sel:containerEntrypoint:ModelQualityAppSpecification' :: ModelQualityAppSpecification -> Maybe (NonEmpty Text)
containerEntrypoint} -> Maybe (NonEmpty Text)
containerEntrypoint) (\s :: ModelQualityAppSpecification
s@ModelQualityAppSpecification' {} Maybe (NonEmpty Text)
a -> ModelQualityAppSpecification
s {$sel:containerEntrypoint:ModelQualityAppSpecification' :: Maybe (NonEmpty Text)
containerEntrypoint = Maybe (NonEmpty Text)
a} :: ModelQualityAppSpecification) ((Maybe (NonEmpty Text) -> f (Maybe (NonEmpty Text)))
 -> ModelQualityAppSpecification -> f ModelQualityAppSpecification)
-> ((Maybe (NonEmpty Text) -> f (Maybe (NonEmpty Text)))
    -> Maybe (NonEmpty Text) -> f (Maybe (NonEmpty Text)))
-> (Maybe (NonEmpty Text) -> f (Maybe (NonEmpty Text)))
-> ModelQualityAppSpecification
-> f ModelQualityAppSpecification
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.
modelQualityAppSpecification_postAnalyticsProcessorSourceUri :: Lens.Lens' ModelQualityAppSpecification (Prelude.Maybe Prelude.Text)
modelQualityAppSpecification_postAnalyticsProcessorSourceUri :: (Maybe Text -> f (Maybe Text))
-> ModelQualityAppSpecification -> f ModelQualityAppSpecification
modelQualityAppSpecification_postAnalyticsProcessorSourceUri = (ModelQualityAppSpecification -> Maybe Text)
-> (ModelQualityAppSpecification
    -> Maybe Text -> ModelQualityAppSpecification)
-> Lens
     ModelQualityAppSpecification
     ModelQualityAppSpecification
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ModelQualityAppSpecification' {Maybe Text
postAnalyticsProcessorSourceUri :: Maybe Text
$sel:postAnalyticsProcessorSourceUri:ModelQualityAppSpecification' :: ModelQualityAppSpecification -> Maybe Text
postAnalyticsProcessorSourceUri} -> Maybe Text
postAnalyticsProcessorSourceUri) (\s :: ModelQualityAppSpecification
s@ModelQualityAppSpecification' {} Maybe Text
a -> ModelQualityAppSpecification
s {$sel:postAnalyticsProcessorSourceUri:ModelQualityAppSpecification' :: Maybe Text
postAnalyticsProcessorSourceUri = Maybe Text
a} :: ModelQualityAppSpecification)

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

instance Core.FromJSON ModelQualityAppSpecification where
  parseJSON :: Value -> Parser ModelQualityAppSpecification
parseJSON =
    String
-> (Object -> Parser ModelQualityAppSpecification)
-> Value
-> Parser ModelQualityAppSpecification
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
      String
"ModelQualityAppSpecification"
      ( \Object
x ->
          Maybe (NonEmpty Text)
-> Maybe Text
-> Maybe (HashMap Text Text)
-> Maybe MonitoringProblemType
-> Maybe (NonEmpty Text)
-> Maybe Text
-> Text
-> ModelQualityAppSpecification
ModelQualityAppSpecification'
            (Maybe (NonEmpty Text)
 -> Maybe Text
 -> Maybe (HashMap Text Text)
 -> Maybe MonitoringProblemType
 -> Maybe (NonEmpty Text)
 -> Maybe Text
 -> Text
 -> ModelQualityAppSpecification)
-> Parser (Maybe (NonEmpty Text))
-> Parser
     (Maybe Text
      -> Maybe (HashMap Text Text)
      -> Maybe MonitoringProblemType
      -> Maybe (NonEmpty Text)
      -> Maybe Text
      -> Text
      -> ModelQualityAppSpecification)
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 MonitoringProblemType
   -> Maybe (NonEmpty Text)
   -> Maybe Text
   -> Text
   -> ModelQualityAppSpecification)
-> Parser (Maybe Text)
-> Parser
     (Maybe (HashMap Text Text)
      -> Maybe MonitoringProblemType
      -> Maybe (NonEmpty Text)
      -> Maybe Text
      -> Text
      -> ModelQualityAppSpecification)
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 MonitoringProblemType
   -> Maybe (NonEmpty Text)
   -> Maybe Text
   -> Text
   -> ModelQualityAppSpecification)
-> Parser (Maybe (HashMap Text Text))
-> Parser
     (Maybe MonitoringProblemType
      -> Maybe (NonEmpty Text)
      -> Maybe Text
      -> Text
      -> ModelQualityAppSpecification)
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 MonitoringProblemType
   -> Maybe (NonEmpty Text)
   -> Maybe Text
   -> Text
   -> ModelQualityAppSpecification)
-> Parser (Maybe MonitoringProblemType)
-> Parser
     (Maybe (NonEmpty Text)
      -> Maybe Text -> Text -> ModelQualityAppSpecification)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe MonitoringProblemType)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"ProblemType")
            Parser
  (Maybe (NonEmpty Text)
   -> Maybe Text -> Text -> ModelQualityAppSpecification)
-> Parser (Maybe (NonEmpty Text))
-> Parser (Maybe Text -> Text -> ModelQualityAppSpecification)
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 -> ModelQualityAppSpecification)
-> Parser (Maybe Text)
-> Parser (Text -> ModelQualityAppSpecification)
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 -> ModelQualityAppSpecification)
-> Parser Text -> Parser ModelQualityAppSpecification
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
    ModelQualityAppSpecification

instance Prelude.NFData ModelQualityAppSpecification

instance Core.ToJSON ModelQualityAppSpecification where
  toJSON :: ModelQualityAppSpecification -> Value
toJSON ModelQualityAppSpecification' {Maybe (NonEmpty Text)
Maybe Text
Maybe (HashMap Text Text)
Maybe MonitoringProblemType
Text
imageUri :: Text
postAnalyticsProcessorSourceUri :: Maybe Text
containerEntrypoint :: Maybe (NonEmpty Text)
problemType :: Maybe MonitoringProblemType
environment :: Maybe (HashMap Text Text)
recordPreprocessorSourceUri :: Maybe Text
containerArguments :: Maybe (NonEmpty Text)
$sel:imageUri:ModelQualityAppSpecification' :: ModelQualityAppSpecification -> Text
$sel:postAnalyticsProcessorSourceUri:ModelQualityAppSpecification' :: ModelQualityAppSpecification -> Maybe Text
$sel:containerEntrypoint:ModelQualityAppSpecification' :: ModelQualityAppSpecification -> Maybe (NonEmpty Text)
$sel:problemType:ModelQualityAppSpecification' :: ModelQualityAppSpecification -> Maybe MonitoringProblemType
$sel:environment:ModelQualityAppSpecification' :: ModelQualityAppSpecification -> Maybe (HashMap Text Text)
$sel:recordPreprocessorSourceUri:ModelQualityAppSpecification' :: ModelQualityAppSpecification -> Maybe Text
$sel:containerArguments:ModelQualityAppSpecification' :: ModelQualityAppSpecification -> 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
"ProblemType" Text -> MonitoringProblemType -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (MonitoringProblemType -> Pair)
-> Maybe MonitoringProblemType -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe MonitoringProblemType
problemType,
            (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)
          ]
      )