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

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

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

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

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

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

instance Prelude.NFData MonitoringStatisticsResource

instance Core.ToJSON MonitoringStatisticsResource where
  toJSON :: MonitoringStatisticsResource -> Value
toJSON MonitoringStatisticsResource' {Maybe Text
s3Uri :: Maybe Text
$sel:s3Uri:MonitoringStatisticsResource' :: MonitoringStatisticsResource -> 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]
      )