{-# 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.LookoutMetrics.Types.AutoDetectionS3SourceConfig
-- 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.LookoutMetrics.Types.AutoDetectionS3SourceConfig 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

-- | An auto detection source config.
--
-- /See:/ 'newAutoDetectionS3SourceConfig' smart constructor.
data AutoDetectionS3SourceConfig = AutoDetectionS3SourceConfig'
  { -- | The config\'s historical data path list.
    AutoDetectionS3SourceConfig -> Maybe (NonEmpty Text)
historicalDataPathList :: Prelude.Maybe (Prelude.NonEmpty Prelude.Text),
    -- | The config\'s templated path list.
    AutoDetectionS3SourceConfig -> Maybe (NonEmpty Text)
templatedPathList :: Prelude.Maybe (Prelude.NonEmpty Prelude.Text)
  }
  deriving (AutoDetectionS3SourceConfig -> AutoDetectionS3SourceConfig -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: AutoDetectionS3SourceConfig -> AutoDetectionS3SourceConfig -> Bool
$c/= :: AutoDetectionS3SourceConfig -> AutoDetectionS3SourceConfig -> Bool
== :: AutoDetectionS3SourceConfig -> AutoDetectionS3SourceConfig -> Bool
$c== :: AutoDetectionS3SourceConfig -> AutoDetectionS3SourceConfig -> Bool
Prelude.Eq, ReadPrec [AutoDetectionS3SourceConfig]
ReadPrec AutoDetectionS3SourceConfig
Int -> ReadS AutoDetectionS3SourceConfig
ReadS [AutoDetectionS3SourceConfig]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [AutoDetectionS3SourceConfig]
$creadListPrec :: ReadPrec [AutoDetectionS3SourceConfig]
readPrec :: ReadPrec AutoDetectionS3SourceConfig
$creadPrec :: ReadPrec AutoDetectionS3SourceConfig
readList :: ReadS [AutoDetectionS3SourceConfig]
$creadList :: ReadS [AutoDetectionS3SourceConfig]
readsPrec :: Int -> ReadS AutoDetectionS3SourceConfig
$creadsPrec :: Int -> ReadS AutoDetectionS3SourceConfig
Prelude.Read, Int -> AutoDetectionS3SourceConfig -> ShowS
[AutoDetectionS3SourceConfig] -> ShowS
AutoDetectionS3SourceConfig -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [AutoDetectionS3SourceConfig] -> ShowS
$cshowList :: [AutoDetectionS3SourceConfig] -> ShowS
show :: AutoDetectionS3SourceConfig -> String
$cshow :: AutoDetectionS3SourceConfig -> String
showsPrec :: Int -> AutoDetectionS3SourceConfig -> ShowS
$cshowsPrec :: Int -> AutoDetectionS3SourceConfig -> ShowS
Prelude.Show, forall x.
Rep AutoDetectionS3SourceConfig x -> AutoDetectionS3SourceConfig
forall x.
AutoDetectionS3SourceConfig -> Rep AutoDetectionS3SourceConfig x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep AutoDetectionS3SourceConfig x -> AutoDetectionS3SourceConfig
$cfrom :: forall x.
AutoDetectionS3SourceConfig -> Rep AutoDetectionS3SourceConfig x
Prelude.Generic)

-- |
-- Create a value of 'AutoDetectionS3SourceConfig' 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:
--
-- 'historicalDataPathList', 'autoDetectionS3SourceConfig_historicalDataPathList' - The config\'s historical data path list.
--
-- 'templatedPathList', 'autoDetectionS3SourceConfig_templatedPathList' - The config\'s templated path list.
newAutoDetectionS3SourceConfig ::
  AutoDetectionS3SourceConfig
newAutoDetectionS3SourceConfig :: AutoDetectionS3SourceConfig
newAutoDetectionS3SourceConfig =
  AutoDetectionS3SourceConfig'
    { $sel:historicalDataPathList:AutoDetectionS3SourceConfig' :: Maybe (NonEmpty Text)
historicalDataPathList =
        forall a. Maybe a
Prelude.Nothing,
      $sel:templatedPathList:AutoDetectionS3SourceConfig' :: Maybe (NonEmpty Text)
templatedPathList = forall a. Maybe a
Prelude.Nothing
    }

-- | The config\'s historical data path list.
autoDetectionS3SourceConfig_historicalDataPathList :: Lens.Lens' AutoDetectionS3SourceConfig (Prelude.Maybe (Prelude.NonEmpty Prelude.Text))
autoDetectionS3SourceConfig_historicalDataPathList :: Lens' AutoDetectionS3SourceConfig (Maybe (NonEmpty Text))
autoDetectionS3SourceConfig_historicalDataPathList = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AutoDetectionS3SourceConfig' {Maybe (NonEmpty Text)
historicalDataPathList :: Maybe (NonEmpty Text)
$sel:historicalDataPathList:AutoDetectionS3SourceConfig' :: AutoDetectionS3SourceConfig -> Maybe (NonEmpty Text)
historicalDataPathList} -> Maybe (NonEmpty Text)
historicalDataPathList) (\s :: AutoDetectionS3SourceConfig
s@AutoDetectionS3SourceConfig' {} Maybe (NonEmpty Text)
a -> AutoDetectionS3SourceConfig
s {$sel:historicalDataPathList:AutoDetectionS3SourceConfig' :: Maybe (NonEmpty Text)
historicalDataPathList = Maybe (NonEmpty Text)
a} :: AutoDetectionS3SourceConfig) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. forall (f :: * -> *) (g :: * -> *) s t a b.
(Functor f, Functor g) =>
AnIso s t a b -> Iso (f s) (g t) (f a) (g b)
Lens.mapping forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | The config\'s templated path list.
autoDetectionS3SourceConfig_templatedPathList :: Lens.Lens' AutoDetectionS3SourceConfig (Prelude.Maybe (Prelude.NonEmpty Prelude.Text))
autoDetectionS3SourceConfig_templatedPathList :: Lens' AutoDetectionS3SourceConfig (Maybe (NonEmpty Text))
autoDetectionS3SourceConfig_templatedPathList = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AutoDetectionS3SourceConfig' {Maybe (NonEmpty Text)
templatedPathList :: Maybe (NonEmpty Text)
$sel:templatedPathList:AutoDetectionS3SourceConfig' :: AutoDetectionS3SourceConfig -> Maybe (NonEmpty Text)
templatedPathList} -> Maybe (NonEmpty Text)
templatedPathList) (\s :: AutoDetectionS3SourceConfig
s@AutoDetectionS3SourceConfig' {} Maybe (NonEmpty Text)
a -> AutoDetectionS3SourceConfig
s {$sel:templatedPathList:AutoDetectionS3SourceConfig' :: Maybe (NonEmpty Text)
templatedPathList = Maybe (NonEmpty Text)
a} :: AutoDetectionS3SourceConfig) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. forall (f :: * -> *) (g :: * -> *) s t a b.
(Functor f, Functor g) =>
AnIso s t a b -> Iso (f s) (g t) (f a) (g b)
Lens.mapping forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

