{-# 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.KinesisAnalyticsV2.AddApplicationInputProcessingConfiguration
-- 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)
--
-- Adds an InputProcessingConfiguration to a SQL-based Kinesis Data
-- Analytics application. An input processor pre-processes records on the
-- input stream before the application\'s SQL code executes. Currently, the
-- only input processor available is
-- <https://docs.aws.amazon.com/lambda/ Amazon Lambda>.
module Amazonka.KinesisAnalyticsV2.AddApplicationInputProcessingConfiguration
  ( -- * Creating a Request
    AddApplicationInputProcessingConfiguration (..),
    newAddApplicationInputProcessingConfiguration,

    -- * Request Lenses
    addApplicationInputProcessingConfiguration_applicationName,
    addApplicationInputProcessingConfiguration_currentApplicationVersionId,
    addApplicationInputProcessingConfiguration_inputId,
    addApplicationInputProcessingConfiguration_inputProcessingConfiguration,

    -- * Destructuring the Response
    AddApplicationInputProcessingConfigurationResponse (..),
    newAddApplicationInputProcessingConfigurationResponse,

    -- * Response Lenses
    addApplicationInputProcessingConfigurationResponse_applicationARN,
    addApplicationInputProcessingConfigurationResponse_applicationVersionId,
    addApplicationInputProcessingConfigurationResponse_inputId,
    addApplicationInputProcessingConfigurationResponse_inputProcessingConfigurationDescription,
    addApplicationInputProcessingConfigurationResponse_httpStatus,
  )
where

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

-- | /See:/ 'newAddApplicationInputProcessingConfiguration' smart constructor.
data AddApplicationInputProcessingConfiguration = AddApplicationInputProcessingConfiguration'
  { -- | The name of the application to which you want to add the input
    -- processing configuration.
    AddApplicationInputProcessingConfiguration -> Text
applicationName :: Prelude.Text,
    -- | The version of the application to which you want to add the input
    -- processing configuration. You can use the DescribeApplication operation
    -- to get the current application version. If the version specified is not
    -- the current version, the @ConcurrentModificationException@ is returned.
    AddApplicationInputProcessingConfiguration -> Natural
currentApplicationVersionId :: Prelude.Natural,
    -- | The ID of the input configuration to add the input processing
    -- configuration to. You can get a list of the input IDs for an application
    -- using the DescribeApplication operation.
    AddApplicationInputProcessingConfiguration -> Text
inputId :: Prelude.Text,
    -- | The InputProcessingConfiguration to add to the application.
    AddApplicationInputProcessingConfiguration
-> InputProcessingConfiguration
inputProcessingConfiguration :: InputProcessingConfiguration
  }
  deriving (AddApplicationInputProcessingConfiguration
-> AddApplicationInputProcessingConfiguration -> Bool
(AddApplicationInputProcessingConfiguration
 -> AddApplicationInputProcessingConfiguration -> Bool)
-> (AddApplicationInputProcessingConfiguration
    -> AddApplicationInputProcessingConfiguration -> Bool)
-> Eq AddApplicationInputProcessingConfiguration
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: AddApplicationInputProcessingConfiguration
-> AddApplicationInputProcessingConfiguration -> Bool
$c/= :: AddApplicationInputProcessingConfiguration
-> AddApplicationInputProcessingConfiguration -> Bool
== :: AddApplicationInputProcessingConfiguration
-> AddApplicationInputProcessingConfiguration -> Bool
$c== :: AddApplicationInputProcessingConfiguration
-> AddApplicationInputProcessingConfiguration -> Bool
Prelude.Eq, ReadPrec [AddApplicationInputProcessingConfiguration]
ReadPrec AddApplicationInputProcessingConfiguration
Int -> ReadS AddApplicationInputProcessingConfiguration
ReadS [AddApplicationInputProcessingConfiguration]
(Int -> ReadS AddApplicationInputProcessingConfiguration)
-> ReadS [AddApplicationInputProcessingConfiguration]
-> ReadPrec AddApplicationInputProcessingConfiguration
-> ReadPrec [AddApplicationInputProcessingConfiguration]
-> Read AddApplicationInputProcessingConfiguration
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [AddApplicationInputProcessingConfiguration]
$creadListPrec :: ReadPrec [AddApplicationInputProcessingConfiguration]
readPrec :: ReadPrec AddApplicationInputProcessingConfiguration
$creadPrec :: ReadPrec AddApplicationInputProcessingConfiguration
readList :: ReadS [AddApplicationInputProcessingConfiguration]
$creadList :: ReadS [AddApplicationInputProcessingConfiguration]
readsPrec :: Int -> ReadS AddApplicationInputProcessingConfiguration
$creadsPrec :: Int -> ReadS AddApplicationInputProcessingConfiguration
Prelude.Read, Int -> AddApplicationInputProcessingConfiguration -> ShowS
[AddApplicationInputProcessingConfiguration] -> ShowS
AddApplicationInputProcessingConfiguration -> String
(Int -> AddApplicationInputProcessingConfiguration -> ShowS)
-> (AddApplicationInputProcessingConfiguration -> String)
-> ([AddApplicationInputProcessingConfiguration] -> ShowS)
-> Show AddApplicationInputProcessingConfiguration
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [AddApplicationInputProcessingConfiguration] -> ShowS
$cshowList :: [AddApplicationInputProcessingConfiguration] -> ShowS
show :: AddApplicationInputProcessingConfiguration -> String
$cshow :: AddApplicationInputProcessingConfiguration -> String
showsPrec :: Int -> AddApplicationInputProcessingConfiguration -> ShowS
$cshowsPrec :: Int -> AddApplicationInputProcessingConfiguration -> ShowS
Prelude.Show, (forall x.
 AddApplicationInputProcessingConfiguration
 -> Rep AddApplicationInputProcessingConfiguration x)
-> (forall x.
    Rep AddApplicationInputProcessingConfiguration x
    -> AddApplicationInputProcessingConfiguration)
-> Generic AddApplicationInputProcessingConfiguration
forall x.
Rep AddApplicationInputProcessingConfiguration x
-> AddApplicationInputProcessingConfiguration
forall x.
AddApplicationInputProcessingConfiguration
-> Rep AddApplicationInputProcessingConfiguration x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep AddApplicationInputProcessingConfiguration x
-> AddApplicationInputProcessingConfiguration
$cfrom :: forall x.
AddApplicationInputProcessingConfiguration
-> Rep AddApplicationInputProcessingConfiguration x
Prelude.Generic)

