{-# 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.MediaPackageVOD.CreatePackagingConfiguration
-- Copyright   : (c) 2013-2023 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay
-- Stability   : auto-generated
-- Portability : non-portable (GHC extensions)
--
-- Creates a new MediaPackage VOD PackagingConfiguration resource.
module Amazonka.MediaPackageVOD.CreatePackagingConfiguration
  ( -- * Creating a Request
    CreatePackagingConfiguration (..),
    newCreatePackagingConfiguration,

    -- * Request Lenses
    createPackagingConfiguration_cmafPackage,
    createPackagingConfiguration_dashPackage,
    createPackagingConfiguration_hlsPackage,
    createPackagingConfiguration_mssPackage,
    createPackagingConfiguration_tags,
    createPackagingConfiguration_id,
    createPackagingConfiguration_packagingGroupId,

    -- * Destructuring the Response
    CreatePackagingConfigurationResponse (..),
    newCreatePackagingConfigurationResponse,

    -- * Response Lenses
    createPackagingConfigurationResponse_arn,
    createPackagingConfigurationResponse_cmafPackage,
    createPackagingConfigurationResponse_dashPackage,
    createPackagingConfigurationResponse_hlsPackage,
    createPackagingConfigurationResponse_id,
    createPackagingConfigurationResponse_mssPackage,
    createPackagingConfigurationResponse_packagingGroupId,
    createPackagingConfigurationResponse_tags,
    createPackagingConfigurationResponse_httpStatus,
  )
where

import qualified Amazonka.Core as Core
import qualified Amazonka.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
import Amazonka.MediaPackageVOD.Types
import qualified Amazonka.Prelude as Prelude
import qualified Amazonka.Request as Request
import qualified Amazonka.Response as Response

-- | A new MediaPackage VOD PackagingConfiguration resource configuration.
--
-- /See:/ 'newCreatePackagingConfiguration' smart constructor.
data CreatePackagingConfiguration = CreatePackagingConfiguration'
  { CreatePackagingConfiguration -> Maybe CmafPackage
cmafPackage :: Prelude.Maybe CmafPackage,
    CreatePackagingConfiguration -> Maybe DashPackage
dashPackage :: Prelude.Maybe DashPackage,
    CreatePackagingConfiguration -> Maybe HlsPackage
hlsPackage :: Prelude.Maybe HlsPackage,
    CreatePackagingConfiguration -> Maybe MssPackage
mssPackage :: Prelude.Maybe MssPackage,
    CreatePackagingConfiguration -> Maybe (HashMap Text Text)
tags :: Prelude.Maybe (Prelude.HashMap Prelude.Text Prelude.Text),
    -- | The ID of the PackagingConfiguration.
    CreatePackagingConfiguration -> Text
id :: Prelude.Text,
    -- | The ID of a PackagingGroup.
    CreatePackagingConfiguration -> Text
packagingGroupId :: Prelude.Text
  }
  deriving (CreatePackagingConfiguration
-> CreatePackagingConfiguration -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: CreatePackagingConfiguration
-> CreatePackagingConfiguration -> Bool
$c/= :: CreatePackagingConfiguration
-> CreatePackagingConfiguration -> Bool
== :: CreatePackagingConfiguration
-> CreatePackagingConfiguration -> Bool
$c== :: CreatePackagingConfiguration
-> CreatePackagingConfiguration -> Bool
Prelude.Eq, ReadPrec [CreatePackagingConfiguration]
ReadPrec CreatePackagingConfiguration
Int -> ReadS CreatePackagingConfiguration
ReadS [CreatePackagingConfiguration]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [CreatePackagingConfiguration]
$creadListPrec :: ReadPrec [CreatePackagingConfiguration]
readPrec :: ReadPrec CreatePackagingConfiguration
$creadPrec :: ReadPrec CreatePackagingConfiguration
readList :: ReadS [CreatePackagingConfiguration]
$creadList :: ReadS [CreatePackagingConfiguration]
readsPrec :: Int -> ReadS CreatePackagingConfiguration
$creadsPrec :: Int -> ReadS CreatePackagingConfiguration
Prelude.Read, Int -> CreatePackagingConfiguration -> ShowS
[CreatePackagingConfiguration] -> ShowS
CreatePackagingConfiguration -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [CreatePackagingConfiguration] -> ShowS
$cshowList :: [CreatePackagingConfiguration] -> ShowS
show :: CreatePackagingConfiguration -> String
$cshow :: CreatePackagingConfiguration -> String
showsPrec :: Int -> CreatePackagingConfiguration -> ShowS
$cshowsPrec :: Int -> CreatePackagingConfiguration -> ShowS
Prelude.Show, forall x.
Rep CreatePackagingConfiguration x -> CreatePackagingConfiguration
forall x.
CreatePackagingConfiguration -> Rep CreatePackagingConfiguration x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep CreatePackagingConfiguration x -> CreatePackagingConfiguration
$cfrom :: forall x.
CreatePackagingConfiguration -> Rep CreatePackagingConfiguration x
Prelude.Generic)

-- |
-- Create a value of 'CreatePackagingConfiguration' 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:
--
-- 'cmafPackage', 'createPackagingConfiguration_cmafPackage' - Undocumented member.
--
-- 'dashPackage', 'createPackagingConfiguration_dashPackage' - Undocumented member.
--
-- 'hlsPackage', 'createPackagingConfiguration_hlsPackage' - Undocumented member.
--
-- 'mssPackage', 'createPackagingConfiguration_mssPackage' - Undocumented member.
--
-- 'tags', 'createPackagingConfiguration_tags' - Undocumented member.
--
-- 'id', 'createPackagingConfiguration_id' - The ID of the PackagingConfiguration.
--
-- 'packagingGroupId', 'createPackagingConfiguration_packagingGroupId' - The ID of a PackagingGroup.
newCreatePackagingConfiguration ::
  -- | 'id'
  Prelude.Text ->
  -- | 'packagingGroupId'
  Prelude.Text ->
  CreatePackagingConfiguration
newCreatePackagingConfiguration :: Text -> Text -> CreatePackagingConfiguration
newCreatePackagingConfiguration
  Text
pId_
  Text
pPackagingGroupId_ =
    CreatePackagingConfiguration'
      { $sel:cmafPackage:CreatePackagingConfiguration' :: Maybe CmafPackage
cmafPackage =
          forall a. Maybe a
Prelude.Nothing,
        $sel:dashPackage:CreatePackagingConfiguration' :: Maybe DashPackage
dashPackage = forall a. Maybe a
Prelude.Nothing,
        $sel:hlsPackage:CreatePackagingConfiguration' :: Maybe HlsPackage
hlsPackage = forall a. Maybe a
Prelude.Nothing,
        $sel:mssPackage:CreatePackagingConfiguration' :: Maybe MssPackage
mssPackage = forall a. Maybe a
Prelude.Nothing,
        $sel:tags:CreatePackagingConfiguration' :: Maybe (HashMap Text Text)
tags = forall a. Maybe a
Prelude.Nothing,
        $sel:id:CreatePackagingConfiguration' :: Text
id = Text
pId_,
        $sel:packagingGroupId:CreatePackagingConfiguration' :: Text
packagingGroupId = Text
pPackagingGroupId_
      }

-- | Undocumented member.
createPackagingConfiguration_cmafPackage :: Lens.Lens' CreatePackagingConfiguration (Prelude.Maybe CmafPackage)
createPackagingConfiguration_cmafPackage :: Lens' CreatePackagingConfiguration (Maybe CmafPackage)
createPackagingConfiguration_cmafPackage = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreatePackagingConfiguration' {Maybe CmafPackage
cmafPackage :: Maybe CmafPackage
$sel:cmafPackage:CreatePackagingConfiguration' :: CreatePackagingConfiguration -> Maybe CmafPackage
cmafPackage} -> Maybe CmafPackage
cmafPackage) (\s :: CreatePackagingConfiguration
s@CreatePackagingConfiguration' {} Maybe CmafPackage
a -> CreatePackagingConfiguration
s {$sel:cmafPackage:CreatePackagingConfiguration' :: Maybe CmafPackage
cmafPackage = Maybe CmafPackage
a} :: CreatePackagingConfiguration)

