{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE DuplicateRecordFields #-}
{-# LANGUAGE NamedFieldPuns #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE RecordWildCards #-}
{-# LANGUAGE StrictData #-}
{-# LANGUAGE TypeFamilies #-}
{-# LANGUAGE NoImplicitPrelude #-}
{-# OPTIONS_GHC -fno-warn-unused-binds #-}
{-# 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.CreatePreset
-- 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)
--
-- The CreatePreset operation creates a preset with settings that you
-- specify.
--
-- Elastic Transcoder checks the CreatePreset settings to ensure that they
-- meet Elastic Transcoder requirements and to determine whether they
-- comply with H.264 standards. If your settings are not valid for Elastic
-- Transcoder, Elastic Transcoder returns an HTTP 400 response
-- (@ValidationException@) and does not create the preset. If the settings
-- are valid for Elastic Transcoder but aren\'t strictly compliant with the
-- H.264 standard, Elastic Transcoder creates the preset and returns a
-- warning message in the response. This helps you determine whether your
-- settings comply with the H.264 standard while giving you greater
-- flexibility with respect to the video that Elastic Transcoder produces.
--
-- Elastic Transcoder uses the H.264 video-compression format. For more
-- information, see the International Telecommunication Union publication
-- /Recommendation ITU-T H.264: Advanced video coding for generic
-- audiovisual services/.
module Amazonka.ElasticTranscoder.CreatePreset
  ( -- * Creating a Request
    CreatePreset (..),
    newCreatePreset,

    -- * Request Lenses
    createPreset_video,
    createPreset_thumbnails,
    createPreset_description,
    createPreset_audio,
    createPreset_name,
    createPreset_container,

    -- * Destructuring the Response
    CreatePresetResponse (..),
    newCreatePresetResponse,

    -- * Response Lenses
    createPresetResponse_warning,
    createPresetResponse_preset,
    createPresetResponse_httpStatus,
  )
where

import qualified Amazonka.Core as Core
import Amazonka.ElasticTranscoder.Types
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
import qualified Amazonka.Request as Request
import qualified Amazonka.Response as Response

-- | The @CreatePresetRequest@ structure.
--
-- /See:/ 'newCreatePreset' smart constructor.
data CreatePreset = CreatePreset'
  { -- | A section of the request body that specifies the video parameters.
    CreatePreset -> Maybe VideoParameters
video :: Prelude.Maybe VideoParameters,
    -- | A section of the request body that specifies the thumbnail parameters,
    -- if any.
    CreatePreset -> Maybe Thumbnails
thumbnails :: Prelude.Maybe Thumbnails,
    -- | A description of the preset.
    CreatePreset -> Maybe Text
description :: Prelude.Maybe Prelude.Text,
    -- | A section of the request body that specifies the audio parameters.
    CreatePreset -> Maybe AudioParameters
audio :: Prelude.Maybe AudioParameters,
    -- | The name of the preset. We recommend that the name be unique within the
    -- AWS account, but uniqueness is not enforced.
    CreatePreset -> Text
name :: 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@.
    CreatePreset -> Text
container :: Prelude.Text
  }
  deriving (CreatePreset -> CreatePreset -> Bool
(CreatePreset -> CreatePreset -> Bool)
-> (CreatePreset -> CreatePreset -> Bool) -> Eq CreatePreset
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: CreatePreset -> CreatePreset -> Bool
$c/= :: CreatePreset -> CreatePreset -> Bool
== :: CreatePreset -> CreatePreset -> Bool
$c== :: CreatePreset -> CreatePreset -> Bool
Prelude.Eq, ReadPrec [CreatePreset]
ReadPrec CreatePreset
Int -> ReadS CreatePreset
ReadS [CreatePreset]
(Int -> ReadS CreatePreset)
-> ReadS [CreatePreset]
-> ReadPrec CreatePreset
-> ReadPrec [CreatePreset]
-> Read CreatePreset
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [CreatePreset]
$creadListPrec :: ReadPrec [CreatePreset]
readPrec :: ReadPrec CreatePreset
$creadPrec :: ReadPrec CreatePreset
readList :: ReadS [CreatePreset]
$creadList :: ReadS [CreatePreset]
readsPrec :: Int -> ReadS CreatePreset
$creadsPrec :: Int -> ReadS CreatePreset
Prelude.Read, Int -> CreatePreset -> ShowS
[CreatePreset] -> ShowS
CreatePreset -> String
(Int -> CreatePreset -> ShowS)
-> (CreatePreset -> String)
-> ([CreatePreset] -> ShowS)
-> Show CreatePreset
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [CreatePreset] -> ShowS
$cshowList :: [CreatePreset] -> ShowS
show :: CreatePreset -> String
$cshow :: CreatePreset -> String
showsPrec :: Int -> CreatePreset -> ShowS
$cshowsPrec :: Int -> CreatePreset -> ShowS
Prelude.Show, (forall x. CreatePreset -> Rep CreatePreset x)
-> (forall x. Rep CreatePreset x -> CreatePreset)
-> Generic CreatePreset
forall x. Rep CreatePreset x -> CreatePreset
forall x. CreatePreset -> Rep CreatePreset x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep CreatePreset x -> CreatePreset
$cfrom :: forall x. CreatePreset -> Rep CreatePreset x
Prelude.Generic)

-- |
-- Create a value of 'CreatePreset' 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:
--
-- 'video', 'createPreset_video' - A section of the request body that specifies the video parameters.
--
-- 'thumbnails', 'createPreset_thumbnails' - A section of the request body that specifies the thumbnail parameters,
-- if any.
--
-- 'description', 'createPreset_description' - A description of the preset.
--
-- 'audio', 'createPreset_audio' - A section of the request body that specifies the audio parameters.
--
-- 'name', 'createPreset_name' - The name of the preset. We recommend that the name be unique within the
-- AWS account, but uniqueness is not enforced.
--
-- 'container', 'createPreset_container' - The container type for the output file. Valid values include @flac@,
-- @flv@, @fmp4@, @gif@, @mp3@, @mp4@, @mpg@, @mxf@, @oga@, @ogg@, @ts@,
-- and @webm@.
newCreatePreset ::
  -- | 'name'
  Prelude.Text ->
  -- | 'container'
  Prelude.Text ->
  CreatePreset
newCreatePreset :: Text -> Text -> CreatePreset
newCreatePreset Text
pName_ Text
pContainer_ =
  CreatePreset' :: Maybe VideoParameters
-> Maybe Thumbnails
-> Maybe Text
-> Maybe AudioParameters
-> Text
-> Text
-> CreatePreset
CreatePreset'
    { $sel:video:CreatePreset' :: Maybe VideoParameters
video = Maybe VideoParameters
forall a. Maybe a
Prelude.Nothing,
      $sel:thumbnails:CreatePreset' :: Maybe Thumbnails
thumbnails = Maybe Thumbnails
forall a. Maybe a
Prelude.Nothing,
      $sel:description:CreatePreset' :: Maybe Text
description = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:audio:CreatePreset' :: Maybe AudioParameters
audio = Maybe AudioParameters
forall a. Maybe a
Prelude.Nothing,
      $sel:name:CreatePreset' :: Text
name = Text
pName_,
      $sel:container:CreatePreset' :: Text
container = Text
pContainer_
    }

-- | A section of the request body that specifies the video parameters.
createPreset_video :: Lens.Lens' CreatePreset (Prelude.Maybe VideoParameters)
createPreset_video :: (Maybe VideoParameters -> f (Maybe VideoParameters))
-> CreatePreset -> f CreatePreset
createPreset_video = (CreatePreset -> Maybe VideoParameters)
-> (CreatePreset -> Maybe VideoParameters -> CreatePreset)
-> Lens
     CreatePreset
     CreatePreset
     (Maybe VideoParameters)
     (Maybe VideoParameters)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreatePreset' {Maybe VideoParameters
video :: Maybe VideoParameters
$sel:video:CreatePreset' :: CreatePreset -> Maybe VideoParameters
video} -> Maybe VideoParameters
video) (\s :: CreatePreset
s@CreatePreset' {} Maybe VideoParameters
a -> CreatePreset
s {$sel:video:CreatePreset' :: Maybe VideoParameters
video = Maybe VideoParameters
a} :: CreatePreset)

-- | A section of the request body that specifies the thumbnail parameters,
-- if any.
createPreset_thumbnails :: Lens.Lens' CreatePreset (Prelude.Maybe Thumbnails)
createPreset_thumbnails :: (Maybe Thumbnails -> f (Maybe Thumbnails))
-> CreatePreset -> f CreatePreset
createPreset_thumbnails = (CreatePreset -> Maybe Thumbnails)
-> (CreatePreset -> Maybe Thumbnails -> CreatePreset)
-> Lens
     CreatePreset CreatePreset (Maybe Thumbnails) (Maybe Thumbnails)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreatePreset' {Maybe Thumbnails
thumbnails :: Maybe Thumbnails
$sel:thumbnails:CreatePreset' :: CreatePreset -> Maybe Thumbnails
thumbnails} -> Maybe Thumbnails
thumbnails) (\s :: CreatePreset
s@CreatePreset' {} Maybe Thumbnails
a -> CreatePreset
s {$sel:thumbnails:CreatePreset' :: Maybe Thumbnails
thumbnails = Maybe Thumbnails
a} :: CreatePreset)

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

-- | A section of the request body that specifies the audio parameters.
createPreset_audio :: Lens.Lens' CreatePreset (Prelude.Maybe AudioParameters)
createPreset_audio :: (Maybe AudioParameters -> f (Maybe AudioParameters))
-> CreatePreset -> f CreatePreset
createPreset_audio = (CreatePreset -> Maybe AudioParameters)
-> (CreatePreset -> Maybe AudioParameters -> CreatePreset)
-> Lens
     CreatePreset
     CreatePreset
     (Maybe AudioParameters)
     (Maybe AudioParameters)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreatePreset' {Maybe AudioParameters
audio :: Maybe AudioParameters
$sel:audio:CreatePreset' :: CreatePreset -> Maybe AudioParameters
audio} -> Maybe AudioParameters
audio) (\s :: CreatePreset
s@CreatePreset' {} Maybe AudioParameters
a -> CreatePreset
s {$sel:audio:CreatePreset' :: Maybe AudioParameters
audio = Maybe AudioParameters
a} :: CreatePreset)

