{-# 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.AddApplicationReferenceDataSource
-- 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 a reference data source to an existing SQL-based Kinesis Data
-- Analytics application.
--
-- Kinesis Data Analytics reads reference data (that is, an Amazon S3
-- object) and creates an in-application table within your application. In
-- the request, you provide the source (S3 bucket name and object key
-- name), name of the in-application table to create, and the necessary
-- mapping information that describes how data in an Amazon S3 object maps
-- to columns in the resulting in-application table.
module Amazonka.KinesisAnalyticsV2.AddApplicationReferenceDataSource
  ( -- * Creating a Request
    AddApplicationReferenceDataSource (..),
    newAddApplicationReferenceDataSource,

    -- * Request Lenses
    addApplicationReferenceDataSource_applicationName,
    addApplicationReferenceDataSource_currentApplicationVersionId,
    addApplicationReferenceDataSource_referenceDataSource,

    -- * Destructuring the Response
    AddApplicationReferenceDataSourceResponse (..),
    newAddApplicationReferenceDataSourceResponse,

    -- * Response Lenses
    addApplicationReferenceDataSourceResponse_applicationARN,
    addApplicationReferenceDataSourceResponse_applicationVersionId,
    addApplicationReferenceDataSourceResponse_referenceDataSourceDescriptions,
    addApplicationReferenceDataSourceResponse_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:/ 'newAddApplicationReferenceDataSource' smart constructor.
data AddApplicationReferenceDataSource = AddApplicationReferenceDataSource'
  { -- | The name of an existing application.
    AddApplicationReferenceDataSource -> Text
applicationName :: Prelude.Text,
    -- | The version of the application for which you are adding the reference
    -- data source. 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.
    AddApplicationReferenceDataSource -> Natural
currentApplicationVersionId :: Prelude.Natural,
    -- | The reference data source can be an object in your Amazon S3 bucket.
    -- Kinesis Data Analytics reads the object and copies the data into the
    -- in-application table that is created. You provide an S3 bucket, object
    -- key name, and the resulting in-application table that is created.
    AddApplicationReferenceDataSource -> ReferenceDataSource
referenceDataSource :: ReferenceDataSource
  }
  deriving (AddApplicationReferenceDataSource
-> AddApplicationReferenceDataSource -> Bool
(AddApplicationReferenceDataSource
 -> AddApplicationReferenceDataSource -> Bool)
-> (AddApplicationReferenceDataSource
    -> AddApplicationReferenceDataSource -> Bool)
-> Eq AddApplicationReferenceDataSource
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: AddApplicationReferenceDataSource
-> AddApplicationReferenceDataSource -> Bool
$c/= :: AddApplicationReferenceDataSource
-> AddApplicationReferenceDataSource -> Bool
== :: AddApplicationReferenceDataSource
-> AddApplicationReferenceDataSource -> Bool
$c== :: AddApplicationReferenceDataSource
-> AddApplicationReferenceDataSource -> Bool
Prelude.Eq, ReadPrec [AddApplicationReferenceDataSource]
ReadPrec AddApplicationReferenceDataSource
Int -> ReadS AddApplicationReferenceDataSource
ReadS [AddApplicationReferenceDataSource]
(Int -> ReadS AddApplicationReferenceDataSource)
-> ReadS [AddApplicationReferenceDataSource]
-> ReadPrec AddApplicationReferenceDataSource
-> ReadPrec [AddApplicationReferenceDataSource]
-> Read AddApplicationReferenceDataSource
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [AddApplicationReferenceDataSource]
$creadListPrec :: ReadPrec [AddApplicationReferenceDataSource]
readPrec :: ReadPrec AddApplicationReferenceDataSource
$creadPrec :: ReadPrec AddApplicationReferenceDataSource
readList :: ReadS [AddApplicationReferenceDataSource]
$creadList :: ReadS [AddApplicationReferenceDataSource]
readsPrec :: Int -> ReadS AddApplicationReferenceDataSource
$creadsPrec :: Int -> ReadS AddApplicationReferenceDataSource
Prelude.Read, Int -> AddApplicationReferenceDataSource -> ShowS
[AddApplicationReferenceDataSource] -> ShowS
AddApplicationReferenceDataSource -> String
(Int -> AddApplicationReferenceDataSource -> ShowS)
-> (AddApplicationReferenceDataSource -> String)
-> ([AddApplicationReferenceDataSource] -> ShowS)
-> Show AddApplicationReferenceDataSource
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [AddApplicationReferenceDataSource] -> ShowS
$cshowList :: [AddApplicationReferenceDataSource] -> ShowS
show :: AddApplicationReferenceDataSource -> String
$cshow :: AddApplicationReferenceDataSource -> String
showsPrec :: Int -> AddApplicationReferenceDataSource -> ShowS
$cshowsPrec :: Int -> AddApplicationReferenceDataSource -> ShowS
Prelude.Show, (forall x.
 AddApplicationReferenceDataSource
 -> Rep AddApplicationReferenceDataSource x)
-> (forall x.
    Rep AddApplicationReferenceDataSource x
    -> AddApplicationReferenceDataSource)
-> Generic AddApplicationReferenceDataSource
forall x.
Rep AddApplicationReferenceDataSource x
-> AddApplicationReferenceDataSource
forall x.
AddApplicationReferenceDataSource
-> Rep AddApplicationReferenceDataSource x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep AddApplicationReferenceDataSource x
-> AddApplicationReferenceDataSource
$cfrom :: forall x.
AddApplicationReferenceDataSource
-> Rep AddApplicationReferenceDataSource x
Prelude.Generic)

-- |
-- Create a value of 'AddApplicationReferenceDataSource' 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', 'addApplicationReferenceDataSource_applicationName' - The name of an existing application.
--
-- 'currentApplicationVersionId', 'addApplicationReferenceDataSource_currentApplicationVersionId' - The version of the application for which you are adding the reference
-- data source. 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.
--
-- 'referenceDataSource', 'addApplicationReferenceDataSource_referenceDataSource' - The reference data source can be an object in your Amazon S3 bucket.
-- Kinesis Data Analytics reads the object and copies the data into the
-- in-application table that is created. You provide an S3 bucket, object
-- key name, and the resulting in-application table that is created.
newAddApplicationReferenceDataSource ::
  -- | 'applicationName'
  Prelude.Text ->
  -- | 'currentApplicationVersionId'
  Prelude.Natural ->
  -- | 'referenceDataSource'
  ReferenceDataSource ->
  AddApplicationReferenceDataSource
newAddApplicationReferenceDataSource :: Text
-> Natural
-> ReferenceDataSource
-> AddApplicationReferenceDataSource
newAddApplicationReferenceDataSource
  Text
pApplicationName_
  Natural
pCurrentApplicationVersionId_
  ReferenceDataSource
pReferenceDataSource_ =
    AddApplicationReferenceDataSource' :: Text
-> Natural
-> ReferenceDataSource
-> AddApplicationReferenceDataSource
AddApplicationReferenceDataSource'
      { $sel:applicationName:AddApplicationReferenceDataSource' :: Text
applicationName =
          Text
pApplicationName_,
        $sel:currentApplicationVersionId:AddApplicationReferenceDataSource' :: Natural
currentApplicationVersionId =
          Natural
pCurrentApplicationVersionId_,
        $sel:referenceDataSource:AddApplicationReferenceDataSource' :: ReferenceDataSource
referenceDataSource =
          ReferenceDataSource
pReferenceDataSource_
      }

-- | The name of an existing application.
addApplicationReferenceDataSource_applicationName :: Lens.Lens' AddApplicationReferenceDataSource Prelude.Text
addApplicationReferenceDataSource_applicationName :: (Text -> f Text)
-> AddApplicationReferenceDataSource
-> f AddApplicationReferenceDataSource
addApplicationReferenceDataSource_applicationName = (AddApplicationReferenceDataSource -> Text)
-> (AddApplicationReferenceDataSource
    -> Text -> AddApplicationReferenceDataSource)
-> Lens
     AddApplicationReferenceDataSource
     AddApplicationReferenceDataSource
     Text
     Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AddApplicationReferenceDataSource' {Text
applicationName :: Text
$sel:applicationName:AddApplicationReferenceDataSource' :: AddApplicationReferenceDataSource -> Text
applicationName} -> Text
applicationName) (\s :: AddApplicationReferenceDataSource
s@AddApplicationReferenceDataSource' {} Text
a -> AddApplicationReferenceDataSource
s {$sel:applicationName:AddApplicationReferenceDataSource' :: Text
applicationName = Text
a} :: AddApplicationReferenceDataSource)

