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

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

-- | The constraints resource for a monitoring job.
--
-- /See:/ 'newMonitoringConstraintsResource' smart constructor.
data MonitoringConstraintsResource = MonitoringConstraintsResource'
  { -- | The Amazon S3 URI for the constraints resource.
    MonitoringConstraintsResource -> Maybe Text
s3Uri :: Prelude.Maybe Prelude.Text
  }
  deriving (MonitoringConstraintsResource
-> MonitoringConstraintsResource -> Bool
(MonitoringConstraintsResource
 -> MonitoringConstraintsResource -> Bool)
-> (MonitoringConstraintsResource
    -> MonitoringConstraintsResource -> Bool)
-> Eq MonitoringConstraintsResource
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: MonitoringConstraintsResource
-> MonitoringConstraintsResource -> Bool
$c/= :: MonitoringConstraintsResource
-> MonitoringConstraintsResource -> Bool
== :: MonitoringConstraintsResource
-> MonitoringConstraintsResource -> Bool
$c== :: MonitoringConstraintsResource
-> MonitoringConstraintsResource -> Bool
Prelude.Eq, ReadPrec [MonitoringConstraintsResource]
ReadPrec MonitoringConstraintsResource
Int -> ReadS MonitoringConstraintsResource
ReadS [MonitoringConstraintsResource]
(Int -> ReadS MonitoringConstraintsResource)
-> ReadS [MonitoringConstraintsResource]
-> ReadPrec MonitoringConstraintsResource
-> ReadPrec [MonitoringConstraintsResource]
-> Read MonitoringConstraintsResource
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [MonitoringConstraintsResource]
$creadListPrec :: ReadPrec [MonitoringConstraintsResource]
readPrec :: ReadPrec MonitoringConstraintsResource
$creadPrec :: ReadPrec MonitoringConstraintsResource
readList :: ReadS [MonitoringConstraintsResource]
$creadList :: ReadS [MonitoringConstraintsResource]
readsPrec :: Int -> ReadS MonitoringConstraintsResource
$creadsPrec :: Int -> ReadS MonitoringConstraintsResource
Prelude.Read, Int -> MonitoringConstraintsResource -> ShowS
[MonitoringConstraintsResource] -> ShowS
MonitoringConstraintsResource -> String
(Int -> MonitoringConstraintsResource -> ShowS)
-> (MonitoringConstraintsResource -> String)
-> ([MonitoringConstraintsResource] -> ShowS)
-> Show MonitoringConstraintsResource
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [MonitoringConstraintsResource] -> ShowS
$cshowList :: [MonitoringConstraintsResource] -> ShowS
show :: MonitoringConstraintsResource -> String
$cshow :: MonitoringConstraintsResource -> String
showsPrec :: Int -> MonitoringConstraintsResource -> ShowS
$cshowsPrec :: Int -> MonitoringConstraintsResource -> ShowS
Prelude.Show, (forall x.
 MonitoringConstraintsResource
 -> Rep MonitoringConstraintsResource x)
-> (forall x.
    Rep MonitoringConstraintsResource x
    -> MonitoringConstraintsResource)
-> Generic MonitoringConstraintsResource
forall x.
Rep MonitoringConstraintsResource x
-> MonitoringConstraintsResource
forall x.
MonitoringConstraintsResource
-> Rep MonitoringConstraintsResource x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep MonitoringConstraintsResource x
-> MonitoringConstraintsResource
$cfrom :: forall x.
MonitoringConstraintsResource
-> Rep MonitoringConstraintsResource x
Prelude.Generic)

-- |
-- Create a value of 'MonitoringConstraintsResource' 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:
--
-- 's3Uri', 'monitoringConstraintsResource_s3Uri' - The Amazon S3 URI for the constraints resource.
newMonitoringConstraintsResource ::
  MonitoringConstraintsResource
newMonitoringConstraintsResource :: MonitoringConstraintsResource
newMonitoringConstraintsResource =
  MonitoringConstraintsResource' :: Maybe Text -> MonitoringConstraintsResource
MonitoringConstraintsResource'
    { $sel:s3Uri:MonitoringConstraintsResource' :: Maybe Text
s3Uri =
        Maybe Text
forall a. Maybe a
Prelude.Nothing
    }

-- | The Amazon S3 URI for the constraints resource.
monitoringConstraintsResource_s3Uri :: Lens.Lens' MonitoringConstraintsResource (Prelude.Maybe Prelude.Text)
monitoringConstraintsResource_s3Uri :: (Maybe Text -> f (Maybe Text))
-> MonitoringConstraintsResource -> f MonitoringConstraintsResource
monitoringConstraintsResource_s3Uri = (MonitoringConstraintsResource -> Maybe Text)
-> (MonitoringConstraintsResource
    -> Maybe Text -> MonitoringConstraintsResource)
-> Lens
     MonitoringConstraintsResource
     MonitoringConstraintsResource
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\MonitoringConstraintsResource' {Maybe Text
s3Uri :: Maybe Text
$sel:s3Uri:MonitoringConstraintsResource' :: MonitoringConstraintsResource -> Maybe Text
s3Uri} -> Maybe Text
s3Uri) (\s :: MonitoringConstraintsResource
s@MonitoringConstraintsResource' {} Maybe Text
a -> MonitoringConstraintsResource
s {$sel:s3Uri:MonitoringConstraintsResource' :: Maybe Text
s3Uri = Maybe Text
a} :: MonitoringConstraintsResource)

instance Core.FromJSON MonitoringConstraintsResource where
  parseJSON :: Value -> Parser MonitoringConstraintsResource
parseJSON =
    String
-> (Object -> Parser MonitoringConstraintsResource)
-> Value
-> Parser MonitoringConstraintsResource
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
      String
"MonitoringConstraintsResource"
      ( \Object
x ->
          Maybe Text -> MonitoringConstraintsResource
MonitoringConstraintsResource'
            (Maybe Text -> MonitoringConstraintsResource)
-> Parser (Maybe Text) -> Parser MonitoringConstraintsResource
forall (f :: * -> *) a b. Functor 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
"S3Uri")
      )

instance
  Prelude.Hashable
    MonitoringConstraintsResource

instance Prelude.NFData MonitoringConstraintsResource

instance Core.ToJSON MonitoringConstraintsResource where
  toJSON :: MonitoringConstraintsResource -> Value
toJSON MonitoringConstraintsResource' {Maybe Text
s3Uri :: Maybe Text
$sel:s3Uri:MonitoringConstraintsResource' :: MonitoringConstraintsResource -> Maybe Text
..} =
    [Pair] -> Value
Core.object
      ( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [(Text
"S3Uri" 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
s3Uri]
      )