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

import qualified Amazonka.Core as Core
import qualified Amazonka.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
import Amazonka.LookoutMetrics.Types.FileFormatDescriptor
import qualified Amazonka.Prelude as Prelude

-- | Contains information about the source configuration in Amazon S3.
--
-- /See:/ 'newSampleDataS3SourceConfig' smart constructor.
data SampleDataS3SourceConfig = SampleDataS3SourceConfig'
  { -- | An array of strings containing the historical set of data paths.
    SampleDataS3SourceConfig -> Maybe (NonEmpty Text)
historicalDataPathList :: Prelude.Maybe (Prelude.NonEmpty Prelude.Text),
    -- | An array of strings containing the list of templated paths.
    SampleDataS3SourceConfig -> Maybe (NonEmpty Text)
templatedPathList :: Prelude.Maybe (Prelude.NonEmpty Prelude.Text),
    -- | The Amazon Resource Name (ARN) of the role.
    SampleDataS3SourceConfig -> Text
roleArn :: Prelude.Text,
    SampleDataS3SourceConfig -> FileFormatDescriptor
fileFormatDescriptor :: FileFormatDescriptor
  }
  deriving (SampleDataS3SourceConfig -> SampleDataS3SourceConfig -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: SampleDataS3SourceConfig -> SampleDataS3SourceConfig -> Bool
$c/= :: SampleDataS3SourceConfig -> SampleDataS3SourceConfig -> Bool
== :: SampleDataS3SourceConfig -> SampleDataS3SourceConfig -> Bool
$c== :: SampleDataS3SourceConfig -> SampleDataS3SourceConfig -> Bool
Prelude.Eq, ReadPrec [SampleDataS3SourceConfig]
ReadPrec SampleDataS3SourceConfig
Int -> ReadS SampleDataS3SourceConfig
ReadS [SampleDataS3SourceConfig]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [SampleDataS3SourceConfig]
$creadListPrec :: ReadPrec [SampleDataS3SourceConfig]
readPrec :: ReadPrec SampleDataS3SourceConfig
$creadPrec :: ReadPrec SampleDataS3SourceConfig
readList :: ReadS [SampleDataS3SourceConfig]
$creadList :: ReadS [SampleDataS3SourceConfig]
readsPrec :: Int -> ReadS SampleDataS3SourceConfig
$creadsPrec :: Int -> ReadS SampleDataS3SourceConfig
Prelude.Read, Int -> SampleDataS3SourceConfig -> ShowS
[SampleDataS3SourceConfig] -> ShowS
SampleDataS3SourceConfig -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [SampleDataS3SourceConfig] -> ShowS
$cshowList :: [SampleDataS3SourceConfig] -> ShowS
show :: SampleDataS3SourceConfig -> String
$cshow :: SampleDataS3SourceConfig -> String
showsPrec :: Int -> SampleDataS3SourceConfig -> ShowS
$cshowsPrec :: Int -> SampleDataS3SourceConfig -> ShowS
Prelude.Show, forall x.
Rep SampleDataS3SourceConfig x -> SampleDataS3SourceConfig
forall x.
SampleDataS3SourceConfig -> Rep SampleDataS3SourceConfig x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep SampleDataS3SourceConfig x -> SampleDataS3SourceConfig
$cfrom :: forall x.
SampleDataS3SourceConfig -> Rep SampleDataS3SourceConfig x
Prelude.Generic)

-- |
-- Create a value of 'SampleDataS3SourceConfig' 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', 'sampleDataS3SourceConfig_historicalDataPathList' - An array of strings containing the historical set of data paths.
--
-- 'templatedPathList', 'sampleDataS3SourceConfig_templatedPathList' - An array of strings containing the list of templated paths.
--
-- 'roleArn', 'sampleDataS3SourceConfig_roleArn' - The Amazon Resource Name (ARN) of the role.
--
-- 'fileFormatDescriptor', 'sampleDataS3SourceConfig_fileFormatDescriptor' - Undocumented member.
newSampleDataS3SourceConfig ::
  -- | 'roleArn'
  Prelude.Text ->
  -- | 'fileFormatDescriptor'
  FileFormatDescriptor ->
  SampleDataS3SourceConfig
newSampleDataS3SourceConfig :: Text -> FileFormatDescriptor -> SampleDataS3SourceConfig
newSampleDataS3SourceConfig
  Text
