{-# 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.AddApplicationVpcConfiguration
-- 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 Virtual Private Cloud (VPC) configuration to the application.
-- Applications can use VPCs to store and access resources securely.
--
-- Note the following about VPC configurations for Kinesis Data Analytics
-- applications:
--
-- -   VPC configurations are not supported for SQL applications.
--
-- -   When a VPC is added to a Kinesis Data Analytics application, the
--     application can no longer be accessed from the Internet directly. To
--     enable Internet access to the application, add an Internet gateway
--     to your VPC.
module Amazonka.KinesisAnalyticsV2.AddApplicationVpcConfiguration
  ( -- * Creating a Request
    AddApplicationVpcConfiguration (..),
    newAddApplicationVpcConfiguration,

    -- * Request Lenses
    addApplicationVpcConfiguration_currentApplicationVersionId,
    addApplicationVpcConfiguration_conditionalToken,
    addApplicationVpcConfiguration_applicationName,
    addApplicationVpcConfiguration_vpcConfiguration,

    -- * Destructuring the Response
    AddApplicationVpcConfigurationResponse (..),
    newAddApplicationVpcConfigurationResponse,

    -- * Response Lenses
    addApplicationVpcConfigurationResponse_applicationARN,
    addApplicationVpcConfigurationResponse_applicationVersionId,
    addApplicationVpcConfigurationResponse_vpcConfigurationDescription,
    addApplicationVpcConfigurationResponse_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:/ 'newAddApplicationVpcConfiguration' smart constructor.
data AddApplicationVpcConfiguration = AddApplicationVpcConfiguration'
  { -- | The version of the application to which you want to add the VPC
    -- configuration. You must provide the @CurrentApplicationVersionId@ or the
    -- @ConditionalToken@. 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. For
    -- better concurrency support, use the @ConditionalToken@ parameter instead
    -- of @CurrentApplicationVersionId@.
    AddApplicationVpcConfiguration -> Maybe Natural
currentApplicationVersionId :: Prelude.Maybe Prelude.Natural,
    -- | A value you use to implement strong concurrency for application updates.
    -- You must provide the @ApplicationVersionID@ or the @ConditionalToken@.
    -- You get the application\'s current @ConditionalToken@ using
    -- DescribeApplication. For better concurrency support, use the
    -- @ConditionalToken@ parameter instead of @CurrentApplicationVersionId@.
    AddApplicationVpcConfiguration -> Maybe Text
conditionalToken :: Prelude.Maybe Prelude.Text,
    -- | The name of an existing application.
    AddApplicationVpcConfiguration -> Text
applicationName :: Prelude.Text,
    -- | Description of the VPC to add to the application.
    AddApplicationVpcConfiguration -> VpcConfiguration
vpcConfiguration :: VpcConfiguration
  }
  deriving (AddApplicationVpcConfiguration
-> AddApplicationVpcConfiguration -> Bool
(AddApplicationVpcConfiguration
 -> AddApplicationVpcConfiguration -> Bool)
-> (AddApplicationVpcConfiguration
    -> AddApplicationVpcConfiguration -> Bool)
-> Eq AddApplicationVpcConfiguration
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: AddApplicationVpcConfiguration
-> AddApplicationVpcConfiguration -> Bool
$c/= :: AddApplicationVpcConfiguration
-> AddApplicationVpcConfiguration -> Bool
== :: AddApplicationVpcConfiguration
-> AddApplicationVpcConfiguration -> Bool
$c== :: AddApplicationVpcConfiguration
-> AddApplicationVpcConfiguration -> Bool
Prelude.Eq, ReadPrec [AddApplicationVpcConfiguration]
ReadPrec AddApplicationVpcConfiguration
Int -> ReadS AddApplicationVpcConfiguration
ReadS [AddApplicationVpcConfiguration]
(Int -> ReadS AddApplicationVpcConfiguration)
-> ReadS [AddApplicationVpcConfiguration]
-> ReadPrec AddApplicationVpcConfiguration
-> ReadPrec [AddApplicationVpcConfiguration]
-> Read AddApplicationVpcConfiguration
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [AddApplicationVpcConfiguration]
$creadListPrec :: ReadPrec [AddApplicationVpcConfiguration]
readPrec :: ReadPrec AddApplicationVpcConfiguration
$creadPrec :: ReadPrec AddApplicationVpcConfiguration
readList :: ReadS [AddApplicationVpcConfiguration]
$creadList :: ReadS [AddApplicationVpcConfiguration]
readsPrec :: Int -> ReadS AddApplicationVpcConfiguration
$creadsPrec :: Int -> ReadS AddApplicationVpcConfiguration
Prelude.Read, Int -> AddApplicationVpcConfiguration -> ShowS
[AddApplicationVpcConfiguration] -> ShowS
AddApplicationVpcConfiguration -> String
(Int -> AddApplicationVpcConfiguration -> ShowS)
-> (AddApplicationVpcConfiguration -> String)
-> ([AddApplicationVpcConfiguration] -> ShowS)
-> Show AddApplicationVpcConfiguration
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [AddApplicationVpcConfiguration] -> ShowS
$cshowList :: [AddApplicationVpcConfiguration] -> ShowS
show :: AddApplicationVpcConfiguration -> String
$cshow :: AddApplicationVpcConfiguration -> String
showsPrec :: Int -> AddApplicationVpcConfiguration -> ShowS
$cshowsPrec :: Int -> AddApplicationVpcConfiguration -> ShowS
Prelude.Show, (forall x.
 AddApplicationVpcConfiguration
 -> Rep AddApplicationVpcConfiguration x)
-> (forall x.
    Rep AddApplicationVpcConfiguration x
    -> AddApplicationVpcConfiguration)
-> Generic AddApplicationVpcConfiguration
forall x.
Rep AddApplicationVpcConfiguration x
-> AddApplicationVpcConfiguration
forall x.
AddApplicationVpcConfiguration
-> Rep AddApplicationVpcConfiguration x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep AddApplicationVpcConfiguration x
-> AddApplicationVpcConfiguration
$cfrom :: forall x.
AddApplicationVpcConfiguration
-> Rep AddApplicationVpcConfiguration x
Prelude.Generic)

-- |
-- Create a value of 'AddApplicationVpcConfiguration' 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:
--
-- 'currentApplicationVersionId', 'addApplicationVpcConfiguration_currentApplicationVersionId' - The version of the application to which you want to add the VPC
-- configuration. You must provide the @CurrentApplicationVersionId@ or the
-- @ConditionalToken@. 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. For
-- better concurrency support, use the @ConditionalToken@ parameter instead
-- of @CurrentApplicationVersionId@.
--
-- 'conditionalToken', 'addApplicationVpcConfiguration_conditionalToken' - A value you use to implement strong concurrency for application updates.
-- You must provide the @ApplicationVersionID@ or the @ConditionalToken@.
-- You get the application\'s current @ConditionalToken@ using
-- DescribeApplication. For better concurrency support, use the
-- @ConditionalToken@ parameter instead of @CurrentApplicationVersionId@.
--
-- 'applicationName', 'addApplicationVpcConfiguration_applicationName' - The name of an existing application.
--
-- 'vpcConfiguration', 'addApplicationVpcConfiguration_vpcConfiguration' - Description of the VPC to add to the application.
newAddApplicationVpcConfiguration ::
  -- | 'applicationName'
  Prelude.Text ->
  -- | 'vpcConfiguration'
  VpcConfiguration ->
  AddApplicationVpcConfiguration
newAddApplicationVpcConfiguration :: Text -> VpcConfiguration -> AddApplicationVpcConfiguration
newAddApplicationVpcConfiguration
  Text
pApplicationName_
  VpcConfiguration
pVpcConfiguration_ =
    AddApplicationVpcConfiguration' :: Maybe Natural
-> Maybe Text
-> Text
-> VpcConfiguration
-> AddApplicationVpcConfiguration
AddApplicationVpcConfiguration'
      { $sel:currentApplicationVersionId:AddApplicationVpcConfiguration' :: Maybe Natural
currentApplicationVersionId =
          Maybe Natural
forall a. Maybe a
Prelude.Nothing,
        $sel:conditionalToken:AddApplicationVpcConfiguration' :: Maybe Text
conditionalToken = Maybe Text
forall a. Maybe a
Prelude.Nothing,
        $sel:applicationName:AddApplicationVpcConfiguration' :: Text
applicationName = Text
pApplicationName_,
        $sel:vpcConfiguration:AddApplicationVpcConfiguration' :: VpcConfiguration
vpcConfiguration = VpcConfiguration
pVpcConfiguration_
      }

-- | The version of the application to which you want to add the VPC
-- configuration. You must provide the @CurrentApplicationVersionId@ or the
-- @ConditionalToken@. 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. For
-- better concurrency support, use the @ConditionalToken@ parameter instead
-- of @CurrentApplicationVersionId@.
addApplicationVpcConfiguration_currentApplicationVersionId :: Lens.Lens' AddApplicationVpcConfiguration (Prelude.Maybe Prelude.Natural)
addApplicationVpcConfiguration_currentApplicationVersionId :: (Maybe Natural -> f (Maybe Natural))
-> AddApplicationVpcConfiguration
-> f AddApplicationVpcConfiguration
addApplicationVpcConfiguration_currentApplicationVersionId = (AddApplicationVpcConfiguration -> Maybe Natural)
-> (AddApplicationVpcConfiguration
    -> Maybe Natural -> AddApplicationVpcConfiguration)
-> Lens
     AddApplicationVpcConfiguration
     AddApplicationVpcConfiguration
     (Maybe Natural)
     (Maybe Natural)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AddApplicationVpcConfiguration' {Maybe Natural
currentApplicationVersionId :: Maybe Natural
$sel:currentApplicationVersionId:AddApplicationVpcConfiguration' :: AddApplicationVpcConfiguration -> Maybe Natural
currentApplicationVersionId} -> Maybe Natural
currentApplicationVersionId) (\s :: AddApplicationVpcConfiguration
s@AddApplicationVpcConfiguration' {} Maybe Natural
a -> AddApplicationVpcConfiguration
s {$sel:currentApplicationVersionId:AddApplicationVpcConfiguration' :: Maybe Natural
currentApplicationVersionId = Maybe Natural
a} :: AddApplicationVpcConfiguration)