-- | Undocumented member.
createPackagingConfiguration_dashPackage :: Lens.Lens' CreatePackagingConfiguration (Prelude.Maybe DashPackage)
createPackagingConfiguration_dashPackage :: Lens' CreatePackagingConfiguration (Maybe DashPackage)
createPackagingConfiguration_dashPackage = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreatePackagingConfiguration' {Maybe DashPackage
dashPackage :: Maybe DashPackage
$sel:dashPackage:CreatePackagingConfiguration' :: CreatePackagingConfiguration -> Maybe DashPackage
dashPackage} -> Maybe DashPackage
dashPackage) (\s :: CreatePackagingConfiguration
s@CreatePackagingConfiguration' {} Maybe DashPackage
a -> CreatePackagingConfiguration
s {$sel:dashPackage:CreatePackagingConfiguration' :: Maybe DashPackage
dashPackage = Maybe DashPackage
a} :: CreatePackagingConfiguration)

-- | Undocumented member.
createPackagingConfiguration_hlsPackage :: Lens.Lens' CreatePackagingConfiguration (Prelude.Maybe HlsPackage)
createPackagingConfiguration_hlsPackage :: Lens' CreatePackagingConfiguration (Maybe HlsPackage)
createPackagingConfiguration_hlsPackage = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreatePackagingConfiguration' {Maybe HlsPackage
hlsPackage :: Maybe HlsPackage
$sel:hlsPackage:CreatePackagingConfiguration' :: CreatePackagingConfiguration -> Maybe HlsPackage
hlsPackage} -> Maybe HlsPackage
hlsPackage) (\s :: CreatePackagingConfiguration
s@CreatePackagingConfiguration' {} Maybe HlsPackage
a -> CreatePackagingConfiguration
s {$sel:hlsPackage:CreatePackagingConfiguration' :: Maybe HlsPackage
hlsPackage = Maybe HlsPackage
a} :: CreatePackagingConfiguration)

