{-# 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.HubS3StorageConfig
-- Copyright   : (c) 2013-2023 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay
-- Stability   : auto-generated
-- Portability : non-portable (GHC extensions)
module Amazonka.SageMaker.Types.HubS3StorageConfig where

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

-- | The Amazon S3 storage configuration of a hub.
--
-- /See:/ 'newHubS3StorageConfig' smart constructor.
data HubS3StorageConfig = HubS3StorageConfig'
  { -- | The Amazon S3 output path for the hub.
    HubS3StorageConfig -> Maybe Text
s3OutputPath :: Prelude.Maybe Prelude.Text
  }
  deriving (HubS3StorageConfig -> HubS3StorageConfig -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: HubS3StorageConfig -> HubS3StorageConfig -> Bool
$c/= :: HubS3StorageConfig -> HubS3StorageConfig -> Bool
== :: HubS3StorageConfig -> HubS3StorageConfig -> Bool
$c== :: HubS3StorageConfig -> HubS3StorageConfig -> Bool
Prelude.Eq, ReadPrec [HubS3StorageConfig]
ReadPrec HubS3StorageConfig
Int -> ReadS HubS3StorageConfig
ReadS [HubS3StorageConfig]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [HubS3StorageConfig]
$creadListPrec :: ReadPrec [HubS3StorageConfig]
readPrec :: ReadPrec HubS3StorageConfig
$creadPrec :: ReadPrec HubS3StorageConfig
readList :: ReadS [HubS3StorageConfig]
$creadList :: ReadS [HubS3StorageConfig]
readsPrec :: Int -> ReadS HubS3StorageConfig
$creadsPrec :: Int -> ReadS HubS3StorageConfig
Prelude.Read, Int -> HubS3StorageConfig -> ShowS
[HubS3StorageConfig] -> ShowS
HubS3StorageConfig -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [HubS3StorageConfig] -> ShowS
$cshowList :: [HubS3StorageConfig] -> ShowS
show :: HubS3StorageConfig -> String
$cshow :: HubS3StorageConfig -> String
showsPrec :: Int -> HubS3StorageConfig -> ShowS
$cshowsPrec :: Int -> HubS3StorageConfig -> ShowS
Prelude.Show, forall x. Rep HubS3StorageConfig x -> HubS3StorageConfig
forall x. HubS3StorageConfig -> Rep HubS3StorageConfig x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep HubS3StorageConfig x -> HubS3StorageConfig
$cfrom :: forall x. HubS3StorageConfig -> Rep HubS3StorageConfig x
Prelude.Generic)

-- |
-- Create a value of 'HubS3StorageConfig' 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:
--
-- 's3OutputPath', 'hubS3StorageConfig_s3OutputPath' - The Amazon S3 output path for the hub.
newHubS3StorageConfig ::
  HubS3StorageConfig
newHubS3StorageConfig :: HubS3StorageConfig
newHubS3StorageConfig =
  HubS3StorageConfig' {$sel:s3OutputPath:HubS3StorageConfig' :: Maybe Text
s3OutputPath = forall a. Maybe a
Prelude.Nothing}

-- | The Amazon S3 output path for the hub.
hubS3StorageConfig_s3OutputPath :: Lens.Lens' HubS3StorageConfig (Prelude.Maybe Prelude.Text)
hubS3StorageConfig_s3OutputPath :: Lens' HubS3StorageConfig (Maybe Text)
hubS3StorageConfig_s3OutputPath = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\HubS3StorageConfig' {Maybe Text
s3OutputPath :: Maybe Text
$sel:s3OutputPath:HubS3StorageConfig' :: HubS3StorageConfig -> Maybe Text
s3OutputPath} -> Maybe Text
s3OutputPath) (\s :: HubS3StorageConfig
s@HubS3StorageConfig' {} Maybe Text
a -> HubS3StorageConfig
s {$sel:s3OutputPath:HubS3StorageConfig' :: Maybe Text
s3OutputPath = Maybe Text
a} :: HubS3StorageConfig)

instance Data.FromJSON HubS3StorageConfig where
  parseJSON :: Value -> Parser HubS3StorageConfig
parseJSON =
    forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
      String
"HubS3StorageConfig"
      ( \Object
x ->
          Maybe Text -> HubS3StorageConfig
HubS3StorageConfig'
            forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"S3OutputPath")
      )

instance Prelude.Hashable HubS3StorageConfig where
  hashWithSalt :: Int -> HubS3StorageConfig -> Int
hashWithSalt Int
_salt HubS3StorageConfig' {Maybe Text
s3OutputPath :: Maybe Text
$sel:s3OutputPath:HubS3StorageConfig' :: HubS3StorageConfig -> Maybe Text
..} =
    Int
_salt forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
s3OutputPath

instance Prelude.NFData HubS3StorageConfig where
  rnf :: HubS3StorageConfig -> ()
rnf HubS3StorageConfig' {Maybe Text
s3OutputPath :: Maybe Text
$sel:s3OutputPath:HubS3StorageConfig' :: HubS3StorageConfig -> Maybe Text
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
s3OutputPath

instance Data.ToJSON HubS3StorageConfig where
  toJSON :: HubS3StorageConfig -> Value
toJSON HubS3StorageConfig' {Maybe Text
s3OutputPath :: Maybe Text
$sel:s3OutputPath:HubS3StorageConfig' :: HubS3StorageConfig -> Maybe Text
..} =
    [Pair] -> Value
Data.object
      ( forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [(Key
"S3OutputPath" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=) forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
s3OutputPath]
      )