{-# 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.QuickSight.UpdateDataSource
-- Copyright   : (c) 2013-2023 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay
-- Stability   : auto-generated
-- Portability : non-portable (GHC extensions)
--
-- Updates a data source.
module Amazonka.QuickSight.UpdateDataSource
  ( -- * Creating a Request
    UpdateDataSource (..),
    newUpdateDataSource,

    -- * Request Lenses
    updateDataSource_credentials,
    updateDataSource_dataSourceParameters,
    updateDataSource_sslProperties,
    updateDataSource_vpcConnectionProperties,
    updateDataSource_awsAccountId,
    updateDataSource_dataSourceId,
    updateDataSource_name,

    -- * Destructuring the Response
    UpdateDataSourceResponse (..),
    newUpdateDataSourceResponse,

    -- * Response Lenses
    updateDataSourceResponse_arn,
    updateDataSourceResponse_dataSourceId,
    updateDataSourceResponse_requestId,
    updateDataSourceResponse_updateStatus,
    updateDataSourceResponse_status,
  )
where

import qualified Amazonka.Core as Core
import qualified Amazonka.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
import qualified Amazonka.Prelude as Prelude
import Amazonka.QuickSight.Types
import qualified Amazonka.Request as Request
import qualified Amazonka.Response as Response

-- | /See:/ 'newUpdateDataSource' smart constructor.
data UpdateDataSource = UpdateDataSource'
  { -- | The credentials that Amazon QuickSight that uses to connect to your
    -- underlying source. Currently, only credentials based on user name and
    -- password are supported.
    UpdateDataSource -> Maybe (Sensitive DataSourceCredentials)
credentials :: Prelude.Maybe (Data.Sensitive DataSourceCredentials),
    -- | The parameters that Amazon QuickSight uses to connect to your underlying
    -- source.
    UpdateDataSource -> Maybe DataSourceParameters
dataSourceParameters :: Prelude.Maybe DataSourceParameters,
    -- | Secure Socket Layer (SSL) properties that apply when Amazon QuickSight
    -- connects to your underlying source.
    UpdateDataSource -> Maybe SslProperties
sslProperties :: Prelude.Maybe SslProperties,
    -- | Use this parameter only when you want Amazon QuickSight to use a VPC
    -- connection when connecting to your underlying source.
    UpdateDataSource -> Maybe VpcConnectionProperties
vpcConnectionProperties :: Prelude.Maybe VpcConnectionProperties,
    -- | The Amazon Web Services account ID.
    UpdateDataSource -> Text
awsAccountId :: Prelude.Text,
    -- | The ID of the data source. This ID is unique per Amazon Web Services
    -- Region for each Amazon Web Services account.
    UpdateDataSource -> Text
dataSourceId :: Prelude.Text,
    -- | A display name for the data source.
    UpdateDataSource -> Text
name :: Prelude.Text
  }
  deriving (UpdateDataSource -> UpdateDataSource -> Bool
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, Int -> UpdateDataSource -> ShowS
[UpdateDataSource] -> ShowS
UpdateDataSource -> String
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. 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)

-- |
-- Create a value of 'UpdateDataSource' 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:
--
-- 'credentials', 'updateDataSource_credentials' - The credentials that Amazon QuickSight that uses to connect to your
-- underlying source. Currently, only credentials based on user name and
-- password are supported.
--
-- 'dataSourceParameters', 'updateDataSource_dataSourceParameters' - The parameters that Amazon QuickSight uses to connect to your underlying
-- source.
--
-- 'sslProperties', 'updateDataSource_sslProperties' - Secure Socket Layer (SSL) properties that apply when Amazon QuickSight
-- connects to your underlying source.
--
-- 'vpcConnectionProperties', 'updateDataSource_vpcConnectionProperties' - Use this parameter only when you want Amazon QuickSight to use a VPC
-- connection when connecting to your underlying source.
--
-- 'awsAccountId', 'updateDataSource_awsAccountId' - The Amazon Web Services account ID.
--
-- 'dataSourceId', 'updateDataSource_dataSourceId' - The ID of the data source. This ID is unique per Amazon Web Services
-- Region for each Amazon Web Services account.
--
-- 'name', 'updateDataSource_name' - A display name for the data source.
newUpdateDataSource ::
  -- | 'awsAccountId'
  Prelude.Text ->
  -- | 'dataSourceId'
  Prelude.Text ->
  -- | 'name'
  Prelude.Text ->
  UpdateDataSource
newUpdateDataSource :: Text -> Text -> Text -> UpdateDataSource
newUpdateDataSource
  Text
pAwsAccountId_
  Text
pDataSourceId_
  Text
pName_ =
    UpdateDataSource'
      { $sel:credentials:UpdateDataSource' :: Maybe (Sensitive DataSourceCredentials)
credentials = forall a. Maybe a
Prelude.Nothing,
        $sel:dataSourceParameters:UpdateDataSource' :: Maybe DataSourceParameters
dataSourceParameters = forall a. Maybe a
Prelude.Nothing,
        $sel:sslProperties:UpdateDataSource' :: Maybe SslProperties
sslProperties = forall a. Maybe a
Prelude.Nothing,
        $sel:vpcConnectionProperties:UpdateDataSource' :: Maybe VpcConnectionProperties
vpcConnectionProperties = forall a. Maybe a
Prelude.Nothing,
        $sel:awsAccountId:UpdateDataSource' :: Text
awsAccountId = Text
pAwsAccountId_,
        $sel:dataSourceId:UpdateDataSource' :: Text
dataSourceId = Text
pDataSourceId_,
        $sel:name:UpdateDataSource' :: Text
name = Text
pName_
      }

-- | The credentials that Amazon QuickSight that uses to connect to your
-- underlying source. Currently, only credentials based on user name and
-- password are supported.
updateDataSource_credentials :: Lens.Lens' UpdateDataSource (Prelude.Maybe DataSourceCredentials)
updateDataSource_credentials :: Lens' UpdateDataSource (Maybe DataSourceCredentials)
updateDataSource_credentials = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateDataSource' {Maybe (Sensitive DataSourceCredentials)
credentials :: Maybe (Sensitive DataSourceCredentials)
$sel:credentials:UpdateDataSource' :: UpdateDataSource -> Maybe (Sensitive DataSourceCredentials)
credentials} -> Maybe (Sensitive DataSourceCredentials)
credentials) (\s :: UpdateDataSource
s@UpdateDataSource' {} Maybe (Sensitive DataSourceCredentials)
a -> UpdateDataSource
s {$sel:credentials:UpdateDataSource' :: Maybe (Sensitive DataSourceCredentials)
credentials = Maybe (Sensitive DataSourceCredentials)
a} :: UpdateDataSource) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. 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 forall a. Iso' (Sensitive a) a
Data._Sensitive