-- | The version of the application for which you are adding the reference
-- data source. 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.
addApplicationReferenceDataSource_currentApplicationVersionId :: Lens.Lens' AddApplicationReferenceDataSource Prelude.Natural
addApplicationReferenceDataSource_currentApplicationVersionId :: (Natural -> f Natural)
-> AddApplicationReferenceDataSource
-> f AddApplicationReferenceDataSource
addApplicationReferenceDataSource_currentApplicationVersionId = (AddApplicationReferenceDataSource -> Natural)
-> (AddApplicationReferenceDataSource
    -> Natural -> AddApplicationReferenceDataSource)
-> Lens
     AddApplicationReferenceDataSource
     AddApplicationReferenceDataSource
     Natural
     Natural
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AddApplicationReferenceDataSource' {Natural
currentApplicationVersionId :: Natural
$sel:currentApplicationVersionId:AddApplicationReferenceDataSource' :: AddApplicationReferenceDataSource -> Natural
currentApplicationVersionId} -> Natural
currentApplicationVersionId) (\s :: AddApplicationReferenceDataSource
s@AddApplicationReferenceDataSource' {} Natural
a -> AddApplicationReferenceDataSource
s {$sel:currentApplicationVersionId:AddApplicationReferenceDataSource' :: Natural
currentApplicationVersionId = Natural
a} :: AddApplicationReferenceDataSource)