-- | Undocumented member.
createPackagingConfiguration_mssPackage :: Lens.Lens' CreatePackagingConfiguration (Prelude.Maybe MssPackage)
createPackagingConfiguration_mssPackage :: Lens' CreatePackagingConfiguration (Maybe MssPackage)
createPackagingConfiguration_mssPackage = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreatePackagingConfiguration' {Maybe MssPackage
mssPackage :: Maybe MssPackage
$sel:mssPackage:CreatePackagingConfiguration' :: CreatePackagingConfiguration -> Maybe MssPackage
mssPackage} -> Maybe MssPackage
mssPackage) (\s :: CreatePackagingConfiguration
s@CreatePackagingConfiguration' {} Maybe MssPackage
a -> CreatePackagingConfiguration
s {$sel:mssPackage:CreatePackagingConfiguration' :: Maybe MssPackage
mssPackage = Maybe MssPackage
a} :: CreatePackagingConfiguration)

-- | Undocumented member.
createPackagingConfiguration_tags :: Lens.Lens' CreatePackagingConfiguration (Prelude.Maybe (Prelude.HashMap Prelude.Text Prelude.Text))
createPackagingConfiguration_tags :: Lens' CreatePackagingConfiguration (Maybe (HashMap Text Text))
createPackagingConfiguration_tags = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreatePackagingConfiguration' {Maybe (HashMap Text Text)
tags :: Maybe (HashMap Text Text)
$sel:tags:CreatePackagingConfiguration' :: CreatePackagingConfiguration -> Maybe (HashMap Text Text)
tags} -> Maybe (HashMap Text Text)
tags) (\s :: CreatePackagingConfiguration
s@CreatePackagingConfiguration' {} Maybe (HashMap Text Text)
a -> CreatePackagingConfiguration
s {$sel:tags:CreatePackagingConfiguration' :: Maybe (HashMap Text Text)
tags = Maybe (HashMap Text Text)
a} :: CreatePackagingConfiguration) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. 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 forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | The ID of the PackagingConfiguration.
createPackagingConfiguration_id :: Lens.Lens' CreatePackagingConfiguration Prelude.Text
createPackagingConfiguration_id :: Lens' CreatePackagingConfiguration Text
createPackagingConfiguration_id = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreatePackagingConfiguration' {Text
id :: Text
$sel:id:CreatePackagingConfiguration' :: CreatePackagingConfiguration -> Text
id} -> Text
id) (\s :: CreatePackagingConfiguration
s@CreatePackagingConfiguration' {} Text
a -> CreatePackagingConfiguration
s {$sel:id:CreatePackagingConfiguration' :: Text
id = Text
a} :: CreatePackagingConfiguration)

-- | The ID of a PackagingGroup.
createPackagingConfiguration_packagingGroupId :: Lens.Lens' CreatePackagingConfiguration Prelude.Text
createPackagingConfiguration_packagingGroupId :: Lens' CreatePackagingConfiguration Text
createPackagingConfiguration_packagingGroupId = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreatePackagingConfiguration' {Text
packagingGroupId :: Text
$sel:packagingGroupId:CreatePackagingConfiguration' :: CreatePackagingConfiguration -> Text
packagingGroupId} -> Text
packagingGroupId) (\s :: CreatePackagingConfiguration
s@CreatePackagingConfiguration' {} Text
a -> CreatePackagingConfiguration
s {$sel:packagingGroupId:CreatePackagingConfiguration' :: Text
packagingGroupId = Text
a} :: CreatePackagingConfiguration)

instance Core.AWSRequest CreatePackagingConfiguration where
  type
    AWSResponse CreatePackagingConfiguration =
      CreatePackagingConfigurationResponse
  request :: (Service -> Service)
-> CreatePackagingConfiguration
-> Request CreatePackagingConfiguration
request Service -> Service
overrides =
    forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON (Service -> Service
overrides Service
defaultService)
  response :: forall (m :: * -> *).
MonadResource m =>
(ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy CreatePackagingConfiguration
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse CreatePackagingConfiguration)))
response =
    forall (m :: * -> *) a.
