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

import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
import Amazonka.Transcribe.Types.SubtitleFormat

-- | Specify the output format for your subtitle file.
--
-- /See:/ 'newSubtitlesOutput' smart constructor.
data SubtitlesOutput = SubtitlesOutput'
  { -- | Specify the output format for your subtitle file; if you select both SRT
    -- and VTT formats, two output files are genereated.
    SubtitlesOutput -> Maybe [SubtitleFormat]
formats :: Prelude.Maybe [SubtitleFormat],
    -- | Choose the output location for your subtitle file. This location must be
    -- an S3 bucket.
    SubtitlesOutput -> Maybe [Text]
subtitleFileUris :: Prelude.Maybe [Prelude.Text]
  }
  deriving (SubtitlesOutput -> SubtitlesOutput -> Bool
(SubtitlesOutput -> SubtitlesOutput -> Bool)
-> (SubtitlesOutput -> SubtitlesOutput -> Bool)
-> Eq SubtitlesOutput
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: SubtitlesOutput -> SubtitlesOutput -> Bool
$c/= :: SubtitlesOutput -> SubtitlesOutput -> Bool
== :: SubtitlesOutput -> SubtitlesOutput -> Bool
$c== :: SubtitlesOutput -> SubtitlesOutput -> Bool
Prelude.Eq, ReadPrec [SubtitlesOutput]
ReadPrec SubtitlesOutput
Int -> ReadS SubtitlesOutput
ReadS [SubtitlesOutput]
(Int -> ReadS SubtitlesOutput)
-> ReadS [SubtitlesOutput]
-> ReadPrec SubtitlesOutput
-> ReadPrec [SubtitlesOutput]
-> Read SubtitlesOutput
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [SubtitlesOutput]
$creadListPrec :: ReadPrec [SubtitlesOutput]
readPrec :: ReadPrec SubtitlesOutput
$creadPrec :: ReadPrec SubtitlesOutput
readList :: ReadS [SubtitlesOutput]
$creadList :: ReadS [SubtitlesOutput]
readsPrec :: Int -> ReadS SubtitlesOutput
$creadsPrec :: Int -> ReadS SubtitlesOutput
Prelude.Read, Int -> SubtitlesOutput -> ShowS
[SubtitlesOutput] -> ShowS
SubtitlesOutput -> String
(Int -> SubtitlesOutput -> ShowS)
-> (SubtitlesOutput -> String)
-> ([SubtitlesOutput] -> ShowS)
-> Show SubtitlesOutput
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [SubtitlesOutput] -> ShowS
$cshowList :: [SubtitlesOutput] -> ShowS
show :: SubtitlesOutput -> String
$cshow :: SubtitlesOutput -> String
showsPrec :: Int -> SubtitlesOutput -> ShowS
$cshowsPrec :: Int -> SubtitlesOutput -> ShowS
Prelude.Show, (forall x. SubtitlesOutput -> Rep SubtitlesOutput x)
-> (forall x. Rep SubtitlesOutput x -> SubtitlesOutput)
-> Generic SubtitlesOutput
forall x. Rep SubtitlesOutput x -> SubtitlesOutput
forall x. SubtitlesOutput -> Rep SubtitlesOutput x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep SubtitlesOutput x -> SubtitlesOutput
$cfrom :: forall x. SubtitlesOutput -> Rep SubtitlesOutput x
Prelude.Generic)

-- |
-- Create a value of 'SubtitlesOutput' 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:
--
-- 'formats', 'subtitlesOutput_formats' - Specify the output format for your subtitle file; if you select both SRT
-- and VTT formats, two output files are genereated.
--
-- 'subtitleFileUris', 'subtitlesOutput_subtitleFileUris' - Choose the output location for your subtitle file. This location must be
-- an S3 bucket.
newSubtitlesOutput ::
  SubtitlesOutput
newSubtitlesOutput :: SubtitlesOutput
newSubtitlesOutput =
  SubtitlesOutput' :: Maybe [SubtitleFormat] -> Maybe [Text] -> SubtitlesOutput
SubtitlesOutput'
    { $sel:formats:SubtitlesOutput' :: Maybe [SubtitleFormat]
formats = Maybe [SubtitleFormat]
forall a. Maybe a
Prelude.Nothing,
      $sel:subtitleFileUris:SubtitlesOutput' :: Maybe [Text]
subtitleFileUris = Maybe [Text]
forall a. Maybe a
Prelude.Nothing
    }

-- | Specify the output format for your subtitle file; if you select both SRT
-- and VTT formats, two output files are genereated.
subtitlesOutput_formats :: Lens.Lens' SubtitlesOutput (Prelude.Maybe [SubtitleFormat])
subtitlesOutput_formats :: (Maybe [SubtitleFormat] -> f (Maybe [SubtitleFormat]))
-> SubtitlesOutput -> f SubtitlesOutput
subtitlesOutput_formats = (SubtitlesOutput -> Maybe [SubtitleFormat])
-> (SubtitlesOutput -> Maybe [SubtitleFormat] -> SubtitlesOutput)
-> Lens
     SubtitlesOutput
     SubtitlesOutput
     (Maybe [SubtitleFormat])
     (Maybe [SubtitleFormat])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SubtitlesOutput' {Maybe [SubtitleFormat]