-- | The parameters that Amazon QuickSight uses to connect to your underlying
-- source.
updateDataSource_dataSourceParameters :: Lens.Lens' UpdateDataSource (Prelude.Maybe DataSourceParameters)
updateDataSource_dataSourceParameters :: Lens' UpdateDataSource (Maybe DataSourceParameters)
updateDataSource_dataSourceParameters = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateDataSource' {Maybe DataSourceParameters
dataSourceParameters :: Maybe DataSourceParameters
$sel:dataSourceParameters:UpdateDataSource' :: UpdateDataSource -> Maybe DataSourceParameters
dataSourceParameters} -> Maybe DataSourceParameters
dataSourceParameters) (\s :: UpdateDataSource
s@UpdateDataSource' {} Maybe DataSourceParameters
a -> UpdateDataSource
s {$sel:dataSourceParameters:UpdateDataSource' :: Maybe DataSourceParameters
dataSourceParameters = Maybe DataSourceParameters
a} :: UpdateDataSource)

-- | Secure Socket Layer (SSL) properties that apply when Amazon QuickSight
-- connects to your underlying source.
updateDataSource_sslProperties :: Lens.Lens' UpdateDataSource (Prelude.Maybe SslProperties)
updateDataSource_sslProperties :: Lens' UpdateDataSource (Maybe SslProperties)
updateDataSource_sslProperties = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateDataSource' {Maybe SslProperties
sslProperties :: Maybe SslProperties
$sel:sslProperties:UpdateDataSource' :: UpdateDataSource -> Maybe SslProperties
sslProperties} -> Maybe SslProperties
sslProperties) (\s :: UpdateDataSource
s@UpdateDataSource' {} Maybe SslProperties
a -> UpdateDataSource
s {$sel:sslProperties:UpdateDataSource' :: Maybe SslProperties
sslProperties = Maybe SslProperties
a} :: UpdateDataSource)