-- |
-- Create a value of 'AddApplicationInputProcessingConfiguration' 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:
--
-- 'applicationName', 'addApplicationInputProcessingConfiguration_applicationName' - The name of the application to which you want to add the input
-- processing configuration.
--
-- 'currentApplicationVersionId', 'addApplicationInputProcessingConfiguration_currentApplicationVersionId' - The version of the application to which you want to add the input
-- processing configuration. You can use the DescribeApplication operation
-- to get the current application version. If the version specified is not
-- the current version, the @ConcurrentModificationException@ is returned.
--
-- 'inputId', 'addApplicationInputProcessingConfiguration_inputId' - The ID of the input configuration to add the input processing
-- configuration to. You can get a list of the input IDs for an application
-- using the DescribeApplication operation.
--
-- 'inputProcessingConfiguration', 'addApplicationInputProcessingConfiguration_inputProcessingConfiguration' - The InputProcessingConfiguration to add to the application.
newAddApplicationInputProcessingConfiguration ::
  -- | 'applicationName'
  Prelude.Text ->
  -- | 'currentApplicationVersionId'
  Prelude.Natural ->
  -- | 'inputId'
  Prelude.Text ->
  -- | 'inputProcessingConfiguration'
  InputProcessingConfiguration ->
  AddApplicationInputProcessingConfiguration
newAddApplicationInputProcessingConfiguration :: Text
-> Natural
-> Text
-> InputProcessingConfiguration
-> AddApplicationInputProcessingConfiguration
newAddApplicationInputProcessingConfiguration
  Text
pApplicationName_
  Natural
pCurrentApplicationVersionId_
  Text
pInputId_
  InputProcessingConfiguration
pInputProcessingConfiguration_ =
    AddApplicationInputProcessingConfiguration' :: Text
-> Natural
-> Text
-> InputProcessingConfiguration
-> AddApplicationInputProcessingConfiguration
AddApplicationInputProcessingConfiguration'
      { $sel:applicationName:AddApplicationInputProcessingConfiguration' :: Text
applicationName =
          Text
pApplicationName_,
        $sel:currentApplicationVersionId:AddApplicationInputProcessingConfiguration' :: Natural
currentApplicationVersionId =
          Natural
pCurrentApplicationVersionId_,
        $sel:inputId:AddApplicationInputProcessingConfiguration' :: Text
inputId = Text
pInputId_,
        $sel:inputProcessingConfiguration:AddApplicationInputProcessingConfiguration' :: InputProcessingConfiguration
inputProcessingConfiguration =
          InputProcessingConfiguration
pInputProcessingConfiguration_
      }

