{-# 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.MediaLive.CreateInput
-- 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)
--
-- Create an input
module Amazonka.MediaLive.CreateInput
  ( -- * Creating a Request
    CreateInput' (..),
    newCreateInput',

    -- * Request Lenses
    createInput'_requestId,
    createInput'_inputDevices,
    createInput'_sources,
    createInput'_inputSecurityGroups,
    createInput'_destinations,
    createInput'_name,
    createInput'_vpc,
    createInput'_type,
    createInput'_mediaConnectFlows,
    createInput'_tags,
    createInput'_roleArn,

    -- * Destructuring the Response
    CreateInputResponse (..),
    newCreateInputResponse,

    -- * Response Lenses
    createInputResponse_input,
    createInputResponse_httpStatus,
  )
where

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

-- | The name of the input
--
-- /See:/ 'newCreateInput'' smart constructor.
data CreateInput' = CreateInput''
  { -- | Unique identifier of the request to ensure the request is handled
    -- exactly once in case of retries.
    CreateInput' -> Maybe Text
requestId :: Prelude.Maybe Prelude.Text,
    -- | Settings for the devices.
    CreateInput' -> Maybe [InputDeviceSettings]
inputDevices :: Prelude.Maybe [InputDeviceSettings],
    -- | The source URLs for a PULL-type input. Every PULL type input needs
    -- exactly two source URLs for redundancy. Only specify sources for PULL
    -- type Inputs. Leave Destinations empty.
    CreateInput' -> Maybe [InputSourceRequest]
sources :: Prelude.Maybe [InputSourceRequest],
    -- | A list of security groups referenced by IDs to attach to the input.
    CreateInput' -> Maybe [Text]
inputSecurityGroups :: Prelude.Maybe [Prelude.Text],
    -- | Destination settings for PUSH type inputs.
    CreateInput' -> Maybe [InputDestinationRequest]
destinations :: Prelude.Maybe [InputDestinationRequest],
    -- | Name of the input.
    CreateInput' -> Maybe Text
name :: Prelude.Maybe Prelude.Text,
    CreateInput' -> Maybe InputVpcRequest
vpc :: Prelude.Maybe InputVpcRequest,
    CreateInput' -> Maybe InputType
type' :: Prelude.Maybe InputType,
    -- | A list of the MediaConnect Flows that you want to use in this input. You
    -- can specify as few as one Flow and presently, as many as two. The only
    -- requirement is when you have more than one is that each Flow is in a
    -- separate Availability Zone as this ensures your EML input is redundant
    -- to AZ issues.
    CreateInput' -> Maybe [MediaConnectFlowRequest]
mediaConnectFlows :: Prelude.Maybe [MediaConnectFlowRequest],
    -- | A collection of key-value pairs.
    CreateInput' -> Maybe (HashMap Text Text)
tags :: Prelude.Maybe (Prelude.HashMap Prelude.Text Prelude.Text),
    -- | The Amazon Resource Name (ARN) of the role this input assumes during and
    -- after creation.
    CreateInput' -> Maybe Text
roleArn :: Prelude.Maybe Prelude.Text
  }
  deriving (CreateInput' -> CreateInput' -> Bool
(CreateInput' -> CreateInput' -> Bool)
-> (CreateInput' -> CreateInput' -> Bool) -> Eq CreateInput'
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: CreateInput' -> CreateInput' -> Bool
$c/= :: CreateInput' -> CreateInput' -> Bool
== :: CreateInput' -> CreateInput' -> Bool
$c== :: CreateInput' -> CreateInput' -> Bool
Prelude.Eq, ReadPrec [CreateInput']
ReadPrec CreateInput'
Int -> ReadS CreateInput'
ReadS [CreateInput']
(Int -> ReadS CreateInput')
-> ReadS [CreateInput']
-> ReadPrec CreateInput'
-> ReadPrec [CreateInput']
-> Read CreateInput'
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [CreateInput']
$creadListPrec :: ReadPrec [CreateInput']
readPrec :: ReadPrec CreateInput'
$creadPrec :: ReadPrec CreateInput'
readList :: ReadS [CreateInput']
$creadList :: ReadS [CreateInput']
readsPrec :: Int -> ReadS CreateInput'
$creadsPrec :: Int -> ReadS CreateInput'
Prelude.Read, Int -> CreateInput' -> ShowS
[CreateInput'] -> ShowS
CreateInput' -> String
(Int -> CreateInput' -> ShowS)
-> (CreateInput' -> String)
-> ([CreateInput'] -> ShowS)
-> Show CreateInput'
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [CreateInput'] -> ShowS
$cshowList :: [CreateInput'] -> ShowS
show :: CreateInput' -> String
$cshow :: CreateInput' -> String
showsPrec :: Int -> CreateInput' -> ShowS
$cshowsPrec :: Int -> CreateInput' -> ShowS
Prelude.Show, (forall x. CreateInput' -> Rep CreateInput' x)
-> (forall x. Rep CreateInput' x -> CreateInput')
-> Generic CreateInput'
forall x. Rep CreateInput' x -> CreateInput'
forall x. CreateInput' -> Rep CreateInput' x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep CreateInput' x -> CreateInput'
$cfrom :: forall x. CreateInput' -> Rep CreateInput' x
Prelude.Generic)

-- |
-- Create a value of 'CreateInput'' 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:
--
-- 'requestId', 'createInput'_requestId' - Unique identifier of the request to ensure the request is handled
-- exactly once in case of retries.
--
-- 'inputDevices', 'createInput'_inputDevices' - Settings for the devices.
--
-- 'sources', 'createInput'_sources' - The source URLs for a PULL-type input. Every PULL type input needs
-- exactly two source URLs for redundancy. Only specify sources for PULL
-- type Inputs. Leave Destinations empty.
--
-- 'inputSecurityGroups', 'createInput'_inputSecurityGroups' - A list of security groups referenced by IDs to attach to the input.
--
-- 'destinations', 'createInput'_destinations' - Destination settings for PUSH type inputs.
--
-- 'name', 'createInput'_name' - Name of the input.
--
-- 'vpc', 'createInput'_vpc' - Undocumented member.
--
-- 'type'', 'createInput'_type' - Undocumented member.
--
-- 'mediaConnectFlows', 'createInput'_mediaConnectFlows' - A list of the MediaConnect Flows that you want to use in this input. You
-- can specify as few as one Flow and presently, as many as two. The only
-- requirement is when you have more than one is that each Flow is in a
-- separate Availability Zone as this ensures your EML input is redundant
-- to AZ issues.
--
-- 'tags', 'createInput'_tags' - A collection of key-value pairs.
--
-- 'roleArn', 'createInput'_roleArn' - The Amazon Resource Name (ARN) of the role this input assumes during and
-- after creation.
newCreateInput' ::
  CreateInput'
newCreateInput' :: CreateInput'
newCreateInput' =
  CreateInput'' :: Maybe Text
-> Maybe [InputDeviceSettings]
-> Maybe [InputSourceRequest]
-> Maybe [Text]
-> Maybe [InputDestinationRequest]
-> Maybe Text
-> Maybe InputVpcRequest
-> Maybe InputType
-> Maybe [MediaConnectFlowRequest]
-> Maybe (HashMap Text Text)
-> Maybe Text
-> CreateInput'
CreateInput''
    { $sel:requestId:CreateInput'' :: Maybe Text
requestId = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:inputDevices:CreateInput'' :: Maybe [InputDeviceSettings]
inputDevices = Maybe [InputDeviceSettings]
forall a. Maybe a
Prelude.Nothing,
      $sel:sources:CreateInput'' :: Maybe [InputSourceRequest]
sources = Maybe [InputSourceRequest]
forall a. Maybe a
Prelude.Nothing,
      $sel:inputSecurityGroups:CreateInput'' :: Maybe [Text]
inputSecurityGroups = Maybe [Text]
forall a. Maybe a
Prelude.Nothing,
      $sel:destinations:CreateInput'' :: Maybe [InputDestinationRequest]
destinations = Maybe [InputDestinationRequest]
forall a. Maybe a
Prelude.Nothing,
      $sel:name:CreateInput'' :: Maybe Text
name = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:vpc:CreateInput'' :: Maybe InputVpcRequest
vpc = Maybe InputVpcRequest
forall a. Maybe a
Prelude.Nothing,
      $sel:type':CreateInput'' :: Maybe InputType
type' = Maybe InputType
forall a. Maybe a
Prelude.Nothing,
      $sel:mediaConnectFlows:CreateInput'' :: Maybe [MediaConnectFlowRequest]
mediaConnectFlows = Maybe [MediaConnectFlowRequest]
forall a. Maybe a
Prelude.Nothing,
      $sel:tags:CreateInput'' :: Maybe (HashMap Text Text)
tags = Maybe (HashMap Text Text)
forall a. Maybe a
Prelude.Nothing,
      $sel:roleArn:CreateInput'' :: Maybe Text
roleArn = Maybe Text
forall a. Maybe a
Prelude.Nothing
    }

-- | Unique identifier of the request to ensure the request is handled
-- exactly once in case of retries.
createInput'_requestId :: Lens.Lens' CreateInput' (Prelude.Maybe Prelude.Text)
createInput'_requestId :: (Maybe Text -> f (Maybe Text)) -> CreateInput' -> f CreateInput'
createInput'_requestId = (CreateInput' -> Maybe Text)
-> (CreateInput' -> Maybe Text -> CreateInput')
-> Lens CreateInput' CreateInput' (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateInput'' {Maybe Text
requestId :: Maybe Text
$sel:requestId:CreateInput'' :: CreateInput' -> Maybe Text
requestId} -> Maybe Text
requestId) (\s :: CreateInput'
s@CreateInput'' {} Maybe Text
a -> CreateInput'
s {$sel:requestId:CreateInput'' :: Maybe Text
requestId = Maybe Text
a} :: CreateInput')

-- | Settings for the devices.
createInput'_inputDevices :: Lens.Lens' CreateInput' (Prelude.Maybe [InputDeviceSettings])
createInput'_inputDevices :: (Maybe [InputDeviceSettings] -> f (Maybe [InputDeviceSettings]))
-> CreateInput' -> f CreateInput'
createInput'_inputDevices = (CreateInput' -> Maybe [InputDeviceSettings])
-> (CreateInput' -> Maybe [InputDeviceSettings] -> CreateInput')
-> Lens
     CreateInput'
     CreateInput'
     (Maybe [InputDeviceSettings])
     (Maybe [InputDeviceSettings])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateInput'' {Maybe [InputDeviceSettings]
inputDevices :: Maybe [InputDeviceSettings]
$sel:inputDevices:CreateInput'' :: CreateInput' -> Maybe [InputDeviceSettings]
inputDevices} -> Maybe [InputDeviceSettings]
inputDevices) (\s :: CreateInput'
s@CreateInput'' {} Maybe [InputDeviceSettings]
a -> CreateInput'
s {$sel:inputDevices:CreateInput'' :: Maybe [InputDeviceSettings]
inputDevices = Maybe [InputDeviceSettings]
a} :: CreateInput') ((Maybe [InputDeviceSettings] -> f (Maybe [InputDeviceSettings]))
 -> CreateInput' -> f CreateInput')
-> ((Maybe [InputDeviceSettings]
     -> f (Maybe [InputDeviceSettings]))
    -> Maybe [InputDeviceSettings] -> f (Maybe [InputDeviceSettings]))
-> (Maybe [InputDeviceSettings] -> f (Maybe [InputDeviceSettings]))
-> CreateInput'
-> f CreateInput'
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
  [InputDeviceSettings]
  [InputDeviceSettings]
  [InputDeviceSettings]
  [InputDeviceSettings]
-> Iso
     (Maybe [InputDeviceSettings])
     (Maybe [InputDeviceSettings])
     (Maybe [InputDeviceSettings])
     (Maybe [InputDeviceSettings])
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
  [InputDeviceSettings]
  [InputDeviceSettings]
  [InputDeviceSettings]
  [InputDeviceSettings]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | The source URLs for a PULL-type input. Every PULL type input needs
-- exactly two source URLs for redundancy. Only specify sources for PULL
-- type Inputs. Leave Destinations empty.
createInput'_sources :: Lens.Lens' CreateInput' (Prelude.Maybe [InputSourceRequest])
createInput'_sources :: (Maybe [InputSourceRequest] -> f (Maybe [InputSourceRequest]))
-> CreateInput' -> f CreateInput'
createInput'_sources = (CreateInput' -> Maybe [InputSourceRequest])
-> (CreateInput' -> Maybe [InputSourceRequest] -> CreateInput')
-> Lens
     CreateInput'
     CreateInput'
     (Maybe [InputSourceRequest])
     (Maybe [InputSourceRequest])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateInput'' {Maybe [InputSourceRequest]
sources :: Maybe [InputSourceRequest]
$sel:sources:CreateInput'' :: CreateInput' -> Maybe [InputSourceRequest]
sources} -> Maybe [InputSourceRequest]
sources) (\s :: CreateInput'
s@CreateInput'' {} Maybe [InputSourceRequest]
a -> CreateInput'
s {$sel:sources:CreateInput'' :: Maybe [InputSourceRequest]
sources = Maybe [InputSourceRequest]
a} :: CreateInput') ((Maybe [InputSourceRequest] -> f (Maybe [InputSourceRequest]))
 -> CreateInput' -> f CreateInput')
-> ((Maybe [InputSourceRequest] -> f (Maybe [InputSourceRequest]))
    -> Maybe [InputSourceRequest] -> f (Maybe [InputSourceRequest]))
-> (Maybe [InputSourceRequest] -> f (Maybe [InputSourceRequest]))
-> CreateInput'
-> f CreateInput'
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
  [InputSourceRequest]
  [InputSourceRequest]
  [InputSourceRequest]
  [InputSourceRequest]
-> Iso
     (Maybe [InputSourceRequest])
     (Maybe [InputSourceRequest])
     (Maybe [InputSourceRequest])
     (Maybe [InputSourceRequest])
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
  [InputSourceRequest]
  [InputSourceRequest]
  [InputSourceRequest]
  [InputSourceRequest]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | A list of security groups referenced by IDs to attach to the input.
createInput'_inputSecurityGroups :: Lens.Lens' CreateInput' (Prelude.Maybe [Prelude.Text])
createInput'_inputSecurityGroups :: (Maybe [Text] -> f (Maybe [Text]))
-> CreateInput' -> f CreateInput'
createInput'_inputSecurityGroups = (CreateInput' -> Maybe [Text])
-> (CreateInput' -> Maybe [Text] -> CreateInput')
-> Lens CreateInput' CreateInput' (Maybe [Text]) (Maybe [Text])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateInput'' {Maybe [Text]
inputSecurityGroups :: Maybe [Text]
$sel:inputSecurityGroups:CreateInput'' :: CreateInput' -> Maybe [Text]
inputSecurityGroups} -> Maybe [Text]
inputSecurityGroups) (\s :: CreateInput'
s@CreateInput'' {} Maybe [Text]
a -> CreateInput'
s {$sel:inputSecurityGroups:CreateInput'' :: Maybe [Text]
inputSecurityGroups = Maybe [Text]
a} :: CreateInput') ((Maybe [Text] -> f (Maybe [Text]))
 -> CreateInput' -> f CreateInput')
-> ((Maybe [Text] -> f (Maybe [Text]))
    -> Maybe [Text] -> f (Maybe [Text]))
-> (Maybe [Text] -> f (Maybe [Text]))
-> CreateInput'
-> f CreateInput'
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso [Text] [Text] [Text] [Text]
-> Iso (Maybe [Text]) (Maybe [Text]) (Maybe [Text]) (Maybe [Text])
forall (f :: * -> *) (g :: * -> *) s t a b.
(Functor f, Functor g) =>
AnIso s t a b -> Iso (f s) (g t) (f a) (g b)
Lens.mapping AnIso [Text] [Text] [Text] [Text]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | Destination settings for PUSH type inputs.
createInput'_destinations :: Lens.Lens' CreateInput' (Prelude.Maybe [InputDestinationRequest])
createInput'_destinations :: (Maybe [InputDestinationRequest]
 -> f (Maybe [InputDestinationRequest]))
-> CreateInput' -> f CreateInput'
createInput'_destinations = (CreateInput' -> Maybe [InputDestinationRequest])
-> (CreateInput'
    -> Maybe [InputDestinationRequest] -> CreateInput')
-> Lens
     CreateInput'
     CreateInput'
     (Maybe [InputDestinationRequest])
     (Maybe [InputDestinationRequest])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateInput'' {Maybe [InputDestinationRequest]
destinations :: Maybe [InputDestinationRequest]
$sel:destinations:CreateInput'' :: CreateInput' -> Maybe [InputDestinationRequest]
destinations} -> Maybe [InputDestinationRequest]
destinations) (\s :: CreateInput'
s@CreateInput'' {} Maybe [InputDestinationRequest]
a -> CreateInput'
s {$sel:destinations:CreateInput'' :: Maybe [InputDestinationRequest]
destinations = Maybe [InputDestinationRequest]
a} :: CreateInput') ((Maybe [InputDestinationRequest]
  -> f (Maybe [InputDestinationRequest]))
 -> CreateInput' -> f CreateInput')
-> ((Maybe [InputDestinationRequest]
     -> f (Maybe [InputDestinationRequest]))
    -> Maybe [InputDestinationRequest]
    -> f (Maybe [InputDestinationRequest]))
-> (Maybe [InputDestinationRequest]
    -> f (Maybe [InputDestinationRequest]))
-> CreateInput'
-> f CreateInput'
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
  [InputDestinationRequest]
  [InputDestinationRequest]
  [InputDestinationRequest]
  [InputDestinationRequest]
-> Iso
     (Maybe [InputDestinationRequest])
     (Maybe [InputDestinationRequest])
     (Maybe [InputDestinationRequest])
     (Maybe [InputDestinationRequest])
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
  [InputDestinationRequest]
  [InputDestinationRequest]
  [InputDestinationRequest]
  [InputDestinationRequest]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | Name of the input.
createInput'_name :: Lens.Lens' CreateInput' (Prelude.Maybe Prelude.Text)
createInput'_name :: (Maybe Text -> f (Maybe Text)) -> CreateInput' -> f CreateInput'
createInput'_name = (CreateInput' -> Maybe Text)
-> (CreateInput' -> Maybe Text -> CreateInput')
-> Lens CreateInput' CreateInput' (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateInput'' {Maybe Text
name :: Maybe Text
$sel:name:CreateInput'' :: CreateInput' -> Maybe Text
name} -> Maybe Text
name) (\s :: CreateInput'
s@CreateInput'' {} Maybe Text
a -> CreateInput'
s {$sel:name:CreateInput'' :: Maybe Text
name = Maybe Text
a} :: CreateInput')

-- | Undocumented member.
createInput'_vpc :: Lens.Lens' CreateInput' (Prelude.Maybe InputVpcRequest)
createInput'_vpc :: (Maybe InputVpcRequest -> f (Maybe InputVpcRequest))
-> CreateInput' -> f CreateInput'
createInput'_vpc = (CreateInput' -> Maybe InputVpcRequest)
-> (CreateInput' -> Maybe InputVpcRequest -> CreateInput')
-> Lens
     CreateInput'
     CreateInput'
     (Maybe InputVpcRequest)
     (Maybe InputVpcRequest)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateInput'' {Maybe InputVpcRequest
vpc :: Maybe InputVpcRequest
$sel:vpc:CreateInput'' :: CreateInput' -> Maybe InputVpcRequest
vpc} -> Maybe InputVpcRequest
vpc) (\s :: CreateInput'
s@CreateInput'' {} Maybe InputVpcRequest
a -> CreateInput'
s {$sel:vpc:CreateInput'' :: Maybe InputVpcRequest
vpc = Maybe InputVpcRequest
a} :: CreateInput')

-- | Undocumented member.
createInput'_type :: Lens.Lens' CreateInput' (Prelude.Maybe InputType)
createInput'_type :: (Maybe InputType -> f (Maybe InputType))
-> CreateInput' -> f CreateInput'
createInput'_type = (CreateInput' -> Maybe InputType)
-> (CreateInput' -> Maybe InputType -> CreateInput')
-> Lens
     CreateInput' CreateInput' (Maybe InputType) (Maybe InputType)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateInput'' {Maybe InputType
type' :: Maybe InputType
$sel:type':CreateInput'' :: CreateInput' -> Maybe InputType
type'} -> Maybe InputType
type') (\s :: CreateInput'
s@CreateInput'' {} Maybe InputType
a -> CreateInput'
s {$sel:type':CreateInput'' :: Maybe InputType
type' = Maybe InputType
a} :: CreateInput')

-- | A list of the MediaConnect Flows that you want to use in this input. You
-- can specify as few as one Flow and presently, as many as two. The only
-- requirement is when you have more than one is that each Flow is in a
-- separate Availability Zone as this ensures your EML input is redundant
-- to AZ issues.
createInput'_mediaConnectFlows :: Lens.Lens' CreateInput' (Prelude.Maybe [MediaConnectFlowRequest])
createInput'_mediaConnectFlows :: (Maybe [MediaConnectFlowRequest]
 -> f (Maybe [MediaConnectFlowRequest]))
-> CreateInput' -> f CreateInput'
createInput'_mediaConnectFlows = (CreateInput' -> Maybe [MediaConnectFlowRequest])
-> (CreateInput'
    -> Maybe [MediaConnectFlowRequest] -> CreateInput')
-> Lens
     CreateInput'
     CreateInput'
     (Maybe [MediaConnectFlowRequest])
     (Maybe [MediaConnectFlowRequest])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateInput'' {Maybe [MediaConnectFlowRequest]
mediaConnectFlows :: Maybe [MediaConnectFlowRequest]
$sel:mediaConnectFlows:CreateInput'' :: CreateInput' -> Maybe [MediaConnectFlowRequest]
mediaConnectFlows} -> Maybe [MediaConnectFlowRequest]
mediaConnectFlows) (\s :: CreateInput'
s@CreateInput'' {} Maybe [MediaConnectFlowRequest]
a -> CreateInput'
s {$sel:mediaConnectFlows:CreateInput'' :: Maybe [MediaConnectFlowRequest]
mediaConnectFlows = Maybe [MediaConnectFlowRequest]
a} :: CreateInput') ((Maybe [MediaConnectFlowRequest]
  -> f (Maybe [MediaConnectFlowRequest]))
 -> CreateInput' -> f CreateInput')
-> ((Maybe [MediaConnectFlowRequest]
     -> f (Maybe [MediaConnectFlowRequest]))
    -> Maybe [MediaConnectFlowRequest]
    -> f (Maybe [MediaConnectFlowRequest]))
-> (Maybe [MediaConnectFlowRequest]
    -> f (Maybe [MediaConnectFlowRequest]))
-> CreateInput'
-> f CreateInput'
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
  [MediaConnectFlowRequest]
  [MediaConnectFlowRequest]
  [MediaConnectFlowRequest]
  [MediaConnectFlowRequest]
-> Iso
     (Maybe [MediaConnectFlowRequest])
     (Maybe [MediaConnectFlowRequest])
     (Maybe [MediaConnectFlowRequest])
     (Maybe [MediaConnectFlowRequest])
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
  [MediaConnectFlowRequest]
  [MediaConnectFlowRequest]
  [MediaConnectFlowRequest]
  [MediaConnectFlowRequest]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | A collection of key-value pairs.
createInput'_tags :: Lens.Lens' CreateInput' (Prelude.Maybe (Prelude.HashMap Prelude.Text Prelude.Text))
createInput'_tags :: (Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
-> CreateInput' -> f CreateInput'
createInput'_tags = (CreateInput' -> Maybe (HashMap Text Text))
-> (CreateInput' -> Maybe (HashMap Text Text) -> CreateInput')
-> Lens
     CreateInput'
     CreateInput'
     (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 (\CreateInput'' {Maybe (HashMap Text Text)
tags :: Maybe (HashMap Text Text)
$sel:tags:CreateInput'' :: CreateInput' -> Maybe (HashMap Text Text)
tags} -> Maybe (HashMap Text Text)
tags) (\s :: CreateInput'
s@CreateInput'' {} Maybe (HashMap Text Text)
a -> CreateInput'
s {$sel:tags:CreateInput'' :: Maybe (HashMap Text Text)
tags = Maybe (HashMap Text Text)
a} :: CreateInput') ((Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
 -> CreateInput' -> f CreateInput')
-> ((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)))
-> CreateInput'
-> f CreateInput'
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 Amazon Resource Name (ARN) of the role this input assumes during and
-- after creation.
createInput'_roleArn :: Lens.Lens' CreateInput' (Prelude.Maybe Prelude.Text)
createInput'_roleArn :: (Maybe Text -> f (Maybe Text)) -> CreateInput' -> f CreateInput'
createInput'_roleArn = (CreateInput' -> Maybe Text)
-> (CreateInput' -> Maybe Text -> CreateInput')
-> Lens CreateInput' CreateInput' (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateInput'' {Maybe Text
roleArn :: Maybe Text
$sel:roleArn:CreateInput'' :: CreateInput' -> Maybe Text
roleArn} -> Maybe Text
roleArn) (\s :: CreateInput'
s@CreateInput'' {} Maybe Text
a -> CreateInput'
s {$sel:roleArn:CreateInput'' :: Maybe Text
roleArn = Maybe Text
a} :: CreateInput')

instance Core.AWSRequest CreateInput' where
  type AWSResponse CreateInput' = CreateInputResponse
  request :: CreateInput' -> Request CreateInput'
request = Service -> CreateInput' -> Request CreateInput'
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON Service
defaultService
  response :: Logger
-> Service
-> Proxy CreateInput'
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse CreateInput')))
response =
    (Int
 -> ResponseHeaders
 -> Object
 -> Either String (AWSResponse CreateInput'))
-> Logger
-> Service
-> Proxy CreateInput'
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse CreateInput')))
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 Input -> Int -> CreateInputResponse
CreateInputResponse'
            (Maybe Input -> Int -> CreateInputResponse)
-> Either String (Maybe Input)
-> Either String (Int -> CreateInputResponse)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Either String (Maybe Input)
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"input")
            Either String (Int -> CreateInputResponse)
-> Either String Int -> Either String CreateInputResponse
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 CreateInput'

instance Prelude.NFData CreateInput'

instance Core.ToHeaders CreateInput' where
  toHeaders :: CreateInput' -> ResponseHeaders
toHeaders =
    ResponseHeaders -> CreateInput' -> 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 CreateInput' where
  toJSON :: CreateInput' -> Value
toJSON CreateInput'' {Maybe [Text]
Maybe [InputDestinationRequest]
Maybe [InputDeviceSettings]
Maybe [InputSourceRequest]
Maybe [MediaConnectFlowRequest]
Maybe Text
Maybe (HashMap Text Text)
Maybe InputType
Maybe InputVpcRequest
roleArn :: Maybe Text
tags :: Maybe (HashMap Text Text)
mediaConnectFlows :: Maybe [MediaConnectFlowRequest]
type' :: Maybe InputType
vpc :: Maybe InputVpcRequest
name :: Maybe Text
destinations :: Maybe [InputDestinationRequest]
inputSecurityGroups :: Maybe [Text]
sources :: Maybe [InputSourceRequest]
inputDevices :: Maybe [InputDeviceSettings]
requestId :: Maybe Text
$sel:roleArn:CreateInput'' :: CreateInput' -> Maybe Text
$sel:tags:CreateInput'' :: CreateInput' -> Maybe (HashMap Text Text)
$sel:mediaConnectFlows:CreateInput'' :: CreateInput' -> Maybe [MediaConnectFlowRequest]
$sel:type':CreateInput'' :: CreateInput' -> Maybe InputType
$sel:vpc:CreateInput'' :: CreateInput' -> Maybe InputVpcRequest
$sel:name:CreateInput'' :: CreateInput' -> Maybe Text
$sel:destinations:CreateInput'' :: CreateInput' -> Maybe [InputDestinationRequest]
$sel:inputSecurityGroups:CreateInput'' :: CreateInput' -> Maybe [Text]
$sel:sources:CreateInput'' :: CreateInput' -> Maybe [InputSourceRequest]
$sel:inputDevices:CreateInput'' :: CreateInput' -> Maybe [InputDeviceSettings]
$sel:requestId:CreateInput'' :: CreateInput' -> Maybe Text
..} =
    [Pair] -> Value
Core.object
      ( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ (Text
"requestId" 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
requestId,
            (Text
"inputDevices" Text -> [InputDeviceSettings] -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) ([InputDeviceSettings] -> Pair)
-> Maybe [InputDeviceSettings] -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe [InputDeviceSettings]
inputDevices,
            (Text
"sources" Text -> [InputSourceRequest] -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) ([InputSourceRequest] -> Pair)
-> Maybe [InputSourceRequest] -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe [InputSourceRequest]
sources,
            (Text
"inputSecurityGroups" 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]
inputSecurityGroups,
            (Text
"destinations" Text -> [InputDestinationRequest] -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) ([InputDestinationRequest] -> Pair)
-> Maybe [InputDestinationRequest] -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe [InputDestinationRequest]
destinations,
            (Text
"name" 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
name,
            (Text
"vpc" Text -> InputVpcRequest -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (InputVpcRequest -> Pair) -> Maybe InputVpcRequest -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe InputVpcRequest
vpc,
            (Text
"type" Text -> InputType -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (InputType -> Pair) -> Maybe InputType -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe InputType
type',
            (Text
"mediaConnectFlows" Text -> [MediaConnectFlowRequest] -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
              ([MediaConnectFlowRequest] -> Pair)
-> Maybe [MediaConnectFlowRequest] -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe [MediaConnectFlowRequest]
mediaConnectFlows,
            (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,
            (Text
"roleArn" 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
roleArn
          ]
      )

instance Core.ToPath CreateInput' where
  toPath :: CreateInput' -> ByteString
toPath = ByteString -> CreateInput' -> ByteString
forall a b. a -> b -> a
Prelude.const ByteString
"/prod/inputs"

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

-- | Placeholder documentation for CreateInputResponse
--
-- /See:/ 'newCreateInputResponse' smart constructor.
data CreateInputResponse = CreateInputResponse'
  { CreateInputResponse -> Maybe Input
input :: Prelude.Maybe Input,
    -- | The response's http status code.
    CreateInputResponse -> Int
httpStatus :: Prelude.Int
  }
  deriving (CreateInputResponse -> CreateInputResponse -> Bool
(CreateInputResponse -> CreateInputResponse -> Bool)
-> (CreateInputResponse -> CreateInputResponse -> Bool)
-> Eq CreateInputResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: CreateInputResponse -> CreateInputResponse -> Bool
$c/= :: CreateInputResponse -> CreateInputResponse -> Bool
== :: CreateInputResponse -> CreateInputResponse -> Bool
$c== :: CreateInputResponse -> CreateInputResponse -> Bool
Prelude.Eq, ReadPrec [CreateInputResponse]
ReadPrec CreateInputResponse
Int -> ReadS CreateInputResponse
ReadS [CreateInputResponse]
(Int -> ReadS CreateInputResponse)
-> ReadS [CreateInputResponse]
-> ReadPrec CreateInputResponse
-> ReadPrec [CreateInputResponse]
-> Read CreateInputResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [CreateInputResponse]
$creadListPrec :: ReadPrec [CreateInputResponse]
readPrec :: ReadPrec CreateInputResponse
$creadPrec :: ReadPrec CreateInputResponse
readList :: ReadS [CreateInputResponse]
$creadList :: ReadS [CreateInputResponse]
readsPrec :: Int -> ReadS CreateInputResponse
$creadsPrec :: Int -> ReadS CreateInputResponse
Prelude.Read, Int -> CreateInputResponse -> ShowS
[CreateInputResponse] -> ShowS
CreateInputResponse -> String
(Int -> CreateInputResponse -> ShowS)
-> (CreateInputResponse -> String)
-> ([CreateInputResponse] -> ShowS)
-> Show CreateInputResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [CreateInputResponse] -> ShowS
$cshowList :: [CreateInputResponse] -> ShowS
show :: CreateInputResponse -> String
$cshow :: CreateInputResponse -> String
showsPrec :: Int -> CreateInputResponse -> ShowS
$cshowsPrec :: Int -> CreateInputResponse -> ShowS
Prelude.Show, (forall x. CreateInputResponse -> Rep CreateInputResponse x)
-> (forall x. Rep CreateInputResponse x -> CreateInputResponse)
-> Generic CreateInputResponse
forall x. Rep CreateInputResponse x -> CreateInputResponse
forall x. CreateInputResponse -> Rep CreateInputResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep CreateInputResponse x -> CreateInputResponse
$cfrom :: forall x. CreateInputResponse -> Rep CreateInputResponse x
Prelude.Generic)

-- |
-- Create a value of 'CreateInputResponse' 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:
--
-- 'input', 'createInputResponse_input' - Undocumented member.
--
-- 'httpStatus', 'createInputResponse_httpStatus' - The response's http status code.
newCreateInputResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  CreateInputResponse
newCreateInputResponse :: Int -> CreateInputResponse
newCreateInputResponse Int
pHttpStatus_ =
  CreateInputResponse' :: Maybe Input -> Int -> CreateInputResponse
CreateInputResponse'
    { $sel:input:CreateInputResponse' :: Maybe Input
input = Maybe Input
forall a. Maybe a
Prelude.Nothing,
      $sel:httpStatus:CreateInputResponse' :: Int
httpStatus = Int
pHttpStatus_
    }

-- | Undocumented member.
createInputResponse_input :: Lens.Lens' CreateInputResponse (Prelude.Maybe Input)
createInputResponse_input :: (Maybe Input -> f (Maybe Input))
-> CreateInputResponse -> f CreateInputResponse
createInputResponse_input = (CreateInputResponse -> Maybe Input)
-> (CreateInputResponse -> Maybe Input -> CreateInputResponse)
-> Lens
     CreateInputResponse CreateInputResponse (Maybe Input) (Maybe Input)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateInputResponse' {Maybe Input
input :: Maybe Input
$sel:input:CreateInputResponse' :: CreateInputResponse -> Maybe Input
input} -> Maybe Input
input) (\s :: CreateInputResponse
s@CreateInputResponse' {} Maybe Input
a -> CreateInputResponse
s {$sel:input:CreateInputResponse' :: Maybe Input
input = Maybe Input
a} :: CreateInputResponse)

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

instance Prelude.NFData CreateInputResponse