-- | A value you use to implement strong concurrency for application updates.
-- You must provide the @ApplicationVersionID@ or the @ConditionalToken@.
-- You get the application\'s current @ConditionalToken@ using
-- DescribeApplication. For better concurrency support, use the
-- @ConditionalToken@ parameter instead of @CurrentApplicationVersionId@.
addApplicationVpcConfiguration_conditionalToken :: Lens.Lens' AddApplicationVpcConfiguration (Prelude.Maybe Prelude.Text)
addApplicationVpcConfiguration_conditionalToken :: (Maybe Text -> f (Maybe Text))
-> AddApplicationVpcConfiguration
-> f AddApplicationVpcConfiguration
addApplicationVpcConfiguration_conditionalToken = (AddApplicationVpcConfiguration -> Maybe Text)
-> (AddApplicationVpcConfiguration
    -> Maybe Text -> AddApplicationVpcConfiguration)
-> Lens
     AddApplicationVpcConfiguration
     AddApplicationVpcConfiguration
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AddApplicationVpcConfiguration' {Maybe Text
conditionalToken :: Maybe Text
$sel:conditionalToken:AddApplicationVpcConfiguration' :: AddApplicationVpcConfiguration -> Maybe Text
conditionalToken} -> Maybe Text
conditionalToken) (\s :: AddApplicationVpcConfiguration
s@AddApplicationVpcConfiguration' {} Maybe Text
a -> AddApplicationVpcConfiguration
s {$sel:conditionalToken:AddApplicationVpcConfiguration' :: Maybe Text
conditionalToken = Maybe Text
a} :: AddApplicationVpcConfiguration)

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