-- | The name of the application to which you want to add the input
-- processing configuration.
addApplicationInputProcessingConfiguration_applicationName :: Lens.Lens' AddApplicationInputProcessingConfiguration Prelude.Text
addApplicationInputProcessingConfiguration_applicationName :: (Text -> f Text)
-> AddApplicationInputProcessingConfiguration
-> f AddApplicationInputProcessingConfiguration
addApplicationInputProcessingConfiguration_applicationName = (AddApplicationInputProcessingConfiguration -> Text)
-> (AddApplicationInputProcessingConfiguration
    -> Text -> AddApplicationInputProcessingConfiguration)
-> Lens
     AddApplicationInputProcessingConfiguration
     AddApplicationInputProcessingConfiguration
     Text
     Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AddApplicationInputProcessingConfiguration' {Text
applicationName :: Text
$sel:applicationName:AddApplicationInputProcessingConfiguration' :: AddApplicationInputProcessingConfiguration -> Text
applicationName} -> Text
applicationName) (\s :: AddApplicationInputProcessingConfiguration
s@AddApplicationInputProcessingConfiguration' {} Text
a -> AddApplicationInputProcessingConfiguration
s {$sel:applicationName:AddApplicationInputProcessingConfiguration' :: Text
applicationName = Text
a} :: AddApplicationInputProcessingConfiguration)

-- | The version of the application to which you want to add the input
-- processing configuration. You can use the DescribeApplication operation
-- to get the current application version. If the version specified is not
-- the current version, the @ConcurrentModificationException@ is returned.
addApplicationInputProcessingConfiguration_currentApplicationVersionId :: Lens.Lens' AddApplicationInputProcessingConfiguration Prelude.Natural
addApplicationInputProcessingConfiguration_currentApplicationVersionId :: (Natural -> f Natural)
-> AddApplicationInputProcessingConfiguration
-> f AddApplicationInputProcessingConfiguration
addApplicationInputProcessingConfiguration_currentApplicationVersionId = (AddApplicationInputProcessingConfiguration -> Natural)
-> (AddApplicationInputProcessingConfiguration
    -> Natural -> AddApplicationInputProcessingConfiguration)
-> Lens
     AddApplicationInputProcessingConfiguration
     AddApplicationInputProcessingConfiguration
     Natural
     Natural
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AddApplicationInputProcessingConfiguration' {Natural
currentApplicationVersionId :: Natural
$sel:currentApplicationVersionId:AddApplicationInputProcessingConfiguration' :: AddApplicationInputProcessingConfiguration -> Natural
currentApplicationVersionId} -> Natural
currentApplicationVersionId) (\s :: AddApplicationInputProcessingConfiguration
s@AddApplicationInputProcessingConfiguration' {} Natural
a -> AddApplicationInputProcessingConfiguration
s {$sel:currentApplicationVersionId:AddApplicationInputProcessingConfiguration' :: Natural
currentApplicationVersionId = Natural
a} :: AddApplicationInputProcessingConfiguration)

-- | The ID of the input configuration to add the input processing
-- configuration to. You can get a list of the input IDs for an application
-- using the DescribeApplication operation.
addApplicationInputProcessingConfiguration_inputId :: Lens.Lens' AddApplicationInputProcessingConfiguration Prelude.Text
addApplicationInputProcessingConfiguration_inputId :: (Text -> f Text)
-> AddApplicationInputProcessingConfiguration
-> f AddApplicationInputProcessingConfiguration
addApplicationInputProcessingConfiguration_inputId = (AddApplicationInputProcessingConfiguration -> Text)
-> (AddApplicationInputProcessingConfiguration
    -> Text -> AddApplicationInputProcessingConfiguration)
-> Lens
     AddApplicationInputProcessingConfiguration
     AddApplicationInputProcessingConfiguration
     Text
     Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AddApplicationInputProcessingConfiguration' {Text
inputId :: Text
$sel:inputId:AddApplicationInputProcessingConfiguration' :: AddApplicationInputProcessingConfiguration -> Text
inputId} -> Text
inputId) (\s :: AddApplicationInputProcessingConfiguration
s@AddApplicationInputProcessingConfiguration' {} Text
a -> AddApplicationInputProcessingConfiguration
s {$sel:inputId:AddApplicationInputProcessingConfiguration' :: Text
inputId = Text
a} :: AddApplicationInputProcessingConfiguration)

-- | The InputProcessingConfiguration to add to the application.
addApplicationInputProcessingConfiguration_inputProcessingConfiguration :: Lens.Lens' AddApplicationInputProcessingConfiguration InputProcessingConfiguration
addApplicationInputProcessingConfiguration_inputProcessingConfiguration :: (InputProcessingConfiguration -> f InputProcessingConfiguration)
-> AddApplicationInputProcessingConfiguration
-> f AddApplicationInputProcessingConfiguration
addApplicationInputProcessingConfiguration_inputProcessingConfiguration = (AddApplicationInputProcessingConfiguration
 -> InputProcessingConfiguration)