-- | The name of the preset. We recommend that the name be unique within the
-- AWS account, but uniqueness is not enforced.
createPreset_name :: Lens.Lens' CreatePreset Prelude.Text
createPreset_name :: (Text -> f Text) -> CreatePreset -> f CreatePreset
createPreset_name = (CreatePreset -> Text)
-> (CreatePreset -> Text -> CreatePreset)
-> Lens CreatePreset CreatePreset Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreatePreset' {Text
name :: Text
$sel:name:CreatePreset' :: CreatePreset -> Text
name} -> Text
name) (\s :: CreatePreset
s@CreatePreset' {} Text
a -> CreatePreset
s {$sel:name:CreatePreset' :: Text
name = Text
a} :: CreatePreset)

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

instance Core.AWSRequest CreatePreset where
  type AWSResponse CreatePreset = CreatePresetResponse
  request :: CreatePreset -> Request CreatePreset
request = Service -> CreatePreset -> Request CreatePreset
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON Service
defaultService
  response :: Logger
-> Service
-> Proxy CreatePreset
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse CreatePreset)))
response =
    (Int
 -> ResponseHeaders
 -> Object
 -> Either String (AWSResponse CreatePreset))
-> Logger
-> Service
-> Proxy CreatePreset
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse CreatePreset)))
forall (m :: * -> *) a.
MonadResource m =>
(Int -> ResponseHeaders -> Object -> Either String (AWSResponse a))
-> Logger
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveJSON
      ( \Int
s ResponseHeaders
h Object
x ->
          Maybe Text -> Maybe Preset -> Int -> CreatePresetResponse
CreatePresetResponse'
            (Maybe Text -> Maybe Preset -> Int -> CreatePresetResponse)
-> Either String (Maybe Text)
-> Either String (Maybe Preset -> Int -> CreatePresetResponse)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Either String (Maybe Text)
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"Warning")
            Either String (Maybe Preset -> Int -> CreatePresetResponse)