-- | Description of the VPC to add to the application.
addApplicationVpcConfiguration_vpcConfiguration :: Lens.Lens' AddApplicationVpcConfiguration VpcConfiguration
addApplicationVpcConfiguration_vpcConfiguration :: (VpcConfiguration -> f VpcConfiguration)
-> AddApplicationVpcConfiguration
-> f AddApplicationVpcConfiguration
addApplicationVpcConfiguration_vpcConfiguration = (AddApplicationVpcConfiguration -> VpcConfiguration)
-> (AddApplicationVpcConfiguration
    -> VpcConfiguration -> AddApplicationVpcConfiguration)
-> Lens
     AddApplicationVpcConfiguration
     AddApplicationVpcConfiguration
     VpcConfiguration
     VpcConfiguration
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AddApplicationVpcConfiguration' {VpcConfiguration
vpcConfiguration :: VpcConfiguration
$sel:vpcConfiguration:AddApplicationVpcConfiguration' :: AddApplicationVpcConfiguration -> VpcConfiguration
vpcConfiguration} -> VpcConfiguration
vpcConfiguration) (\s :: AddApplicationVpcConfiguration
s@AddApplicationVpcConfiguration' {} VpcConfiguration
a -> AddApplicationVpcConfiguration
s {$sel:vpcConfiguration:AddApplicationVpcConfiguration' :: VpcConfiguration
vpcConfiguration = VpcConfiguration
a} :: AddApplicationVpcConfiguration)

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