-- | The reference data source can be an object in your Amazon S3 bucket.
-- Kinesis Data Analytics reads the object and copies the data into the
-- in-application table that is created. You provide an S3 bucket, object
-- key name, and the resulting in-application table that is created.
addApplicationReferenceDataSource_referenceDataSource :: Lens.Lens' AddApplicationReferenceDataSource ReferenceDataSource
addApplicationReferenceDataSource_referenceDataSource :: (ReferenceDataSource -> f ReferenceDataSource)
-> AddApplicationReferenceDataSource
-> f AddApplicationReferenceDataSource
addApplicationReferenceDataSource_referenceDataSource = (AddApplicationReferenceDataSource -> ReferenceDataSource)
-> (AddApplicationReferenceDataSource
    -> ReferenceDataSource -> AddApplicationReferenceDataSource)
-> Lens
     AddApplicationReferenceDataSource
     AddApplicationReferenceDataSource
     ReferenceDataSource
     ReferenceDataSource
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AddApplicationReferenceDataSource' {ReferenceDataSource
referenceDataSource :: ReferenceDataSource
$sel:referenceDataSource:AddApplicationReferenceDataSource' :: AddApplicationReferenceDataSource -> ReferenceDataSource
referenceDataSource} -> ReferenceDataSource
referenceDataSource) (\s :: AddApplicationReferenceDataSource
s@AddApplicationReferenceDataSource' {} ReferenceDataSource
a -> AddApplicationReferenceDataSource
s {$sel:referenceDataSource:AddApplicationReferenceDataSource' :: ReferenceDataSource
referenceDataSource = ReferenceDataSource
a} :: AddApplicationReferenceDataSource)

instance
  Core.AWSRequest
    AddApplicationReferenceDataSource
  where
  type
    AWSResponse AddApplicationReferenceDataSource =
      AddApplicationReferenceDataSourceResponse
  request :: AddApplicationReferenceDataSource
-> Request AddApplicationReferenceDataSource
request = Service
-> AddApplicationReferenceDataSource
-> Request AddApplicationReferenceDataSource
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON Service
defaultService
  response :: Logger