-- | Use this parameter only when you want Amazon QuickSight to use a VPC
-- connection when connecting to your underlying source.
updateDataSource_vpcConnectionProperties :: Lens.Lens' UpdateDataSource (Prelude.Maybe VpcConnectionProperties)
updateDataSource_vpcConnectionProperties :: Lens' UpdateDataSource (Maybe VpcConnectionProperties)
updateDataSource_vpcConnectionProperties = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateDataSource' {Maybe VpcConnectionProperties
vpcConnectionProperties :: Maybe VpcConnectionProperties
$sel:vpcConnectionProperties:UpdateDataSource' :: UpdateDataSource -> Maybe VpcConnectionProperties
vpcConnectionProperties} -> Maybe VpcConnectionProperties
vpcConnectionProperties) (\s :: UpdateDataSource
s@UpdateDataSource' {} Maybe VpcConnectionProperties
a -> UpdateDataSource
s {$sel:vpcConnectionProperties:UpdateDataSource' :: Maybe VpcConnectionProperties
vpcConnectionProperties = Maybe VpcConnectionProperties
a} :: UpdateDataSource)

-- | The Amazon Web Services account ID.
updateDataSource_awsAccountId :: Lens.Lens' UpdateDataSource Prelude.Text
updateDataSource_awsAccountId :: Lens' UpdateDataSource Text
updateDataSource_awsAccountId = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateDataSource' {Text
awsAccountId :: Text
$sel:awsAccountId:UpdateDataSource' :: UpdateDataSource -> Text
awsAccountId} -> Text
awsAccountId) (\s :: UpdateDataSource
s@UpdateDataSource' {} Text
a -> UpdateDataSource
s {$sel:awsAccountId:UpdateDataSource' :: Text
awsAccountId = Text
a} :: UpdateDataSource)

-- | The ID of the data source. This ID is unique per Amazon Web Services
-- Region for each Amazon Web Services account.
updateDataSource_dataSourceId :: Lens.Lens' UpdateDataSource Prelude.Text
updateDataSource_dataSourceId :: Lens' UpdateDataSource Text
updateDataSource_dataSourceId = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateDataSource' {Text
dataSourceId :: Text
$sel:dataSourceId:UpdateDataSource' :: UpdateDataSource -> Text
dataSourceId} -> Text
dataSourceId) (\s :: UpdateDataSource
s@UpdateDataSource' {} Text
a -> UpdateDataSource
s {$sel:dataSourceId:UpdateDataSource' :: Text
dataSourceId = Text
a} :: UpdateDataSource)

-- | A display name for the data source.
updateDataSource_name :: Lens.Lens' UpdateDataSource Prelude.Text
updateDataSource_name :: Lens' UpdateDataSource Text
updateDataSource_name = 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)

instance Core.AWSRequest UpdateDataSource where
  type
    AWSResponse UpdateDataSource =
      UpdateDataSourceResponse
  request :: (Service -> Service)
-> UpdateDataSource -> Request UpdateDataSource
request Service -> Service
overrides =
    forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.putJSON (Service -> Service
overrides Service
defaultService)
  response :: forall (m :: * -> *).
MonadResource m =>
(ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy UpdateDataSource
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse UpdateDataSource)))
response =
    forall (m :: * -> *) a.