MonadResource m =>
(Int -> ResponseHeaders -> Object -> Either String (AWSResponse a))
-> (ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveJSON
      ( \Int
s ResponseHeaders
h Object
x ->
          Maybe Text
-> Maybe CmafPackage
-> Maybe DashPackage
-> Maybe HlsPackage
-> Maybe Text
-> Maybe MssPackage
-> Maybe Text
-> Maybe (HashMap Text Text)
-> Int
-> CreatePackagingConfigurationResponse
CreatePackagingConfigurationResponse'
            forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x forall a. FromJSON a => Object -> Key -> Either String (Maybe a)
Data..?> Key
"arn")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Either String (Maybe a)
Data..?> Key
"cmafPackage")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Either String (Maybe a)
Data..?> Key
"dashPackage")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Either String (Maybe a)
Data..?> Key
"hlsPackage")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Either String (Maybe a)
Data..?> Key
"id")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Either String (Maybe a)
Data..?> Key
"mssPackage")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Either String (Maybe a)
Data..?> Key
"packagingGroupId")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Either String (Maybe a)
Data..?> Key
"tags" forall (f :: * -> *) a. Functor f => f (Maybe a) -> a -> f a
Core..!@ forall a. Monoid a => a
Prelude.mempty)
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (forall (f :: * -> *) a. Applicative f => a -> f a
Prelude.pure (forall a. Enum a => a -> Int
Prelude.fromEnum Int
s))
      )

instance
  Prelude.Hashable
    CreatePackagingConfiguration
  where
  hashWithSalt :: Int -> CreatePackagingConfiguration -> Int
hashWithSalt Int
_salt CreatePackagingConfiguration' {Maybe (HashMap Text Text)
Maybe MssPackage
Maybe HlsPackage
Maybe CmafPackage
Maybe DashPackage
Text
packagingGroupId :: Text
id :: Text
tags :: Maybe (HashMap Text Text)
mssPackage :: Maybe MssPackage
hlsPackage :: Maybe HlsPackage
dashPackage :: Maybe DashPackage
cmafPackage :: Maybe CmafPackage
$sel:packagingGroupId:CreatePackagingConfiguration' :: CreatePackagingConfiguration -> Text
$sel:id:CreatePackagingConfiguration' :: CreatePackagingConfiguration -> Text
$sel:tags:CreatePackagingConfiguration' :: CreatePackagingConfiguration -> Maybe (HashMap Text Text)
$sel:mssPackage:CreatePackagingConfiguration' :: CreatePackagingConfiguration -> Maybe MssPackage
$sel:hlsPackage:CreatePackagingConfiguration' :: CreatePackagingConfiguration -> Maybe HlsPackage
$sel:dashPackage:CreatePackagingConfiguration' :: CreatePackagingConfiguration -> Maybe DashPackage
$sel:cmafPackage:CreatePackagingConfiguration' :: CreatePackagingConfiguration -> Maybe CmafPackage
..} =
    Int
_salt
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe CmafPackage
cmafPackage
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe DashPackage
dashPackage
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe HlsPackage
hlsPackage
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe MssPackage
mssPackage
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe (HashMap Text Text)
tags
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
id
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
packagingGroupId

instance Prelude.NFData CreatePackagingConfiguration where
  rnf :: CreatePackagingConfiguration -> ()
rnf CreatePackagingConfiguration' {Maybe (HashMap Text Text)
Maybe MssPackage
Maybe HlsPackage
Maybe CmafPackage
Maybe DashPackage
Text
packagingGroupId :: Text
id :: Text
tags :: Maybe (HashMap Text Text)
mssPackage :: Maybe MssPackage
hlsPackage :: Maybe HlsPackage
dashPackage :: Maybe DashPackage
cmafPackage :: Maybe CmafPackage
$sel:packagingGroupId:CreatePackagingConfiguration' :: CreatePackagingConfiguration -> Text
$sel:id:CreatePackagingConfiguration' :: CreatePackagingConfiguration -> Text
$sel:tags:CreatePackagingConfiguration' :: CreatePackagingConfiguration -> Maybe (HashMap Text Text)
$sel:mssPackage:CreatePackagingConfiguration' :: CreatePackagingConfiguration -> Maybe MssPackage
$sel:hlsPackage:CreatePackagingConfiguration' :: CreatePackagingConfiguration -> Maybe HlsPackage
$sel:dashPackage:CreatePackagingConfiguration' :: CreatePackagingConfiguration -> Maybe DashPackage
$sel:cmafPackage:CreatePackagingConfiguration' :: CreatePackagingConfiguration -> Maybe CmafPackage
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe CmafPackage
cmafPackage
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe DashPackage
dashPackage
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe HlsPackage
hlsPackage
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe MssPackage
mssPackage
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe (HashMap Text Text)
tags
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
id
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
packagingGroupId

instance Data.ToHeaders CreatePackagingConfiguration where
  toHeaders :: CreatePackagingConfiguration -> ResponseHeaders
toHeaders =
    forall a b. a -> b -> a
Prelude.const
      ( forall a. Monoid a => [a] -> a
Prelude.mconcat
          [ HeaderName
"Content-Type"
              forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Data.=# ( ByteString
"application/x-amz-json-1.1" ::
                          Prelude.ByteString
                      )
          ]
      )