-> (AddApplicationInputProcessingConfiguration
    -> InputProcessingConfiguration
    -> AddApplicationInputProcessingConfiguration)
-> Lens
     AddApplicationInputProcessingConfiguration
     AddApplicationInputProcessingConfiguration
     InputProcessingConfiguration
     InputProcessingConfiguration
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AddApplicationInputProcessingConfiguration' {InputProcessingConfiguration
inputProcessingConfiguration :: InputProcessingConfiguration
$sel:inputProcessingConfiguration:AddApplicationInputProcessingConfiguration' :: AddApplicationInputProcessingConfiguration
-> InputProcessingConfiguration
inputProcessingConfiguration} -> InputProcessingConfiguration
inputProcessingConfiguration) (\s :: AddApplicationInputProcessingConfiguration
s@AddApplicationInputProcessingConfiguration' {} InputProcessingConfiguration
a -> AddApplicationInputProcessingConfiguration
s {$sel:inputProcessingConfiguration:AddApplicationInputProcessingConfiguration' :: InputProcessingConfiguration
inputProcessingConfiguration = InputProcessingConfiguration
a} :: AddApplicationInputProcessingConfiguration)

instance
  Core.AWSRequest
    AddApplicationInputProcessingConfiguration
  where
  type
    AWSResponse
      AddApplicationInputProcessingConfiguration =
      AddApplicationInputProcessingConfigurationResponse
  request :: AddApplicationInputProcessingConfiguration
-> Request AddApplicationInputProcessingConfiguration
request = Service
-> AddApplicationInputProcessingConfiguration
-> Request AddApplicationInputProcessingConfiguration
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON Service
defaultService
  response :: Logger
-> Service
-> Proxy AddApplicationInputProcessingConfiguration
-> ClientResponse ClientBody
-> m (Either
        Error
        (ClientResponse
           (AWSResponse AddApplicationInputProcessingConfiguration)))
response =
    (Int
 -> ResponseHeaders
 -> Object
 -> Either
      String (AWSResponse AddApplicationInputProcessingConfiguration))
-> Logger
-> Service
-> Proxy AddApplicationInputProcessingConfiguration
-> ClientResponse ClientBody
-> m (Either
        Error
        (ClientResponse
           (AWSResponse AddApplicationInputProcessingConfiguration)))
forall (m :: * -> *) a.
MonadResource m =>
(Int -> ResponseHeaders -> Object -> Either String (AWSResponse a))
-> Logger
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveJSON
      ( \Int
s ResponseHeaders
h Object
x ->
          Maybe Text
-> Maybe Natural
-> Maybe Text
-> Maybe InputProcessingConfigurationDescription
-> Int
-> AddApplicationInputProcessingConfigurationResponse
AddApplicationInputProcessingConfigurationResponse'
            (Maybe Text
 -> Maybe Natural
 -> Maybe Text
 -> Maybe InputProcessingConfigurationDescription
 -> Int
 -> AddApplicationInputProcessingConfigurationResponse)
-> Either String (Maybe Text)
-> Either
     String
     (Maybe Natural
      -> Maybe Text
      -> Maybe InputProcessingConfigurationDescription
      -> Int
      -> AddApplicationInputProcessingConfigurationResponse)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Either String (Maybe Text)
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"ApplicationARN")
              Either
  String
  (Maybe Natural
   -> Maybe Text
   -> Maybe InputProcessingConfigurationDescription
   -> Int
   -> AddApplicationInputProcessingConfigurationResponse)
-> Either String (Maybe Natural)
-> Either
     String
     (Maybe Text
      -> Maybe InputProcessingConfigurationDescription
      -> Int
      -> AddApplicationInputProcessingConfigurationResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Either String (Maybe Natural)
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"ApplicationVersionId")
              Either
  String
  (Maybe Text
   -> Maybe InputProcessingConfigurationDescription
   -> Int
   -> AddApplicationInputProcessingConfigurationResponse)
-> Either String (Maybe Text)
-> Either
     String
     (Maybe InputProcessingConfigurationDescription
      -> Int -> AddApplicationInputProcessingConfigurationResponse)
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
"InputId")
              Either
  String
  (Maybe InputProcessingConfigurationDescription
   -> Int -> AddApplicationInputProcessingConfigurationResponse)