pRoleArn_
  FileFormatDescriptor
pFileFormatDescriptor_ =
    SampleDataS3SourceConfig'
      { $sel:historicalDataPathList:SampleDataS3SourceConfig' :: Maybe (NonEmpty Text)
historicalDataPathList =
          forall a. Maybe a
Prelude.Nothing,
        $sel:templatedPathList:SampleDataS3SourceConfig' :: Maybe (NonEmpty Text)
templatedPathList = forall a. Maybe a
Prelude.Nothing,
        $sel:roleArn:SampleDataS3SourceConfig' :: Text
roleArn = Text
pRoleArn_,
        $sel:fileFormatDescriptor:SampleDataS3SourceConfig' :: FileFormatDescriptor
fileFormatDescriptor = FileFormatDescriptor
pFileFormatDescriptor_
      }

-- | An array of strings containing the historical set of data paths.
sampleDataS3SourceConfig_historicalDataPathList :: Lens.Lens' SampleDataS3SourceConfig (Prelude.Maybe (Prelude.NonEmpty Prelude.Text))
sampleDataS3SourceConfig_historicalDataPathList :: Lens' SampleDataS3SourceConfig (Maybe (NonEmpty Text))
sampleDataS3SourceConfig_historicalDataPathList = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SampleDataS3SourceConfig' {Maybe (NonEmpty Text)
historicalDataPathList :: Maybe (NonEmpty Text)
$sel:historicalDataPathList:SampleDataS3SourceConfig' :: SampleDataS3SourceConfig -> Maybe (NonEmpty Text)
historicalDataPathList} -> Maybe (NonEmpty Text)
historicalDataPathList) (\s :: SampleDataS3SourceConfig
s@SampleDataS3SourceConfig' {} Maybe (NonEmpty Text)
a -> SampleDataS3SourceConfig
s {$sel:historicalDataPathList:SampleDataS3SourceConfig' :: Maybe (NonEmpty Text)
historicalDataPathList = Maybe (NonEmpty Text)
a} :: SampleDataS3SourceConfig) 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

-- | An array of strings containing the list of templated paths.
sampleDataS3SourceConfig_templatedPathList :: Lens.Lens' SampleDataS3SourceConfig (Prelude.Maybe (Prelude.NonEmpty Prelude.Text))
sampleDataS3SourceConfig_templatedPathList :: Lens' SampleDataS3SourceConfig (Maybe (NonEmpty Text))
sampleDataS3SourceConfig_templatedPathList = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SampleDataS3SourceConfig' {Maybe (NonEmpty Text)
templatedPathList :: Maybe (NonEmpty Text)
$sel:templatedPathList:SampleDataS3SourceConfig' :: SampleDataS3SourceConfig -> Maybe (NonEmpty Text)
templatedPathList} -> Maybe (NonEmpty Text)
templatedPathList) (\s :: SampleDataS3SourceConfig
s@SampleDataS3SourceConfig' {} Maybe (NonEmpty Text)
a -> SampleDataS3SourceConfig
s {$sel:templatedPathList:SampleDataS3SourceConfig' :: Maybe (NonEmpty Text)
templatedPathList = Maybe (NonEmpty Text)
a} :: SampleDataS3SourceConfig) 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 Amazon Resource Name (ARN) of the role.
sampleDataS3SourceConfig_roleArn :: Lens.Lens' SampleDataS3SourceConfig Prelude.Text
sampleDataS3SourceConfig_roleArn :: Lens' SampleDataS3SourceConfig Text
sampleDataS3SourceConfig_roleArn = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SampleDataS3SourceConfig' {Text
roleArn :: Text
$sel:roleArn:SampleDataS3SourceConfig' :: SampleDataS3SourceConfig -> Text
roleArn} -> Text
roleArn) (\s :: SampleDataS3SourceConfig
s@SampleDataS3SourceConfig' {} Text
a -> SampleDataS3SourceConfig
s {$sel:roleArn:SampleDataS3SourceConfig' :: Text
roleArn = Text
a} :: SampleDataS3SourceConfig)