MonadResource m =>
(Int -> ResponseHeaders -> Object -> Either String (AWSResponse a))
-> (ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveJSON
      ( \Int
s ResponseHeaders
h Object
x ->
          Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe ResourceStatus
-> Int
-> UpdateDataSourceResponse
UpdateDataSourceResponse'
            forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x forall a. FromJSON a => Object -> Key -> Either String (Maybe a)
Data..?> Key
"Arn")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Either String (Maybe a)
Data..?> Key
"DataSourceId")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Either String (Maybe a)
Data..?> Key
"RequestId")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Either String (Maybe a)
Data..?> Key
"UpdateStatus")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (forall (f :: * -> *) a. Applicative f => a -> f a
Prelude.pure (forall a. Enum a => a -> Int
Prelude.fromEnum Int
s))
      )

instance Prelude.Hashable UpdateDataSource where
  hashWithSalt :: Int -> UpdateDataSource -> Int
hashWithSalt Int
_salt UpdateDataSource' {Maybe (Sensitive DataSourceCredentials)
Maybe SslProperties
Maybe DataSourceParameters
Maybe VpcConnectionProperties
Text
name :: Text
dataSourceId :: Text
awsAccountId :: Text
vpcConnectionProperties :: Maybe VpcConnectionProperties
sslProperties :: Maybe SslProperties
dataSourceParameters :: Maybe DataSourceParameters
credentials :: Maybe (Sensitive DataSourceCredentials)
$sel:name:UpdateDataSource' :: UpdateDataSource -> Text
$sel:dataSourceId:UpdateDataSource' :: UpdateDataSource -> Text
$sel:awsAccountId:UpdateDataSource' :: UpdateDataSource -> Text
$sel:vpcConnectionProperties:UpdateDataSource' :: UpdateDataSource -> Maybe VpcConnectionProperties
$sel:sslProperties:UpdateDataSource' :: UpdateDataSource -> Maybe SslProperties
$sel:dataSourceParameters:UpdateDataSource' :: UpdateDataSource -> Maybe DataSourceParameters
$sel:credentials:UpdateDataSource' :: UpdateDataSource -> Maybe (Sensitive DataSourceCredentials)
..} =
    Int
_salt
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe (Sensitive DataSourceCredentials)
credentials
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe DataSourceParameters
dataSourceParameters
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe SslProperties
sslProperties
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe VpcConnectionProperties
vpcConnectionProperties
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
awsAccountId
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
dataSourceId
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
name

instance Prelude.NFData UpdateDataSource where
  rnf :: UpdateDataSource -> ()
rnf UpdateDataSource' {Maybe (Sensitive DataSourceCredentials)
Maybe SslProperties
Maybe DataSourceParameters
Maybe VpcConnectionProperties
Text
name :: Text
dataSourceId :: Text
awsAccountId :: Text
vpcConnectionProperties :: Maybe VpcConnectionProperties
sslProperties :: Maybe SslProperties
dataSourceParameters :: Maybe DataSourceParameters
credentials :: Maybe (Sensitive DataSourceCredentials)
$sel:name:UpdateDataSource' :: UpdateDataSource -> Text
$sel:dataSourceId:UpdateDataSource' :: UpdateDataSource -> Text
$sel:awsAccountId:UpdateDataSource' :: UpdateDataSource -> Text
$sel:vpcConnectionProperties:UpdateDataSource' :: UpdateDataSource -> Maybe VpcConnectionProperties
$sel:sslProperties:UpdateDataSource' :: UpdateDataSource -> Maybe SslProperties
$sel:dataSourceParameters:UpdateDataSource' :: UpdateDataSource -> Maybe DataSourceParameters
$sel:credentials:UpdateDataSource' :: UpdateDataSource -> Maybe (Sensitive DataSourceCredentials)
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe (Sensitive DataSourceCredentials)
credentials
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe DataSourceParameters
dataSourceParameters
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe SslProperties
sslProperties
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe VpcConnectionProperties
vpcConnectionProperties
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
awsAccountId
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
dataSourceId
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
name

instance Data.ToHeaders UpdateDataSource where
  toHeaders :: UpdateDataSource -> ResponseHeaders
toHeaders =
    forall a b. a -> b -> a
