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

import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
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 list of templated paths.
    SampleDataS3SourceConfig -> Maybe (NonEmpty Text)
templatedPathList :: Prelude.Maybe (Prelude.NonEmpty Prelude.Text),
    -- | An array of strings containing the historical set of data paths.
    SampleDataS3SourceConfig -> Maybe (NonEmpty Text)
historicalDataPathList :: 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
(SampleDataS3SourceConfig -> SampleDataS3SourceConfig -> Bool)
-> (SampleDataS3SourceConfig -> SampleDataS3SourceConfig -> Bool)
-> Eq SampleDataS3SourceConfig
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]
(Int -> ReadS SampleDataS3SourceConfig)
-> ReadS [SampleDataS3SourceConfig]
-> ReadPrec SampleDataS3SourceConfig
-> ReadPrec [SampleDataS3SourceConfig]
-> Read 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
(Int -> SampleDataS3SourceConfig -> ShowS)
-> (SampleDataS3SourceConfig -> String)
-> ([SampleDataS3SourceConfig] -> ShowS)
-> Show SampleDataS3SourceConfig
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.
 SampleDataS3SourceConfig -> Rep SampleDataS3SourceConfig x)
-> (forall x.
    Rep SampleDataS3SourceConfig x -> SampleDataS3SourceConfig)
-> Generic SampleDataS3SourceConfig
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:
--
-- 'templatedPathList', 'sampleDataS3SourceConfig_templatedPathList' - An array of strings containing the list of templated paths.
--
-- 'historicalDataPathList', 'sampleDataS3SourceConfig_historicalDataPathList' - An array of strings containing the historical set of data 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' :: Maybe (NonEmpty Text)
-> Maybe (NonEmpty Text)
-> Text
-> FileFormatDescriptor
-> SampleDataS3SourceConfig
SampleDataS3SourceConfig'
      { $sel:templatedPathList:SampleDataS3SourceConfig' :: Maybe (NonEmpty Text)
templatedPathList =
          Maybe (NonEmpty Text)
forall a. Maybe a
Prelude.Nothing,
        $sel:historicalDataPathList:SampleDataS3SourceConfig' :: Maybe (NonEmpty Text)
historicalDataPathList = Maybe (NonEmpty Text)
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 list of templated paths.
sampleDataS3SourceConfig_templatedPathList :: Lens.Lens' SampleDataS3SourceConfig (Prelude.Maybe (Prelude.NonEmpty Prelude.Text))
sampleDataS3SourceConfig_templatedPathList :: (Maybe (NonEmpty Text) -> f (Maybe (NonEmpty Text)))
-> SampleDataS3SourceConfig -> f SampleDataS3SourceConfig
sampleDataS3SourceConfig_templatedPathList = (SampleDataS3SourceConfig -> Maybe (NonEmpty Text))
-> (SampleDataS3SourceConfig
    -> Maybe (NonEmpty Text) -> SampleDataS3SourceConfig)
-> Lens
     SampleDataS3SourceConfig
     SampleDataS3SourceConfig
     (Maybe (NonEmpty Text))
     (Maybe (NonEmpty Text))
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) ((Maybe (NonEmpty Text) -> f (Maybe (NonEmpty Text)))
 -> SampleDataS3SourceConfig -> f SampleDataS3SourceConfig)
-> ((Maybe (NonEmpty Text) -> f (Maybe (NonEmpty Text)))
    -> Maybe (NonEmpty Text) -> f (Maybe (NonEmpty Text)))
-> (Maybe (NonEmpty Text) -> f (Maybe (NonEmpty Text)))
-> SampleDataS3SourceConfig
-> f SampleDataS3SourceConfig
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
  (NonEmpty Text) (NonEmpty Text) (NonEmpty Text) (NonEmpty Text)
-> Iso
     (Maybe (NonEmpty Text))
     (Maybe (NonEmpty Text))
     (Maybe (NonEmpty Text))
     (Maybe (NonEmpty Text))
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 AnIso
  (NonEmpty Text) (NonEmpty Text) (NonEmpty Text) (NonEmpty Text)
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | An array of strings containing the historical set of data paths.
sampleDataS3SourceConfig_historicalDataPathList :: Lens.Lens' SampleDataS3SourceConfig (Prelude.Maybe (Prelude.NonEmpty Prelude.Text))
sampleDataS3SourceConfig_historicalDataPathList :: (Maybe (NonEmpty Text) -> f (Maybe (NonEmpty Text)))
-> SampleDataS3SourceConfig -> f SampleDataS3SourceConfig
sampleDataS3SourceConfig_historicalDataPathList = (SampleDataS3SourceConfig -> Maybe (NonEmpty Text))
-> (SampleDataS3SourceConfig
    -> Maybe (NonEmpty Text) -> SampleDataS3SourceConfig)
