{-# 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.Transcribe.Types.InputDataConfig
-- 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.Transcribe.Types.InputDataConfig where

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

-- | The object that contains the Amazon S3 object location and access role
-- required to train and tune your custom language model.
--
-- /See:/ 'newInputDataConfig' smart constructor.
data InputDataConfig = InputDataConfig'
  { -- | The Amazon S3 prefix you specify to access the plain text files that you
    -- use to tune your custom language model.
    InputDataConfig -> Maybe Text
tuningDataS3Uri :: Prelude.Maybe Prelude.Text,
    -- | The Amazon S3 prefix you specify to access the plain text files that you
    -- use to train your custom language model.
    InputDataConfig -> Text
s3Uri :: Prelude.Text,
    -- | The Amazon Resource Name (ARN) that uniquely identifies the permissions
    -- you\'ve given Amazon Transcribe to access your Amazon S3 buckets
    -- containing your media files or text data.
    InputDataConfig -> Text
dataAccessRoleArn :: Prelude.Text
  }
  deriving (InputDataConfig -> InputDataConfig -> Bool
(InputDataConfig -> InputDataConfig -> Bool)
-> (InputDataConfig -> InputDataConfig -> Bool)
-> Eq InputDataConfig
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: InputDataConfig -> InputDataConfig -> Bool
$c/= :: InputDataConfig -> InputDataConfig -> Bool
== :: InputDataConfig -> InputDataConfig -> Bool
$c== :: InputDataConfig -> InputDataConfig -> Bool
Prelude.Eq, ReadPrec [InputDataConfig]
ReadPrec InputDataConfig
Int -> ReadS InputDataConfig
ReadS [InputDataConfig]
(Int -> ReadS InputDataConfig)
-> ReadS [InputDataConfig]
-> ReadPrec InputDataConfig
-> ReadPrec [InputDataConfig]
-> Read InputDataConfig
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [InputDataConfig]
$creadListPrec :: ReadPrec [InputDataConfig]
readPrec :: ReadPrec InputDataConfig
$creadPrec :: ReadPrec InputDataConfig
readList :: ReadS [InputDataConfig]
$creadList :: ReadS [InputDataConfig]
readsPrec :: Int -> ReadS InputDataConfig
$creadsPrec :: Int -> ReadS InputDataConfig
Prelude.Read, Int -> InputDataConfig -> ShowS
[InputDataConfig] -> ShowS
InputDataConfig -> String
(Int -> InputDataConfig -> ShowS)
-> (InputDataConfig -> String)
-> ([InputDataConfig] -> ShowS)
-> Show InputDataConfig
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [InputDataConfig] -> ShowS
$cshowList :: [InputDataConfig] -> ShowS
show :: InputDataConfig -> String
$cshow :: InputDataConfig -> String
showsPrec :: Int -> InputDataConfig -> ShowS
$cshowsPrec :: Int -> InputDataConfig -> ShowS
Prelude.Show, (forall x. InputDataConfig -> Rep InputDataConfig x)
-> (forall x. Rep InputDataConfig x -> InputDataConfig)
-> Generic InputDataConfig
forall x. Rep InputDataConfig x -> InputDataConfig
forall x. InputDataConfig -> Rep InputDataConfig x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep InputDataConfig x -> InputDataConfig
$cfrom :: forall x. InputDataConfig -> Rep InputDataConfig x
Prelude.Generic)

-- |
-- Create a value of 'InputDataConfig' 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:
--
-- 'tuningDataS3Uri', 'inputDataConfig_tuningDataS3Uri' - The Amazon S3 prefix you specify to access the plain text files that you
-- use to tune your custom language model.
--
-- 's3Uri', 'inputDataConfig_s3Uri' - The Amazon S3 prefix you specify to access the plain text files that you
-- use to train your custom language model.
--
-- 'dataAccessRoleArn', 'inputDataConfig_dataAccessRoleArn' - The Amazon Resource Name (ARN) that uniquely identifies the permissions
-- you\'ve given Amazon Transcribe to access your Amazon S3 buckets
-- containing your media files or text data.
newInputDataConfig ::
  -- | 's3Uri'
  Prelude.Text ->
  -- | 'dataAccessRoleArn'
  Prelude.Text ->
  InputDataConfig
newInputDataConfig :: Text -> Text -> InputDataConfig
newInputDataConfig Text
pS3Uri_ Text
pDataAccessRoleArn_ =
  InputDataConfig' :: Maybe Text -> Text -> Text -> InputDataConfig
InputDataConfig'
    { $sel:tuningDataS3Uri:InputDataConfig' :: Maybe Text
tuningDataS3Uri = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:s3Uri:InputDataConfig' :: Text
s3Uri = Text
pS3Uri_,
      $sel:dataAccessRoleArn:InputDataConfig' :: Text
dataAccessRoleArn = Text
pDataAccessRoleArn_
    }

-- | The Amazon S3 prefix you specify to access the plain text files that you
-- use to tune your custom language model.
inputDataConfig_tuningDataS3Uri :: Lens.Lens' InputDataConfig (Prelude.Maybe Prelude.Text)
inputDataConfig_tuningDataS3Uri :: (Maybe Text -> f (Maybe Text))
-> InputDataConfig -> f InputDataConfig
inputDataConfig_tuningDataS3Uri = (InputDataConfig -> Maybe Text)
-> (InputDataConfig -> Maybe Text -> InputDataConfig)
-> Lens InputDataConfig InputDataConfig (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\InputDataConfig' {Maybe Text
tuningDataS3Uri :: Maybe Text
$sel:tuningDataS3Uri:InputDataConfig' :: InputDataConfig -> Maybe Text
tuningDataS3Uri} -> Maybe Text
tuningDataS3Uri) (\s :: InputDataConfig
s@InputDataConfig' {} Maybe Text
a -> InputDataConfig
s {$sel:tuningDataS3Uri:InputDataConfig' :: Maybe Text
tuningDataS3Uri = Maybe Text
a} :: InputDataConfig)

