{-# 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.ElasticTranscoder.Types.Preset
-- 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.ElasticTranscoder.Types.Preset where

import qualified Amazonka.Core as Core
import Amazonka.ElasticTranscoder.Types.AudioParameters
import Amazonka.ElasticTranscoder.Types.Thumbnails
import Amazonka.ElasticTranscoder.Types.VideoParameters
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude

-- | Presets are templates that contain most of the settings for transcoding
-- media files from one format to another. Elastic Transcoder includes some
-- default presets for common formats, for example, several iPod and iPhone
-- versions. You can also create your own presets for formats that aren\'t
-- included among the default presets. You specify which preset you want to
-- use when you create a job.
--
-- /See:/ 'newPreset' smart constructor.
data Preset = Preset'
  { -- | The Amazon Resource Name (ARN) for the preset.
    Preset -> Maybe Text
arn :: Prelude.Maybe Prelude.Text,
    -- | A section of the response body that provides information about the video
    -- preset values.
    Preset -> Maybe VideoParameters
video :: Prelude.Maybe VideoParameters,
    -- | A section of the response body that provides information about the
    -- thumbnail preset values, if any.
    Preset -> Maybe Thumbnails
thumbnails :: Prelude.Maybe Thumbnails,
    -- | The name of the preset.
    Preset -> Maybe Text
name :: Prelude.Maybe Prelude.Text,
    -- | The container type for the output file. Valid values include @flac@,
    -- @flv@, @fmp4@, @gif@, @mp3@, @mp4@, @mpg@, @mxf@, @oga@, @ogg@, @ts@,
    -- and @webm@.
    Preset -> Maybe Text
container :: Prelude.Maybe Prelude.Text,
    -- | Identifier for the new preset. You use this value to get settings for
    -- the preset or to delete it.
    Preset -> Maybe Text
id :: Prelude.Maybe Prelude.Text,
    -- | Whether the preset is a default preset provided by Elastic Transcoder
    -- (@System@) or a preset that you have defined (@Custom@).
    Preset -> Maybe Text
type' :: Prelude.Maybe Prelude.Text,
    -- | A description of the preset.
    Preset -> Maybe Text
description :: Prelude.Maybe Prelude.Text,
    -- | A section of the response body that provides information about the audio
    -- preset values.
    Preset -> Maybe AudioParameters
audio :: Prelude.Maybe AudioParameters
  }
  deriving (Preset -> Preset -> Bool
(Preset -> Preset -> Bool)
-> (Preset -> Preset -> Bool) -> Eq Preset
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: Preset -> Preset -> Bool
$c/= :: Preset -> Preset -> Bool
== :: Preset -> Preset -> Bool
$c== :: Preset -> Preset -> Bool
Prelude.Eq, ReadPrec [Preset]
ReadPrec Preset
Int -> ReadS Preset
ReadS [Preset]
(Int -> ReadS Preset)
-> ReadS [Preset]
-> ReadPrec Preset
-> ReadPrec [Preset]
-> Read Preset
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [Preset]
$creadListPrec :: ReadPrec [Preset]
readPrec :: ReadPrec Preset
$creadPrec :: ReadPrec Preset
readList :: ReadS [Preset]
$creadList :: ReadS [Preset]
readsPrec :: Int -> ReadS Preset
$creadsPrec :: Int -> ReadS Preset
Prelude.Read, Int -> Preset -> ShowS
[Preset] -> ShowS
Preset -> String
(Int -> Preset -> ShowS)
-> (Preset -> String) -> ([Preset] -> ShowS) -> Show Preset
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [Preset] -> ShowS
$cshowList :: [Preset] -> ShowS
show :: Preset -> String
$cshow :: Preset -> String
showsPrec :: Int -> Preset -> ShowS
$cshowsPrec :: Int -> Preset -> ShowS
Prelude.Show, (forall x. Preset -> Rep Preset x)
-> (forall x. Rep Preset x -> Preset) -> Generic Preset
forall x. Rep Preset x -> Preset
forall x. Preset -> Rep Preset x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep Preset x -> Preset
$cfrom :: forall x. Preset -> Rep Preset x
Prelude.Generic)

-- |
-- Create a value of 'Preset' 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:
--
-- 'arn', 'preset_arn' - The Amazon Resource Name (ARN) for the preset.
--
-- 'video', 'preset_video' - A section of the response body that provides information about the video
-- preset values.
--
-- 'thumbnails', 'preset_thumbnails' - A section of the response body that provides information about the
-- thumbnail preset values, if any.
--
-- 'name', 'preset_name' - The name of the preset.
--
-- 'container', 'preset_container' - The container type for the output file. Valid values include @flac@,
-- @flv@, @fmp4@, @gif@, @mp3@, @mp4@, @mpg@, @mxf@, @oga@, @ogg@, @ts@,
-- and @webm@.
--
-- 'id', 'preset_id' - Identifier for the new preset. You use this value to get settings for
-- the preset or to delete it.
--
-- 'type'', 'preset_type' - Whether the preset is a default preset provided by Elastic Transcoder
-- (@System@) or a preset that you have defined (@Custom@).
--
-- 'description', 'preset_description' - A description of the preset.
--
-- 'audio', 'preset_audio' - A section of the response body that provides information about the audio
-- preset values.
newPreset ::
  Preset
newPreset :: Preset
newPreset =
  Preset' :: Maybe Text
-> Maybe VideoParameters
-> Maybe Thumbnails
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe AudioParameters
-> Preset
Preset'
    { $sel:arn:Preset' :: Maybe Text
arn = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:video:Preset' :: Maybe VideoParameters
video = Maybe VideoParameters
forall a. Maybe a
Prelude.Nothing,
      $sel:thumbnails:Preset' :: Maybe Thumbnails
thumbnails = Maybe Thumbnails
forall a. Maybe a
Prelude.Nothing,
      $sel:name:Preset' :: Maybe Text
name = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:container:Preset' :: Maybe Text
container = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:id:Preset' :: Maybe Text
id = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:type':Preset' :: Maybe Text
type' = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:description:Preset' :: Maybe Text
description = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:audio:Preset' :: Maybe AudioParameters
audio = Maybe AudioParameters
forall a. Maybe a
Prelude.Nothing
    }

-- | The Amazon Resource Name (ARN) for the preset.
preset_arn :: Lens.Lens' Preset (Prelude.Maybe Prelude.Text)
preset_arn :: (Maybe Text -> f (Maybe Text)) -> Preset -> f Preset
preset_arn = (Preset -> Maybe Text)
-> (Preset -> Maybe Text -> Preset)
-> Lens Preset Preset (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Preset' {Maybe Text
arn :: Maybe Text
$sel:arn:Preset' :: Preset -> Maybe Text
arn} -> Maybe Text
arn) (\s :: Preset
s@Preset' {} Maybe Text
a -> Preset
s {$sel:arn:Preset' :: Maybe Text
arn = Maybe Text
a} :: Preset)