-> Either String (Maybe InputProcessingConfigurationDescription)
-> Either
     String (Int -> AddApplicationInputProcessingConfigurationResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ( Object
x
                              Object
-> Text
-> Either String (Maybe InputProcessingConfigurationDescription)
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"InputProcessingConfigurationDescription"
                          )
              Either
  String (Int -> AddApplicationInputProcessingConfigurationResponse)
-> Either String Int
-> Either String AddApplicationInputProcessingConfigurationResponse
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
    AddApplicationInputProcessingConfiguration

instance
  Prelude.NFData
    AddApplicationInputProcessingConfiguration

instance
  Core.ToHeaders
    AddApplicationInputProcessingConfiguration
  where
  toHeaders :: AddApplicationInputProcessingConfiguration -> ResponseHeaders
toHeaders =
    ResponseHeaders
-> AddApplicationInputProcessingConfiguration -> ResponseHeaders
forall a b. a -> b -> a
Prelude.const
      ( [ResponseHeaders] -> ResponseHeaders
forall a. Monoid a => [a] -> a
Prelude.mconcat
          [ HeaderName
"X-Amz-Target"
              HeaderName -> ByteString -> ResponseHeaders
forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Core.=# ( ByteString
"KinesisAnalytics_20180523.AddApplicationInputProcessingConfiguration" ::
                          Prelude.ByteString
                      ),
            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
    AddApplicationInputProcessingConfiguration
  where
  toJSON :: AddApplicationInputProcessingConfiguration -> Value
toJSON
    AddApplicationInputProcessingConfiguration' {Natural
Text
InputProcessingConfiguration
inputProcessingConfiguration :: InputProcessingConfiguration
inputId :: Text
currentApplicationVersionId :: Natural
applicationName :: Text
$sel:inputProcessingConfiguration:AddApplicationInputProcessingConfiguration' :: AddApplicationInputProcessingConfiguration
-> InputProcessingConfiguration
$sel:inputId:AddApplicationInputProcessingConfiguration' :: AddApplicationInputProcessingConfiguration -> Text
$sel:currentApplicationVersionId:AddApplicationInputProcessingConfiguration' :: AddApplicationInputProcessingConfiguration -> Natural
$sel:applicationName:AddApplicationInputProcessingConfiguration' :: AddApplicationInputProcessingConfiguration -> Text
..} =
      [Pair] -> Value
Core.object
        ( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
            [ Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just
                (Text
"ApplicationName" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
applicationName),
              Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just
                ( Text
"CurrentApplicationVersionId"
                    Text -> Natural -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Natural
currentApplicationVersionId
                ),
              Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"InputId" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
inputId),
              Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just
                ( Text
"InputProcessingConfiguration"
                    Text -> InputProcessingConfiguration -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= InputProcessingConfiguration
inputProcessingConfiguration
                )
            ]
        )

instance
  Core.ToPath
    AddApplicationInputProcessingConfiguration
  where
  toPath :: AddApplicationInputProcessingConfiguration -> ByteString
toPath = ByteString
-> AddApplicationInputProcessingConfiguration -> ByteString
forall a b. a -> b -> a
Prelude.const ByteString
"/"

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

