{-# 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.FIS.Types.ExperimentTemplateS3LogConfiguration
-- 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.FIS.Types.ExperimentTemplateS3LogConfiguration 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

-- | Describes the configuration for experiment logging to Amazon S3.
--
-- /See:/ 'newExperimentTemplateS3LogConfiguration' smart constructor.
data ExperimentTemplateS3LogConfiguration = ExperimentTemplateS3LogConfiguration'
  { -- | The name of the destination bucket.
    ExperimentTemplateS3LogConfiguration -> Maybe Text
bucketName :: Prelude.Maybe Prelude.Text,
    -- | The bucket prefix.
    ExperimentTemplateS3LogConfiguration -> Maybe Text
prefix :: Prelude.Maybe Prelude.Text
  }
  deriving (ExperimentTemplateS3LogConfiguration
-> ExperimentTemplateS3LogConfiguration -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ExperimentTemplateS3LogConfiguration
-> ExperimentTemplateS3LogConfiguration -> Bool
$c/= :: ExperimentTemplateS3LogConfiguration
-> ExperimentTemplateS3LogConfiguration -> Bool
== :: ExperimentTemplateS3LogConfiguration
-> ExperimentTemplateS3LogConfiguration -> Bool
$c== :: ExperimentTemplateS3LogConfiguration
-> ExperimentTemplateS3LogConfiguration -> Bool
Prelude.Eq, ReadPrec [ExperimentTemplateS3LogConfiguration]
ReadPrec ExperimentTemplateS3LogConfiguration
Int -> ReadS ExperimentTemplateS3LogConfiguration
ReadS [ExperimentTemplateS3LogConfiguration]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ExperimentTemplateS3LogConfiguration]
$creadListPrec :: ReadPrec [ExperimentTemplateS3LogConfiguration]
readPrec :: ReadPrec ExperimentTemplateS3LogConfiguration
$creadPrec :: ReadPrec ExperimentTemplateS3LogConfiguration
readList :: ReadS [ExperimentTemplateS3LogConfiguration]
$creadList :: ReadS [ExperimentTemplateS3LogConfiguration]
readsPrec :: Int -> ReadS ExperimentTemplateS3LogConfiguration
$creadsPrec :: Int -> ReadS ExperimentTemplateS3LogConfiguration
Prelude.Read, Int -> ExperimentTemplateS3LogConfiguration -> ShowS
[ExperimentTemplateS3LogConfiguration] -> ShowS
ExperimentTemplateS3LogConfiguration -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ExperimentTemplateS3LogConfiguration] -> ShowS
$cshowList :: [ExperimentTemplateS3LogConfiguration] -> ShowS
show :: ExperimentTemplateS3LogConfiguration -> String
$cshow :: ExperimentTemplateS3LogConfiguration -> String
showsPrec :: Int -> ExperimentTemplateS3LogConfiguration -> ShowS
$cshowsPrec :: Int -> ExperimentTemplateS3LogConfiguration -> ShowS
Prelude.Show, forall x.
Rep ExperimentTemplateS3LogConfiguration x
-> ExperimentTemplateS3LogConfiguration
forall x.
ExperimentTemplateS3LogConfiguration
-> Rep ExperimentTemplateS3LogConfiguration x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep ExperimentTemplateS3LogConfiguration x
-> ExperimentTemplateS3LogConfiguration
$cfrom :: forall x.
ExperimentTemplateS3LogConfiguration
-> Rep ExperimentTemplateS3LogConfiguration x
Prelude.Generic)

-- |
-- Create a value of 'ExperimentTemplateS3LogConfiguration' 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:
--
-- 'bucketName', 'experimentTemplateS3LogConfiguration_bucketName' - The name of the destination bucket.
--
-- 'prefix', 'experimentTemplateS3LogConfiguration_prefix' - The bucket prefix.
newExperimentTemplateS3LogConfiguration ::
  ExperimentTemplateS3LogConfiguration
newExperimentTemplateS3LogConfiguration :: ExperimentTemplateS3LogConfiguration
newExperimentTemplateS3LogConfiguration =
  ExperimentTemplateS3LogConfiguration'
    { $sel:bucketName:ExperimentTemplateS3LogConfiguration' :: Maybe Text
bucketName =
        forall a. Maybe a
Prelude.Nothing,
      $sel:prefix:ExperimentTemplateS3LogConfiguration' :: Maybe Text
prefix = forall a. Maybe a
Prelude.Nothing
    }

-- | The name of the destination bucket.
experimentTemplateS3LogConfiguration_bucketName :: Lens.Lens' ExperimentTemplateS3LogConfiguration (Prelude.Maybe Prelude.Text)
experimentTemplateS3LogConfiguration_bucketName :: Lens' ExperimentTemplateS3LogConfiguration (Maybe Text)
experimentTemplateS3LogConfiguration_bucketName = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ExperimentTemplateS3LogConfiguration' {Maybe Text
bucketName :: Maybe Text
$sel:bucketName:ExperimentTemplateS3LogConfiguration' :: ExperimentTemplateS3LogConfiguration -> Maybe Text
bucketName} -> Maybe Text
bucketName) (\s :: ExperimentTemplateS3LogConfiguration
s@ExperimentTemplateS3LogConfiguration' {} Maybe Text
a -> ExperimentTemplateS3LogConfiguration
s {$sel:bucketName:ExperimentTemplateS3LogConfiguration' :: Maybe Text
bucketName = Maybe Text
a} :: ExperimentTemplateS3LogConfiguration)

-- | The bucket prefix.
experimentTemplateS3LogConfiguration_prefix :: Lens.Lens' ExperimentTemplateS3LogConfiguration (Prelude.Maybe Prelude.Text)
experimentTemplateS3LogConfiguration_prefix :: Lens' ExperimentTemplateS3LogConfiguration (Maybe Text)
experimentTemplateS3LogConfiguration_prefix = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ExperimentTemplateS3LogConfiguration' {Maybe Text
prefix :: Maybe Text
$sel:prefix:ExperimentTemplateS3LogConfiguration' :: ExperimentTemplateS3LogConfiguration -> Maybe Text
prefix} -> Maybe Text
prefix) (\s :: ExperimentTemplateS3LogConfiguration
s@ExperimentTemplateS3LogConfiguration' {} Maybe Text
a -> ExperimentTemplateS3LogConfiguration
s {$sel:prefix:ExperimentTemplateS3LogConfiguration' :: Maybe Text
prefix = Maybe Text
a} :: ExperimentTemplateS3LogConfiguration)

instance
  Data.FromJSON
    ExperimentTemplateS3LogConfiguration
  where
  parseJSON :: Value -> Parser ExperimentTemplateS3LogConfiguration
parseJSON =
    forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
      String
"ExperimentTemplateS3LogConfiguration"
      ( \Object
x ->
          Maybe Text -> Maybe Text -> ExperimentTemplateS3LogConfiguration
ExperimentTemplateS3LogConfiguration'
            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
"bucketName")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"prefix")
      )

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

instance
  Prelude.NFData
    ExperimentTemplateS3LogConfiguration
  where
  rnf :: ExperimentTemplateS3LogConfiguration -> ()
rnf ExperimentTemplateS3LogConfiguration' {Maybe Text
prefix :: Maybe Text
bucketName :: Maybe Text
$sel:prefix:ExperimentTemplateS3LogConfiguration' :: ExperimentTemplateS3LogConfiguration -> Maybe Text
$sel:bucketName:ExperimentTemplateS3LogConfiguration' :: ExperimentTemplateS3LogConfiguration -> Maybe Text
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
bucketName
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
prefix