formats :: Maybe [SubtitleFormat]
$sel:formats:SubtitlesOutput' :: SubtitlesOutput -> Maybe [SubtitleFormat]
formats} -> Maybe [SubtitleFormat]
formats) (\s :: SubtitlesOutput
s@SubtitlesOutput' {} Maybe [SubtitleFormat]
a -> SubtitlesOutput
s {$sel:formats:SubtitlesOutput' :: Maybe [SubtitleFormat]
formats = Maybe [SubtitleFormat]
a} :: SubtitlesOutput) ((Maybe [SubtitleFormat] -> f (Maybe [SubtitleFormat]))
 -> SubtitlesOutput -> f SubtitlesOutput)
-> ((Maybe [SubtitleFormat] -> f (Maybe [SubtitleFormat]))
    -> Maybe [SubtitleFormat] -> f (Maybe [SubtitleFormat]))
-> (Maybe [SubtitleFormat] -> f (Maybe [SubtitleFormat]))
-> SubtitlesOutput
-> f SubtitlesOutput
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
  [SubtitleFormat] [SubtitleFormat] [SubtitleFormat] [SubtitleFormat]
-> Iso
     (Maybe [SubtitleFormat])
     (Maybe [SubtitleFormat])
     (Maybe [SubtitleFormat])
     (Maybe [SubtitleFormat])
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
  [SubtitleFormat] [SubtitleFormat] [SubtitleFormat] [SubtitleFormat]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | Choose the output location for your subtitle file. This location must be
-- an S3 bucket.
subtitlesOutput_subtitleFileUris :: Lens.Lens' SubtitlesOutput (Prelude.Maybe [Prelude.Text])
subtitlesOutput_subtitleFileUris :: (Maybe [Text] -> f (Maybe [Text]))
-> SubtitlesOutput -> f SubtitlesOutput
subtitlesOutput_subtitleFileUris = (SubtitlesOutput -> Maybe [Text])
-> (SubtitlesOutput -> Maybe [Text] -> SubtitlesOutput)
-> Lens
     SubtitlesOutput SubtitlesOutput (Maybe [Text]) (Maybe [Text])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SubtitlesOutput' {Maybe [Text]
subtitleFileUris :: Maybe [Text]
$sel:subtitleFileUris:SubtitlesOutput' :: SubtitlesOutput -> Maybe [Text]
subtitleFileUris} -> Maybe [Text]
subtitleFileUris) (\s :: SubtitlesOutput
s@SubtitlesOutput' {} Maybe [Text]
a -> SubtitlesOutput
s {$sel:subtitleFileUris:SubtitlesOutput' :: Maybe [Text]
subtitleFileUris = Maybe [Text]
a} :: SubtitlesOutput) ((Maybe [Text] -> f (Maybe [Text]))
 -> SubtitlesOutput -> f SubtitlesOutput)
-> ((Maybe [Text] -> f (Maybe [Text]))
    -> Maybe [Text] -> f (Maybe [Text]))
-> (Maybe [Text] -> f (Maybe [Text]))
-> SubtitlesOutput
-> f SubtitlesOutput
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso [Text] [Text] [Text] [Text]
-> Iso (Maybe [Text]) (Maybe [Text]) (Maybe [Text]) (Maybe [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 [Text] [Text] [Text] [Text]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

instance Core.FromJSON SubtitlesOutput where
  parseJSON :: Value -> Parser SubtitlesOutput
parseJSON =
    String
-> (Object -> Parser SubtitlesOutput)
-> Value
-> Parser SubtitlesOutput
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
      String
"SubtitlesOutput"
      ( \Object
x ->
          Maybe [SubtitleFormat] -> Maybe [Text] -> SubtitlesOutput
SubtitlesOutput'
            (Maybe [SubtitleFormat] -> Maybe [Text] -> SubtitlesOutput)
-> Parser (Maybe [SubtitleFormat])
-> Parser (Maybe [Text] -> SubtitlesOutput)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Parser (Maybe (Maybe [SubtitleFormat]))
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"Formats" Parser (Maybe (Maybe [SubtitleFormat]))
-> Maybe [SubtitleFormat] -> Parser (Maybe [SubtitleFormat])
forall a. Parser (Maybe a) -> a -> Parser a
Core..!= Maybe [SubtitleFormat]
forall a. Monoid a => a
Prelude.mempty)
            Parser (Maybe [Text] -> SubtitlesOutput)
-> Parser (Maybe [Text]) -> Parser SubtitlesOutput
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ( Object
x Object -> Text -> Parser (Maybe (Maybe [Text]))
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"SubtitleFileUris"
                            Parser (Maybe (Maybe [Text]))
-> Maybe [Text] -> Parser (Maybe [Text])
forall a. Parser (Maybe a) -> a -> Parser a
Core..!= Maybe [Text]
forall a. Monoid a => a
Prelude.mempty
                        )
      )

instance Prelude.Hashable SubtitlesOutput

instance Prelude.NFData SubtitlesOutput