-- | /See:/ 'newAddApplicationInputProcessingConfigurationResponse' smart constructor.
data AddApplicationInputProcessingConfigurationResponse = AddApplicationInputProcessingConfigurationResponse'
  { -- | The Amazon Resource Name (ARN) of the application.
    AddApplicationInputProcessingConfigurationResponse -> Maybe Text
applicationARN :: Prelude.Maybe Prelude.Text,
    -- | Provides the current application version.
    AddApplicationInputProcessingConfigurationResponse -> Maybe Natural
applicationVersionId :: Prelude.Maybe Prelude.Natural,
    -- | The input ID that is associated with the application input. This is the
    -- ID that Kinesis Data Analytics assigns to each input configuration that
    -- you add to your application.
    AddApplicationInputProcessingConfigurationResponse -> Maybe Text
inputId :: Prelude.Maybe Prelude.Text,
    -- | The description of the preprocessor that executes on records in this
    -- input before the application\'s code is run.
    AddApplicationInputProcessingConfigurationResponse
-> Maybe InputProcessingConfigurationDescription
inputProcessingConfigurationDescription :: Prelude.Maybe InputProcessingConfigurationDescription,
    -- | The response's http status code.
    AddApplicationInputProcessingConfigurationResponse -> Int
httpStatus :: Prelude.Int
  }
  deriving (AddApplicationInputProcessingConfigurationResponse
-> AddApplicationInputProcessingConfigurationResponse -> Bool
(AddApplicationInputProcessingConfigurationResponse
 -> AddApplicationInputProcessingConfigurationResponse -> Bool)
-> (AddApplicationInputProcessingConfigurationResponse
    -> AddApplicationInputProcessingConfigurationResponse -> Bool)
-> Eq AddApplicationInputProcessingConfigurationResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: AddApplicationInputProcessingConfigurationResponse
-> AddApplicationInputProcessingConfigurationResponse -> Bool
$c/= :: AddApplicationInputProcessingConfigurationResponse
-> AddApplicationInputProcessingConfigurationResponse -> Bool
== :: AddApplicationInputProcessingConfigurationResponse
-> AddApplicationInputProcessingConfigurationResponse -> Bool
$c== :: AddApplicationInputProcessingConfigurationResponse
-> AddApplicationInputProcessingConfigurationResponse -> Bool
Prelude.Eq, ReadPrec [AddApplicationInputProcessingConfigurationResponse]
ReadPrec AddApplicationInputProcessingConfigurationResponse
Int -> ReadS AddApplicationInputProcessingConfigurationResponse
ReadS [AddApplicationInputProcessingConfigurationResponse]
(Int -> ReadS AddApplicationInputProcessingConfigurationResponse)
-> ReadS [AddApplicationInputProcessingConfigurationResponse]
-> ReadPrec AddApplicationInputProcessingConfigurationResponse
-> ReadPrec [AddApplicationInputProcessingConfigurationResponse]
-> Read AddApplicationInputProcessingConfigurationResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [AddApplicationInputProcessingConfigurationResponse]
$creadListPrec :: ReadPrec [AddApplicationInputProcessingConfigurationResponse]
readPrec :: ReadPrec AddApplicationInputProcessingConfigurationResponse
$creadPrec :: ReadPrec AddApplicationInputProcessingConfigurationResponse
readList :: ReadS [AddApplicationInputProcessingConfigurationResponse]
$creadList :: ReadS [AddApplicationInputProcessingConfigurationResponse]
readsPrec :: Int -> ReadS AddApplicationInputProcessingConfigurationResponse
$creadsPrec :: Int -> ReadS AddApplicationInputProcessingConfigurationResponse
Prelude.Read, Int -> AddApplicationInputProcessingConfigurationResponse -> ShowS
[AddApplicationInputProcessingConfigurationResponse] -> ShowS
AddApplicationInputProcessingConfigurationResponse -> String
(Int
 -> AddApplicationInputProcessingConfigurationResponse -> ShowS)
-> (AddApplicationInputProcessingConfigurationResponse -> String)
-> ([AddApplicationInputProcessingConfigurationResponse] -> ShowS)
-> Show AddApplicationInputProcessingConfigurationResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [AddApplicationInputProcessingConfigurationResponse] -> ShowS
$cshowList :: [AddApplicationInputProcessingConfigurationResponse] -> ShowS
show :: AddApplicationInputProcessingConfigurationResponse -> String
$cshow :: AddApplicationInputProcessingConfigurationResponse -> String
showsPrec :: Int -> AddApplicationInputProcessingConfigurationResponse -> ShowS
$cshowsPrec :: Int -> AddApplicationInputProcessingConfigurationResponse -> ShowS
Prelude.Show, (forall x.
 AddApplicationInputProcessingConfigurationResponse
 -> Rep AddApplicationInputProcessingConfigurationResponse x)
-> (forall x.
    Rep AddApplicationInputProcessingConfigurationResponse x
    -> AddApplicationInputProcessingConfigurationResponse)
-> Generic AddApplicationInputProcessingConfigurationResponse
forall x.
Rep AddApplicationInputProcessingConfigurationResponse x
-> AddApplicationInputProcessingConfigurationResponse
forall x.
AddApplicationInputProcessingConfigurationResponse
-> Rep AddApplicationInputProcessingConfigurationResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep AddApplicationInputProcessingConfigurationResponse x
-> AddApplicationInputProcessingConfigurationResponse
$cfrom :: forall x.
AddApplicationInputProcessingConfigurationResponse
-> Rep AddApplicationInputProcessingConfigurationResponse x
Prelude.Generic)

-- |
-- Create a value of 'AddApplicationInputProcessingConfigurationResponse' 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:
--
-- 'applicationARN', 'addApplicationInputProcessingConfigurationResponse_applicationARN' - The Amazon Resource Name (ARN) of the application.
--
-- 'applicationVersionId', 'addApplicationInputProcessingConfigurationResponse_applicationVersionId' - Provides the current application version.
--
-- 'inputId', 'addApplicationInputProcessingConfigurationResponse_inputId' - The input ID that is associated with the application input. This is the
-- ID that Kinesis Data Analytics assigns to each input configuration that
-- you add to your application.
--
-- 'inputProcessingConfigurationDescription', 'addApplicationInputProcessingConfigurationResponse_inputProcessingConfigurationDescription' - The description of the preprocessor that executes on records in this
-- input before the application\'s code is run.
--
-- 'httpStatus', 'addApplicationInputProcessingConfigurationResponse_httpStatus' - The response's http status code.
newAddApplicationInputProcessingConfigurationResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  AddApplicationInputProcessingConfigurationResponse
newAddApplicationInputProcessingConfigurationResponse :: Int -> AddApplicationInputProcessingConfigurationResponse
newAddApplicationInputProcessingConfigurationResponse
  Int