Prelude.const
      ( forall a. Monoid a => [a] -> a
Prelude.mconcat
          [ HeaderName
"Content-Type"
              forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Data.=# ( ByteString
"application/x-amz-json-1.0" ::
                          Prelude.ByteString
                      )
          ]
      )

instance Data.ToJSON UpdateDataSource where
  toJSON :: UpdateDataSource -> Value
toJSON UpdateDataSource' {Maybe (Sensitive DataSourceCredentials)
Maybe SslProperties
Maybe DataSourceParameters
Maybe VpcConnectionProperties
Text
name :: Text
dataSourceId :: Text
awsAccountId :: Text
vpcConnectionProperties :: Maybe VpcConnectionProperties
sslProperties :: Maybe SslProperties
dataSourceParameters :: Maybe DataSourceParameters
credentials :: Maybe (Sensitive DataSourceCredentials)
$sel:name:UpdateDataSource' :: UpdateDataSource -> Text
$sel:dataSourceId:UpdateDataSource' :: UpdateDataSource -> Text
$sel:awsAccountId:UpdateDataSource' :: UpdateDataSource -> Text
$sel:vpcConnectionProperties:UpdateDataSource' :: UpdateDataSource -> Maybe VpcConnectionProperties
$sel:sslProperties:UpdateDataSource' :: UpdateDataSource -> Maybe SslProperties
$sel:dataSourceParameters:UpdateDataSource' :: UpdateDataSource -> Maybe DataSourceParameters
$sel:credentials:UpdateDataSource' :: UpdateDataSource -> Maybe (Sensitive DataSourceCredentials)
..} =
    [Pair] -> Value
Data.object
      ( forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ (Key
"Credentials" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=) forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe (Sensitive DataSourceCredentials)
credentials,
            (Key
"DataSourceParameters" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=)
              forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe DataSourceParameters
dataSourceParameters,
            (Key
"SslProperties" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=) forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe SslProperties
sslProperties,
            (Key
"VpcConnectionProperties" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=)
              forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe VpcConnectionProperties
vpcConnectionProperties,
            forall a. a -> Maybe a
Prelude.Just (Key
"Name" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= Text
name)
          ]
      )

instance Data.ToPath UpdateDataSource where
  toPath :: UpdateDataSource -> ByteString
toPath UpdateDataSource' {Maybe (Sensitive DataSourceCredentials)
Maybe SslProperties
Maybe DataSourceParameters
Maybe VpcConnectionProperties
Text
name :: Text
dataSourceId :: Text
awsAccountId :: Text
vpcConnectionProperties :: Maybe VpcConnectionProperties
sslProperties :: Maybe SslProperties
dataSourceParameters :: Maybe DataSourceParameters
credentials :: Maybe (Sensitive DataSourceCredentials)
$sel:name:UpdateDataSource' :: UpdateDataSource -> Text
$sel:dataSourceId:UpdateDataSource' :: UpdateDataSource -> Text
$sel:awsAccountId:UpdateDataSource' :: UpdateDataSource -> Text
$sel:vpcConnectionProperties:UpdateDataSource' :: UpdateDataSource -> Maybe VpcConnectionProperties
$sel:sslProperties:UpdateDataSource' :: UpdateDataSource -> Maybe SslProperties
$sel:dataSourceParameters:UpdateDataSource' :: UpdateDataSource -> Maybe DataSourceParameters
$sel:credentials:UpdateDataSource' :: UpdateDataSource -> Maybe (Sensitive DataSourceCredentials)
..} =
    forall a. Monoid a => [a] -> a
Prelude.mconcat
      [ ByteString
"/accounts/",
        forall a. ToByteString a => a -> ByteString
Data.toBS Text
awsAccountId,
        ByteString
"/data-sources/",
        forall a. ToByteString a => a -> ByteString
Data.toBS Text
dataSourceId
      ]

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

