{-# 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.MediaTailor.CreateVodSource
-- 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)
--
-- Creates name for a specific VOD source in a source location.
module Amazonka.MediaTailor.CreateVodSource
  ( -- * Creating a Request
    CreateVodSource (..),
    newCreateVodSource,

    -- * Request Lenses
    createVodSource_tags,
    createVodSource_sourceLocationName,
    createVodSource_vodSourceName,
    createVodSource_httpPackageConfigurations,

    -- * Destructuring the Response
    CreateVodSourceResponse (..),
    newCreateVodSourceResponse,

    -- * Response Lenses
    createVodSourceResponse_creationTime,
    createVodSourceResponse_sourceLocationName,
    createVodSourceResponse_arn,
    createVodSourceResponse_lastModifiedTime,
    createVodSourceResponse_httpPackageConfigurations,
    createVodSourceResponse_vodSourceName,
    createVodSourceResponse_tags,
    createVodSourceResponse_httpStatus,
  )
where

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

-- | /See:/ 'newCreateVodSource' smart constructor.
data CreateVodSource = CreateVodSource'
  { -- | The tags to assign to the VOD source.
    CreateVodSource -> Maybe (HashMap Text Text)
tags :: Prelude.Maybe (Prelude.HashMap Prelude.Text Prelude.Text),
    -- | The identifier for the source location you are working on.
    CreateVodSource -> Text
sourceLocationName :: Prelude.Text,
    -- | The identifier for the VOD source you are working on.
    CreateVodSource -> Text
vodSourceName :: Prelude.Text,
    -- | An array of HTTP package configuration parameters for this VOD source.
    CreateVodSource -> [HttpPackageConfiguration]
httpPackageConfigurations :: [HttpPackageConfiguration]
  }
  deriving (CreateVodSource -> CreateVodSource -> Bool
(CreateVodSource -> CreateVodSource -> Bool)
-> (CreateVodSource -> CreateVodSource -> Bool)
-> Eq CreateVodSource
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: CreateVodSource -> CreateVodSource -> Bool
$c/= :: CreateVodSource -> CreateVodSource -> Bool
== :: CreateVodSource -> CreateVodSource -> Bool
$c== :: CreateVodSource -> CreateVodSource -> Bool
Prelude.Eq, ReadPrec [CreateVodSource]
ReadPrec CreateVodSource
Int -> ReadS CreateVodSource
ReadS [CreateVodSource]
(Int -> ReadS CreateVodSource)
-> ReadS [CreateVodSource]
-> ReadPrec CreateVodSource
-> ReadPrec [CreateVodSource]
-> Read CreateVodSource
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [CreateVodSource]
$creadListPrec :: ReadPrec [CreateVodSource]
readPrec :: ReadPrec CreateVodSource
$creadPrec :: ReadPrec CreateVodSource
readList :: ReadS [CreateVodSource]
$creadList :: ReadS [CreateVodSource]
readsPrec :: Int -> ReadS CreateVodSource
$creadsPrec :: Int -> ReadS CreateVodSource
Prelude.Read, Int -> CreateVodSource -> ShowS
[CreateVodSource] -> ShowS
CreateVodSource -> String
(Int -> CreateVodSource -> ShowS)
-> (CreateVodSource -> String)
-> ([CreateVodSource] -> ShowS)
-> Show CreateVodSource
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [CreateVodSource] -> ShowS
$cshowList :: [CreateVodSource] -> ShowS
show :: CreateVodSource -> String
$cshow :: CreateVodSource -> String
showsPrec :: Int -> CreateVodSource -> ShowS
$cshowsPrec :: Int -> CreateVodSource -> ShowS
Prelude.Show, (forall x. CreateVodSource -> Rep CreateVodSource x)
-> (forall x. Rep CreateVodSource x -> CreateVodSource)
-> Generic CreateVodSource
forall x. Rep CreateVodSource x -> CreateVodSource
forall x. CreateVodSource -> Rep CreateVodSource x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep CreateVodSource x -> CreateVodSource
$cfrom :: forall x. CreateVodSource -> Rep CreateVodSource x
Prelude.Generic)

-- |
-- Create a value of 'CreateVodSource' 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:
--
-- 'tags', 'createVodSource_tags' - The tags to assign to the VOD source.
--
-- 'sourceLocationName', 'createVodSource_sourceLocationName' - The identifier for the source location you are working on.
--
-- 'vodSourceName', 'createVodSource_vodSourceName' - The identifier for the VOD source you are working on.
--
-- 'httpPackageConfigurations', 'createVodSource_httpPackageConfigurations' - An array of HTTP package configuration parameters for this VOD source.
newCreateVodSource ::
  -- | 'sourceLocationName'
  Prelude.Text ->
  -- | 'vodSourceName'
  Prelude.Text ->
  CreateVodSource