-- | A section of the response body that provides information about the video
-- preset values.
preset_video :: Lens.Lens' Preset (Prelude.Maybe VideoParameters)
preset_video :: (Maybe VideoParameters -> f (Maybe VideoParameters))
-> Preset -> f Preset
preset_video = (Preset -> Maybe VideoParameters)
-> (Preset -> Maybe VideoParameters -> Preset)
-> Lens
     Preset Preset (Maybe VideoParameters) (Maybe VideoParameters)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Preset' {Maybe VideoParameters
video :: Maybe VideoParameters
$sel:video:Preset' :: Preset -> Maybe VideoParameters
video} -> Maybe VideoParameters
video) (\s :: Preset
s@Preset' {} Maybe VideoParameters
a -> Preset
s {$sel:video:Preset' :: Maybe VideoParameters
video = Maybe VideoParameters
a} :: Preset)

-- | A section of the response body that provides information about the
-- thumbnail preset values, if any.
preset_thumbnails :: Lens.Lens' Preset (Prelude.Maybe Thumbnails)
preset_thumbnails :: (Maybe Thumbnails -> f (Maybe Thumbnails)) -> Preset -> f Preset
preset_thumbnails = (Preset -> Maybe Thumbnails)
-> (Preset -> Maybe Thumbnails -> Preset)
-> Lens Preset Preset (Maybe Thumbnails) (Maybe Thumbnails)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Preset' {Maybe Thumbnails
thumbnails :: Maybe Thumbnails
$sel:thumbnails:Preset' :: Preset -> Maybe Thumbnails
thumbnails} -> Maybe Thumbnails
thumbnails) (\s :: Preset
s@Preset' {} Maybe Thumbnails
a -> Preset
s {$sel:thumbnails:Preset' :: Maybe Thumbnails
thumbnails = Maybe Thumbnails
a} :: Preset)