pHttpStatus_ =
    AddApplicationInputProcessingConfigurationResponse' :: Maybe Text
-> Maybe Natural
-> Maybe Text
-> Maybe InputProcessingConfigurationDescription
-> Int
-> AddApplicationInputProcessingConfigurationResponse
AddApplicationInputProcessingConfigurationResponse'
      { $sel:applicationARN:AddApplicationInputProcessingConfigurationResponse' :: Maybe Text
applicationARN =
          Maybe Text
forall a. Maybe a
Prelude.Nothing,
        $sel:applicationVersionId:AddApplicationInputProcessingConfigurationResponse' :: Maybe Natural
applicationVersionId =
          Maybe Natural
forall a. Maybe a
Prelude.Nothing,
        $sel:inputId:AddApplicationInputProcessingConfigurationResponse' :: Maybe Text
inputId =
          Maybe Text
forall a. Maybe a
Prelude.Nothing,
        $sel:inputProcessingConfigurationDescription:AddApplicationInputProcessingConfigurationResponse' :: Maybe InputProcessingConfigurationDescription
inputProcessingConfigurationDescription =
          Maybe InputProcessingConfigurationDescription
forall a. Maybe a
Prelude.Nothing,
        $sel:httpStatus:AddApplicationInputProcessingConfigurationResponse' :: Int
httpStatus =
          Int
pHttpStatus_
      }

-- | The Amazon Resource Name (ARN) of the application.
addApplicationInputProcessingConfigurationResponse_applicationARN :: Lens.Lens' AddApplicationInputProcessingConfigurationResponse (Prelude.Maybe Prelude.Text)
addApplicationInputProcessingConfigurationResponse_applicationARN :: (Maybe Text -> f (Maybe Text))
-> AddApplicationInputProcessingConfigurationResponse
-> f AddApplicationInputProcessingConfigurationResponse
addApplicationInputProcessingConfigurationResponse_applicationARN = (AddApplicationInputProcessingConfigurationResponse -> Maybe Text)
-> (AddApplicationInputProcessingConfigurationResponse
    -> Maybe Text
    -> AddApplicationInputProcessingConfigurationResponse)
-> Lens
     AddApplicationInputProcessingConfigurationResponse
     AddApplicationInputProcessingConfigurationResponse
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AddApplicationInputProcessingConfigurationResponse' {Maybe Text
applicationARN :: Maybe Text
$sel:applicationARN:AddApplicationInputProcessingConfigurationResponse' :: AddApplicationInputProcessingConfigurationResponse -> Maybe Text
applicationARN} -> Maybe Text
applicationARN) (\s :: AddApplicationInputProcessingConfigurationResponse
s@AddApplicationInputProcessingConfigurationResponse' {} Maybe Text
a -> AddApplicationInputProcessingConfigurationResponse
s {$sel:applicationARN:AddApplicationInputProcessingConfigurationResponse' :: Maybe Text
applicationARN = Maybe Text
a} :: AddApplicationInputProcessingConfigurationResponse)

-- | Provides the current application version.
addApplicationInputProcessingConfigurationResponse_applicationVersionId :: Lens.Lens' AddApplicationInputProcessingConfigurationResponse (Prelude.Maybe Prelude.Natural)
addApplicationInputProcessingConfigurationResponse_applicationVersionId :: (Maybe Natural -> f (Maybe Natural))
-> AddApplicationInputProcessingConfigurationResponse
-> f AddApplicationInputProcessingConfigurationResponse
addApplicationInputProcessingConfigurationResponse_applicationVersionId = (AddApplicationInputProcessingConfigurationResponse
 -> Maybe Natural)
-> (AddApplicationInputProcessingConfigurationResponse
    -> Maybe Natural
    -> AddApplicationInputProcessingConfigurationResponse)
-> Lens
     AddApplicationInputProcessingConfigurationResponse
     AddApplicationInputProcessingConfigurationResponse
     (Maybe Natural)
     (Maybe Natural)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AddApplicationInputProcessingConfigurationResponse' {Maybe Natural