instance Prelude.Hashable AutoDetectionS3SourceConfig where
  hashWithSalt :: Int -> AutoDetectionS3SourceConfig -> Int
hashWithSalt Int
_salt AutoDetectionS3SourceConfig' {Maybe (NonEmpty Text)
templatedPathList :: Maybe (NonEmpty Text)
historicalDataPathList :: Maybe (NonEmpty Text)
$sel:templatedPathList:AutoDetectionS3SourceConfig' :: AutoDetectionS3SourceConfig -> Maybe (NonEmpty Text)
$sel:historicalDataPathList:AutoDetectionS3SourceConfig' :: AutoDetectionS3SourceConfig -> Maybe (NonEmpty Text)
..} =
    Int
_salt
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe (NonEmpty Text)
historicalDataPathList
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe (NonEmpty Text)
templatedPathList

instance Prelude.NFData AutoDetectionS3SourceConfig where
  rnf :: AutoDetectionS3SourceConfig -> ()
rnf AutoDetectionS3SourceConfig' {Maybe (NonEmpty Text)
templatedPathList :: Maybe (NonEmpty Text)
historicalDataPathList :: Maybe (NonEmpty Text)
$sel:templatedPathList:AutoDetectionS3SourceConfig' :: AutoDetectionS3SourceConfig -> Maybe (NonEmpty Text)
$sel:historicalDataPathList:AutoDetectionS3SourceConfig' :: AutoDetectionS3SourceConfig -> Maybe (NonEmpty Text)
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe (NonEmpty Text)
historicalDataPathList
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe (NonEmpty Text)
templatedPathList

instance Data.ToJSON AutoDetectionS3SourceConfig where
  toJSON :: AutoDetectionS3SourceConfig -> Value
toJSON AutoDetectionS3SourceConfig' {Maybe (NonEmpty Text)
templatedPathList :: Maybe (NonEmpty Text)
historicalDataPathList :: Maybe (NonEmpty Text)
$sel:templatedPathList:AutoDetectionS3SourceConfig' :: AutoDetectionS3SourceConfig -> Maybe (NonEmpty Text)
$sel:historicalDataPathList:AutoDetectionS3SourceConfig' :: AutoDetectionS3SourceConfig -> Maybe (NonEmpty Text)
..} =
    [Pair] -> Value
Data.object
      ( forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ (Key
"HistoricalDataPathList" 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 (NonEmpty Text)
historicalDataPathList,
            (Key
"TemplatedPathList" 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 (NonEmpty Text)
templatedPathList
          ]
      )