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

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

-- | The inputs for a monitoring job.
--
-- /See:/ 'newMonitoringInput' smart constructor.
data MonitoringInput = MonitoringInput'
  { -- | The endpoint for a monitoring job.
    MonitoringInput -> EndpointInput
endpointInput :: EndpointInput
  }
  deriving (MonitoringInput -> MonitoringInput -> Bool
(MonitoringInput -> MonitoringInput -> Bool)
-> (MonitoringInput -> MonitoringInput -> Bool)
-> Eq MonitoringInput
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: MonitoringInput -> MonitoringInput -> Bool
$c/= :: MonitoringInput -> MonitoringInput -> Bool
== :: MonitoringInput -> MonitoringInput -> Bool
$c== :: MonitoringInput -> MonitoringInput -> Bool
Prelude.Eq, ReadPrec [MonitoringInput]
ReadPrec MonitoringInput
Int -> ReadS MonitoringInput
ReadS [MonitoringInput]
(Int -> ReadS MonitoringInput)
-> ReadS [MonitoringInput]
-> ReadPrec MonitoringInput
-> ReadPrec [MonitoringInput]
-> Read MonitoringInput
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [MonitoringInput]
$creadListPrec :: ReadPrec [MonitoringInput]
readPrec :: ReadPrec MonitoringInput
$creadPrec :: ReadPrec MonitoringInput
readList :: ReadS [MonitoringInput]
$creadList :: ReadS [MonitoringInput]
readsPrec :: Int -> ReadS MonitoringInput
$creadsPrec :: Int -> ReadS MonitoringInput
Prelude.Read, Int -> MonitoringInput -> ShowS
[MonitoringInput] -> ShowS
MonitoringInput -> String
(Int -> MonitoringInput -> ShowS)
-> (MonitoringInput -> String)
-> ([MonitoringInput] -> ShowS)
-> Show MonitoringInput
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [MonitoringInput] -> ShowS
$cshowList :: [MonitoringInput] -> ShowS
show :: MonitoringInput -> String
$cshow :: MonitoringInput -> String
showsPrec :: Int -> MonitoringInput -> ShowS
$cshowsPrec :: Int -> MonitoringInput -> ShowS
Prelude.Show, (forall x. MonitoringInput -> Rep MonitoringInput x)
-> (forall x. Rep MonitoringInput x -> MonitoringInput)
-> Generic MonitoringInput
forall x. Rep MonitoringInput x -> MonitoringInput
forall x. MonitoringInput -> Rep MonitoringInput x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep MonitoringInput x -> MonitoringInput
$cfrom :: forall x. MonitoringInput -> Rep MonitoringInput x
Prelude.Generic)

-- |
-- Create a value of 'MonitoringInput' 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:
--
-- 'endpointInput', 'monitoringInput_endpointInput' - The endpoint for a monitoring job.
newMonitoringInput ::
  -- | 'endpointInput'
  EndpointInput ->
  MonitoringInput
newMonitoringInput :: EndpointInput -> MonitoringInput
newMonitoringInput EndpointInput
pEndpointInput_ =
  MonitoringInput' :: EndpointInput -> MonitoringInput
MonitoringInput' {$sel:endpointInput:MonitoringInput' :: EndpointInput
endpointInput = EndpointInput
pEndpointInput_}

-- | The endpoint for a monitoring job.
monitoringInput_endpointInput :: Lens.Lens' MonitoringInput EndpointInput
monitoringInput_endpointInput :: (EndpointInput -> f EndpointInput)
-> MonitoringInput -> f MonitoringInput
monitoringInput_endpointInput = (MonitoringInput -> EndpointInput)
-> (MonitoringInput -> EndpointInput -> MonitoringInput)
-> Lens MonitoringInput MonitoringInput EndpointInput EndpointInput
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\MonitoringInput' {EndpointInput
endpointInput :: EndpointInput
$sel:endpointInput:MonitoringInput' :: MonitoringInput -> EndpointInput
endpointInput} -> EndpointInput
endpointInput) (\s :: MonitoringInput
s@MonitoringInput' {} EndpointInput
a -> MonitoringInput
s {$sel:endpointInput:MonitoringInput' :: EndpointInput
endpointInput = EndpointInput
a} :: MonitoringInput)

instance Core.FromJSON MonitoringInput where
  parseJSON :: Value -> Parser MonitoringInput
parseJSON =
    String
-> (Object -> Parser MonitoringInput)
-> Value
-> Parser MonitoringInput
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
      String
"MonitoringInput"
      ( \Object
x ->
          EndpointInput -> MonitoringInput
MonitoringInput'
            (EndpointInput -> MonitoringInput)
-> Parser EndpointInput -> Parser MonitoringInput
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Parser EndpointInput
forall a. FromJSON a => Object -> Text -> Parser a
Core..: Text
"EndpointInput")
      )

instance Prelude.Hashable MonitoringInput

instance Prelude.NFData MonitoringInput

instance Core.ToJSON MonitoringInput where
  toJSON :: MonitoringInput -> Value
toJSON MonitoringInput' {EndpointInput
endpointInput :: EndpointInput
$sel:endpointInput:MonitoringInput' :: MonitoringInput -> EndpointInput
..} =
    [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
"EndpointInput" Text -> EndpointInput -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= EndpointInput
endpointInput)
          ]
      )