-- | /See:/ 'newUpdateDataSourceResponse' smart constructor.
data UpdateDataSourceResponse = UpdateDataSourceResponse'
  { -- | The Amazon Resource Name (ARN) of the data source.
    UpdateDataSourceResponse -> Maybe Text
arn :: Prelude.Maybe Prelude.Text,
    -- | The ID of the data source. This ID is unique per Amazon Web Services
    -- Region for each Amazon Web Services account.
    UpdateDataSourceResponse -> Maybe Text
dataSourceId :: Prelude.Maybe Prelude.Text,
    -- | The Amazon Web Services request ID for this operation.
    UpdateDataSourceResponse -> Maybe Text
requestId :: Prelude.Maybe Prelude.Text,
    -- | The update status of the data source\'s last update.
    UpdateDataSourceResponse -> Maybe ResourceStatus
updateStatus :: Prelude.Maybe ResourceStatus,
    -- | The HTTP status of the request.
    UpdateDataSourceResponse -> Int
status :: Prelude.Int
  }
  deriving (UpdateDataSourceResponse -> UpdateDataSourceResponse -> Bool
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]
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
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.
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)

-- |
-- Create a value of 'UpdateDataSourceResponse' 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:
--
-- 'arn', 'updateDataSourceResponse_arn' - The Amazon Resource Name (ARN) of the data source.
--
-- 'dataSourceId', 'updateDataSourceResponse_dataSourceId' - The ID of the data source. This ID is unique per Amazon Web Services
-- Region for each Amazon Web Services account.
--
-- 'requestId', 'updateDataSourceResponse_requestId' - The Amazon Web Services request ID for this operation.
--
-- 'updateStatus', 'updateDataSourceResponse_updateStatus' - The update status of the data source\'s last update.
--
-- 'status', 'updateDataSourceResponse_status' - The HTTP status of the request.
newUpdateDataSourceResponse ::
  -- | 'status'
  Prelude.Int ->
  UpdateDataSourceResponse
newUpdateDataSourceResponse :: Int -> UpdateDataSourceResponse
newUpdateDataSourceResponse Int
pStatus_ =
  UpdateDataSourceResponse'
    { $sel:arn:UpdateDataSourceResponse' :: Maybe Text
arn = forall a. Maybe a
Prelude.Nothing,
      $sel:dataSourceId:UpdateDataSourceResponse' :: Maybe Text
dataSourceId = forall a. Maybe a
Prelude.Nothing,
      $sel:requestId:UpdateDataSourceResponse' :: Maybe Text
requestId = forall a. Maybe a
Prelude.Nothing,
      $sel:updateStatus:UpdateDataSourceResponse' :: Maybe ResourceStatus
updateStatus = forall a. Maybe a
Prelude.Nothing,
      $sel:status:UpdateDataSourceResponse' :: Int
status = Int
pStatus_
    }

-- | The Amazon Resource Name (ARN) of the data source.
updateDataSourceResponse_arn :: Lens.Lens' UpdateDataSourceResponse (Prelude.Maybe Prelude.Text)
updateDataSourceResponse_arn :: Lens' UpdateDataSourceResponse (Maybe Text)
updateDataSourceResponse_arn = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateDataSourceResponse' {Maybe Text
arn :: Maybe Text
$sel:arn:UpdateDataSourceResponse' :: UpdateDataSourceResponse -> Maybe Text
arn} -> Maybe Text
arn) (\s :: UpdateDataSourceResponse
s@UpdateDataSourceResponse' {} Maybe Text
a -> UpdateDataSourceResponse
s {$sel:arn:UpdateDataSourceResponse' :: Maybe Text
arn = Maybe Text
a} :: UpdateDataSourceResponse)

-- | The ID of the data source. This ID is unique per Amazon Web Services
-- Region for each Amazon Web Services account.
updateDataSourceResponse_dataSourceId :: Lens.Lens' UpdateDataSourceResponse (Prelude.Maybe Prelude.Text)
updateDataSourceResponse_dataSourceId :: Lens' UpdateDataSourceResponse (Maybe Text)
updateDataSourceResponse_dataSourceId = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateDataSourceResponse' {Maybe Text
dataSourceId :: Maybe Text
$sel:dataSourceId:UpdateDataSourceResponse' :: UpdateDataSourceResponse -> Maybe Text
dataSourceId} -> Maybe Text
dataSourceId) (\s :: UpdateDataSourceResponse
s@UpdateDataSourceResponse' {} Maybe Text
a -> UpdateDataSourceResponse
s {$sel:dataSourceId:UpdateDataSourceResponse' :: Maybe Text
dataSourceId = Maybe Text
a} :: UpdateDataSourceResponse)