newCreateVodSource :: Text -> Text -> CreateVodSource
newCreateVodSource
  Text
pSourceLocationName_
  Text
pVodSourceName_ =
    CreateVodSource' :: Maybe (HashMap Text Text)
-> Text -> Text -> [HttpPackageConfiguration] -> CreateVodSource
CreateVodSource'
      { $sel:tags:CreateVodSource' :: Maybe (HashMap Text Text)
tags = Maybe (HashMap Text Text)
forall a. Maybe a
Prelude.Nothing,
        $sel:sourceLocationName:CreateVodSource' :: Text
sourceLocationName = Text
pSourceLocationName_,
        $sel:vodSourceName:CreateVodSource' :: Text
vodSourceName = Text
pVodSourceName_,
        $sel:httpPackageConfigurations:CreateVodSource' :: [HttpPackageConfiguration]
httpPackageConfigurations = [HttpPackageConfiguration]
forall a. Monoid a => a
Prelude.mempty
      }

-- | The tags to assign to the VOD source.
createVodSource_tags :: Lens.Lens' CreateVodSource (Prelude.Maybe (Prelude.HashMap Prelude.Text Prelude.Text))
createVodSource_tags :: (Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
-> CreateVodSource -> f CreateVodSource
createVodSource_tags = (CreateVodSource -> Maybe (HashMap Text Text))
-> (CreateVodSource
    -> Maybe (HashMap Text Text) -> CreateVodSource)
-> Lens
     CreateVodSource
     CreateVodSource
     (Maybe (HashMap Text Text))
     (Maybe (HashMap Text Text))
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateVodSource' {Maybe (HashMap Text Text)
tags :: Maybe (HashMap Text Text)
$sel:tags:CreateVodSource' :: CreateVodSource -> Maybe (HashMap Text Text)
tags} -> Maybe (HashMap Text Text)
tags) (\s :: CreateVodSource
s@CreateVodSource' {} Maybe (HashMap Text Text)
a -> CreateVodSource
s {$sel:tags:CreateVodSource' :: Maybe (HashMap Text Text)
tags = Maybe (HashMap Text Text)
a} :: CreateVodSource) ((Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
 -> CreateVodSource -> f CreateVodSource)
-> ((Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
    -> Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
-> (Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
-> CreateVodSource
-> f CreateVodSource
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
  (HashMap Text Text)
  (HashMap Text Text)
  (HashMap Text Text)
  (HashMap Text Text)
-> Iso
     (Maybe (HashMap Text Text))
     (Maybe (HashMap Text Text))
     (Maybe (HashMap Text Text))
     (Maybe (HashMap Text 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
  (HashMap Text Text)
  (HashMap Text Text)
  (HashMap Text Text)
  (HashMap Text Text)
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | The identifier for the source location you are working on.
createVodSource_sourceLocationName :: Lens.Lens' CreateVodSource Prelude.Text
createVodSource_sourceLocationName :: (Text -> f Text) -> CreateVodSource -> f CreateVodSource
createVodSource_sourceLocationName = (CreateVodSource -> Text)
-> (CreateVodSource -> Text -> CreateVodSource)
-> Lens CreateVodSource CreateVodSource Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateVodSource' {Text
sourceLocationName :: Text
$sel:sourceLocationName:CreateVodSource' :: CreateVodSource -> Text
sourceLocationName} -> Text
sourceLocationName) (\s :: CreateVodSource
s@CreateVodSource' {} Text
a -> CreateVodSource
s {$sel:sourceLocationName:CreateVodSource' :: Text
sourceLocationName = Text
a} :: CreateVodSource)

-- | The identifier for the VOD source you are working on.
createVodSource_vodSourceName :: Lens.Lens' CreateVodSource Prelude.Text
createVodSource_vodSourceName :: (Text -> f Text) -> CreateVodSource -> f CreateVodSource
createVodSource_vodSourceName = (CreateVodSource -> Text)
-> (CreateVodSource -> Text -> CreateVodSource)
-> Lens CreateVodSource CreateVodSource Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateVodSource' {Text
vodSourceName :: Text
$sel:vodSourceName:CreateVodSource' :: CreateVodSource -> Text
vodSourceName} -> Text
vodSourceName) (\s :: CreateVodSource
s@CreateVodSource' {} Text
a -> CreateVodSource
s {$sel:vodSourceName:CreateVodSource' :: Text
vodSourceName = Text
a} :: CreateVodSource)

-- | An array of HTTP package configuration parameters for this VOD source.
createVodSource_httpPackageConfigurations :: Lens.Lens' CreateVodSource [HttpPackageConfiguration]
createVodSource_httpPackageConfigurations :: ([HttpPackageConfiguration] -> f [HttpPackageConfiguration])
-> CreateVodSource -> f CreateVodSource
createVodSource_httpPackageConfigurations = (CreateVodSource -> [HttpPackageConfiguration])
-> (CreateVodSource
    -> [HttpPackageConfiguration] -> CreateVodSource)
-> Lens
     CreateVodSource
     CreateVodSource
     [HttpPackageConfiguration]
     [HttpPackageConfiguration]
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateVodSource' {[HttpPackageConfiguration]
httpPackageConfigurations :: [HttpPackageConfiguration]
$sel:httpPackageConfigurations:CreateVodSource' :: CreateVodSource -> [HttpPackageConfiguration]
httpPackageConfigurations} -> [HttpPackageConfiguration]
httpPackageConfigurations) (\s :: CreateVodSource
s@CreateVodSource' {} [HttpPackageConfiguration]
a -> CreateVodSource
s {$sel:httpPackageConfigurations:CreateVodSource' :: [HttpPackageConfiguration]
httpPackageConfigurations = [HttpPackageConfiguration]
a} :: CreateVodSource) (([HttpPackageConfiguration] -> f [HttpPackageConfiguration])
 -> CreateVodSource -> f CreateVodSource)