-> Service
-> Proxy AddApplicationReferenceDataSource
-> ClientResponse ClientBody
-> m (Either
        Error
        (ClientResponse (AWSResponse AddApplicationReferenceDataSource)))
response =
    (Int
 -> ResponseHeaders
 -> Object
 -> Either String (AWSResponse AddApplicationReferenceDataSource))
-> Logger
-> Service
-> Proxy AddApplicationReferenceDataSource
-> ClientResponse ClientBody
-> m (Either
        Error
        (ClientResponse (AWSResponse AddApplicationReferenceDataSource)))
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 [ReferenceDataSourceDescription]
-> Int
-> AddApplicationReferenceDataSourceResponse
AddApplicationReferenceDataSourceResponse'
            (Maybe Text
 -> Maybe Natural
 -> Maybe [ReferenceDataSourceDescription]
 -> Int
 -> AddApplicationReferenceDataSourceResponse)
-> Either String (Maybe Text)
-> Either
     String
     (Maybe Natural
      -> Maybe [ReferenceDataSourceDescription]
      -> Int
      -> AddApplicationReferenceDataSourceResponse)
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 [ReferenceDataSourceDescription]
   -> Int
   -> AddApplicationReferenceDataSourceResponse)
-> Either String (Maybe Natural)
-> Either
     String
     (Maybe [ReferenceDataSourceDescription]
      -> Int -> AddApplicationReferenceDataSourceResponse)
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 [ReferenceDataSourceDescription]
   -> Int -> AddApplicationReferenceDataSourceResponse)
-> Either String (Maybe [ReferenceDataSourceDescription])
-> Either String (Int -> AddApplicationReferenceDataSourceResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ( Object
x Object
-> Text
-> Either String (Maybe (Maybe [ReferenceDataSourceDescription]))
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"ReferenceDataSourceDescriptions"
                              Either String (Maybe (Maybe [ReferenceDataSourceDescription]))
-> Maybe [ReferenceDataSourceDescription]
-> Either String (Maybe [ReferenceDataSourceDescription])
forall (f :: * -> *) a. Functor f => f (Maybe a) -> a -> f a
Core..!@ Maybe [ReferenceDataSourceDescription]
forall a. Monoid a => a
Prelude.mempty
                          )
              Either String (Int -> AddApplicationReferenceDataSourceResponse)
-> Either String Int
-> Either String AddApplicationReferenceDataSourceResponse
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
    AddApplicationReferenceDataSource

instance
  Prelude.NFData
    AddApplicationReferenceDataSource

instance
  Core.ToHeaders
    AddApplicationReferenceDataSource
  where
  toHeaders :: AddApplicationReferenceDataSource -> ResponseHeaders
toHeaders =
    ResponseHeaders
-> AddApplicationReferenceDataSource -> 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.AddApplicationReferenceDataSource" ::
                          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
    AddApplicationReferenceDataSource
  where
  toJSON :: AddApplicationReferenceDataSource -> Value
toJSON AddApplicationReferenceDataSource' {Natural
Text
ReferenceDataSource
referenceDataSource :: ReferenceDataSource
currentApplicationVersionId :: Natural
applicationName :: Text
$sel:referenceDataSource:AddApplicationReferenceDataSource' :: AddApplicationReferenceDataSource -> ReferenceDataSource
$sel:currentApplicationVersionId:AddApplicationReferenceDataSource' :: AddApplicationReferenceDataSource -> Natural
$sel:applicationName:AddApplicationReferenceDataSource' :: AddApplicationReferenceDataSource -> 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
"ReferenceDataSource" Text -> ReferenceDataSource -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= ReferenceDataSource
referenceDataSource)
          ]
      )

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

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