instance
  Prelude.NFData
    AddApplicationVpcConfiguration

instance
  Core.ToHeaders
    AddApplicationVpcConfiguration
  where
  toHeaders :: AddApplicationVpcConfiguration -> ResponseHeaders
toHeaders =
    ResponseHeaders
-> AddApplicationVpcConfiguration -> 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.AddApplicationVpcConfiguration" ::
                          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 AddApplicationVpcConfiguration where
  toJSON :: AddApplicationVpcConfiguration -> Value
toJSON AddApplicationVpcConfiguration' {Maybe Natural
Maybe Text
Text
VpcConfiguration
vpcConfiguration :: VpcConfiguration
applicationName :: Text
conditionalToken :: Maybe Text
currentApplicationVersionId :: Maybe Natural
$sel:vpcConfiguration:AddApplicationVpcConfiguration' :: AddApplicationVpcConfiguration -> VpcConfiguration
$sel:applicationName:AddApplicationVpcConfiguration' :: AddApplicationVpcConfiguration -> Text
$sel:conditionalToken:AddApplicationVpcConfiguration' :: AddApplicationVpcConfiguration -> Maybe Text
$sel:currentApplicationVersionId:AddApplicationVpcConfiguration' :: AddApplicationVpcConfiguration -> Maybe Natural
..} =
    [Pair] -> Value
Core.object
      ( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ (Text
"CurrentApplicationVersionId" Text -> Natural -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
              (Natural -> Pair) -> Maybe Natural -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Natural
currentApplicationVersionId,
            (Text
"ConditionalToken" 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
conditionalToken,
            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
"VpcConfiguration" Text -> VpcConfiguration -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= VpcConfiguration
vpcConfiguration)
          ]
      )

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

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