-- | The Amazon S3 prefix you specify to access the plain text files that you
-- use to train your custom language model.
inputDataConfig_s3Uri :: Lens.Lens' InputDataConfig Prelude.Text
inputDataConfig_s3Uri :: (Text -> f Text) -> InputDataConfig -> f InputDataConfig
inputDataConfig_s3Uri = (InputDataConfig -> Text)
-> (InputDataConfig -> Text -> InputDataConfig)
-> Lens InputDataConfig InputDataConfig Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\InputDataConfig' {Text
s3Uri :: Text
$sel:s3Uri:InputDataConfig' :: InputDataConfig -> Text
s3Uri} -> Text
s3Uri) (\s :: InputDataConfig
s@InputDataConfig' {} Text
a -> InputDataConfig
s {$sel:s3Uri:InputDataConfig' :: Text
s3Uri = Text
a} :: InputDataConfig)

-- | The Amazon Resource Name (ARN) that uniquely identifies the permissions
-- you\'ve given Amazon Transcribe to access your Amazon S3 buckets
-- containing your media files or text data.
inputDataConfig_dataAccessRoleArn :: Lens.Lens' InputDataConfig Prelude.Text
inputDataConfig_dataAccessRoleArn :: (Text -> f Text) -> InputDataConfig -> f InputDataConfig
inputDataConfig_dataAccessRoleArn = (InputDataConfig -> Text)
-> (InputDataConfig -> Text -> InputDataConfig)
-> Lens InputDataConfig InputDataConfig Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\InputDataConfig' {Text
dataAccessRoleArn :: Text
$sel:dataAccessRoleArn:InputDataConfig' :: InputDataConfig -> Text
dataAccessRoleArn} -> Text
dataAccessRoleArn) (\s :: InputDataConfig
s@InputDataConfig' {} Text
a -> InputDataConfig
s {$sel:dataAccessRoleArn:InputDataConfig' :: Text
dataAccessRoleArn = Text
a} :: InputDataConfig)

instance Core.FromJSON InputDataConfig where
  parseJSON :: Value -> Parser InputDataConfig
parseJSON =
    String
-> (Object -> Parser InputDataConfig)
-> Value
-> Parser InputDataConfig
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
      String
"InputDataConfig"
      ( \Object
x ->
          Maybe Text -> Text -> Text -> InputDataConfig
InputDataConfig'
            (Maybe Text -> Text -> Text -> InputDataConfig)
-> Parser (Maybe Text) -> Parser (Text -> Text -> InputDataConfig)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"TuningDataS3Uri")
            Parser (Text -> Text -> InputDataConfig)
-> Parser Text -> Parser (Text -> InputDataConfig)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser Text
forall a. FromJSON a => Object -> Text -> Parser a
Core..: Text
"S3Uri")
            Parser (Text -> InputDataConfig)
-> Parser Text -> Parser InputDataConfig
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser Text
forall a. FromJSON a => Object -> Text -> Parser a
Core..: Text
"DataAccessRoleArn")
      )

instance Prelude.Hashable InputDataConfig

instance Prelude.NFData InputDataConfig

instance Core.ToJSON InputDataConfig where
  toJSON :: InputDataConfig -> Value
toJSON InputDataConfig' {Maybe Text
Text
dataAccessRoleArn :: Text
s3Uri :: Text
tuningDataS3Uri :: Maybe Text
$sel:dataAccessRoleArn:InputDataConfig' :: InputDataConfig -> Text
$sel:s3Uri:InputDataConfig' :: InputDataConfig -> Text
$sel:tuningDataS3Uri:InputDataConfig' :: InputDataConfig -> Maybe Text
..} =
    [Pair] -> Value
Core.object
      ( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ (Text
"TuningDataS3Uri" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
              (Text -> Pair) -> Maybe Text -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
tuningDataS3Uri,
            Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"S3Uri" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
s3Uri),
            Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just
              (Text
"DataAccessRoleArn" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
dataAccessRoleArn)
          ]
      )