-- | Undocumented member.
sampleDataS3SourceConfig_fileFormatDescriptor :: Lens.Lens' SampleDataS3SourceConfig FileFormatDescriptor
sampleDataS3SourceConfig_fileFormatDescriptor :: Lens' SampleDataS3SourceConfig FileFormatDescriptor
sampleDataS3SourceConfig_fileFormatDescriptor = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SampleDataS3SourceConfig' {FileFormatDescriptor
fileFormatDescriptor :: FileFormatDescriptor
$sel:fileFormatDescriptor:SampleDataS3SourceConfig' :: SampleDataS3SourceConfig -> FileFormatDescriptor
fileFormatDescriptor} -> FileFormatDescriptor
fileFormatDescriptor) (\s :: SampleDataS3SourceConfig
s@SampleDataS3SourceConfig' {} FileFormatDescriptor
a -> SampleDataS3SourceConfig
s {$sel:fileFormatDescriptor:SampleDataS3SourceConfig' :: FileFormatDescriptor
fileFormatDescriptor = FileFormatDescriptor
a} :: SampleDataS3SourceConfig)

instance Prelude.Hashable SampleDataS3SourceConfig where
  hashWithSalt :: Int -> SampleDataS3SourceConfig -> Int
hashWithSalt Int
_salt SampleDataS3SourceConfig' {Maybe (NonEmpty Text)
Text
FileFormatDescriptor
fileFormatDescriptor :: FileFormatDescriptor
roleArn :: Text
templatedPathList :: Maybe (NonEmpty Text)
historicalDataPathList :: Maybe (NonEmpty Text)
$sel:fileFormatDescriptor:SampleDataS3SourceConfig' :: SampleDataS3SourceConfig -> FileFormatDescriptor
$sel:roleArn:SampleDataS3SourceConfig' :: SampleDataS3SourceConfig -> Text
$sel:templatedPathList:SampleDataS3SourceConfig' :: SampleDataS3SourceConfig -> Maybe (NonEmpty Text)
$sel:historicalDataPathList:SampleDataS3SourceConfig' :: SampleDataS3SourceConfig -> 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
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
roleArn
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` FileFormatDescriptor
fileFormatDescriptor

instance Prelude.NFData SampleDataS3SourceConfig where
  rnf :: SampleDataS3SourceConfig -> ()
rnf SampleDataS3SourceConfig' {Maybe (NonEmpty Text)
Text
FileFormatDescriptor
fileFormatDescriptor :: FileFormatDescriptor
roleArn :: Text
templatedPathList :: Maybe (NonEmpty Text)
historicalDataPathList :: Maybe (NonEmpty Text)
$sel:fileFormatDescriptor:SampleDataS3SourceConfig' :: SampleDataS3SourceConfig -> FileFormatDescriptor
$sel:roleArn:SampleDataS3SourceConfig' :: SampleDataS3SourceConfig -> Text
$sel:templatedPathList:SampleDataS3SourceConfig' :: SampleDataS3SourceConfig -> Maybe (NonEmpty Text)
$sel:historicalDataPathList:SampleDataS3SourceConfig' :: SampleDataS3SourceConfig -> 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
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
roleArn
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf FileFormatDescriptor
fileFormatDescriptor

instance Data.ToJSON SampleDataS3SourceConfig where
  toJSON :: SampleDataS3SourceConfig -> Value
toJSON SampleDataS3SourceConfig' {Maybe (NonEmpty Text)
Text
FileFormatDescriptor
fileFormatDescriptor :: FileFormatDescriptor
roleArn :: Text
templatedPathList :: Maybe (NonEmpty Text)
historicalDataPathList :: Maybe (NonEmpty Text)
$sel:fileFormatDescriptor:SampleDataS3SourceConfig' :: SampleDataS3SourceConfig -> FileFormatDescriptor
$sel:roleArn:SampleDataS3SourceConfig' :: SampleDataS3SourceConfig -> Text
$sel:templatedPathList:SampleDataS3SourceConfig' :: SampleDataS3SourceConfig -> Maybe (NonEmpty Text)
$sel:historicalDataPathList:SampleDataS3SourceConfig' :: SampleDataS3SourceConfig -> 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,
            forall a. a -> Maybe a
Prelude.Just (Key
"RoleArn" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= Text
roleArn),
            forall a. a -> Maybe a
Prelude.Just
              ( Key
"FileFormatDescriptor"
                  forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= FileFormatDescriptor
fileFormatDescriptor
              )
          ]
      )