-- | /See:/ 'newAddApplicationVpcConfigurationResponse' smart constructor.
data AddApplicationVpcConfigurationResponse = AddApplicationVpcConfigurationResponse'
  { -- | The ARN of the application.
    AddApplicationVpcConfigurationResponse -> Maybe Text
applicationARN :: Prelude.Maybe Prelude.Text,
    -- | Provides the current application version. Kinesis Data Analytics updates
    -- the ApplicationVersionId each time you update the application.
    AddApplicationVpcConfigurationResponse -> Maybe Natural
applicationVersionId :: Prelude.Maybe Prelude.Natural,
    -- | The parameters of the new VPC configuration.
    AddApplicationVpcConfigurationResponse
-> Maybe VpcConfigurationDescription
vpcConfigurationDescription :: Prelude.Maybe VpcConfigurationDescription,
    -- | The response's http status code.
    AddApplicationVpcConfigurationResponse -> Int
httpStatus :: Prelude.Int
  }
  deriving (AddApplicationVpcConfigurationResponse
-> AddApplicationVpcConfigurationResponse -> Bool
(AddApplicationVpcConfigurationResponse
 -> AddApplicationVpcConfigurationResponse -> Bool)
-> (AddApplicationVpcConfigurationResponse
    -> AddApplicationVpcConfigurationResponse -> Bool)
-> Eq AddApplicationVpcConfigurationResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: AddApplicationVpcConfigurationResponse
-> AddApplicationVpcConfigurationResponse -> Bool
$c/= :: AddApplicationVpcConfigurationResponse
-> AddApplicationVpcConfigurationResponse -> Bool
== :: AddApplicationVpcConfigurationResponse
-> AddApplicationVpcConfigurationResponse -> Bool
$c== :: AddApplicationVpcConfigurationResponse
-> AddApplicationVpcConfigurationResponse -> Bool
Prelude.Eq, ReadPrec [AddApplicationVpcConfigurationResponse]
ReadPrec AddApplicationVpcConfigurationResponse
Int -> ReadS AddApplicationVpcConfigurationResponse
ReadS [AddApplicationVpcConfigurationResponse]
(Int -> ReadS AddApplicationVpcConfigurationResponse)
-> ReadS [AddApplicationVpcConfigurationResponse]
-> ReadPrec AddApplicationVpcConfigurationResponse
-> ReadPrec [AddApplicationVpcConfigurationResponse]
-> Read AddApplicationVpcConfigurationResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [AddApplicationVpcConfigurationResponse]
$creadListPrec :: ReadPrec [AddApplicationVpcConfigurationResponse]
readPrec :: ReadPrec AddApplicationVpcConfigurationResponse
$creadPrec :: ReadPrec AddApplicationVpcConfigurationResponse
readList :: ReadS [AddApplicationVpcConfigurationResponse]
$creadList :: ReadS [AddApplicationVpcConfigurationResponse]
readsPrec :: Int -> ReadS AddApplicationVpcConfigurationResponse
$creadsPrec :: Int -> ReadS AddApplicationVpcConfigurationResponse
Prelude.Read, Int -> AddApplicationVpcConfigurationResponse -> ShowS
[AddApplicationVpcConfigurationResponse] -> ShowS
AddApplicationVpcConfigurationResponse -> String
(Int -> AddApplicationVpcConfigurationResponse -> ShowS)
-> (AddApplicationVpcConfigurationResponse -> String)
-> ([AddApplicationVpcConfigurationResponse] -> ShowS)
-> Show AddApplicationVpcConfigurationResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [AddApplicationVpcConfigurationResponse] -> ShowS
$cshowList :: [AddApplicationVpcConfigurationResponse] -> ShowS
show :: AddApplicationVpcConfigurationResponse -> String
$cshow :: AddApplicationVpcConfigurationResponse -> String
showsPrec :: Int -> AddApplicationVpcConfigurationResponse -> ShowS
$cshowsPrec :: Int -> AddApplicationVpcConfigurationResponse -> ShowS
Prelude.Show, (forall x.
 AddApplicationVpcConfigurationResponse
 -> Rep AddApplicationVpcConfigurationResponse x)
-> (forall x.
    Rep AddApplicationVpcConfigurationResponse x
    -> AddApplicationVpcConfigurationResponse)
-> Generic AddApplicationVpcConfigurationResponse
forall x.
Rep AddApplicationVpcConfigurationResponse x
-> AddApplicationVpcConfigurationResponse
forall x.
AddApplicationVpcConfigurationResponse
-> Rep AddApplicationVpcConfigurationResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep AddApplicationVpcConfigurationResponse x
-> AddApplicationVpcConfigurationResponse
$cfrom :: forall x.
AddApplicationVpcConfigurationResponse
-> Rep AddApplicationVpcConfigurationResponse x
Prelude.Generic)

-- |
-- Create a value of 'AddApplicationVpcConfigurationResponse' 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', 'addApplicationVpcConfigurationResponse_applicationARN' - The ARN of the application.
--
-- 'applicationVersionId', 'addApplicationVpcConfigurationResponse_applicationVersionId' - Provides the current application version. Kinesis Data Analytics updates
-- the ApplicationVersionId each time you update the application.
--
-- 'vpcConfigurationDescription', 'addApplicationVpcConfigurationResponse_vpcConfigurationDescription' - The parameters of the new VPC configuration.
--
-- 'httpStatus', 'addApplicationVpcConfigurationResponse_httpStatus' - The response's http status code.
newAddApplicationVpcConfigurationResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  AddApplicationVpcConfigurationResponse
newAddApplicationVpcConfigurationResponse :: Int -> AddApplicationVpcConfigurationResponse
newAddApplicationVpcConfigurationResponse
  Int
pHttpStatus_ =
    AddApplicationVpcConfigurationResponse' :: Maybe Text