-- | The name of the preset.
preset_name :: Lens.Lens' Preset (Prelude.Maybe Prelude.Text)
preset_name :: (Maybe Text -> f (Maybe Text)) -> Preset -> f Preset
preset_name = (Preset -> Maybe Text)
-> (Preset -> Maybe Text -> Preset)
-> Lens Preset Preset (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Preset' {Maybe Text
name :: Maybe Text
$sel:name:Preset' :: Preset -> Maybe Text
name} -> Maybe Text
name) (\s :: Preset
s@Preset' {} Maybe Text
a -> Preset
s {$sel:name:Preset' :: Maybe Text
name = Maybe Text
a} :: Preset)

-- | The container type for the output file. Valid values include @flac@,
-- @flv@, @fmp4@, @gif@, @mp3@, @mp4@, @mpg@, @mxf@, @oga@, @ogg@, @ts@,
-- and @webm@.
preset_container :: Lens.Lens' Preset (Prelude.Maybe Prelude.Text)
preset_container :: (Maybe Text -> f (Maybe Text)) -> Preset -> f Preset
preset_container = (Preset -> Maybe Text)
-> (Preset -> Maybe Text -> Preset)
-> Lens Preset Preset (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Preset' {Maybe Text
container :: Maybe Text
$sel:container:Preset' :: Preset -> Maybe Text
container} -> Maybe Text
container) (\s :: Preset
s@Preset' {} Maybe Text
a -> Preset
s {$sel:container:Preset' :: Maybe Text
container = Maybe Text
a} :: Preset)

-- | Identifier for the new preset. You use this value to get settings for
-- the preset or to delete it.
preset_id :: Lens.Lens' Preset (Prelude.Maybe Prelude.Text)
preset_id :: (Maybe Text -> f (Maybe Text)) -> Preset -> f Preset
preset_id = (Preset -> Maybe Text)
-> (Preset -> Maybe Text -> Preset)
-> Lens Preset Preset (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Preset' {Maybe Text
id :: Maybe Text
$sel:id:Preset' :: Preset -> Maybe Text
id} -> Maybe Text
id) (\s :: Preset
s@Preset' {} Maybe Text
a -> Preset
s {$sel:id:Preset' :: Maybe Text
id = Maybe Text
a} :: Preset)

-- | Whether the preset is a default preset provided by Elastic Transcoder
-- (@System@) or a preset that you have defined (@Custom@).
preset_type :: Lens.Lens' Preset (Prelude.Maybe Prelude.Text)
preset_type :: (Maybe Text -> f (Maybe Text)) -> Preset -> f Preset
preset_type = (Preset -> Maybe Text)
-> (Preset -> Maybe Text -> Preset)
-> Lens Preset Preset (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Preset' {Maybe Text
type' :: Maybe Text
$sel:type':Preset' :: Preset -> Maybe Text
type'} -> Maybe Text
type') (\s :: Preset
s@Preset' {} Maybe Text
a -> Preset
s {$sel:type':Preset' :: Maybe Text
type' = Maybe Text
a} :: Preset)

-- | A description of the preset.
preset_description :: Lens.Lens' Preset (Prelude.Maybe Prelude.Text)
preset_description :: (Maybe Text -> f (Maybe Text)) -> Preset -> f Preset
preset_description = (Preset -> Maybe Text)
-> (Preset -> Maybe Text -> Preset)
-> Lens Preset Preset (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Preset' {Maybe Text
description :: Maybe Text
$sel:description:Preset' :: Preset -> Maybe Text
description} -> Maybe Text
description) (\s :: Preset
s@Preset' {} Maybe Text
a -> Preset
s {$sel:description:Preset' :: Maybe Text
description = Maybe Text
a} :: Preset)