-- | The Amazon Web Services request ID for this operation.
updateDataSourceResponse_requestId :: Lens.Lens' UpdateDataSourceResponse (Prelude.Maybe Prelude.Text)
updateDataSourceResponse_requestId :: Lens' UpdateDataSourceResponse (Maybe Text)
updateDataSourceResponse_requestId = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateDataSourceResponse' {Maybe Text
requestId :: Maybe Text
$sel:requestId:UpdateDataSourceResponse' :: UpdateDataSourceResponse -> Maybe Text
requestId} -> Maybe Text
requestId) (\s :: UpdateDataSourceResponse
s@UpdateDataSourceResponse' {} Maybe Text
a -> UpdateDataSourceResponse
s {$sel:requestId:UpdateDataSourceResponse' :: Maybe Text
requestId = Maybe Text
a} :: UpdateDataSourceResponse)

-- | The update status of the data source\'s last update.
updateDataSourceResponse_updateStatus :: Lens.Lens' UpdateDataSourceResponse (Prelude.Maybe ResourceStatus)
updateDataSourceResponse_updateStatus :: Lens' UpdateDataSourceResponse (Maybe ResourceStatus)
updateDataSourceResponse_updateStatus = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateDataSourceResponse' {Maybe ResourceStatus
updateStatus :: Maybe ResourceStatus
$sel:updateStatus:UpdateDataSourceResponse' :: UpdateDataSourceResponse -> Maybe ResourceStatus
updateStatus} -> Maybe ResourceStatus
updateStatus) (\s :: UpdateDataSourceResponse
s@UpdateDataSourceResponse' {} Maybe ResourceStatus
a -> UpdateDataSourceResponse
s {$sel:updateStatus:UpdateDataSourceResponse' :: Maybe ResourceStatus
updateStatus = Maybe ResourceStatus
a} :: UpdateDataSourceResponse)

-- | The HTTP status of the request.
updateDataSourceResponse_status :: Lens.Lens' UpdateDataSourceResponse Prelude.Int
updateDataSourceResponse_status :: Lens' UpdateDataSourceResponse Int
updateDataSourceResponse_status = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateDataSourceResponse' {Int
status :: Int
$sel:status:UpdateDataSourceResponse' :: UpdateDataSourceResponse -> Int
status} -> Int
status) (\s :: UpdateDataSourceResponse
s@UpdateDataSourceResponse' {} Int
a -> UpdateDataSourceResponse
s {$sel:status:UpdateDataSourceResponse' :: Int
status = Int
a} :: UpdateDataSourceResponse)

instance Prelude.NFData UpdateDataSourceResponse where
  rnf :: UpdateDataSourceResponse -> ()
rnf UpdateDataSourceResponse' {Int
Maybe Text
Maybe ResourceStatus
status :: Int
updateStatus :: Maybe ResourceStatus
requestId :: Maybe Text
dataSourceId :: Maybe Text
arn :: Maybe Text
$sel:status:UpdateDataSourceResponse' :: UpdateDataSourceResponse -> Int
$sel:updateStatus:UpdateDataSourceResponse' :: UpdateDataSourceResponse -> Maybe ResourceStatus
$sel:requestId:UpdateDataSourceResponse' :: UpdateDataSourceResponse -> Maybe Text
$sel:dataSourceId:UpdateDataSourceResponse' :: UpdateDataSourceResponse -> Maybe Text
$sel:arn:UpdateDataSourceResponse' :: UpdateDataSourceResponse -> Maybe Text
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
arn
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
dataSourceId
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
requestId
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe ResourceStatus
updateStatus
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Int
status