-> Maybe Natural
-> Maybe VpcConfigurationDescription
-> Int
-> AddApplicationVpcConfigurationResponse
AddApplicationVpcConfigurationResponse'
      { $sel:applicationARN:AddApplicationVpcConfigurationResponse' :: Maybe Text
applicationARN =
          Maybe Text
forall a. Maybe a
Prelude.Nothing,
        $sel:applicationVersionId:AddApplicationVpcConfigurationResponse' :: Maybe Natural
applicationVersionId =
          Maybe Natural
forall a. Maybe a
Prelude.Nothing,
        $sel:vpcConfigurationDescription:AddApplicationVpcConfigurationResponse' :: Maybe VpcConfigurationDescription
vpcConfigurationDescription =
          Maybe VpcConfigurationDescription
forall a. Maybe a
Prelude.Nothing,
        $sel:httpStatus:AddApplicationVpcConfigurationResponse' :: Int
httpStatus = Int
pHttpStatus_
      }

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

-- | Provides the current application version. Kinesis Data Analytics updates
-- the ApplicationVersionId each time you update the application.
addApplicationVpcConfigurationResponse_applicationVersionId :: Lens.Lens' AddApplicationVpcConfigurationResponse (Prelude.Maybe Prelude.Natural)
addApplicationVpcConfigurationResponse_applicationVersionId :: (Maybe Natural -> f (Maybe Natural))
-> AddApplicationVpcConfigurationResponse
-> f AddApplicationVpcConfigurationResponse
addApplicationVpcConfigurationResponse_applicationVersionId = (AddApplicationVpcConfigurationResponse -> Maybe Natural)
-> (AddApplicationVpcConfigurationResponse
    -> Maybe Natural -> AddApplicationVpcConfigurationResponse)
-> Lens
     AddApplicationVpcConfigurationResponse
     AddApplicationVpcConfigurationResponse
     (Maybe Natural)
     (Maybe Natural)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AddApplicationVpcConfigurationResponse' {Maybe Natural
applicationVersionId :: Maybe Natural
$sel:applicationVersionId:AddApplicationVpcConfigurationResponse' :: AddApplicationVpcConfigurationResponse -> Maybe Natural
applicationVersionId} -> Maybe Natural
applicationVersionId) (\s :: AddApplicationVpcConfigurationResponse
s@AddApplicationVpcConfigurationResponse' {} Maybe Natural
a -> AddApplicationVpcConfigurationResponse
s {$sel:applicationVersionId:AddApplicationVpcConfigurationResponse' :: Maybe Natural
applicationVersionId = Maybe Natural
a} :: AddApplicationVpcConfigurationResponse)

-- | The parameters of the new VPC configuration.
addApplicationVpcConfigurationResponse_vpcConfigurationDescription :: Lens.Lens' AddApplicationVpcConfigurationResponse (Prelude.Maybe VpcConfigurationDescription)
addApplicationVpcConfigurationResponse_vpcConfigurationDescription :: (Maybe VpcConfigurationDescription
 -> f (Maybe VpcConfigurationDescription))
-> AddApplicationVpcConfigurationResponse
-> f AddApplicationVpcConfigurationResponse
addApplicationVpcConfigurationResponse_vpcConfigurationDescription = (AddApplicationVpcConfigurationResponse
 -> Maybe VpcConfigurationDescription)
-> (AddApplicationVpcConfigurationResponse
    -> Maybe VpcConfigurationDescription
    -> AddApplicationVpcConfigurationResponse)
-> Lens
     AddApplicationVpcConfigurationResponse
     AddApplicationVpcConfigurationResponse
     (Maybe VpcConfigurationDescription)
     (Maybe VpcConfigurationDescription)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AddApplicationVpcConfigurationResponse' {Maybe VpcConfigurationDescription
vpcConfigurationDescription :: Maybe VpcConfigurationDescription
$sel:vpcConfigurationDescription:AddApplicationVpcConfigurationResponse' :: AddApplicationVpcConfigurationResponse
-> Maybe VpcConfigurationDescription
vpcConfigurationDescription} -> Maybe VpcConfigurationDescription
vpcConfigurationDescription) (\s :: AddApplicationVpcConfigurationResponse
s@AddApplicationVpcConfigurationResponse' {} Maybe VpcConfigurationDescription
a -> AddApplicationVpcConfigurationResponse
s {$sel:vpcConfigurationDescription:AddApplicationVpcConfigurationResponse' :: Maybe VpcConfigurationDescription
vpcConfigurationDescription = Maybe VpcConfigurationDescription
a} :: AddApplicationVpcConfigurationResponse)

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

instance
  Prelude.NFData
    AddApplicationVpcConfigurationResponse