-- | A section of the response body that provides information about the audio
-- preset values.
preset_audio :: Lens.Lens' Preset (Prelude.Maybe AudioParameters)
preset_audio :: (Maybe AudioParameters -> f (Maybe AudioParameters))
-> Preset -> f Preset
preset_audio = (Preset -> Maybe AudioParameters)
-> (Preset -> Maybe AudioParameters -> Preset)
-> Lens
     Preset Preset (Maybe AudioParameters) (Maybe AudioParameters)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Preset' {Maybe AudioParameters
audio :: Maybe AudioParameters
$sel:audio:Preset' :: Preset -> Maybe AudioParameters
audio} -> Maybe AudioParameters
audio) (\s :: Preset
s@Preset' {} Maybe AudioParameters
a -> Preset
s {$sel:audio:Preset' :: Maybe AudioParameters
audio = Maybe AudioParameters
a} :: Preset)

instance Core.FromJSON Preset where
  parseJSON :: Value -> Parser Preset
parseJSON =
    String -> (Object -> Parser Preset) -> Value -> Parser Preset
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
      String
"Preset"
      ( \Object
x ->
          Maybe Text
-> Maybe VideoParameters
-> Maybe Thumbnails
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe AudioParameters
-> Preset
Preset'
            (Maybe Text
 -> Maybe VideoParameters
 -> Maybe Thumbnails
 -> Maybe Text
 -> Maybe Text
 -> Maybe Text
 -> Maybe Text
 -> Maybe Text
 -> Maybe AudioParameters
 -> Preset)
-> Parser (Maybe Text)
-> Parser
     (Maybe VideoParameters
      -> Maybe Thumbnails
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe AudioParameters
      -> Preset)
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
"Arn")
            Parser
  (Maybe VideoParameters
   -> Maybe Thumbnails
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe AudioParameters
   -> Preset)
-> Parser (Maybe VideoParameters)
-> Parser
     (Maybe Thumbnails
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe AudioParameters
      -> Preset)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe VideoParameters)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"Video")
            Parser
  (Maybe Thumbnails
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe AudioParameters
   -> Preset)
-> Parser (Maybe Thumbnails)
-> Parser
     (Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe AudioParameters
      -> Preset)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Thumbnails)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"Thumbnails")
            Parser
  (Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe AudioParameters
   -> Preset)
-> Parser (Maybe Text)
-> Parser
     (Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe AudioParameters
      -> Preset)
forall (f :: * -> *) a b. Applicative f => 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
"Name")
            Parser
  (Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe AudioParameters
   -> Preset)
-> Parser (Maybe Text)
-> Parser
     (Maybe Text
      -> Maybe Text -> Maybe Text -> Maybe AudioParameters -> Preset)
forall (f :: * -> *) a b. Applicative f => 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
"Container")
            Parser
  (Maybe Text
   -> Maybe Text -> Maybe Text -> Maybe AudioParameters -> Preset)
-> Parser (Maybe Text)
-> Parser
     (Maybe Text -> Maybe Text -> Maybe AudioParameters -> Preset)
forall (f :: * -> *) a b. Applicative f => 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
"Id")
            Parser
  (Maybe Text -> Maybe Text -> Maybe AudioParameters -> Preset)
-> Parser (Maybe Text)
-> Parser (Maybe Text -> Maybe AudioParameters -> Preset)
forall (f :: * -> *) a b. Applicative f => 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
"Type")
            Parser (Maybe Text -> Maybe AudioParameters -> Preset)
-> Parser (Maybe Text) -> Parser (Maybe AudioParameters -> Preset)
forall (f :: * -> *) a b. Applicative f => 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
"Description")
            Parser (Maybe AudioParameters -> Preset)
-> Parser (Maybe AudioParameters) -> Parser Preset
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe AudioParameters)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"Audio")
      )

instance Prelude.Hashable Preset

instance Prelude.NFData Preset