-> (([HttpPackageConfiguration] -> f [HttpPackageConfiguration])
    -> [HttpPackageConfiguration] -> f [HttpPackageConfiguration])
-> ([HttpPackageConfiguration] -> f [HttpPackageConfiguration])
-> CreateVodSource
-> f CreateVodSource
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. ([HttpPackageConfiguration] -> f [HttpPackageConfiguration])
-> [HttpPackageConfiguration] -> f [HttpPackageConfiguration]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

instance Core.AWSRequest CreateVodSource where
  type
    AWSResponse CreateVodSource =
      CreateVodSourceResponse
  request :: CreateVodSource -> Request CreateVodSource
request = Service -> CreateVodSource -> Request CreateVodSource
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON Service
defaultService
  response :: Logger
-> Service
-> Proxy CreateVodSource
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse CreateVodSource)))
response =
    (Int
 -> ResponseHeaders
 -> Object
 -> Either String (AWSResponse CreateVodSource))
-> Logger
-> Service
-> Proxy CreateVodSource
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse CreateVodSource)))
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 POSIX
-> Maybe Text
-> Maybe Text
-> Maybe POSIX
-> Maybe [HttpPackageConfiguration]
-> Maybe Text
-> Maybe (HashMap Text Text)
-> Int
-> CreateVodSourceResponse
CreateVodSourceResponse'
            (Maybe POSIX
 -> Maybe Text
 -> Maybe Text
 -> Maybe POSIX
 -> Maybe [HttpPackageConfiguration]
 -> Maybe Text
 -> Maybe (HashMap Text Text)
 -> Int
 -> CreateVodSourceResponse)
-> Either String (Maybe POSIX)
-> Either
     String
     (Maybe Text
      -> Maybe Text
      -> Maybe POSIX
      -> Maybe [HttpPackageConfiguration]
      -> Maybe Text
      -> Maybe (HashMap Text Text)
      -> Int
      -> CreateVodSourceResponse)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Either String (Maybe POSIX)
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"CreationTime")
            Either
  String
  (Maybe Text
   -> Maybe Text
   -> Maybe POSIX
   -> Maybe [HttpPackageConfiguration]
   -> Maybe Text
   -> Maybe (HashMap Text Text)
   -> Int
   -> CreateVodSourceResponse)
-> Either String (Maybe Text)
-> Either
     String
     (Maybe Text
      -> Maybe POSIX
      -> Maybe [HttpPackageConfiguration]
      -> Maybe Text
      -> Maybe (HashMap Text Text)
      -> Int
      -> CreateVodSourceResponse)
forall (f :: * -> *) a b. Applicative f => 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
"SourceLocationName")
            Either
  String
  (Maybe Text
   -> Maybe POSIX
   -> Maybe [HttpPackageConfiguration]
   -> Maybe Text
   -> Maybe (HashMap Text Text)
   -> Int
   -> CreateVodSourceResponse)
-> Either String (Maybe Text)
-> Either
     String
     (Maybe POSIX
      -> Maybe [HttpPackageConfiguration]
      -> Maybe Text
      -> Maybe (HashMap Text Text)
      -> Int
      -> CreateVodSourceResponse)
forall (f :: * -> *) a b. Applicative f => 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
"Arn")
            Either
  String
  (Maybe POSIX
   -> Maybe [HttpPackageConfiguration]
   -> Maybe Text
   -> Maybe (HashMap Text Text)
   -> Int
   -> CreateVodSourceResponse)
-> Either String (Maybe POSIX)
-> Either
     String
     (Maybe [HttpPackageConfiguration]
      -> Maybe Text
      -> Maybe (HashMap Text Text)
      -> Int
      -> CreateVodSourceResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Either String (Maybe POSIX)
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"LastModifiedTime")
            Either
  String
  (Maybe [HttpPackageConfiguration]
   -> Maybe Text
   -> Maybe (HashMap Text Text)
   -> Int
   -> CreateVodSourceResponse)