-> Either String (Maybe Preset)
-> Either String (Int -> CreatePresetResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Either String (Maybe Preset)
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"Preset")
            Either String (Int -> CreatePresetResponse)
-> Either String Int -> Either String CreatePresetResponse
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Int -> Either String Int
forall (f :: * -> *) a. Applicative f => a -> f a
Prelude.pure (Int -> Int
forall a. Enum a => a -> Int
Prelude.fromEnum Int
s))
      )

instance Prelude.Hashable CreatePreset

instance Prelude.NFData CreatePreset

instance Core.ToHeaders CreatePreset where
  toHeaders :: CreatePreset -> ResponseHeaders
toHeaders = ResponseHeaders -> CreatePreset -> ResponseHeaders
forall a b. a -> b -> a
Prelude.const ResponseHeaders
forall a. Monoid a => a
Prelude.mempty

instance Core.ToJSON CreatePreset where
  toJSON :: CreatePreset -> Value
toJSON CreatePreset' {Maybe Text
Maybe AudioParameters
Maybe Thumbnails
Maybe VideoParameters
Text
container :: Text
name :: Text
audio :: Maybe AudioParameters
description :: Maybe Text
thumbnails :: Maybe Thumbnails
video :: Maybe VideoParameters
$sel:container:CreatePreset' :: CreatePreset -> Text
$sel:name:CreatePreset' :: CreatePreset -> Text
$sel:audio:CreatePreset' :: CreatePreset -> Maybe AudioParameters
$sel:description:CreatePreset' :: CreatePreset -> Maybe Text
$sel:thumbnails:CreatePreset' :: CreatePreset -> Maybe Thumbnails
$sel:video:CreatePreset' :: CreatePreset -> Maybe VideoParameters
..} =
    [Pair] -> Value
