{-# 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 #-}
module Amazonka.KinesisAnalytics.AddApplicationReferenceDataSource
(
AddApplicationReferenceDataSource (..),
newAddApplicationReferenceDataSource,
addApplicationReferenceDataSource_applicationName,
addApplicationReferenceDataSource_currentApplicationVersionId,
addApplicationReferenceDataSource_referenceDataSource,
AddApplicationReferenceDataSourceResponse (..),
newAddApplicationReferenceDataSourceResponse,
addApplicationReferenceDataSourceResponse_httpStatus,
)
where
import qualified Amazonka.Core as Core
import Amazonka.KinesisAnalytics.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
data AddApplicationReferenceDataSource = AddApplicationReferenceDataSource'
{
AddApplicationReferenceDataSource -> Text
applicationName :: Prelude.Text,
AddApplicationReferenceDataSource -> Natural
currentApplicationVersionId :: Prelude.Natural,
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)
newAddApplicationReferenceDataSource ::
Prelude.Text ->
Prelude.Natural ->
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_
}
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)
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)
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
-> ()
-> Either String (AWSResponse AddApplicationReferenceDataSource))
-> Logger
-> Service
-> Proxy AddApplicationReferenceDataSource
-> ClientResponse ClientBody
-> m (Either
Error
(ClientResponse (AWSResponse AddApplicationReferenceDataSource)))
forall (m :: * -> *) a.
MonadResource m =>
(Int -> ResponseHeaders -> () -> Either String (AWSResponse a))
-> Logger
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveEmpty
( \Int
s ResponseHeaders
h ()
x ->
Int -> AddApplicationReferenceDataSourceResponse
AddApplicationReferenceDataSourceResponse'
(Int -> AddApplicationReferenceDataSourceResponse)
-> Either String Int
-> Either String AddApplicationReferenceDataSourceResponse
forall (f :: * -> *) a b. Functor 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_20150814.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
data AddApplicationReferenceDataSourceResponse = AddApplicationReferenceDataSourceResponse'
{
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)
newAddApplicationReferenceDataSourceResponse ::
Prelude.Int ->
AddApplicationReferenceDataSourceResponse
newAddApplicationReferenceDataSourceResponse :: Int -> AddApplicationReferenceDataSourceResponse
newAddApplicationReferenceDataSourceResponse
Int
pHttpStatus_ =
AddApplicationReferenceDataSourceResponse' :: Int -> AddApplicationReferenceDataSourceResponse
AddApplicationReferenceDataSourceResponse'
{ $sel:httpStatus:AddApplicationReferenceDataSourceResponse' :: Int
httpStatus =
Int
pHttpStatus_
}
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