-> Either String (Maybe [HttpPackageConfiguration])
-> Either
     String
     (Maybe Text
      -> Maybe (HashMap Text Text) -> Int -> CreateVodSourceResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ( Object
x Object
-> Text -> Either String (Maybe (Maybe [HttpPackageConfiguration]))
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"HttpPackageConfigurations"
                            Either String (Maybe (Maybe [HttpPackageConfiguration]))
-> Maybe [HttpPackageConfiguration]
-> Either String (Maybe [HttpPackageConfiguration])
forall (f :: * -> *) a. Functor f => f (Maybe a) -> a -> f a
Core..!@ Maybe [HttpPackageConfiguration]
forall a. Monoid a => a
Prelude.mempty
                        )
            Either
  String
  (Maybe Text
   -> Maybe (HashMap Text Text) -> Int -> CreateVodSourceResponse)
-> Either String (Maybe Text)
-> Either
     String
     (Maybe (HashMap Text Text) -> Int -> CreateVodSourceResponse)
forall (f :: * -> *) a b. Applicative f => 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
"VodSourceName")
            Either
  String
  (Maybe (HashMap Text Text) -> Int -> CreateVodSourceResponse)
-> Either String (Maybe (HashMap Text Text))
-> Either String (Int -> CreateVodSourceResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Either String (Maybe (Maybe (HashMap Text Text)))
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"tags" Either String (Maybe (Maybe (HashMap Text Text)))
-> Maybe (HashMap Text Text)
-> Either String (Maybe (HashMap Text Text))
forall (f :: * -> *) a. Functor f => f (Maybe a) -> a -> f a
Core..!@ Maybe (HashMap Text Text)
forall a. Monoid a => a
Prelude.mempty)
            Either String (Int -> CreateVodSourceResponse)
-> Either String Int -> Either String CreateVodSourceResponse
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 CreateVodSource

instance Prelude.NFData CreateVodSource

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

instance Core.ToJSON CreateVodSource where
  toJSON :: CreateVodSource -> Value
toJSON CreateVodSource' {[HttpPackageConfiguration]
Maybe (HashMap Text Text)
Text
httpPackageConfigurations :: [HttpPackageConfiguration]
vodSourceName :: Text
sourceLocationName :: Text
tags :: Maybe (HashMap Text Text)
$sel:httpPackageConfigurations:CreateVodSource' :: CreateVodSource -> [HttpPackageConfiguration]
$sel:vodSourceName:CreateVodSource' :: CreateVodSource -> Text
$sel:sourceLocationName:CreateVodSource' :: CreateVodSource -> Text
$sel:tags:CreateVodSource' :: CreateVodSource -> Maybe (HashMap Text Text)
..} =
    [Pair] -> Value
Core.object
      ( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ (Text
"tags" Text -> HashMap Text Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (HashMap Text Text -> Pair)
-> Maybe (HashMap Text Text) -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe (HashMap Text Text)
tags,
            Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just
              ( Text
"HttpPackageConfigurations"
                  Text -> [HttpPackageConfiguration] -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= [HttpPackageConfiguration]
httpPackageConfigurations
              )
          ]
      )

instance Core.ToPath CreateVodSource where
  toPath :: CreateVodSource -> ByteString
toPath CreateVodSource' {[HttpPackageConfiguration]
Maybe (HashMap Text Text)
Text
httpPackageConfigurations :: [HttpPackageConfiguration]
vodSourceName :: Text
sourceLocationName :: Text
tags :: Maybe (HashMap Text Text)
$sel:httpPackageConfigurations:CreateVodSource' :: CreateVodSource -> [HttpPackageConfiguration]
$sel:vodSourceName:CreateVodSource' :: CreateVodSource -> Text
$sel:sourceLocationName:CreateVodSource' :: CreateVodSource -> Text
$sel:tags:CreateVodSource' :: CreateVodSource -> Maybe (HashMap Text Text)
..} =
    [ByteString] -> ByteString
forall a. Monoid a => [a] -> a
Prelude.mconcat
      [ ByteString
"/sourceLocation/",
        Text -> ByteString
forall a. ToByteString a => a -> ByteString
Core.toBS Text
sourceLocationName,
        ByteString
"/vodSource/",
        Text -> ByteString
forall a. ToByteString a => a -> ByteString
Core.toBS Text
vodSourceName
      ]

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