-- | /See:/ 'newAddApplicationReferenceDataSourceResponse' smart constructor.
data AddApplicationReferenceDataSourceResponse = AddApplicationReferenceDataSourceResponse'
  { -- | The application Amazon Resource Name (ARN).
    AddApplicationReferenceDataSourceResponse -> Maybe Text
applicationARN :: Prelude.Maybe Prelude.Text,
    -- | The updated application version ID. Kinesis Data Analytics increments
    -- this ID when the application is updated.
    AddApplicationReferenceDataSourceResponse -> Maybe Natural
applicationVersionId :: Prelude.Maybe Prelude.Natural,
    -- | Describes reference data sources configured for the application.
    AddApplicationReferenceDataSourceResponse
-> Maybe [ReferenceDataSourceDescription]
referenceDataSourceDescriptions :: Prelude.Maybe [ReferenceDataSourceDescription],
    -- | The response's http status code.
    AddApplicationReferenceDataSourceResponse -> Int
httpStatus :: Prelude.Int
  }
  deriving (AddApplicationReferenceDataSourceResponse
-> AddApplicationReferenceDataSourceResponse -> Bool
(AddApplicationReferenceDataSourceResponse
 -> AddApplicationReferenceDataSourceResponse -> Bool)
-> (AddApplicationReferenceDataSourceResponse
    -> AddApplicationReferenceDataSourceResponse -> Bool)
-> Eq AddApplicationReferenceDataSourceResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: AddApplicationReferenceDataSourceResponse
-> AddApplicationReferenceDataSourceResponse -> Bool
$c/= :: AddApplicationReferenceDataSourceResponse
-> AddApplicationReferenceDataSourceResponse -> Bool
== :: AddApplicationReferenceDataSourceResponse
-> AddApplicationReferenceDataSourceResponse -> Bool
$c== :: AddApplicationReferenceDataSourceResponse
-> AddApplicationReferenceDataSourceResponse -> Bool
Prelude.Eq, ReadPrec [AddApplicationReferenceDataSourceResponse]
ReadPrec AddApplicationReferenceDataSourceResponse
Int -> ReadS AddApplicationReferenceDataSourceResponse
ReadS [AddApplicationReferenceDataSourceResponse]
(Int -> ReadS AddApplicationReferenceDataSourceResponse)
-> ReadS [AddApplicationReferenceDataSourceResponse]
-> ReadPrec AddApplicationReferenceDataSourceResponse
-> ReadPrec [AddApplicationReferenceDataSourceResponse]
-> Read AddApplicationReferenceDataSourceResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [AddApplicationReferenceDataSourceResponse]
$creadListPrec :: ReadPrec [AddApplicationReferenceDataSourceResponse]
readPrec :: ReadPrec AddApplicationReferenceDataSourceResponse
$creadPrec :: ReadPrec AddApplicationReferenceDataSourceResponse
readList :: ReadS [AddApplicationReferenceDataSourceResponse]
$creadList :: ReadS [AddApplicationReferenceDataSourceResponse]
readsPrec :: Int -> ReadS AddApplicationReferenceDataSourceResponse
$creadsPrec :: Int -> ReadS AddApplicationReferenceDataSourceResponse
Prelude.Read, Int -> AddApplicationReferenceDataSourceResponse -> ShowS
[AddApplicationReferenceDataSourceResponse] -> ShowS
AddApplicationReferenceDataSourceResponse -> String
(Int -> AddApplicationReferenceDataSourceResponse -> ShowS)
-> (AddApplicationReferenceDataSourceResponse -> String)
-> ([AddApplicationReferenceDataSourceResponse] -> ShowS)
-> Show AddApplicationReferenceDataSourceResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [AddApplicationReferenceDataSourceResponse] -> ShowS
$cshowList :: [AddApplicationReferenceDataSourceResponse] -> ShowS
show :: AddApplicationReferenceDataSourceResponse -> String
$cshow :: AddApplicationReferenceDataSourceResponse -> String
showsPrec :: Int -> AddApplicationReferenceDataSourceResponse -> ShowS
$cshowsPrec :: Int -> AddApplicationReferenceDataSourceResponse -> ShowS
Prelude.Show, (forall x.
 AddApplicationReferenceDataSourceResponse
 -> Rep AddApplicationReferenceDataSourceResponse x)
-> (forall x.
    Rep AddApplicationReferenceDataSourceResponse x
    -> AddApplicationReferenceDataSourceResponse)
-> Generic AddApplicationReferenceDataSourceResponse
forall x.
Rep AddApplicationReferenceDataSourceResponse x
-> AddApplicationReferenceDataSourceResponse
forall x.
AddApplicationReferenceDataSourceResponse
-> Rep AddApplicationReferenceDataSourceResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep AddApplicationReferenceDataSourceResponse x
-> AddApplicationReferenceDataSourceResponse
$cfrom :: forall x.
AddApplicationReferenceDataSourceResponse
-> Rep AddApplicationReferenceDataSourceResponse x
Prelude.Generic)