instance Data.ToJSON CreatePackagingConfiguration where
  toJSON :: CreatePackagingConfiguration -> Value
toJSON CreatePackagingConfiguration' {Maybe (HashMap Text Text)
Maybe MssPackage
Maybe HlsPackage
Maybe CmafPackage
Maybe DashPackage
Text
packagingGroupId :: Text
id :: Text
tags :: Maybe (HashMap Text Text)
mssPackage :: Maybe MssPackage
hlsPackage :: Maybe HlsPackage
dashPackage :: Maybe DashPackage
cmafPackage :: Maybe CmafPackage
$sel:packagingGroupId:CreatePackagingConfiguration' :: CreatePackagingConfiguration -> Text
$sel:id:CreatePackagingConfiguration' :: CreatePackagingConfiguration -> Text
$sel:tags:CreatePackagingConfiguration' :: CreatePackagingConfiguration -> Maybe (HashMap Text Text)
$sel:mssPackage:CreatePackagingConfiguration' :: CreatePackagingConfiguration -> Maybe MssPackage
$sel:hlsPackage:CreatePackagingConfiguration' :: CreatePackagingConfiguration -> Maybe HlsPackage
$sel:dashPackage:CreatePackagingConfiguration' :: CreatePackagingConfiguration -> Maybe DashPackage
$sel:cmafPackage:CreatePackagingConfiguration' :: CreatePackagingConfiguration -> Maybe CmafPackage
..} =
    [Pair] -> Value
Data.object
      ( forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ (Key
"cmafPackage" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=) forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe CmafPackage
cmafPackage,
            (Key
"dashPackage" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=) forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe DashPackage
dashPackage,
            (Key
"hlsPackage" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=) forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe HlsPackage
hlsPackage,
            (Key
"mssPackage" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=) forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe MssPackage
mssPackage,
            (Key
"tags" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=) forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe (HashMap Text Text)
tags,
            forall a. a -> Maybe a
Prelude.Just (Key
"id" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= Text
id),
            forall a. a -> Maybe a
Prelude.Just
              (Key
"packagingGroupId" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= Text
packagingGroupId)
          ]
      )

instance Data.ToPath CreatePackagingConfiguration where
  toPath :: CreatePackagingConfiguration -> ByteString
toPath = forall a b. a -> b -> a
Prelude.const ByteString
"/packaging_configurations"

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

-- | /See:/ 'newCreatePackagingConfigurationResponse' smart constructor.
data CreatePackagingConfigurationResponse = CreatePackagingConfigurationResponse'
  { -- | The ARN of the PackagingConfiguration.
    CreatePackagingConfigurationResponse -> Maybe Text
arn :: Prelude.Maybe Prelude.Text,
    CreatePackagingConfigurationResponse -> Maybe CmafPackage
cmafPackage :: Prelude.Maybe CmafPackage,
    CreatePackagingConfigurationResponse -> Maybe DashPackage
dashPackage :: Prelude.Maybe DashPackage,
    CreatePackagingConfigurationResponse -> Maybe HlsPackage
hlsPackage :: Prelude.Maybe HlsPackage,
    -- | The ID of the PackagingConfiguration.
    CreatePackagingConfigurationResponse -> Maybe Text
id :: Prelude.Maybe Prelude.Text,
    CreatePackagingConfigurationResponse -> Maybe MssPackage
mssPackage :: Prelude.Maybe MssPackage,
    -- | The ID of a PackagingGroup.
    CreatePackagingConfigurationResponse -> Maybe Text
packagingGroupId :: Prelude.Maybe Prelude.Text,
    CreatePackagingConfigurationResponse -> Maybe (HashMap Text Text)
tags :: Prelude.Maybe (Prelude.HashMap Prelude.Text Prelude.Text),
    -- | The response's http status code.
    CreatePackagingConfigurationResponse -> Int
httpStatus :: Prelude.Int
  }
  deriving (CreatePackagingConfigurationResponse
-> CreatePackagingConfigurationResponse -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: CreatePackagingConfigurationResponse
-> CreatePackagingConfigurationResponse -> Bool
$c/= :: CreatePackagingConfigurationResponse
-> CreatePackagingConfigurationResponse -> Bool
== :: CreatePackagingConfigurationResponse
-> CreatePackagingConfigurationResponse -> Bool
$c== :: CreatePackagingConfigurationResponse
-> CreatePackagingConfigurationResponse -> Bool
Prelude.Eq, ReadPrec [CreatePackagingConfigurationResponse]
ReadPrec CreatePackagingConfigurationResponse
Int -> ReadS CreatePackagingConfigurationResponse
ReadS [CreatePackagingConfigurationResponse]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [CreatePackagingConfigurationResponse]
$creadListPrec :: ReadPrec [CreatePackagingConfigurationResponse]
readPrec :: ReadPrec CreatePackagingConfigurationResponse
$creadPrec :: ReadPrec CreatePackagingConfigurationResponse
readList :: ReadS [CreatePackagingConfigurationResponse]
$creadList :: ReadS [CreatePackagingConfigurationResponse]
readsPrec :: Int -> ReadS CreatePackagingConfigurationResponse
$creadsPrec :: Int -> ReadS CreatePackagingConfigurationResponse
Prelude.Read, Int -> CreatePackagingConfigurationResponse -> ShowS
[CreatePackagingConfigurationResponse] -> ShowS
CreatePackagingConfigurationResponse -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [CreatePackagingConfigurationResponse] -> ShowS
$cshowList :: [CreatePackagingConfigurationResponse] -> ShowS
show :: CreatePackagingConfigurationResponse -> String
$cshow :: CreatePackagingConfigurationResponse -> String
showsPrec :: Int -> CreatePackagingConfigurationResponse -> ShowS
$cshowsPrec :: Int -> CreatePackagingConfigurationResponse -> ShowS
Prelude.Show, forall x.
Rep CreatePackagingConfigurationResponse x
-> CreatePackagingConfigurationResponse
forall x.
CreatePackagingConfigurationResponse
-> Rep CreatePackagingConfigurationResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep CreatePackagingConfigurationResponse x
-> CreatePackagingConfigurationResponse
$cfrom :: forall x.
CreatePackagingConfigurationResponse
-> Rep CreatePackagingConfigurationResponse x
Prelude.Generic)