-- | /See:/ 'newCreateVodSourceResponse' smart constructor.
data CreateVodSourceResponse = CreateVodSourceResponse'
  { -- | The timestamp that indicates when the VOD source was created.
    CreateVodSourceResponse -> Maybe POSIX
creationTime :: Prelude.Maybe Core.POSIX,
    -- | The name of the source location associated with the VOD source.
    CreateVodSourceResponse -> Maybe Text
sourceLocationName :: Prelude.Maybe Prelude.Text,
    -- | The ARN of the VOD source.
    CreateVodSourceResponse -> Maybe Text
arn :: Prelude.Maybe Prelude.Text,
    -- | The ARN for the VOD source.
    CreateVodSourceResponse -> Maybe POSIX
lastModifiedTime :: Prelude.Maybe Core.POSIX,
    -- | The HTTP package configurations.
    CreateVodSourceResponse -> Maybe [HttpPackageConfiguration]
httpPackageConfigurations :: Prelude.Maybe [HttpPackageConfiguration],
    -- | The name of the VOD source.
    CreateVodSourceResponse -> Maybe Text
vodSourceName :: Prelude.Maybe Prelude.Text,
    -- | The tags assigned to the VOD source.
    CreateVodSourceResponse -> Maybe (HashMap Text Text)
tags :: Prelude.Maybe (Prelude.HashMap Prelude.Text Prelude.Text),
    -- | The response's http status code.
    CreateVodSourceResponse -> Int
httpStatus :: Prelude.Int
  }
  deriving (CreateVodSourceResponse -> CreateVodSourceResponse -> Bool
(CreateVodSourceResponse -> CreateVodSourceResponse -> Bool)
-> (CreateVodSourceResponse -> CreateVodSourceResponse -> Bool)
-> Eq CreateVodSourceResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: CreateVodSourceResponse -> CreateVodSourceResponse -> Bool
$c/= :: CreateVodSourceResponse -> CreateVodSourceResponse -> Bool
== :: CreateVodSourceResponse -> CreateVodSourceResponse -> Bool
$c== :: CreateVodSourceResponse -> CreateVodSourceResponse -> Bool
Prelude.Eq, ReadPrec [CreateVodSourceResponse]
ReadPrec CreateVodSourceResponse
Int -> ReadS CreateVodSourceResponse
ReadS [CreateVodSourceResponse]
(Int -> ReadS CreateVodSourceResponse)
-> ReadS [CreateVodSourceResponse]
-> ReadPrec CreateVodSourceResponse
-> ReadPrec [CreateVodSourceResponse]
-> Read CreateVodSourceResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [CreateVodSourceResponse]
$creadListPrec :: ReadPrec [CreateVodSourceResponse]
readPrec :: ReadPrec CreateVodSourceResponse
$creadPrec :: ReadPrec CreateVodSourceResponse
readList :: ReadS [CreateVodSourceResponse]
$creadList :: ReadS [CreateVodSourceResponse]
readsPrec :: Int -> ReadS CreateVodSourceResponse
$creadsPrec :: Int -> ReadS CreateVodSourceResponse
Prelude.Read, Int -> CreateVodSourceResponse -> ShowS
[CreateVodSourceResponse] -> ShowS
CreateVodSourceResponse -> String
(Int -> CreateVodSourceResponse -> ShowS)
-> (CreateVodSourceResponse -> String)
-> ([CreateVodSourceResponse] -> ShowS)
-> Show CreateVodSourceResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [CreateVodSourceResponse] -> ShowS
$cshowList :: [CreateVodSourceResponse] -> ShowS
show :: CreateVodSourceResponse -> String
$cshow :: CreateVodSourceResponse -> String
showsPrec :: Int -> CreateVodSourceResponse -> ShowS
$cshowsPrec :: Int -> CreateVodSourceResponse -> ShowS
Prelude.Show, (forall x.
 CreateVodSourceResponse -> Rep CreateVodSourceResponse x)
-> (forall x.
    Rep CreateVodSourceResponse x -> CreateVodSourceResponse)
-> Generic CreateVodSourceResponse
forall x. Rep CreateVodSourceResponse x -> CreateVodSourceResponse
forall x. CreateVodSourceResponse -> Rep CreateVodSourceResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep CreateVodSourceResponse x -> CreateVodSourceResponse
$cfrom :: forall x. CreateVodSourceResponse -> Rep CreateVodSourceResponse x
Prelude.Generic)

-- |
-- Create a value of 'CreateVodSourceResponse' 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:
--
-- 'creationTime', 'createVodSourceResponse_creationTime' - The timestamp that indicates when the VOD source was created.
--
-- 'sourceLocationName', 'createVodSourceResponse_sourceLocationName' - The name of the source location associated with the VOD source.
--
-- 'arn', 'createVodSourceResponse_arn' - The ARN of the VOD source.
--
-- 'lastModifiedTime', 'createVodSourceResponse_lastModifiedTime' - The ARN for the VOD source.
--
-- 'httpPackageConfigurations', 'createVodSourceResponse_httpPackageConfigurations' - The HTTP package configurations.
--
-- 'vodSourceName', 'createVodSourceResponse_vodSourceName' - The name of the VOD source.
--
-- 'tags', 'createVodSourceResponse_tags' - The tags assigned to the VOD source.
--
-- 'httpStatus', 'createVodSourceResponse_httpStatus' - The response's http status code.
newCreateVodSourceResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  CreateVodSourceResponse
newCreateVodSourceResponse :: Int -> CreateVodSourceResponse
newCreateVodSourceResponse Int
pHttpStatus_ =
  CreateVodSourceResponse' :: Maybe POSIX