-- |
-- Create a value of 'AddApplicationReferenceDataSourceResponse' 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', 'addApplicationReferenceDataSourceResponse_applicationARN' - The application Amazon Resource Name (ARN).
--
-- 'applicationVersionId', 'addApplicationReferenceDataSourceResponse_applicationVersionId' - The updated application version ID. Kinesis Data Analytics increments
-- this ID when the application is updated.
--
-- 'referenceDataSourceDescriptions', 'addApplicationReferenceDataSourceResponse_referenceDataSourceDescriptions' - Describes reference data sources configured for the application.
--
-- 'httpStatus', 'addApplicationReferenceDataSourceResponse_httpStatus' - The response's http status code.
newAddApplicationReferenceDataSourceResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  AddApplicationReferenceDataSourceResponse
newAddApplicationReferenceDataSourceResponse :: Int -> AddApplicationReferenceDataSourceResponse
newAddApplicationReferenceDataSourceResponse
  Int
pHttpStatus_ =
    AddApplicationReferenceDataSourceResponse' :: Maybe Text
-> Maybe Natural
-> Maybe [ReferenceDataSourceDescription]
-> Int
-> AddApplicationReferenceDataSourceResponse
AddApplicationReferenceDataSourceResponse'
      { $sel:applicationARN:AddApplicationReferenceDataSourceResponse' :: Maybe Text
applicationARN =
          Maybe Text
forall a. Maybe a
Prelude.Nothing,
        $sel:applicationVersionId:AddApplicationReferenceDataSourceResponse' :: Maybe Natural
applicationVersionId =
          Maybe Natural
forall a. Maybe a
Prelude.Nothing,
        $sel:referenceDataSourceDescriptions:AddApplicationReferenceDataSourceResponse' :: Maybe [ReferenceDataSourceDescription]
referenceDataSourceDescriptions =
          Maybe [ReferenceDataSourceDescription]
forall a. Maybe a
Prelude.Nothing,
        $sel:httpStatus:AddApplicationReferenceDataSourceResponse' :: Int
httpStatus = Int
pHttpStatus_
      }

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

-- | The updated application version ID. Kinesis Data Analytics increments
-- this ID when the application is updated.
addApplicationReferenceDataSourceResponse_applicationVersionId :: Lens.Lens' AddApplicationReferenceDataSourceResponse (Prelude.Maybe Prelude.Natural)
addApplicationReferenceDataSourceResponse_applicationVersionId :: (Maybe Natural -> f (Maybe Natural))
-> AddApplicationReferenceDataSourceResponse
-> f AddApplicationReferenceDataSourceResponse
addApplicationReferenceDataSourceResponse_applicationVersionId = (AddApplicationReferenceDataSourceResponse -> Maybe Natural)
-> (AddApplicationReferenceDataSourceResponse
    -> Maybe Natural -> AddApplicationReferenceDataSourceResponse)
-> Lens
     AddApplicationReferenceDataSourceResponse
     AddApplicationReferenceDataSourceResponse
     (Maybe Natural)
     (Maybe Natural)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AddApplicationReferenceDataSourceResponse' {Maybe Natural