-- |
-- Create a value of 'CreatePackagingConfigurationResponse' 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', 'createPackagingConfigurationResponse_arn' - The ARN of the PackagingConfiguration.
--
-- 'cmafPackage', 'createPackagingConfigurationResponse_cmafPackage' - Undocumented member.
--
-- 'dashPackage', 'createPackagingConfigurationResponse_dashPackage' - Undocumented member.
--
-- 'hlsPackage', 'createPackagingConfigurationResponse_hlsPackage' - Undocumented member.
--
-- 'id', 'createPackagingConfigurationResponse_id' - The ID of the PackagingConfiguration.
--
-- 'mssPackage', 'createPackagingConfigurationResponse_mssPackage' - Undocumented member.
--
-- 'packagingGroupId', 'createPackagingConfigurationResponse_packagingGroupId' - The ID of a PackagingGroup.
--
-- 'tags', 'createPackagingConfigurationResponse_tags' - Undocumented member.
--
-- 'httpStatus', 'createPackagingConfigurationResponse_httpStatus' - The response's http status code.
newCreatePackagingConfigurationResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  CreatePackagingConfigurationResponse
newCreatePackagingConfigurationResponse :: Int -> CreatePackagingConfigurationResponse
newCreatePackagingConfigurationResponse Int
pHttpStatus_ =
  CreatePackagingConfigurationResponse'
    { $sel:arn:CreatePackagingConfigurationResponse' :: Maybe Text
arn =
        forall a. Maybe a
Prelude.Nothing,
      $sel:cmafPackage:CreatePackagingConfigurationResponse' :: Maybe CmafPackage
cmafPackage = forall a. Maybe a
Prelude.Nothing,
      $sel:dashPackage:CreatePackagingConfigurationResponse' :: Maybe DashPackage
dashPackage = forall a. Maybe a
Prelude.Nothing,
      $sel:hlsPackage:CreatePackagingConfigurationResponse' :: Maybe HlsPackage
hlsPackage = forall a. Maybe a
Prelude.Nothing,
      $sel:id:CreatePackagingConfigurationResponse' :: Maybe Text
id = forall a. Maybe a
Prelude.Nothing,
      $sel:mssPackage:CreatePackagingConfigurationResponse' :: Maybe MssPackage
mssPackage = forall a. Maybe a
Prelude.Nothing,
      $sel:packagingGroupId:CreatePackagingConfigurationResponse' :: Maybe Text
packagingGroupId = forall a. Maybe a
Prelude.Nothing,
      $sel:tags:CreatePackagingConfigurationResponse' :: Maybe (HashMap Text Text)
tags = forall a. Maybe a
Prelude.Nothing,
      $sel:httpStatus:CreatePackagingConfigurationResponse' :: Int
httpStatus = Int
pHttpStatus_
    }

-- | The ARN of the PackagingConfiguration.
createPackagingConfigurationResponse_arn :: Lens.Lens' CreatePackagingConfigurationResponse (Prelude.Maybe Prelude.Text)
createPackagingConfigurationResponse_arn :: Lens' CreatePackagingConfigurationResponse (Maybe Text)
createPackagingConfigurationResponse_arn = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreatePackagingConfigurationResponse' {Maybe Text
arn :: Maybe Text
$sel:arn:CreatePackagingConfigurationResponse' :: CreatePackagingConfigurationResponse -> Maybe Text
arn} -> Maybe Text
arn) (\s :: CreatePackagingConfigurationResponse
s@CreatePackagingConfigurationResponse' {} Maybe Text
a -> CreatePackagingConfigurationResponse
s {$sel:arn:CreatePackagingConfigurationResponse' :: Maybe Text
arn = Maybe Text
a} :: CreatePackagingConfigurationResponse)