-> Maybe Text
-> Maybe Text
-> Maybe POSIX
-> Maybe [HttpPackageConfiguration]
-> Maybe Text
-> Maybe (HashMap Text Text)
-> Int
-> CreateVodSourceResponse
CreateVodSourceResponse'
    { $sel:creationTime:CreateVodSourceResponse' :: Maybe POSIX
creationTime =
        Maybe POSIX
forall a. Maybe a
Prelude.Nothing,
      $sel:sourceLocationName:CreateVodSourceResponse' :: Maybe Text
sourceLocationName = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:arn:CreateVodSourceResponse' :: Maybe Text
arn = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:lastModifiedTime:CreateVodSourceResponse' :: Maybe POSIX
lastModifiedTime = Maybe POSIX
forall a. Maybe a
Prelude.Nothing,
      $sel:httpPackageConfigurations:CreateVodSourceResponse' :: Maybe [HttpPackageConfiguration]
httpPackageConfigurations = Maybe [HttpPackageConfiguration]
forall a. Maybe a
Prelude.Nothing,
      $sel:vodSourceName:CreateVodSourceResponse' :: Maybe Text
vodSourceName = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:tags:CreateVodSourceResponse' :: Maybe (HashMap Text Text)
tags = Maybe (HashMap Text Text)
forall a. Maybe a
Prelude.Nothing,
      $sel:httpStatus:CreateVodSourceResponse' :: Int
httpStatus = Int
pHttpStatus_
    }

-- | The timestamp that indicates when the VOD source was created.
createVodSourceResponse_creationTime :: Lens.Lens' CreateVodSourceResponse (Prelude.Maybe Prelude.UTCTime)
createVodSourceResponse_creationTime :: (Maybe UTCTime -> f (Maybe UTCTime))
-> CreateVodSourceResponse -> f CreateVodSourceResponse
createVodSourceResponse_creationTime = (CreateVodSourceResponse -> Maybe POSIX)
-> (CreateVodSourceResponse
    -> Maybe POSIX -> CreateVodSourceResponse)
-> Lens
     CreateVodSourceResponse
     CreateVodSourceResponse
     (Maybe POSIX)
     (Maybe POSIX)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateVodSourceResponse' {Maybe POSIX
creationTime :: Maybe POSIX
$sel:creationTime:CreateVodSourceResponse' :: CreateVodSourceResponse -> Maybe POSIX
creationTime} -> Maybe POSIX
creationTime) (\s :: CreateVodSourceResponse
s@CreateVodSourceResponse' {} Maybe POSIX
a -> CreateVodSourceResponse
s {$sel:creationTime:CreateVodSourceResponse' :: Maybe POSIX
creationTime = Maybe POSIX
a} :: CreateVodSourceResponse) ((Maybe POSIX -> f (Maybe POSIX))
 -> CreateVodSourceResponse -> f CreateVodSourceResponse)
-> ((Maybe UTCTime -> f (Maybe UTCTime))
    -> Maybe POSIX -> f (Maybe POSIX))
-> (Maybe UTCTime -> f (Maybe UTCTime))
-> CreateVodSourceResponse
-> f CreateVodSourceResponse
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso POSIX POSIX UTCTime UTCTime
-> Iso (Maybe POSIX) (Maybe POSIX) (Maybe UTCTime) (Maybe UTCTime)
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 POSIX POSIX UTCTime UTCTime
forall (a :: Format). Iso' (Time a) UTCTime
Core._Time

-- | The name of the source location associated with the VOD source.
createVodSourceResponse_sourceLocationName :: Lens.Lens' CreateVodSourceResponse (Prelude.Maybe Prelude.Text)
createVodSourceResponse_sourceLocationName :: (Maybe Text -> f (Maybe Text))
-> CreateVodSourceResponse -> f CreateVodSourceResponse
createVodSourceResponse_sourceLocationName = (CreateVodSourceResponse -> Maybe Text)
-> (CreateVodSourceResponse
    -> Maybe Text -> CreateVodSourceResponse)