Core.object
      ( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ (Text
"Video" Text -> VideoParameters -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (VideoParameters -> Pair) -> Maybe VideoParameters -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe VideoParameters
video,
            (Text
"Thumbnails" Text -> Thumbnails -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (Thumbnails -> Pair) -> Maybe Thumbnails -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Thumbnails
thumbnails,
            (Text
"Description" 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
description,
            (Text
"Audio" Text -> AudioParameters -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (AudioParameters -> Pair) -> Maybe AudioParameters -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe AudioParameters
audio,
            Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"Name" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
name),
            Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"Container" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
container)
          ]
      )

instance Core.ToPath CreatePreset where
  toPath :: CreatePreset -> ByteString
toPath = ByteString -> CreatePreset -> ByteString
forall a b. a -> b -> a
Prelude.const ByteString
"/2012-09-25/presets"

instance Core.ToQuery CreatePreset where
  toQuery :: CreatePreset -> QueryString
toQuery = QueryString -> CreatePreset -> QueryString
forall a b. a -> b -> a
Prelude.const QueryString
forall a. Monoid a => a
Prelude.mempty

-- | The @CreatePresetResponse@ structure.
--
-- /See:/ 'newCreatePresetResponse' smart constructor.
data CreatePresetResponse = CreatePresetResponse'
  { -- | If the preset settings don\'t comply with the standards for the video
    -- codec but Elastic Transcoder created the preset, this message explains
    -- the reason the preset settings don\'t meet the standard. Elastic
    -- Transcoder created the preset because the settings might produce
    -- acceptable output.
    CreatePresetResponse -> Maybe Text
warning :: Prelude.Maybe Prelude.Text,
    -- | A section of the response body that provides information about the
    -- preset that is created.
    CreatePresetResponse -> Maybe Preset
preset :: Prelude.Maybe Preset,
    -- | The response's http status code.
    CreatePresetResponse -> Int
httpStatus :: Prelude.Int
  }
  deriving (CreatePresetResponse -> CreatePresetResponse -> Bool
(CreatePresetResponse -> CreatePresetResponse -> Bool)
-> (CreatePresetResponse -> CreatePresetResponse -> Bool)
-> Eq CreatePresetResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: CreatePresetResponse -> CreatePresetResponse -> Bool
$c/= :: CreatePresetResponse -> CreatePresetResponse -> Bool
== :: CreatePresetResponse -> CreatePresetResponse -> Bool
$c== :: CreatePresetResponse -> CreatePresetResponse -> Bool
Prelude.Eq, ReadPrec [CreatePresetResponse]
ReadPrec CreatePresetResponse
Int -> ReadS CreatePresetResponse
ReadS [CreatePresetResponse]
(Int -> ReadS CreatePresetResponse)
-> ReadS [CreatePresetResponse]
-> ReadPrec CreatePresetResponse
-> ReadPrec [CreatePresetResponse]
-> Read CreatePresetResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [CreatePresetResponse]
$creadListPrec :: ReadPrec [CreatePresetResponse]
readPrec :: ReadPrec CreatePresetResponse
$creadPrec :: ReadPrec CreatePresetResponse
readList :: ReadS [CreatePresetResponse]
$creadList :: ReadS [CreatePresetResponse]
readsPrec :: Int -> ReadS CreatePresetResponse
$creadsPrec :: Int -> ReadS CreatePresetResponse
Prelude.Read, Int -> CreatePresetResponse -> ShowS
[CreatePresetResponse] -> ShowS
CreatePresetResponse -> String
(Int -> CreatePresetResponse -> ShowS)
-> (CreatePresetResponse -> String)
-> ([CreatePresetResponse] -> ShowS)
-> Show CreatePresetResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [CreatePresetResponse] -> ShowS
$cshowList :: [CreatePresetResponse] -> ShowS
show :: CreatePresetResponse -> String
$cshow :: CreatePresetResponse -> String
showsPrec :: Int -> CreatePresetResponse -> ShowS
$cshowsPrec :: Int -> CreatePresetResponse -> ShowS
Prelude.Show, (forall x. CreatePresetResponse -> Rep CreatePresetResponse x)
-> (forall x. Rep CreatePresetResponse x -> CreatePresetResponse)
-> Generic CreatePresetResponse
forall x. Rep CreatePresetResponse x -> CreatePresetResponse
forall x. CreatePresetResponse -> Rep CreatePresetResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep CreatePresetResponse x -> CreatePresetResponse
$cfrom :: forall x. CreatePresetResponse -> Rep CreatePresetResponse x
Prelude.Generic)

-- |
-- Create a value of 'CreatePresetResponse' 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:
--
-- 'warning', 'createPresetResponse_warning' - If the preset settings don\'t comply with the standards for the video
-- codec but Elastic Transcoder created the preset, this message explains
-- the reason the preset settings don\'t meet the standard. Elastic
-- Transcoder created the preset because the settings might produce
-- acceptable output.
--
-- 'preset', 'createPresetResponse_preset' - A section of the response body that provides information about the
-- preset that is created.
--
-- 'httpStatus', 'createPresetResponse_httpStatus' - The response's http status code.
newCreatePresetResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  CreatePresetResponse
newCreatePresetResponse :: Int -> CreatePresetResponse
newCreatePresetResponse Int
pHttpStatus_ =
  CreatePresetResponse' :: Maybe Text -> Maybe Preset -> Int -> CreatePresetResponse
CreatePresetResponse'
    { $sel:warning:CreatePresetResponse' :: Maybe Text
warning = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:preset:CreatePresetResponse' :: Maybe Preset
preset = Maybe Preset
forall a. Maybe a
Prelude.Nothing,
      $sel:httpStatus:CreatePresetResponse' :: Int
httpStatus = Int
pHttpStatus_
    }

-- | If the preset settings don\'t comply with the standards for the video
-- codec but Elastic Transcoder created the preset, this message explains
-- the reason the preset settings don\'t meet the standard. Elastic
-- Transcoder created the preset because the settings might produce
-- acceptable output.
createPresetResponse_warning :: Lens.Lens' CreatePresetResponse (Prelude.Maybe Prelude.Text)
createPresetResponse_warning :: (Maybe Text -> f (Maybe Text))
-> CreatePresetResponse -> f CreatePresetResponse
createPresetResponse_warning = (CreatePresetResponse -> Maybe Text)
-> (CreatePresetResponse -> Maybe Text -> CreatePresetResponse)
-> Lens
     CreatePresetResponse CreatePresetResponse (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreatePresetResponse' {Maybe Text
warning :: Maybe Text
$sel:warning:CreatePresetResponse' :: CreatePresetResponse -> Maybe Text
warning} -> Maybe Text
warning) (\s :: CreatePresetResponse
s@CreatePresetResponse' {} Maybe Text
a -> CreatePresetResponse
s {$sel:warning:CreatePresetResponse' :: Maybe Text
warning = Maybe Text
a} :: CreatePresetResponse)

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

-- | The response's http status code.
createPresetResponse_httpStatus :: Lens.Lens' CreatePresetResponse Prelude.Int
createPresetResponse_httpStatus :: (Int -> f Int) -> CreatePresetResponse -> f CreatePresetResponse
createPresetResponse_httpStatus = (CreatePresetResponse -> Int)
-> (CreatePresetResponse -> Int -> CreatePresetResponse)
-> Lens CreatePresetResponse CreatePresetResponse Int Int
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreatePresetResponse' {Int
httpStatus :: Int
$sel:httpStatus:CreatePresetResponse' :: CreatePresetResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: CreatePresetResponse
s@CreatePresetResponse' {} Int
a -> CreatePresetResponse
s {$sel:httpStatus:CreatePresetResponse' :: Int
httpStatus = Int
a} :: CreatePresetResponse)

instance Prelude.NFData CreatePresetResponse