-- | Undocumented member.
createPackagingConfigurationResponse_cmafPackage :: Lens.Lens' CreatePackagingConfigurationResponse (Prelude.Maybe CmafPackage)
createPackagingConfigurationResponse_cmafPackage :: Lens' CreatePackagingConfigurationResponse (Maybe CmafPackage)
createPackagingConfigurationResponse_cmafPackage = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreatePackagingConfigurationResponse' {Maybe CmafPackage
cmafPackage :: Maybe CmafPackage
$sel:cmafPackage:CreatePackagingConfigurationResponse' :: CreatePackagingConfigurationResponse -> Maybe CmafPackage
cmafPackage} -> Maybe CmafPackage
cmafPackage) (\s :: CreatePackagingConfigurationResponse
s@CreatePackagingConfigurationResponse' {} Maybe CmafPackage
a -> CreatePackagingConfigurationResponse
s {$sel:cmafPackage:CreatePackagingConfigurationResponse' :: Maybe CmafPackage
cmafPackage = Maybe CmafPackage
a} :: CreatePackagingConfigurationResponse)

-- | Undocumented member.
createPackagingConfigurationResponse_dashPackage :: Lens.Lens' CreatePackagingConfigurationResponse (Prelude.Maybe DashPackage)
createPackagingConfigurationResponse_dashPackage :: Lens' CreatePackagingConfigurationResponse (Maybe DashPackage)
createPackagingConfigurationResponse_dashPackage = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreatePackagingConfigurationResponse' {Maybe DashPackage
dashPackage :: Maybe DashPackage
$sel:dashPackage:CreatePackagingConfigurationResponse' :: CreatePackagingConfigurationResponse -> Maybe DashPackage
dashPackage} -> Maybe DashPackage
dashPackage) (\s :: CreatePackagingConfigurationResponse
s@CreatePackagingConfigurationResponse' {} Maybe DashPackage
a -> CreatePackagingConfigurationResponse
s {$sel:dashPackage:CreatePackagingConfigurationResponse' :: Maybe DashPackage
dashPackage = Maybe DashPackage
a} :: CreatePackagingConfigurationResponse)

-- | Undocumented member.
createPackagingConfigurationResponse_hlsPackage :: Lens.Lens' CreatePackagingConfigurationResponse (Prelude.Maybe HlsPackage)
createPackagingConfigurationResponse_hlsPackage :: Lens' CreatePackagingConfigurationResponse (Maybe HlsPackage)
createPackagingConfigurationResponse_hlsPackage = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreatePackagingConfigurationResponse' {Maybe HlsPackage
hlsPackage :: Maybe HlsPackage
$sel:hlsPackage:CreatePackagingConfigurationResponse' :: CreatePackagingConfigurationResponse -> Maybe HlsPackage
hlsPackage} -> Maybe HlsPackage
hlsPackage) (\s :: CreatePackagingConfigurationResponse
s@CreatePackagingConfigurationResponse' {} Maybe HlsPackage
a -> CreatePackagingConfigurationResponse
s {$sel:hlsPackage:CreatePackagingConfigurationResponse' :: Maybe HlsPackage
hlsPackage = Maybe HlsPackage
a} :: CreatePackagingConfigurationResponse)

-- | The ID of the PackagingConfiguration.
createPackagingConfigurationResponse_id :: Lens.Lens' CreatePackagingConfigurationResponse (Prelude.Maybe Prelude.Text)
createPackagingConfigurationResponse_id :: Lens' CreatePackagingConfigurationResponse (Maybe Text)
createPackagingConfigurationResponse_id = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreatePackagingConfigurationResponse' {Maybe Text
id :: Maybe Text
$sel:id:CreatePackagingConfigurationResponse' :: CreatePackagingConfigurationResponse -> Maybe Text
id} -> Maybe Text
id) (\s :: CreatePackagingConfigurationResponse
s@CreatePackagingConfigurationResponse' {} Maybe Text
a -> CreatePackagingConfigurationResponse
s {$sel:id:CreatePackagingConfigurationResponse' :: Maybe Text
id = Maybe Text
a} :: CreatePackagingConfigurationResponse)