-> Lens
     CreateVodSourceResponse
     CreateVodSourceResponse
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateVodSourceResponse' {Maybe Text
sourceLocationName :: Maybe Text
$sel:sourceLocationName:CreateVodSourceResponse' :: CreateVodSourceResponse -> Maybe Text
sourceLocationName} -> Maybe Text
sourceLocationName) (\s :: CreateVodSourceResponse
s@CreateVodSourceResponse' {} Maybe Text
a -> CreateVodSourceResponse
s {$sel:sourceLocationName:CreateVodSourceResponse' :: Maybe Text
sourceLocationName = Maybe Text
a} :: CreateVodSourceResponse)

-- | The ARN of the VOD source.
createVodSourceResponse_arn :: Lens.Lens' CreateVodSourceResponse (Prelude.Maybe Prelude.Text)
createVodSourceResponse_arn :: (Maybe Text -> f (Maybe Text))
-> CreateVodSourceResponse -> f CreateVodSourceResponse
createVodSourceResponse_arn = (CreateVodSourceResponse -> Maybe Text)
-> (CreateVodSourceResponse
    -> Maybe Text -> CreateVodSourceResponse)
-> Lens
     CreateVodSourceResponse
     CreateVodSourceResponse
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateVodSourceResponse' {Maybe Text
arn :: Maybe Text
$sel:arn:CreateVodSourceResponse' :: CreateVodSourceResponse -> Maybe Text
arn} -> Maybe Text
arn) (\s :: CreateVodSourceResponse
s@CreateVodSourceResponse' {} Maybe Text
a -> CreateVodSourceResponse
s {$sel:arn:CreateVodSourceResponse' :: Maybe Text
arn = Maybe Text
a} :: CreateVodSourceResponse)

-- | The ARN for the VOD source.
createVodSourceResponse_lastModifiedTime :: Lens.Lens' CreateVodSourceResponse (Prelude.Maybe Prelude.UTCTime)
createVodSourceResponse_lastModifiedTime :: (Maybe UTCTime -> f (Maybe UTCTime))
-> CreateVodSourceResponse -> f CreateVodSourceResponse
createVodSourceResponse_lastModifiedTime = (CreateVodSourceResponse -> Maybe POSIX)
-> (CreateVodSourceResponse
    -> Maybe POSIX -> CreateVodSourceResponse)
-> Lens
     CreateVodSourceResponse
     CreateVodSourceResponse
     (Maybe POSIX)
     (Maybe POSIX)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateVodSourceResponse' {Maybe POSIX
lastModifiedTime :: Maybe POSIX
$sel:lastModifiedTime:CreateVodSourceResponse' :: CreateVodSourceResponse -> Maybe POSIX
lastModifiedTime} -> Maybe POSIX
lastModifiedTime) (\s :: CreateVodSourceResponse
s@CreateVodSourceResponse' {} Maybe POSIX
a -> CreateVodSourceResponse
s {$sel:lastModifiedTime:CreateVodSourceResponse' :: Maybe POSIX
lastModifiedTime = Maybe POSIX
a} :: CreateVodSourceResponse) ((Maybe POSIX -> f (Maybe POSIX))
 -> CreateVodSourceResponse -> f CreateVodSourceResponse)
-> ((Maybe UTCTime -> f (Maybe UTCTime))
    -> Maybe POSIX -> f (Maybe POSIX))
-> (Maybe UTCTime -> f (Maybe UTCTime))
-> CreateVodSourceResponse
-> f CreateVodSourceResponse
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso POSIX POSIX UTCTime UTCTime
-> Iso (Maybe POSIX) (Maybe POSIX) (Maybe UTCTime) (Maybe UTCTime)
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 POSIX POSIX UTCTime UTCTime
forall (a :: Format). Iso' (Time a) UTCTime
Core._Time

-- | The HTTP package configurations.
createVodSourceResponse_httpPackageConfigurations :: Lens.Lens' CreateVodSourceResponse (Prelude.Maybe [HttpPackageConfiguration])
createVodSourceResponse_httpPackageConfigurations :: (Maybe [HttpPackageConfiguration]
 -> f (Maybe [HttpPackageConfiguration]))
-> CreateVodSourceResponse -> f CreateVodSourceResponse
createVodSourceResponse_httpPackageConfigurations = (CreateVodSourceResponse -> Maybe [HttpPackageConfiguration])
-> (CreateVodSourceResponse
    -> Maybe [HttpPackageConfiguration] -> CreateVodSourceResponse)
-> Lens
     CreateVodSourceResponse
     CreateVodSourceResponse
     (Maybe [HttpPackageConfiguration])
     (Maybe [HttpPackageConfiguration])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateVodSourceResponse' {Maybe [HttpPackageConfiguration]
