{-# 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.AppSync.UpdateDataSource
(
UpdateDataSource (..),
newUpdateDataSource,
updateDataSource_serviceRoleArn,
updateDataSource_relationalDatabaseConfig,
updateDataSource_dynamodbConfig,
updateDataSource_httpConfig,
updateDataSource_openSearchServiceConfig,
updateDataSource_lambdaConfig,
updateDataSource_description,
updateDataSource_elasticsearchConfig,
updateDataSource_apiId,
updateDataSource_name,
updateDataSource_type,
UpdateDataSourceResponse (..),
newUpdateDataSourceResponse,
updateDataSourceResponse_dataSource,
updateDataSourceResponse_httpStatus,
)
where
import Amazonka.AppSync.Types
import qualified Amazonka.Core as Core
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 UpdateDataSource = UpdateDataSource'
{
UpdateDataSource -> Maybe Text
serviceRoleArn :: Prelude.Maybe Prelude.Text,
UpdateDataSource -> Maybe RelationalDatabaseDataSourceConfig
relationalDatabaseConfig :: Prelude.Maybe RelationalDatabaseDataSourceConfig,
UpdateDataSource -> Maybe DynamodbDataSourceConfig
dynamodbConfig :: Prelude.Maybe DynamodbDataSourceConfig,
UpdateDataSource -> Maybe HttpDataSourceConfig
httpConfig :: Prelude.Maybe HttpDataSourceConfig,
UpdateDataSource -> Maybe OpenSearchServiceDataSourceConfig
openSearchServiceConfig :: Prelude.Maybe OpenSearchServiceDataSourceConfig,
UpdateDataSource -> Maybe LambdaDataSourceConfig
lambdaConfig :: Prelude.Maybe LambdaDataSourceConfig,
UpdateDataSource -> Maybe Text
description :: Prelude.Maybe Prelude.Text,
UpdateDataSource -> Maybe ElasticsearchDataSourceConfig
elasticsearchConfig :: Prelude.Maybe ElasticsearchDataSourceConfig,
UpdateDataSource -> Text
apiId :: Prelude.Text,
UpdateDataSource -> Text
name :: Prelude.Text,
UpdateDataSource -> DataSourceType
type' :: DataSourceType
}
deriving (UpdateDataSource -> UpdateDataSource -> Bool
(UpdateDataSource -> UpdateDataSource -> Bool)
-> (UpdateDataSource -> UpdateDataSource -> Bool)
-> Eq UpdateDataSource
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: UpdateDataSource -> UpdateDataSource -> Bool
$c/= :: UpdateDataSource -> UpdateDataSource -> Bool
== :: UpdateDataSource -> UpdateDataSource -> Bool
$c== :: UpdateDataSource -> UpdateDataSource -> Bool
Prelude.Eq, ReadPrec [UpdateDataSource]
ReadPrec UpdateDataSource
Int -> ReadS UpdateDataSource
ReadS [UpdateDataSource]
(Int -> ReadS UpdateDataSource)
-> ReadS [UpdateDataSource]
-> ReadPrec UpdateDataSource
-> ReadPrec [UpdateDataSource]
-> Read UpdateDataSource
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [UpdateDataSource]
$creadListPrec :: ReadPrec [UpdateDataSource]
readPrec :: ReadPrec UpdateDataSource
$creadPrec :: ReadPrec UpdateDataSource
readList :: ReadS [UpdateDataSource]
$creadList :: ReadS [UpdateDataSource]
readsPrec :: Int -> ReadS UpdateDataSource
$creadsPrec :: Int -> ReadS UpdateDataSource
Prelude.Read, Int -> UpdateDataSource -> ShowS
[UpdateDataSource] -> ShowS
UpdateDataSource -> String
(Int -> UpdateDataSource -> ShowS)
-> (UpdateDataSource -> String)
-> ([UpdateDataSource] -> ShowS)
-> Show UpdateDataSource
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [UpdateDataSource] -> ShowS
$cshowList :: [UpdateDataSource] -> ShowS
show :: UpdateDataSource -> String
$cshow :: UpdateDataSource -> String
showsPrec :: Int -> UpdateDataSource -> ShowS
$cshowsPrec :: Int -> UpdateDataSource -> ShowS
Prelude.Show, (forall x. UpdateDataSource -> Rep UpdateDataSource x)
-> (forall x. Rep UpdateDataSource x -> UpdateDataSource)
-> Generic UpdateDataSource
forall x. Rep UpdateDataSource x -> UpdateDataSource
forall x. UpdateDataSource -> Rep UpdateDataSource x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep UpdateDataSource x -> UpdateDataSource
$cfrom :: forall x. UpdateDataSource -> Rep UpdateDataSource x
Prelude.Generic)
newUpdateDataSource ::
Prelude.Text ->
Prelude.Text ->
DataSourceType ->
UpdateDataSource
newUpdateDataSource :: Text -> Text -> DataSourceType -> UpdateDataSource
newUpdateDataSource Text
pApiId_ Text
pName_ DataSourceType
pType_ =
UpdateDataSource' :: Maybe Text
-> Maybe RelationalDatabaseDataSourceConfig
-> Maybe DynamodbDataSourceConfig
-> Maybe HttpDataSourceConfig
-> Maybe OpenSearchServiceDataSourceConfig
-> Maybe LambdaDataSourceConfig
-> Maybe Text
-> Maybe ElasticsearchDataSourceConfig
-> Text
-> Text
-> DataSourceType
-> UpdateDataSource
UpdateDataSource'
{ $sel:serviceRoleArn:UpdateDataSource' :: Maybe Text
serviceRoleArn = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:relationalDatabaseConfig:UpdateDataSource' :: Maybe RelationalDatabaseDataSourceConfig
relationalDatabaseConfig = Maybe RelationalDatabaseDataSourceConfig
forall a. Maybe a
Prelude.Nothing,
$sel:dynamodbConfig:UpdateDataSource' :: Maybe DynamodbDataSourceConfig
dynamodbConfig = Maybe DynamodbDataSourceConfig
forall a. Maybe a
Prelude.Nothing,
$sel:httpConfig:UpdateDataSource' :: Maybe HttpDataSourceConfig
httpConfig = Maybe HttpDataSourceConfig
forall a. Maybe a
Prelude.Nothing,
$sel:openSearchServiceConfig:UpdateDataSource' :: Maybe OpenSearchServiceDataSourceConfig
openSearchServiceConfig = Maybe OpenSearchServiceDataSourceConfig
forall a. Maybe a
Prelude.Nothing,
$sel:lambdaConfig:UpdateDataSource' :: Maybe LambdaDataSourceConfig
lambdaConfig = Maybe LambdaDataSourceConfig
forall a. Maybe a
Prelude.Nothing,
$sel:description:UpdateDataSource' :: Maybe Text
description = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:elasticsearchConfig:UpdateDataSource' :: Maybe ElasticsearchDataSourceConfig
elasticsearchConfig = Maybe ElasticsearchDataSourceConfig
forall a. Maybe a
Prelude.Nothing,
$sel:apiId:UpdateDataSource' :: Text
apiId = Text
pApiId_,
$sel:name:UpdateDataSource' :: Text
name = Text
pName_,
$sel:type':UpdateDataSource' :: DataSourceType
type' = DataSourceType
pType_
}
updateDataSource_serviceRoleArn :: Lens.Lens' UpdateDataSource (Prelude.Maybe Prelude.Text)
updateDataSource_serviceRoleArn :: (Maybe Text -> f (Maybe Text))
-> UpdateDataSource -> f UpdateDataSource
updateDataSource_serviceRoleArn = (UpdateDataSource -> Maybe Text)
-> (UpdateDataSource -> Maybe Text -> UpdateDataSource)
-> Lens UpdateDataSource UpdateDataSource (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateDataSource' {Maybe Text
serviceRoleArn :: Maybe Text
$sel:serviceRoleArn:UpdateDataSource' :: UpdateDataSource -> Maybe Text
serviceRoleArn} -> Maybe Text
serviceRoleArn) (\s :: UpdateDataSource
s@UpdateDataSource' {} Maybe Text
a -> UpdateDataSource
s {$sel:serviceRoleArn:UpdateDataSource' :: Maybe Text
serviceRoleArn = Maybe Text
a} :: UpdateDataSource)
updateDataSource_relationalDatabaseConfig :: Lens.Lens' UpdateDataSource (Prelude.Maybe RelationalDatabaseDataSourceConfig)
updateDataSource_relationalDatabaseConfig :: (Maybe RelationalDatabaseDataSourceConfig
-> f (Maybe RelationalDatabaseDataSourceConfig))
-> UpdateDataSource -> f UpdateDataSource
updateDataSource_relationalDatabaseConfig = (UpdateDataSource -> Maybe RelationalDatabaseDataSourceConfig)
-> (UpdateDataSource
-> Maybe RelationalDatabaseDataSourceConfig -> UpdateDataSource)
-> Lens
UpdateDataSource
UpdateDataSource
(Maybe RelationalDatabaseDataSourceConfig)
(Maybe RelationalDatabaseDataSourceConfig)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateDataSource' {Maybe RelationalDatabaseDataSourceConfig
relationalDatabaseConfig :: Maybe RelationalDatabaseDataSourceConfig
$sel:relationalDatabaseConfig:UpdateDataSource' :: UpdateDataSource -> Maybe RelationalDatabaseDataSourceConfig
relationalDatabaseConfig} -> Maybe RelationalDatabaseDataSourceConfig
relationalDatabaseConfig) (\s :: UpdateDataSource
s@UpdateDataSource' {} Maybe RelationalDatabaseDataSourceConfig
a -> UpdateDataSource
s {$sel:relationalDatabaseConfig:UpdateDataSource' :: Maybe RelationalDatabaseDataSourceConfig
relationalDatabaseConfig = Maybe RelationalDatabaseDataSourceConfig
a} :: UpdateDataSource)
updateDataSource_dynamodbConfig :: Lens.Lens' UpdateDataSource (Prelude.Maybe DynamodbDataSourceConfig)
updateDataSource_dynamodbConfig :: (Maybe DynamodbDataSourceConfig
-> f (Maybe DynamodbDataSourceConfig))
-> UpdateDataSource -> f UpdateDataSource
updateDataSource_dynamodbConfig = (UpdateDataSource -> Maybe DynamodbDataSourceConfig)
-> (UpdateDataSource
-> Maybe DynamodbDataSourceConfig -> UpdateDataSource)
-> Lens
UpdateDataSource
UpdateDataSource
(Maybe DynamodbDataSourceConfig)
(Maybe DynamodbDataSourceConfig)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateDataSource' {Maybe DynamodbDataSourceConfig
dynamodbConfig :: Maybe DynamodbDataSourceConfig
$sel:dynamodbConfig:UpdateDataSource' :: UpdateDataSource -> Maybe DynamodbDataSourceConfig
dynamodbConfig} -> Maybe DynamodbDataSourceConfig
dynamodbConfig) (\s :: UpdateDataSource
s@UpdateDataSource' {} Maybe DynamodbDataSourceConfig
a -> UpdateDataSource
s {$sel:dynamodbConfig:UpdateDataSource' :: Maybe DynamodbDataSourceConfig
dynamodbConfig = Maybe DynamodbDataSourceConfig
a} :: UpdateDataSource)
updateDataSource_httpConfig :: Lens.Lens' UpdateDataSource (Prelude.Maybe HttpDataSourceConfig)
updateDataSource_httpConfig :: (Maybe HttpDataSourceConfig -> f (Maybe HttpDataSourceConfig))
-> UpdateDataSource -> f UpdateDataSource
updateDataSource_httpConfig = (UpdateDataSource -> Maybe HttpDataSourceConfig)
-> (UpdateDataSource
-> Maybe HttpDataSourceConfig -> UpdateDataSource)
-> Lens
UpdateDataSource
UpdateDataSource
(Maybe HttpDataSourceConfig)
(Maybe HttpDataSourceConfig)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateDataSource' {Maybe HttpDataSourceConfig
httpConfig :: Maybe HttpDataSourceConfig
$sel:httpConfig:UpdateDataSource' :: UpdateDataSource -> Maybe HttpDataSourceConfig
httpConfig} -> Maybe HttpDataSourceConfig
httpConfig) (\s :: UpdateDataSource
s@UpdateDataSource' {} Maybe HttpDataSourceConfig
a -> UpdateDataSource
s {$sel:httpConfig:UpdateDataSource' :: Maybe HttpDataSourceConfig
httpConfig = Maybe HttpDataSourceConfig
a} :: UpdateDataSource)
updateDataSource_openSearchServiceConfig :: Lens.Lens' UpdateDataSource (Prelude.Maybe OpenSearchServiceDataSourceConfig)
updateDataSource_openSearchServiceConfig :: (Maybe OpenSearchServiceDataSourceConfig
-> f (Maybe OpenSearchServiceDataSourceConfig))
-> UpdateDataSource -> f UpdateDataSource
updateDataSource_openSearchServiceConfig = (UpdateDataSource -> Maybe OpenSearchServiceDataSourceConfig)
-> (UpdateDataSource
-> Maybe OpenSearchServiceDataSourceConfig -> UpdateDataSource)
-> Lens
UpdateDataSource
UpdateDataSource
(Maybe OpenSearchServiceDataSourceConfig)
(Maybe OpenSearchServiceDataSourceConfig)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateDataSource' {Maybe OpenSearchServiceDataSourceConfig
openSearchServiceConfig :: Maybe OpenSearchServiceDataSourceConfig
$sel:openSearchServiceConfig:UpdateDataSource' :: UpdateDataSource -> Maybe OpenSearchServiceDataSourceConfig
openSearchServiceConfig} -> Maybe OpenSearchServiceDataSourceConfig
openSearchServiceConfig) (\s :: UpdateDataSource
s@UpdateDataSource' {} Maybe OpenSearchServiceDataSourceConfig
a -> UpdateDataSource
s {$sel:openSearchServiceConfig:UpdateDataSource' :: Maybe OpenSearchServiceDataSourceConfig
openSearchServiceConfig = Maybe OpenSearchServiceDataSourceConfig
a} :: UpdateDataSource)
updateDataSource_lambdaConfig :: Lens.Lens' UpdateDataSource (Prelude.Maybe LambdaDataSourceConfig)
updateDataSource_lambdaConfig :: (Maybe LambdaDataSourceConfig -> f (Maybe LambdaDataSourceConfig))
-> UpdateDataSource -> f UpdateDataSource
updateDataSource_lambdaConfig = (UpdateDataSource -> Maybe LambdaDataSourceConfig)
-> (UpdateDataSource
-> Maybe LambdaDataSourceConfig -> UpdateDataSource)
-> Lens
UpdateDataSource
UpdateDataSource
(Maybe LambdaDataSourceConfig)
(Maybe LambdaDataSourceConfig)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateDataSource' {Maybe LambdaDataSourceConfig
lambdaConfig :: Maybe LambdaDataSourceConfig
$sel:lambdaConfig:UpdateDataSource' :: UpdateDataSource -> Maybe LambdaDataSourceConfig
lambdaConfig} -> Maybe LambdaDataSourceConfig
lambdaConfig) (\s :: UpdateDataSource
s@UpdateDataSource' {} Maybe LambdaDataSourceConfig
a -> UpdateDataSource
s {$sel:lambdaConfig:UpdateDataSource' :: Maybe LambdaDataSourceConfig
lambdaConfig = Maybe LambdaDataSourceConfig
a} :: UpdateDataSource)
updateDataSource_description :: Lens.Lens' UpdateDataSource (Prelude.Maybe Prelude.Text)
updateDataSource_description :: (Maybe Text -> f (Maybe Text))
-> UpdateDataSource -> f UpdateDataSource
updateDataSource_description = (UpdateDataSource -> Maybe Text)
-> (UpdateDataSource -> Maybe Text -> UpdateDataSource)
-> Lens UpdateDataSource UpdateDataSource (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateDataSource' {Maybe Text
description :: Maybe Text
$sel:description:UpdateDataSource' :: UpdateDataSource -> Maybe Text
description} -> Maybe Text
description) (\s :: UpdateDataSource
s@UpdateDataSource' {} Maybe Text
a -> UpdateDataSource
s {$sel:description:UpdateDataSource' :: Maybe Text
description = Maybe Text
a} :: UpdateDataSource)
updateDataSource_elasticsearchConfig :: Lens.Lens' UpdateDataSource (Prelude.Maybe ElasticsearchDataSourceConfig)
updateDataSource_elasticsearchConfig :: (Maybe ElasticsearchDataSourceConfig
-> f (Maybe ElasticsearchDataSourceConfig))
-> UpdateDataSource -> f UpdateDataSource
updateDataSource_elasticsearchConfig = (UpdateDataSource -> Maybe ElasticsearchDataSourceConfig)
-> (UpdateDataSource
-> Maybe ElasticsearchDataSourceConfig -> UpdateDataSource)
-> Lens
UpdateDataSource
UpdateDataSource
(Maybe ElasticsearchDataSourceConfig)
(Maybe ElasticsearchDataSourceConfig)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateDataSource' {Maybe ElasticsearchDataSourceConfig
elasticsearchConfig :: Maybe ElasticsearchDataSourceConfig
$sel:elasticsearchConfig:UpdateDataSource' :: UpdateDataSource -> Maybe ElasticsearchDataSourceConfig
elasticsearchConfig} -> Maybe ElasticsearchDataSourceConfig
elasticsearchConfig) (\s :: UpdateDataSource
s@UpdateDataSource' {} Maybe ElasticsearchDataSourceConfig
a -> UpdateDataSource
s {$sel:elasticsearchConfig:UpdateDataSource' :: Maybe ElasticsearchDataSourceConfig
elasticsearchConfig = Maybe ElasticsearchDataSourceConfig
a} :: UpdateDataSource)
updateDataSource_apiId :: Lens.Lens' UpdateDataSource Prelude.Text
updateDataSource_apiId :: (Text -> f Text) -> UpdateDataSource -> f UpdateDataSource
updateDataSource_apiId = (UpdateDataSource -> Text)
-> (UpdateDataSource -> Text -> UpdateDataSource)
-> Lens UpdateDataSource UpdateDataSource Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateDataSource' {Text
apiId :: Text
$sel:apiId:UpdateDataSource' :: UpdateDataSource -> Text
apiId} -> Text
apiId) (\s :: UpdateDataSource
s@UpdateDataSource' {} Text
a -> UpdateDataSource
s {$sel:apiId:UpdateDataSource' :: Text
apiId = Text
a} :: UpdateDataSource)
updateDataSource_name :: Lens.Lens' UpdateDataSource Prelude.Text
updateDataSource_name :: (Text -> f Text) -> UpdateDataSource -> f UpdateDataSource
updateDataSource_name = (UpdateDataSource -> Text)
-> (UpdateDataSource -> Text -> UpdateDataSource)
-> Lens UpdateDataSource UpdateDataSource Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateDataSource' {Text
name :: Text
$sel:name:UpdateDataSource' :: UpdateDataSource -> Text
name} -> Text
name) (\s :: UpdateDataSource
s@UpdateDataSource' {} Text
a -> UpdateDataSource
s {$sel:name:UpdateDataSource' :: Text
name = Text
a} :: UpdateDataSource)
updateDataSource_type :: Lens.Lens' UpdateDataSource DataSourceType
updateDataSource_type :: (DataSourceType -> f DataSourceType)
-> UpdateDataSource -> f UpdateDataSource
updateDataSource_type = (UpdateDataSource -> DataSourceType)
-> (UpdateDataSource -> DataSourceType -> UpdateDataSource)
-> Lens
UpdateDataSource UpdateDataSource DataSourceType DataSourceType
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateDataSource' {DataSourceType
type' :: DataSourceType
$sel:type':UpdateDataSource' :: UpdateDataSource -> DataSourceType
type'} -> DataSourceType
type') (\s :: UpdateDataSource
s@UpdateDataSource' {} DataSourceType
a -> UpdateDataSource
s {$sel:type':UpdateDataSource' :: DataSourceType
type' = DataSourceType
a} :: UpdateDataSource)
instance Core.AWSRequest UpdateDataSource where
type
AWSResponse UpdateDataSource =
UpdateDataSourceResponse
request :: UpdateDataSource -> Request UpdateDataSource
request = Service -> UpdateDataSource -> Request UpdateDataSource
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON Service
defaultService
response :: Logger
-> Service
-> Proxy UpdateDataSource
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse UpdateDataSource)))
response =
(Int
-> ResponseHeaders
-> Object
-> Either String (AWSResponse UpdateDataSource))
-> Logger
-> Service
-> Proxy UpdateDataSource
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse UpdateDataSource)))
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 DataSource -> Int -> UpdateDataSourceResponse
UpdateDataSourceResponse'
(Maybe DataSource -> Int -> UpdateDataSourceResponse)
-> Either String (Maybe DataSource)
-> Either String (Int -> UpdateDataSourceResponse)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Either String (Maybe DataSource)
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"dataSource")
Either String (Int -> UpdateDataSourceResponse)
-> Either String Int -> Either String UpdateDataSourceResponse
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 UpdateDataSource
instance Prelude.NFData UpdateDataSource
instance Core.ToHeaders UpdateDataSource where
toHeaders :: UpdateDataSource -> ResponseHeaders
toHeaders =
ResponseHeaders -> UpdateDataSource -> ResponseHeaders
forall a b. a -> b -> a
Prelude.const
( [ResponseHeaders] -> ResponseHeaders
forall a. Monoid a => [a] -> a
Prelude.mconcat
[ HeaderName
"Content-Type"
HeaderName -> ByteString -> ResponseHeaders
forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Core.=# ( ByteString
"application/x-amz-json-1.1" ::
Prelude.ByteString
)
]
)
instance Core.ToJSON UpdateDataSource where
toJSON :: UpdateDataSource -> Value
toJSON UpdateDataSource' {Maybe Text
Maybe DynamodbDataSourceConfig
Maybe ElasticsearchDataSourceConfig
Maybe HttpDataSourceConfig
Maybe LambdaDataSourceConfig
Maybe OpenSearchServiceDataSourceConfig
Maybe RelationalDatabaseDataSourceConfig
Text
DataSourceType
type' :: DataSourceType
name :: Text
apiId :: Text
elasticsearchConfig :: Maybe ElasticsearchDataSourceConfig
description :: Maybe Text
lambdaConfig :: Maybe LambdaDataSourceConfig
openSearchServiceConfig :: Maybe OpenSearchServiceDataSourceConfig
httpConfig :: Maybe HttpDataSourceConfig
dynamodbConfig :: Maybe DynamodbDataSourceConfig
relationalDatabaseConfig :: Maybe RelationalDatabaseDataSourceConfig
serviceRoleArn :: Maybe Text
$sel:type':UpdateDataSource' :: UpdateDataSource -> DataSourceType
$sel:name:UpdateDataSource' :: UpdateDataSource -> Text
$sel:apiId:UpdateDataSource' :: UpdateDataSource -> Text
$sel:elasticsearchConfig:UpdateDataSource' :: UpdateDataSource -> Maybe ElasticsearchDataSourceConfig
$sel:description:UpdateDataSource' :: UpdateDataSource -> Maybe Text
$sel:lambdaConfig:UpdateDataSource' :: UpdateDataSource -> Maybe LambdaDataSourceConfig
$sel:openSearchServiceConfig:UpdateDataSource' :: UpdateDataSource -> Maybe OpenSearchServiceDataSourceConfig
$sel:httpConfig:UpdateDataSource' :: UpdateDataSource -> Maybe HttpDataSourceConfig
$sel:dynamodbConfig:UpdateDataSource' :: UpdateDataSource -> Maybe DynamodbDataSourceConfig
$sel:relationalDatabaseConfig:UpdateDataSource' :: UpdateDataSource -> Maybe RelationalDatabaseDataSourceConfig
$sel:serviceRoleArn:UpdateDataSource' :: UpdateDataSource -> Maybe Text
..} =
[Pair] -> Value
Core.object
( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ (Text
"serviceRoleArn" 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
serviceRoleArn,
(Text
"relationalDatabaseConfig" Text -> RelationalDatabaseDataSourceConfig -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
(RelationalDatabaseDataSourceConfig -> Pair)
-> Maybe RelationalDatabaseDataSourceConfig -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe RelationalDatabaseDataSourceConfig
relationalDatabaseConfig,
(Text
"dynamodbConfig" Text -> DynamodbDataSourceConfig -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
(DynamodbDataSourceConfig -> Pair)
-> Maybe DynamodbDataSourceConfig -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe DynamodbDataSourceConfig
dynamodbConfig,
(Text
"httpConfig" Text -> HttpDataSourceConfig -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (HttpDataSourceConfig -> Pair)
-> Maybe HttpDataSourceConfig -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe HttpDataSourceConfig
httpConfig,
(Text
"openSearchServiceConfig" Text -> OpenSearchServiceDataSourceConfig -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
(OpenSearchServiceDataSourceConfig -> Pair)
-> Maybe OpenSearchServiceDataSourceConfig -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe OpenSearchServiceDataSourceConfig
openSearchServiceConfig,
(Text
"lambdaConfig" Text -> LambdaDataSourceConfig -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (LambdaDataSourceConfig -> Pair)
-> Maybe LambdaDataSourceConfig -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe LambdaDataSourceConfig
lambdaConfig,
(Text
"description" 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
description,
(Text
"elasticsearchConfig" Text -> ElasticsearchDataSourceConfig -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
(ElasticsearchDataSourceConfig -> Pair)
-> Maybe ElasticsearchDataSourceConfig -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe ElasticsearchDataSourceConfig
elasticsearchConfig,
Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"type" Text -> DataSourceType -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= DataSourceType
type')
]
)
instance Core.ToPath UpdateDataSource where
toPath :: UpdateDataSource -> ByteString
toPath UpdateDataSource' {Maybe Text
Maybe DynamodbDataSourceConfig
Maybe ElasticsearchDataSourceConfig
Maybe HttpDataSourceConfig
Maybe LambdaDataSourceConfig
Maybe OpenSearchServiceDataSourceConfig
Maybe RelationalDatabaseDataSourceConfig
Text
DataSourceType
type' :: DataSourceType
name :: Text
apiId :: Text
elasticsearchConfig :: Maybe ElasticsearchDataSourceConfig
description :: Maybe Text
lambdaConfig :: Maybe LambdaDataSourceConfig
openSearchServiceConfig :: Maybe OpenSearchServiceDataSourceConfig
httpConfig :: Maybe HttpDataSourceConfig
dynamodbConfig :: Maybe DynamodbDataSourceConfig
relationalDatabaseConfig :: Maybe RelationalDatabaseDataSourceConfig
serviceRoleArn :: Maybe Text
$sel:type':UpdateDataSource' :: UpdateDataSource -> DataSourceType
$sel:name:UpdateDataSource' :: UpdateDataSource -> Text
$sel:apiId:UpdateDataSource' :: UpdateDataSource -> Text
$sel:elasticsearchConfig:UpdateDataSource' :: UpdateDataSource -> Maybe ElasticsearchDataSourceConfig
$sel:description:UpdateDataSource' :: UpdateDataSource -> Maybe Text
$sel:lambdaConfig:UpdateDataSource' :: UpdateDataSource -> Maybe LambdaDataSourceConfig
$sel:openSearchServiceConfig:UpdateDataSource' :: UpdateDataSource -> Maybe OpenSearchServiceDataSourceConfig
$sel:httpConfig:UpdateDataSource' :: UpdateDataSource -> Maybe HttpDataSourceConfig
$sel:dynamodbConfig:UpdateDataSource' :: UpdateDataSource -> Maybe DynamodbDataSourceConfig
$sel:relationalDatabaseConfig:UpdateDataSource' :: UpdateDataSource -> Maybe RelationalDatabaseDataSourceConfig
$sel:serviceRoleArn:UpdateDataSource' :: UpdateDataSource -> Maybe Text
..} =
[ByteString] -> ByteString
forall a. Monoid a => [a] -> a
Prelude.mconcat
[ ByteString
"/v1/apis/",
Text -> ByteString
forall a. ToByteString a => a -> ByteString
Core.toBS Text
apiId,
ByteString
"/datasources/",
Text -> ByteString
forall a. ToByteString a => a -> ByteString
Core.toBS Text
name
]
instance Core.ToQuery UpdateDataSource where
toQuery :: UpdateDataSource -> QueryString
toQuery = QueryString -> UpdateDataSource -> QueryString
forall a b. a -> b -> a
Prelude.const QueryString
forall a. Monoid a => a
Prelude.mempty
data UpdateDataSourceResponse = UpdateDataSourceResponse'
{
UpdateDataSourceResponse -> Maybe DataSource
dataSource :: Prelude.Maybe DataSource,
UpdateDataSourceResponse -> Int
httpStatus :: Prelude.Int
}
deriving (UpdateDataSourceResponse -> UpdateDataSourceResponse -> Bool
(UpdateDataSourceResponse -> UpdateDataSourceResponse -> Bool)
-> (UpdateDataSourceResponse -> UpdateDataSourceResponse -> Bool)
-> Eq UpdateDataSourceResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: UpdateDataSourceResponse -> UpdateDataSourceResponse -> Bool
$c/= :: UpdateDataSourceResponse -> UpdateDataSourceResponse -> Bool
== :: UpdateDataSourceResponse -> UpdateDataSourceResponse -> Bool
$c== :: UpdateDataSourceResponse -> UpdateDataSourceResponse -> Bool
Prelude.Eq, ReadPrec [UpdateDataSourceResponse]
ReadPrec UpdateDataSourceResponse
Int -> ReadS UpdateDataSourceResponse
ReadS [UpdateDataSourceResponse]
(Int -> ReadS UpdateDataSourceResponse)
-> ReadS [UpdateDataSourceResponse]
-> ReadPrec UpdateDataSourceResponse
-> ReadPrec [UpdateDataSourceResponse]
-> Read UpdateDataSourceResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [UpdateDataSourceResponse]
$creadListPrec :: ReadPrec [UpdateDataSourceResponse]
readPrec :: ReadPrec UpdateDataSourceResponse
$creadPrec :: ReadPrec UpdateDataSourceResponse
readList :: ReadS [UpdateDataSourceResponse]
$creadList :: ReadS [UpdateDataSourceResponse]
readsPrec :: Int -> ReadS UpdateDataSourceResponse
$creadsPrec :: Int -> ReadS UpdateDataSourceResponse
Prelude.Read, Int -> UpdateDataSourceResponse -> ShowS
[UpdateDataSourceResponse] -> ShowS
UpdateDataSourceResponse -> String
(Int -> UpdateDataSourceResponse -> ShowS)
-> (UpdateDataSourceResponse -> String)
-> ([UpdateDataSourceResponse] -> ShowS)
-> Show UpdateDataSourceResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [UpdateDataSourceResponse] -> ShowS
$cshowList :: [UpdateDataSourceResponse] -> ShowS
show :: UpdateDataSourceResponse -> String
$cshow :: UpdateDataSourceResponse -> String
showsPrec :: Int -> UpdateDataSourceResponse -> ShowS
$cshowsPrec :: Int -> UpdateDataSourceResponse -> ShowS
Prelude.Show, (forall x.
UpdateDataSourceResponse -> Rep UpdateDataSourceResponse x)
-> (forall x.
Rep UpdateDataSourceResponse x -> UpdateDataSourceResponse)
-> Generic UpdateDataSourceResponse
forall x.
Rep UpdateDataSourceResponse x -> UpdateDataSourceResponse
forall x.
UpdateDataSourceResponse -> Rep UpdateDataSourceResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep UpdateDataSourceResponse x -> UpdateDataSourceResponse
$cfrom :: forall x.
UpdateDataSourceResponse -> Rep UpdateDataSourceResponse x
Prelude.Generic)
newUpdateDataSourceResponse ::
Prelude.Int ->
UpdateDataSourceResponse
newUpdateDataSourceResponse :: Int -> UpdateDataSourceResponse
newUpdateDataSourceResponse Int
pHttpStatus_ =
UpdateDataSourceResponse' :: Maybe DataSource -> Int -> UpdateDataSourceResponse
UpdateDataSourceResponse'
{ $sel:dataSource:UpdateDataSourceResponse' :: Maybe DataSource
dataSource =
Maybe DataSource
forall a. Maybe a
Prelude.Nothing,
$sel:httpStatus:UpdateDataSourceResponse' :: Int
httpStatus = Int
pHttpStatus_
}
updateDataSourceResponse_dataSource :: Lens.Lens' UpdateDataSourceResponse (Prelude.Maybe DataSource)
updateDataSourceResponse_dataSource :: (Maybe DataSource -> f (Maybe DataSource))
-> UpdateDataSourceResponse -> f UpdateDataSourceResponse
updateDataSourceResponse_dataSource = (UpdateDataSourceResponse -> Maybe DataSource)
-> (UpdateDataSourceResponse
-> Maybe DataSource -> UpdateDataSourceResponse)
-> Lens
UpdateDataSourceResponse
UpdateDataSourceResponse
(Maybe DataSource)
(Maybe DataSource)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateDataSourceResponse' {Maybe DataSource
dataSource :: Maybe DataSource
$sel:dataSource:UpdateDataSourceResponse' :: UpdateDataSourceResponse -> Maybe DataSource
dataSource} -> Maybe DataSource
dataSource) (\s :: UpdateDataSourceResponse
s@UpdateDataSourceResponse' {} Maybe DataSource
a -> UpdateDataSourceResponse
s {$sel:dataSource:UpdateDataSourceResponse' :: Maybe DataSource
dataSource = Maybe DataSource
a} :: UpdateDataSourceResponse)
updateDataSourceResponse_httpStatus :: Lens.Lens' UpdateDataSourceResponse Prelude.Int
updateDataSourceResponse_httpStatus :: (Int -> f Int)
-> UpdateDataSourceResponse -> f UpdateDataSourceResponse
updateDataSourceResponse_httpStatus = (UpdateDataSourceResponse -> Int)
-> (UpdateDataSourceResponse -> Int -> UpdateDataSourceResponse)
-> Lens UpdateDataSourceResponse UpdateDataSourceResponse Int Int
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateDataSourceResponse' {Int
httpStatus :: Int
$sel:httpStatus:UpdateDataSourceResponse' :: UpdateDataSourceResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: UpdateDataSourceResponse
s@UpdateDataSourceResponse' {} Int
a -> UpdateDataSourceResponse
s {$sel:httpStatus:UpdateDataSourceResponse' :: Int
httpStatus = Int
a} :: UpdateDataSourceResponse)
instance Prelude.NFData UpdateDataSourceResponse