applicationVersionId :: Maybe Natural
$sel:applicationVersionId:AddApplicationReferenceDataSourceResponse' :: AddApplicationReferenceDataSourceResponse -> Maybe Natural
applicationVersionId} -> Maybe Natural
applicationVersionId) (\s :: AddApplicationReferenceDataSourceResponse
s@AddApplicationReferenceDataSourceResponse' {} Maybe Natural
a -> AddApplicationReferenceDataSourceResponse
s {$sel:applicationVersionId:AddApplicationReferenceDataSourceResponse' :: Maybe Natural
applicationVersionId = Maybe Natural
a} :: AddApplicationReferenceDataSourceResponse)

-- | Describes reference data sources configured for the application.
addApplicationReferenceDataSourceResponse_referenceDataSourceDescriptions :: Lens.Lens' AddApplicationReferenceDataSourceResponse (Prelude.Maybe [ReferenceDataSourceDescription])
addApplicationReferenceDataSourceResponse_referenceDataSourceDescriptions :: (Maybe [ReferenceDataSourceDescription]
 -> f (Maybe [ReferenceDataSourceDescription]))
-> AddApplicationReferenceDataSourceResponse
-> f AddApplicationReferenceDataSourceResponse
addApplicationReferenceDataSourceResponse_referenceDataSourceDescriptions = (AddApplicationReferenceDataSourceResponse
 -> Maybe [ReferenceDataSourceDescription])
-> (AddApplicationReferenceDataSourceResponse
    -> Maybe [ReferenceDataSourceDescription]
    -> AddApplicationReferenceDataSourceResponse)
-> Lens
     AddApplicationReferenceDataSourceResponse
     AddApplicationReferenceDataSourceResponse
     (Maybe [ReferenceDataSourceDescription])
     (Maybe [ReferenceDataSourceDescription])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AddApplicationReferenceDataSourceResponse' {Maybe [ReferenceDataSourceDescription]
referenceDataSourceDescriptions :: Maybe [ReferenceDataSourceDescription]
$sel:referenceDataSourceDescriptions:AddApplicationReferenceDataSourceResponse' :: AddApplicationReferenceDataSourceResponse
-> Maybe [ReferenceDataSourceDescription]
referenceDataSourceDescriptions} -> Maybe [ReferenceDataSourceDescription]
referenceDataSourceDescriptions) (\s :: AddApplicationReferenceDataSourceResponse
s@AddApplicationReferenceDataSourceResponse' {} Maybe [ReferenceDataSourceDescription]
a -> AddApplicationReferenceDataSourceResponse
s {$sel:referenceDataSourceDescriptions:AddApplicationReferenceDataSourceResponse' :: Maybe [ReferenceDataSourceDescription]
referenceDataSourceDescriptions = Maybe [ReferenceDataSourceDescription]
a} :: AddApplicationReferenceDataSourceResponse) ((Maybe [ReferenceDataSourceDescription]
  -> f (Maybe [ReferenceDataSourceDescription]))
 -> AddApplicationReferenceDataSourceResponse
 -> f AddApplicationReferenceDataSourceResponse)
-> ((Maybe [ReferenceDataSourceDescription]
     -> f (Maybe [ReferenceDataSourceDescription]))
    -> Maybe [ReferenceDataSourceDescription]
    -> f (Maybe [ReferenceDataSourceDescription]))
-> (Maybe [ReferenceDataSourceDescription]
    -> f (Maybe [ReferenceDataSourceDescription]))
-> AddApplicationReferenceDataSourceResponse
-> f AddApplicationReferenceDataSourceResponse
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
  [ReferenceDataSourceDescription]
  [ReferenceDataSourceDescription]
  [ReferenceDataSourceDescription]
  [ReferenceDataSourceDescription]
-> Iso
     (Maybe [ReferenceDataSourceDescription])
     (Maybe [ReferenceDataSourceDescription])
     (Maybe [ReferenceDataSourceDescription])
     (Maybe [ReferenceDataSourceDescription])
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
  [ReferenceDataSourceDescription]
  [ReferenceDataSourceDescription]
  [ReferenceDataSourceDescription]
  [ReferenceDataSourceDescription]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

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

instance
  Prelude.NFData
    AddApplicationReferenceDataSourceResponse