httpPackageConfigurations :: Maybe [HttpPackageConfiguration]
$sel:httpPackageConfigurations:CreateVodSourceResponse' :: CreateVodSourceResponse -> Maybe [HttpPackageConfiguration]
httpPackageConfigurations} -> Maybe [HttpPackageConfiguration]
httpPackageConfigurations) (\s :: CreateVodSourceResponse
s@CreateVodSourceResponse' {} Maybe [HttpPackageConfiguration]
a -> CreateVodSourceResponse
s {$sel:httpPackageConfigurations:CreateVodSourceResponse' :: Maybe [HttpPackageConfiguration]
httpPackageConfigurations = Maybe [HttpPackageConfiguration]
a} :: CreateVodSourceResponse) ((Maybe [HttpPackageConfiguration]
  -> f (Maybe [HttpPackageConfiguration]))
 -> CreateVodSourceResponse -> f CreateVodSourceResponse)
-> ((Maybe [HttpPackageConfiguration]
     -> f (Maybe [HttpPackageConfiguration]))
    -> Maybe [HttpPackageConfiguration]
    -> f (Maybe [HttpPackageConfiguration]))
-> (Maybe [HttpPackageConfiguration]
    -> f (Maybe [HttpPackageConfiguration]))
-> CreateVodSourceResponse
-> f CreateVodSourceResponse
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
  [HttpPackageConfiguration]
  [HttpPackageConfiguration]
  [HttpPackageConfiguration]
  [HttpPackageConfiguration]
-> Iso
     (Maybe [HttpPackageConfiguration])
     (Maybe [HttpPackageConfiguration])
     (Maybe [HttpPackageConfiguration])
     (Maybe [HttpPackageConfiguration])
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
  [HttpPackageConfiguration]
  [HttpPackageConfiguration]
  [HttpPackageConfiguration]
  [HttpPackageConfiguration]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | The name of the VOD source.
createVodSourceResponse_vodSourceName :: Lens.Lens' CreateVodSourceResponse (Prelude.Maybe Prelude.Text)
createVodSourceResponse_vodSourceName :: (Maybe Text -> f (Maybe Text))
-> CreateVodSourceResponse -> f CreateVodSourceResponse
createVodSourceResponse_vodSourceName = (CreateVodSourceResponse -> Maybe Text)
-> (CreateVodSourceResponse
    -> Maybe Text -> CreateVodSourceResponse)
-> Lens
     CreateVodSourceResponse
     CreateVodSourceResponse
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateVodSourceResponse' {Maybe Text
vodSourceName :: Maybe Text
$sel:vodSourceName:CreateVodSourceResponse' :: CreateVodSourceResponse -> Maybe Text
vodSourceName} -> Maybe Text
vodSourceName) (\s :: CreateVodSourceResponse
s@CreateVodSourceResponse' {} Maybe Text
a -> CreateVodSourceResponse
s {$sel:vodSourceName:CreateVodSourceResponse' :: Maybe Text
vodSourceName = Maybe Text
a} :: CreateVodSourceResponse)

-- | The tags assigned to the VOD source.
createVodSourceResponse_tags :: Lens.Lens' CreateVodSourceResponse (Prelude.Maybe (Prelude.HashMap Prelude.Text Prelude.Text))
createVodSourceResponse_tags :: (Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
-> CreateVodSourceResponse -> f CreateVodSourceResponse
createVodSourceResponse_tags = (CreateVodSourceResponse -> Maybe (HashMap Text Text))
-> (CreateVodSourceResponse
    -> Maybe (HashMap Text Text) -> CreateVodSourceResponse)
-> Lens
     CreateVodSourceResponse
     CreateVodSourceResponse
     (Maybe (HashMap Text Text))
     (Maybe (HashMap Text Text))
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateVodSourceResponse' {Maybe (HashMap Text Text)
tags :: Maybe (HashMap Text Text)
$sel:tags:CreateVodSourceResponse' :: CreateVodSourceResponse -> Maybe (HashMap Text Text)
tags} -> Maybe (HashMap Text Text)
tags) (\s :: CreateVodSourceResponse
s@CreateVodSourceResponse' {} Maybe (HashMap Text Text)
a -> CreateVodSourceResponse
s {$sel:tags:CreateVodSourceResponse' :: Maybe (HashMap Text Text)
tags = Maybe (HashMap Text Text)
a} :: CreateVodSourceResponse) ((Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
 -> CreateVodSourceResponse -> f CreateVodSourceResponse)
-> ((Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
    -> Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
-> (Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
-> CreateVodSourceResponse
-> f CreateVodSourceResponse
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
  (HashMap Text Text)
  (HashMap Text Text)
  (HashMap Text Text)
  (HashMap Text Text)
-> Iso
     (Maybe (HashMap Text Text))
     (Maybe (HashMap Text Text))
     (Maybe (HashMap Text Text))
     (Maybe (HashMap Text 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
  (HashMap Text Text)
  (HashMap Text Text)
  (HashMap Text Text)
  (HashMap Text Text)
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

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

instance Prelude.NFData CreateVodSourceResponse