-- | Undocumented member.
createPackagingConfigurationResponse_mssPackage :: Lens.Lens' CreatePackagingConfigurationResponse (Prelude.Maybe MssPackage)
createPackagingConfigurationResponse_mssPackage :: Lens' CreatePackagingConfigurationResponse (Maybe MssPackage)
createPackagingConfigurationResponse_mssPackage = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreatePackagingConfigurationResponse' {Maybe MssPackage
mssPackage :: Maybe MssPackage
$sel:mssPackage:CreatePackagingConfigurationResponse' :: CreatePackagingConfigurationResponse -> Maybe MssPackage
mssPackage} -> Maybe MssPackage
mssPackage) (\s :: CreatePackagingConfigurationResponse
s@CreatePackagingConfigurationResponse' {} Maybe MssPackage
a -> CreatePackagingConfigurationResponse
s {$sel:mssPackage:CreatePackagingConfigurationResponse' :: Maybe MssPackage
mssPackage = Maybe MssPackage
a} :: CreatePackagingConfigurationResponse)

-- | The ID of a PackagingGroup.
createPackagingConfigurationResponse_packagingGroupId :: Lens.Lens' CreatePackagingConfigurationResponse (Prelude.Maybe Prelude.Text)
createPackagingConfigurationResponse_packagingGroupId :: Lens' CreatePackagingConfigurationResponse (Maybe Text)
createPackagingConfigurationResponse_packagingGroupId = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreatePackagingConfigurationResponse' {Maybe Text
packagingGroupId :: Maybe Text
$sel:packagingGroupId:CreatePackagingConfigurationResponse' :: CreatePackagingConfigurationResponse -> Maybe Text
packagingGroupId} -> Maybe Text
packagingGroupId) (\s :: CreatePackagingConfigurationResponse
s@CreatePackagingConfigurationResponse' {} Maybe Text
a -> CreatePackagingConfigurationResponse
s {$sel:packagingGroupId:CreatePackagingConfigurationResponse' :: Maybe Text
packagingGroupId = Maybe Text
a} :: CreatePackagingConfigurationResponse)

-- | Undocumented member.
createPackagingConfigurationResponse_tags :: Lens.Lens' CreatePackagingConfigurationResponse (Prelude.Maybe (Prelude.HashMap Prelude.Text Prelude.Text))
createPackagingConfigurationResponse_tags :: Lens'
  CreatePackagingConfigurationResponse (Maybe (HashMap Text Text))
createPackagingConfigurationResponse_tags = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreatePackagingConfigurationResponse' {Maybe (HashMap Text Text)
tags :: Maybe (HashMap Text Text)
$sel:tags:CreatePackagingConfigurationResponse' :: CreatePackagingConfigurationResponse -> Maybe (HashMap Text Text)
tags} -> Maybe (HashMap Text Text)
tags) (\s :: CreatePackagingConfigurationResponse
s@CreatePackagingConfigurationResponse' {} Maybe (HashMap Text Text)
a -> CreatePackagingConfigurationResponse
s {$sel:tags:CreatePackagingConfigurationResponse' :: Maybe (HashMap Text Text)
tags = Maybe (HashMap Text Text)
a} :: CreatePackagingConfigurationResponse) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. 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 forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

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

instance
  Prelude.NFData
    CreatePackagingConfigurationResponse
  where
  rnf :: CreatePackagingConfigurationResponse -> ()
rnf CreatePackagingConfigurationResponse' {Int
Maybe Text
Maybe (HashMap Text Text)
Maybe MssPackage
Maybe HlsPackage
Maybe CmafPackage
Maybe DashPackage
httpStatus :: Int
tags :: Maybe (HashMap Text Text)
packagingGroupId :: Maybe Text
mssPackage :: Maybe MssPackage
id :: Maybe Text
hlsPackage :: Maybe HlsPackage
dashPackage :: Maybe DashPackage
cmafPackage :: Maybe CmafPackage
arn :: Maybe Text
$sel:httpStatus:CreatePackagingConfigurationResponse' :: CreatePackagingConfigurationResponse -> Int
$sel:tags:CreatePackagingConfigurationResponse' :: CreatePackagingConfigurationResponse -> Maybe (HashMap Text Text)
$sel:packagingGroupId:CreatePackagingConfigurationResponse' :: CreatePackagingConfigurationResponse -> Maybe Text
$sel:mssPackage:CreatePackagingConfigurationResponse' :: CreatePackagingConfigurationResponse -> Maybe MssPackage
$sel:id:CreatePackagingConfigurationResponse' :: CreatePackagingConfigurationResponse -> Maybe Text
$sel:hlsPackage:CreatePackagingConfigurationResponse' :: CreatePackagingConfigurationResponse -> Maybe HlsPackage
$sel:dashPackage:CreatePackagingConfigurationResponse' :: CreatePackagingConfigurationResponse -> Maybe DashPackage
$sel:cmafPackage:CreatePackagingConfigurationResponse' :: CreatePackagingConfigurationResponse -> Maybe CmafPackage
$sel:arn:CreatePackagingConfigurationResponse' :: CreatePackagingConfigurationResponse -> Maybe Text
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
arn
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe CmafPackage
cmafPackage
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe DashPackage
dashPackage
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe HlsPackage
hlsPackage
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
id
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe MssPackage
mssPackage
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
packagingGroupId
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe (HashMap Text Text)
tags
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Int
httpStatus