-> Lens
     SampleDataS3SourceConfig
     SampleDataS3SourceConfig
     (Maybe (NonEmpty Text))
     (Maybe (NonEmpty Text))
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) ((Maybe (NonEmpty Text) -> f (Maybe (NonEmpty Text)))
 -> SampleDataS3SourceConfig -> f SampleDataS3SourceConfig)
-> ((Maybe (NonEmpty Text) -> f (Maybe (NonEmpty Text)))
    -> Maybe (NonEmpty Text) -> f (Maybe (NonEmpty Text)))
-> (Maybe (NonEmpty Text) -> f (Maybe (NonEmpty Text)))
-> SampleDataS3SourceConfig
-> f SampleDataS3SourceConfig
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
  (NonEmpty Text) (NonEmpty Text) (NonEmpty Text) (NonEmpty Text)
-> Iso
     (Maybe (NonEmpty Text))
     (Maybe (NonEmpty Text))
     (Maybe (NonEmpty Text))
     (Maybe (NonEmpty Text))
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 AnIso
  (NonEmpty Text) (NonEmpty Text) (NonEmpty Text) (NonEmpty Text)
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 :: (Text -> f Text)
-> SampleDataS3SourceConfig -> f SampleDataS3SourceConfig
sampleDataS3SourceConfig_roleArn = (SampleDataS3SourceConfig -> Text)
-> (SampleDataS3SourceConfig -> Text -> SampleDataS3SourceConfig)
-> Lens SampleDataS3SourceConfig SampleDataS3SourceConfig Text Text
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 :: (FileFormatDescriptor -> f FileFormatDescriptor)
-> SampleDataS3SourceConfig -> f SampleDataS3SourceConfig
sampleDataS3SourceConfig_fileFormatDescriptor = (SampleDataS3SourceConfig -> FileFormatDescriptor)
-> (SampleDataS3SourceConfig
    -> FileFormatDescriptor -> SampleDataS3SourceConfig)
-> Lens
     SampleDataS3SourceConfig
     SampleDataS3SourceConfig
     FileFormatDescriptor
     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

instance Prelude.NFData SampleDataS3SourceConfig

instance Core.ToJSON SampleDataS3SourceConfig where
  toJSON :: SampleDataS3SourceConfig -> Value
toJSON SampleDataS3SourceConfig' {Maybe (NonEmpty Text)
Text
FileFormatDescriptor
fileFormatDescriptor :: FileFormatDescriptor
roleArn :: Text
historicalDataPathList :: Maybe (NonEmpty Text)
templatedPathList :: Maybe (NonEmpty Text)
$sel:fileFormatDescriptor:SampleDataS3SourceConfig' :: SampleDataS3SourceConfig -> FileFormatDescriptor
$sel:roleArn:SampleDataS3SourceConfig' :: SampleDataS3SourceConfig -> Text
$sel:historicalDataPathList:SampleDataS3SourceConfig' :: SampleDataS3SourceConfig -> Maybe (NonEmpty Text)
$sel:templatedPathList:SampleDataS3SourceConfig' :: SampleDataS3SourceConfig -> Maybe (NonEmpty Text)
..} =
    [Pair] -> Value
Core.object
      ( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ (Text
"TemplatedPathList" Text -> NonEmpty Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
              (NonEmpty Text -> Pair) -> Maybe (NonEmpty Text) -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe (NonEmpty Text)
templatedPathList,
            (Text
"HistoricalDataPathList" Text -> NonEmpty Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
              (NonEmpty Text -> Pair) -> Maybe (NonEmpty Text) -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe (NonEmpty Text)
historicalDataPathList,
            Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"RoleArn" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
roleArn),
            Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just
              ( Text
"FileFormatDescriptor"
                  Text -> FileFormatDescriptor -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= FileFormatDescriptor
fileFormatDescriptor
              )
          ]
      )