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

    -- * Request Lenses
    updateInput'_inputDevices,
    updateInput'_sources,
    updateInput'_inputSecurityGroups,
    updateInput'_destinations,
    updateInput'_name,
    updateInput'_mediaConnectFlows,
    updateInput'_roleArn,
    updateInput'_inputId,

    -- * Destructuring the Response
    UpdateInputResponse (..),
    newUpdateInputResponse,

    -- * Response Lenses
    updateInputResponse_input,
    updateInputResponse_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

-- | A request to update an input.
--
-- /See:/ 'newUpdateInput'' smart constructor.
data UpdateInput' = UpdateInput''
  { -- | Settings for the devices.
    UpdateInput' -> Maybe [InputDeviceRequest]
inputDevices :: Prelude.Maybe [InputDeviceRequest],
    -- | 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.
    UpdateInput' -> Maybe [InputSourceRequest]
sources :: Prelude.Maybe [InputSourceRequest],
    -- | A list of security groups referenced by IDs to attach to the input.
    UpdateInput' -> Maybe [Text]
inputSecurityGroups :: Prelude.Maybe [Prelude.Text],
    -- | Destination settings for PUSH type inputs.
    UpdateInput' -> Maybe [InputDestinationRequest]
destinations :: Prelude.Maybe [InputDestinationRequest],
    -- | Name of the input.
    UpdateInput' -> Maybe Text
name :: Prelude.Maybe Prelude.Text,
    -- | A list of the MediaConnect Flow ARNs that you want to use as the source
    -- of the 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.
    UpdateInput' -> Maybe [MediaConnectFlowRequest]
mediaConnectFlows :: Prelude.Maybe [MediaConnectFlowRequest],
    -- | The Amazon Resource Name (ARN) of the role this input assumes during and
    -- after creation.
    UpdateInput' -> Maybe Text
roleArn :: Prelude.Maybe Prelude.Text,
    -- | Unique ID of the input.
    UpdateInput' -> Text
inputId :: Prelude.Text
  }
  deriving (UpdateInput' -> UpdateInput' -> Bool
(UpdateInput' -> UpdateInput' -> Bool)
-> (UpdateInput' -> UpdateInput' -> Bool) -> Eq UpdateInput'
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: UpdateInput' -> UpdateInput' -> Bool
$c/= :: UpdateInput' -> UpdateInput' -> Bool
== :: UpdateInput' -> UpdateInput' -> Bool
$c== :: UpdateInput' -> UpdateInput' -> Bool
Prelude.Eq, ReadPrec [UpdateInput']
ReadPrec UpdateInput'
Int -> ReadS UpdateInput'
ReadS [UpdateInput']
(Int -> ReadS UpdateInput')
-> ReadS [UpdateInput']
-> ReadPrec UpdateInput'
-> ReadPrec [UpdateInput']
-> Read UpdateInput'
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [UpdateInput']
$creadListPrec :: ReadPrec [UpdateInput']
readPrec :: ReadPrec UpdateInput'
$creadPrec :: ReadPrec UpdateInput'
readList :: ReadS [UpdateInput']
$creadList :: ReadS [UpdateInput']
readsPrec :: Int -> ReadS UpdateInput'
$creadsPrec :: Int -> ReadS UpdateInput'
Prelude.Read, Int -> UpdateInput' -> ShowS
[UpdateInput'] -> ShowS
UpdateInput' -> String
(Int -> UpdateInput' -> ShowS)
-> (UpdateInput' -> String)
-> ([UpdateInput'] -> ShowS)
-> Show UpdateInput'
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [UpdateInput'] -> ShowS
$cshowList :: [UpdateInput'] -> ShowS
show :: UpdateInput' -> String
$cshow :: UpdateInput' -> String
showsPrec :: Int -> UpdateInput' -> ShowS
$cshowsPrec :: Int -> UpdateInput' -> ShowS
Prelude.Show, (forall x. UpdateInput' -> Rep UpdateInput' x)
-> (forall x. Rep UpdateInput' x -> UpdateInput')
-> Generic UpdateInput'
forall x. Rep UpdateInput' x -> UpdateInput'
forall x. UpdateInput' -> Rep UpdateInput' x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep UpdateInput' x -> UpdateInput'
$cfrom :: forall x. UpdateInput' -> Rep UpdateInput' x
Prelude.Generic)

-- |
-- Create a value of 'UpdateInput'' 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:
--
-- 'inputDevices', 'updateInput'_inputDevices' - Settings for the devices.
--
-- 'sources', 'updateInput'_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', 'updateInput'_inputSecurityGroups' - A list of security groups referenced by IDs to attach to the input.
--
-- 'destinations', 'updateInput'_destinations' - Destination settings for PUSH type inputs.
--
-- 'name', 'updateInput'_name' - Name of the input.
--
-- 'mediaConnectFlows', 'updateInput'_mediaConnectFlows' - A list of the MediaConnect Flow ARNs that you want to use as the source
-- of the 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.
--
-- 'roleArn', 'updateInput'_roleArn' - The Amazon Resource Name (ARN) of the role this input assumes during and
-- after creation.
--
-- 'inputId', 'updateInput'_inputId' - Unique ID of the input.
newUpdateInput' ::
  -- | 'inputId'
  Prelude.Text ->
  UpdateInput'
newUpdateInput' :: Text -> UpdateInput'
newUpdateInput' Text
pInputId_ =
  UpdateInput'' :: Maybe [InputDeviceRequest]
-> Maybe [InputSourceRequest]
-> Maybe [Text]
-> Maybe [InputDestinationRequest]
-> Maybe Text
-> Maybe [MediaConnectFlowRequest]
-> Maybe Text
-> Text
-> UpdateInput'
UpdateInput''
    { $sel:inputDevices:UpdateInput'' :: Maybe [InputDeviceRequest]
inputDevices = Maybe [InputDeviceRequest]
forall a. Maybe a
Prelude.Nothing,
      $sel:sources:UpdateInput'' :: Maybe [InputSourceRequest]
sources = Maybe [InputSourceRequest]
forall a. Maybe a
Prelude.Nothing,
      $sel:inputSecurityGroups:UpdateInput'' :: Maybe [Text]
inputSecurityGroups = Maybe [Text]
forall a. Maybe a
Prelude.Nothing,
      $sel:destinations:UpdateInput'' :: Maybe [InputDestinationRequest]
destinations = Maybe [InputDestinationRequest]
forall a. Maybe a
Prelude.Nothing,
      $sel:name:UpdateInput'' :: Maybe Text
name = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:mediaConnectFlows:UpdateInput'' :: Maybe [MediaConnectFlowRequest]
mediaConnectFlows = Maybe [MediaConnectFlowRequest]
forall a. Maybe a
Prelude.Nothing,
      $sel:roleArn:UpdateInput'' :: Maybe Text
roleArn = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:inputId:UpdateInput'' :: Text
inputId = Text
pInputId_
    }

-- | Settings for the devices.
updateInput'_inputDevices :: Lens.Lens' UpdateInput' (Prelude.Maybe [InputDeviceRequest])
updateInput'_inputDevices :: (Maybe [InputDeviceRequest] -> f (Maybe [InputDeviceRequest]))
-> UpdateInput' -> f UpdateInput'
updateInput'_inputDevices = (UpdateInput' -> Maybe [InputDeviceRequest])
-> (UpdateInput' -> Maybe [InputDeviceRequest] -> UpdateInput')
-> Lens
     UpdateInput'
     UpdateInput'
     (Maybe [InputDeviceRequest])
     (Maybe [InputDeviceRequest])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateInput'' {Maybe [InputDeviceRequest]
inputDevices :: Maybe [InputDeviceRequest]
$sel:inputDevices:UpdateInput'' :: UpdateInput' -> Maybe [InputDeviceRequest]
inputDevices} -> Maybe [InputDeviceRequest]
inputDevices) (\s :: UpdateInput'
s@UpdateInput'' {} Maybe [InputDeviceRequest]
a -> UpdateInput'
s {$sel:inputDevices:UpdateInput'' :: Maybe [InputDeviceRequest]
inputDevices = Maybe [InputDeviceRequest]
a} :: UpdateInput') ((Maybe [InputDeviceRequest] -> f (Maybe [InputDeviceRequest]))
 -> UpdateInput' -> f UpdateInput')
-> ((Maybe [InputDeviceRequest] -> f (Maybe [InputDeviceRequest]))
    -> Maybe [InputDeviceRequest] -> f (Maybe [InputDeviceRequest]))
-> (Maybe [InputDeviceRequest] -> f (Maybe [InputDeviceRequest]))
-> UpdateInput'
-> f UpdateInput'
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
  [InputDeviceRequest]
  [InputDeviceRequest]
  [InputDeviceRequest]
  [InputDeviceRequest]
-> Iso
     (Maybe [InputDeviceRequest])
     (Maybe [InputDeviceRequest])
     (Maybe [InputDeviceRequest])
     (Maybe [InputDeviceRequest])
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
  [InputDeviceRequest]
  [InputDeviceRequest]
  [InputDeviceRequest]
  [InputDeviceRequest]
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.
updateInput'_sources :: Lens.Lens' UpdateInput' (Prelude.Maybe [InputSourceRequest])
updateInput'_sources :: (Maybe [InputSourceRequest] -> f (Maybe [InputSourceRequest]))
-> UpdateInput' -> f UpdateInput'
updateInput'_sources = (UpdateInput' -> Maybe [InputSourceRequest])
-> (UpdateInput' -> Maybe [InputSourceRequest] -> UpdateInput')
-> Lens
     UpdateInput'
     UpdateInput'
     (Maybe [InputSourceRequest])
     (Maybe [InputSourceRequest])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateInput'' {Maybe [InputSourceRequest]
sources :: Maybe [InputSourceRequest]
$sel:sources:UpdateInput'' :: UpdateInput' -> Maybe [InputSourceRequest]
sources} -> Maybe [InputSourceRequest]
sources) (\s :: UpdateInput'
s@UpdateInput'' {} Maybe [InputSourceRequest]
a -> UpdateInput'
s {$sel:sources:UpdateInput'' :: Maybe [InputSourceRequest]
sources = Maybe [InputSourceRequest]
a} :: UpdateInput') ((Maybe [InputSourceRequest] -> f (Maybe [InputSourceRequest]))
 -> UpdateInput' -> f UpdateInput')
-> ((Maybe [InputSourceRequest] -> f (Maybe [InputSourceRequest]))
    -> Maybe [InputSourceRequest] -> f (Maybe [InputSourceRequest]))
-> (Maybe [InputSourceRequest] -> f (Maybe [InputSourceRequest]))
-> UpdateInput'
-> f UpdateInput'
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.
updateInput'_inputSecurityGroups :: Lens.Lens' UpdateInput' (Prelude.Maybe [Prelude.Text])
updateInput'_inputSecurityGroups :: (Maybe [Text] -> f (Maybe [Text]))
-> UpdateInput' -> f UpdateInput'
updateInput'_inputSecurityGroups = (UpdateInput' -> Maybe [Text])
-> (UpdateInput' -> Maybe [Text] -> UpdateInput')
-> Lens UpdateInput' UpdateInput' (Maybe [Text]) (Maybe [Text])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateInput'' {Maybe [Text]
inputSecurityGroups :: Maybe [Text]
$sel:inputSecurityGroups:UpdateInput'' :: UpdateInput' -> Maybe [Text]
inputSecurityGroups} -> Maybe [Text]
inputSecurityGroups) (\s :: UpdateInput'
s@UpdateInput'' {} Maybe [Text]
a -> UpdateInput'
s {$sel:inputSecurityGroups:UpdateInput'' :: Maybe [Text]
inputSecurityGroups = Maybe [Text]
a} :: UpdateInput') ((Maybe [Text] -> f (Maybe [Text]))
 -> UpdateInput' -> f UpdateInput')
-> ((Maybe [Text] -> f (Maybe [Text]))
    -> Maybe [Text] -> f (Maybe [Text]))
-> (Maybe [Text] -> f (Maybe [Text]))
-> UpdateInput'
-> f UpdateInput'
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.
updateInput'_destinations :: Lens.Lens' UpdateInput' (Prelude.Maybe [InputDestinationRequest])
updateInput'_destinations :: (Maybe [InputDestinationRequest]
 -> f (Maybe [InputDestinationRequest]))
-> UpdateInput' -> f UpdateInput'
updateInput'_destinations = (UpdateInput' -> Maybe [InputDestinationRequest])
-> (UpdateInput'
    -> Maybe [InputDestinationRequest] -> UpdateInput')
-> Lens
     UpdateInput'
     UpdateInput'
     (Maybe [InputDestinationRequest])
     (Maybe [InputDestinationRequest])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateInput'' {Maybe [InputDestinationRequest]
destinations :: Maybe [InputDestinationRequest]
$sel:destinations:UpdateInput'' :: UpdateInput' -> Maybe [InputDestinationRequest]
destinations} -> Maybe [InputDestinationRequest]
destinations) (\s :: UpdateInput'
s@UpdateInput'' {} Maybe [InputDestinationRequest]
a -> UpdateInput'
s {$sel:destinations:UpdateInput'' :: Maybe [InputDestinationRequest]
destinations = Maybe [InputDestinationRequest]
a} :: UpdateInput') ((Maybe [InputDestinationRequest]
  -> f (Maybe [InputDestinationRequest]))
 -> UpdateInput' -> f UpdateInput')
-> ((Maybe [InputDestinationRequest]
     -> f (Maybe [InputDestinationRequest]))
    -> Maybe [InputDestinationRequest]
    -> f (Maybe [InputDestinationRequest]))
-> (Maybe [InputDestinationRequest]
    -> f (Maybe [InputDestinationRequest]))
-> UpdateInput'
-> f UpdateInput'
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.
updateInput'_name :: Lens.Lens' UpdateInput' (Prelude.Maybe Prelude.Text)
updateInput'_name :: (Maybe Text -> f (Maybe Text)) -> UpdateInput' -> f UpdateInput'
updateInput'_name = (UpdateInput' -> Maybe Text)
-> (UpdateInput' -> Maybe Text -> UpdateInput')
-> Lens UpdateInput' UpdateInput' (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateInput'' {Maybe Text
name :: Maybe Text
$sel:name:UpdateInput'' :: UpdateInput' -> Maybe Text
name} -> Maybe Text
name) (\s :: UpdateInput'
s@UpdateInput'' {} Maybe Text
a -> UpdateInput'
s {$sel:name:UpdateInput'' :: Maybe Text
name = Maybe Text
a} :: UpdateInput')

-- | A list of the MediaConnect Flow ARNs that you want to use as the source
-- of the 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.
updateInput'_mediaConnectFlows :: Lens.Lens' UpdateInput' (Prelude.Maybe [MediaConnectFlowRequest])
updateInput'_mediaConnectFlows :: (Maybe [MediaConnectFlowRequest]
 -> f (Maybe [MediaConnectFlowRequest]))
-> UpdateInput' -> f UpdateInput'
updateInput'_mediaConnectFlows = (UpdateInput' -> Maybe [MediaConnectFlowRequest])
-> (UpdateInput'
    -> Maybe [MediaConnectFlowRequest] -> UpdateInput')
-> Lens
     UpdateInput'
     UpdateInput'
     (Maybe [MediaConnectFlowRequest])
     (Maybe [MediaConnectFlowRequest])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateInput'' {Maybe [MediaConnectFlowRequest]
mediaConnectFlows :: Maybe [MediaConnectFlowRequest]
$sel:mediaConnectFlows:UpdateInput'' :: UpdateInput' -> Maybe [MediaConnectFlowRequest]
mediaConnectFlows} -> Maybe [MediaConnectFlowRequest]
mediaConnectFlows) (\s :: UpdateInput'
s@UpdateInput'' {} Maybe [MediaConnectFlowRequest]
a -> UpdateInput'
s {$sel:mediaConnectFlows:UpdateInput'' :: Maybe [MediaConnectFlowRequest]
mediaConnectFlows = Maybe [MediaConnectFlowRequest]
a} :: UpdateInput') ((Maybe [MediaConnectFlowRequest]
  -> f (Maybe [MediaConnectFlowRequest]))
 -> UpdateInput' -> f UpdateInput')
-> ((Maybe [MediaConnectFlowRequest]
     -> f (Maybe [MediaConnectFlowRequest]))
    -> Maybe [MediaConnectFlowRequest]
    -> f (Maybe [MediaConnectFlowRequest]))
-> (Maybe [MediaConnectFlowRequest]
    -> f (Maybe [MediaConnectFlowRequest]))
-> UpdateInput'
-> f UpdateInput'
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

-- | The Amazon Resource Name (ARN) of the role this input assumes during and
-- after creation.
updateInput'_roleArn :: Lens.Lens' UpdateInput' (Prelude.Maybe Prelude.Text)
updateInput'_roleArn :: (Maybe Text -> f (Maybe Text)) -> UpdateInput' -> f UpdateInput'
updateInput'_roleArn = (UpdateInput' -> Maybe Text)
-> (UpdateInput' -> Maybe Text -> UpdateInput')
-> Lens UpdateInput' UpdateInput' (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateInput'' {Maybe Text
roleArn :: Maybe Text
$sel:roleArn:UpdateInput'' :: UpdateInput' -> Maybe Text
roleArn} -> Maybe Text
roleArn) (\s :: UpdateInput'
s@UpdateInput'' {} Maybe Text
a -> UpdateInput'
s {$sel:roleArn:UpdateInput'' :: Maybe Text
roleArn = Maybe Text
a} :: UpdateInput')

-- | Unique ID of the input.
updateInput'_inputId :: Lens.Lens' UpdateInput' Prelude.Text
updateInput'_inputId :: (Text -> f Text) -> UpdateInput' -> f UpdateInput'
updateInput'_inputId = (UpdateInput' -> Text)
-> (UpdateInput' -> Text -> UpdateInput')
-> Lens UpdateInput' UpdateInput' Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateInput'' {Text
inputId :: Text
$sel:inputId:UpdateInput'' :: UpdateInput' -> Text
inputId} -> Text
inputId) (\s :: UpdateInput'
s@UpdateInput'' {} Text
a -> UpdateInput'
s {$sel:inputId:UpdateInput'' :: Text
inputId = Text
a} :: UpdateInput')

instance Core.AWSRequest UpdateInput' where
  type AWSResponse UpdateInput' = UpdateInputResponse
  request :: UpdateInput' -> Request UpdateInput'
request = Service -> UpdateInput' -> Request UpdateInput'
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.putJSON Service
defaultService
  response :: Logger
-> Service
-> Proxy UpdateInput'
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse UpdateInput')))
response =
    (Int
 -> ResponseHeaders
 -> Object
 -> Either String (AWSResponse UpdateInput'))
-> Logger
-> Service
-> Proxy UpdateInput'
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse UpdateInput')))
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 -> UpdateInputResponse
UpdateInputResponse'
            (Maybe Input -> Int -> UpdateInputResponse)
-> Either String (Maybe Input)
-> Either String (Int -> UpdateInputResponse)
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 -> UpdateInputResponse)
-> Either String Int -> Either String UpdateInputResponse
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 UpdateInput'

instance Prelude.NFData UpdateInput'

instance Core.ToHeaders UpdateInput' where
  toHeaders :: UpdateInput' -> ResponseHeaders
toHeaders =
    ResponseHeaders -> UpdateInput' -> 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 UpdateInput' where
  toJSON :: UpdateInput' -> Value
toJSON UpdateInput'' {Maybe [Text]
Maybe [InputDestinationRequest]
Maybe [InputDeviceRequest]
Maybe [InputSourceRequest]
Maybe [MediaConnectFlowRequest]
Maybe Text
Text
inputId :: Text
roleArn :: Maybe Text
mediaConnectFlows :: Maybe [MediaConnectFlowRequest]
name :: Maybe Text
destinations :: Maybe [InputDestinationRequest]
inputSecurityGroups :: Maybe [Text]
sources :: Maybe [InputSourceRequest]
inputDevices :: Maybe [InputDeviceRequest]
$sel:inputId:UpdateInput'' :: UpdateInput' -> Text
$sel:roleArn:UpdateInput'' :: UpdateInput' -> Maybe Text
$sel:mediaConnectFlows:UpdateInput'' :: UpdateInput' -> Maybe [MediaConnectFlowRequest]
$sel:name:UpdateInput'' :: UpdateInput' -> Maybe Text
$sel:destinations:UpdateInput'' :: UpdateInput' -> Maybe [InputDestinationRequest]
$sel:inputSecurityGroups:UpdateInput'' :: UpdateInput' -> Maybe [Text]
$sel:sources:UpdateInput'' :: UpdateInput' -> Maybe [InputSourceRequest]
$sel:inputDevices:UpdateInput'' :: UpdateInput' -> Maybe [InputDeviceRequest]
..} =
    [Pair] -> Value
Core.object
      ( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ (Text
"inputDevices" Text -> [InputDeviceRequest] -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) ([InputDeviceRequest] -> Pair)
-> Maybe [InputDeviceRequest] -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe [InputDeviceRequest]
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
"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
"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 UpdateInput' where
  toPath :: UpdateInput' -> ByteString
toPath UpdateInput'' {Maybe [Text]
Maybe [InputDestinationRequest]
Maybe [InputDeviceRequest]
Maybe [InputSourceRequest]
Maybe [MediaConnectFlowRequest]
Maybe Text
Text
inputId :: Text
roleArn :: Maybe Text
mediaConnectFlows :: Maybe [MediaConnectFlowRequest]
name :: Maybe Text
destinations :: Maybe [InputDestinationRequest]
inputSecurityGroups :: Maybe [Text]
sources :: Maybe [InputSourceRequest]
inputDevices :: Maybe [InputDeviceRequest]
$sel:inputId:UpdateInput'' :: UpdateInput' -> Text
$sel:roleArn:UpdateInput'' :: UpdateInput' -> Maybe Text
$sel:mediaConnectFlows:UpdateInput'' :: UpdateInput' -> Maybe [MediaConnectFlowRequest]
$sel:name:UpdateInput'' :: UpdateInput' -> Maybe Text
$sel:destinations:UpdateInput'' :: UpdateInput' -> Maybe [InputDestinationRequest]
$sel:inputSecurityGroups:UpdateInput'' :: UpdateInput' -> Maybe [Text]
$sel:sources:UpdateInput'' :: UpdateInput' -> Maybe [InputSourceRequest]
$sel:inputDevices:UpdateInput'' :: UpdateInput' -> Maybe [InputDeviceRequest]
..} =
    [ByteString] -> ByteString
forall a. Monoid a => [a] -> a
Prelude.mconcat
      [ByteString
"/prod/inputs/", Text -> ByteString
forall a. ToByteString a => a -> ByteString
Core.toBS Text
inputId]

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

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

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

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

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

instance Prelude.NFData UpdateInputResponse