applicationVersionId :: Maybe Natural
$sel:applicationVersionId:AddApplicationInputProcessingConfigurationResponse' :: AddApplicationInputProcessingConfigurationResponse -> Maybe Natural
applicationVersionId} -> Maybe Natural
applicationVersionId) (\s :: AddApplicationInputProcessingConfigurationResponse
s@AddApplicationInputProcessingConfigurationResponse' {} Maybe Natural
a -> AddApplicationInputProcessingConfigurationResponse
s {$sel:applicationVersionId:AddApplicationInputProcessingConfigurationResponse' :: Maybe Natural
applicationVersionId = Maybe Natural
a} :: AddApplicationInputProcessingConfigurationResponse)

-- | The input ID that is associated with the application input. This is the
-- ID that Kinesis Data Analytics assigns to each input configuration that
-- you add to your application.
addApplicationInputProcessingConfigurationResponse_inputId :: Lens.Lens' AddApplicationInputProcessingConfigurationResponse (Prelude.Maybe Prelude.Text)
addApplicationInputProcessingConfigurationResponse_inputId :: (Maybe Text -> f (Maybe Text))
-> AddApplicationInputProcessingConfigurationResponse
-> f AddApplicationInputProcessingConfigurationResponse
addApplicationInputProcessingConfigurationResponse_inputId = (AddApplicationInputProcessingConfigurationResponse -> Maybe Text)
-> (AddApplicationInputProcessingConfigurationResponse
    -> Maybe Text
    -> AddApplicationInputProcessingConfigurationResponse)
-> Lens
     AddApplicationInputProcessingConfigurationResponse
     AddApplicationInputProcessingConfigurationResponse
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AddApplicationInputProcessingConfigurationResponse' {Maybe Text
inputId :: Maybe Text
$sel:inputId:AddApplicationInputProcessingConfigurationResponse' :: AddApplicationInputProcessingConfigurationResponse -> Maybe Text
inputId} -> Maybe Text
inputId) (\s :: AddApplicationInputProcessingConfigurationResponse
s@AddApplicationInputProcessingConfigurationResponse' {} Maybe Text
a -> AddApplicationInputProcessingConfigurationResponse
s {$sel:inputId:AddApplicationInputProcessingConfigurationResponse' :: Maybe Text
inputId = Maybe Text
a} :: AddApplicationInputProcessingConfigurationResponse)

-- | The description of the preprocessor that executes on records in this
-- input before the application\'s code is run.
addApplicationInputProcessingConfigurationResponse_inputProcessingConfigurationDescription :: Lens.Lens' AddApplicationInputProcessingConfigurationResponse (Prelude.Maybe InputProcessingConfigurationDescription)
addApplicationInputProcessingConfigurationResponse_inputProcessingConfigurationDescription :: (Maybe InputProcessingConfigurationDescription
 -> f (Maybe InputProcessingConfigurationDescription))
-> AddApplicationInputProcessingConfigurationResponse
-> f AddApplicationInputProcessingConfigurationResponse
addApplicationInputProcessingConfigurationResponse_inputProcessingConfigurationDescription = (AddApplicationInputProcessingConfigurationResponse
 -> Maybe InputProcessingConfigurationDescription)
-> (AddApplicationInputProcessingConfigurationResponse
    -> Maybe InputProcessingConfigurationDescription
    -> AddApplicationInputProcessingConfigurationResponse)
-> Lens
     AddApplicationInputProcessingConfigurationResponse
     AddApplicationInputProcessingConfigurationResponse
     (Maybe InputProcessingConfigurationDescription)
     (Maybe InputProcessingConfigurationDescription)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AddApplicationInputProcessingConfigurationResponse' {Maybe InputProcessingConfigurationDescription
inputProcessingConfigurationDescription :: Maybe InputProcessingConfigurationDescription
$sel:inputProcessingConfigurationDescription:AddApplicationInputProcessingConfigurationResponse' :: AddApplicationInputProcessingConfigurationResponse
-> Maybe InputProcessingConfigurationDescription
inputProcessingConfigurationDescription} -> Maybe InputProcessingConfigurationDescription
inputProcessingConfigurationDescription) (\s :: AddApplicationInputProcessingConfigurationResponse
s@AddApplicationInputProcessingConfigurationResponse' {} Maybe InputProcessingConfigurationDescription
a -> AddApplicationInputProcessingConfigurationResponse
s {$sel:inputProcessingConfigurationDescription:AddApplicationInputProcessingConfigurationResponse' :: Maybe InputProcessingConfigurationDescription
inputProcessingConfigurationDescription = Maybe InputProcessingConfigurationDescription
a} :: AddApplicationInputProcessingConfigurationResponse)

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

instance
  Prelude.NFData
    AddApplicationInputProcessingConfigurationResponse