{-# 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.CreateDataSource
-- 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)
--
-- Creates a data source.
module Amazonka.QuickSight.CreateDataSource
  ( -- * Creating a Request
    CreateDataSource (..),
    newCreateDataSource,

    -- * Request Lenses
    createDataSource_dataSourceParameters,
    createDataSource_sslProperties,
    createDataSource_credentials,
    createDataSource_vpcConnectionProperties,
    createDataSource_permissions,
    createDataSource_tags,
    createDataSource_awsAccountId,
    createDataSource_dataSourceId,
    createDataSource_name,
    createDataSource_type,

    -- * Destructuring the Response
    CreateDataSourceResponse (..),
    newCreateDataSourceResponse,

    -- * Response Lenses
    createDataSourceResponse_requestId,
    createDataSourceResponse_arn,
    createDataSourceResponse_creationStatus,
    createDataSourceResponse_dataSourceId,
    createDataSourceResponse_status,
  )
where

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

-- | /See:/ 'newCreateDataSource' smart constructor.
data CreateDataSource = CreateDataSource'
  { -- | The parameters that Amazon QuickSight uses to connect to your underlying
    -- source.
    CreateDataSource -> Maybe DataSourceParameters
dataSourceParameters :: Prelude.Maybe DataSourceParameters,
    -- | Secure Socket Layer (SSL) properties that apply when Amazon QuickSight
    -- connects to your underlying source.
    CreateDataSource -> Maybe SslProperties
sslProperties :: Prelude.Maybe SslProperties,
    -- | The credentials Amazon QuickSight that uses to connect to your
    -- underlying source. Currently, only credentials based on user name and
    -- password are supported.
    CreateDataSource -> Maybe (Sensitive DataSourceCredentials)
credentials :: Prelude.Maybe (Core.Sensitive DataSourceCredentials),
    -- | Use this parameter only when you want Amazon QuickSight to use a VPC
    -- connection when connecting to your underlying source.
    CreateDataSource -> Maybe VpcConnectionProperties
vpcConnectionProperties :: Prelude.Maybe VpcConnectionProperties,
    -- | A list of resource permissions on the data source.
    CreateDataSource -> Maybe (NonEmpty ResourcePermission)
permissions :: Prelude.Maybe (Prelude.NonEmpty ResourcePermission),
    -- | Contains a map of the key-value pairs for the resource tag or tags
    -- assigned to the data source.
    CreateDataSource -> Maybe (NonEmpty Tag)
tags :: Prelude.Maybe (Prelude.NonEmpty Tag),
    -- | The Amazon Web Services account ID.
    CreateDataSource -> Text
awsAccountId :: Prelude.Text,
    -- | An ID for the data source. This ID is unique per Amazon Web Services
    -- Region for each Amazon Web Services account.
    CreateDataSource -> Text
dataSourceId :: Prelude.Text,
    -- | A display name for the data source.
    CreateDataSource -> Text
name :: Prelude.Text,
    -- | The type of the data source. To return a list of all data sources, use
    -- @ListDataSources@.
    --
    -- Use @AMAZON_ELASTICSEARCH@ for Amazon OpenSearch Service.
    CreateDataSource -> DataSourceType
type' :: DataSourceType
  }
  deriving (CreateDataSource -> CreateDataSource -> Bool
(CreateDataSource -> CreateDataSource -> Bool)
-> (CreateDataSource -> CreateDataSource -> Bool)
-> Eq CreateDataSource
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: CreateDataSource -> CreateDataSource -> Bool
$c/= :: CreateDataSource -> CreateDataSource -> Bool
== :: CreateDataSource -> CreateDataSource -> Bool
$c== :: CreateDataSource -> CreateDataSource -> Bool
Prelude.Eq, Int -> CreateDataSource -> ShowS
[CreateDataSource] -> ShowS
CreateDataSource -> String
(Int -> CreateDataSource -> ShowS)
-> (CreateDataSource -> String)
-> ([CreateDataSource] -> ShowS)
-> Show CreateDataSource
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [CreateDataSource] -> ShowS
$cshowList :: [CreateDataSource] -> ShowS
show :: CreateDataSource -> String
$cshow :: CreateDataSource -> String
showsPrec :: Int -> CreateDataSource -> ShowS
$cshowsPrec :: Int -> CreateDataSource -> ShowS
Prelude.Show, (forall x. CreateDataSource -> Rep CreateDataSource x)
-> (forall x. Rep CreateDataSource x -> CreateDataSource)
-> Generic CreateDataSource
forall x. Rep CreateDataSource x -> CreateDataSource
forall x. CreateDataSource -> Rep CreateDataSource x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep CreateDataSource x -> CreateDataSource
$cfrom :: forall x. CreateDataSource -> Rep CreateDataSource x
Prelude.Generic)

-- |
-- Create a value of 'CreateDataSource' 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:
--
-- 'dataSourceParameters', 'createDataSource_dataSourceParameters' - The parameters that Amazon QuickSight uses to connect to your underlying
-- source.
--
-- 'sslProperties', 'createDataSource_sslProperties' - Secure Socket Layer (SSL) properties that apply when Amazon QuickSight
-- connects to your underlying source.
--
-- 'credentials', 'createDataSource_credentials' - The credentials Amazon QuickSight that uses to connect to your
-- underlying source. Currently, only credentials based on user name and
-- password are supported.
--
-- 'vpcConnectionProperties', 'createDataSource_vpcConnectionProperties' - Use this parameter only when you want Amazon QuickSight to use a VPC
-- connection when connecting to your underlying source.
--
-- 'permissions', 'createDataSource_permissions' - A list of resource permissions on the data source.
--
-- 'tags', 'createDataSource_tags' - Contains a map of the key-value pairs for the resource tag or tags
-- assigned to the data source.
--
-- 'awsAccountId', 'createDataSource_awsAccountId' - The Amazon Web Services account ID.
--
-- 'dataSourceId', 'createDataSource_dataSourceId' - An ID for the data source. This ID is unique per Amazon Web Services
-- Region for each Amazon Web Services account.
--
-- 'name', 'createDataSource_name' - A display name for the data source.
--
-- 'type'', 'createDataSource_type' - The type of the data source. To return a list of all data sources, use
-- @ListDataSources@.
--
-- Use @AMAZON_ELASTICSEARCH@ for Amazon OpenSearch Service.
newCreateDataSource ::
  -- | 'awsAccountId'
  Prelude.Text ->
  -- | 'dataSourceId'
  Prelude.Text ->
  -- | 'name'
  Prelude.Text ->
  -- | 'type''
  DataSourceType ->
  CreateDataSource
newCreateDataSource :: Text -> Text -> Text -> DataSourceType -> CreateDataSource
newCreateDataSource
  Text
pAwsAccountId_
  Text
pDataSourceId_
  Text
pName_
  DataSourceType
pType_ =
    CreateDataSource' :: Maybe DataSourceParameters
-> Maybe SslProperties
-> Maybe (Sensitive DataSourceCredentials)
-> Maybe VpcConnectionProperties
-> Maybe (NonEmpty ResourcePermission)
-> Maybe (NonEmpty Tag)
-> Text
-> Text
-> Text
-> DataSourceType
-> CreateDataSource
CreateDataSource'
      { $sel:dataSourceParameters:CreateDataSource' :: Maybe DataSourceParameters
dataSourceParameters =
          Maybe DataSourceParameters
forall a. Maybe a
Prelude.Nothing,
        $sel:sslProperties:CreateDataSource' :: Maybe SslProperties
sslProperties = Maybe SslProperties
forall a. Maybe a
Prelude.Nothing,
        $sel:credentials:CreateDataSource' :: Maybe (Sensitive DataSourceCredentials)
credentials = Maybe (Sensitive DataSourceCredentials)
forall a. Maybe a
Prelude.Nothing,
        $sel:vpcConnectionProperties:CreateDataSource' :: Maybe VpcConnectionProperties
vpcConnectionProperties = Maybe VpcConnectionProperties
forall a. Maybe a
Prelude.Nothing,
        $sel:permissions:CreateDataSource' :: Maybe (NonEmpty ResourcePermission)
permissions = Maybe (NonEmpty ResourcePermission)
forall a. Maybe a
Prelude.Nothing,
        $sel:tags:CreateDataSource' :: Maybe (NonEmpty Tag)
tags = Maybe (NonEmpty Tag)
forall a. Maybe a
Prelude.Nothing,
        $sel:awsAccountId:CreateDataSource' :: Text
awsAccountId = Text
pAwsAccountId_,
        $sel:dataSourceId:CreateDataSource' :: Text
dataSourceId = Text
pDataSourceId_,
        $sel:name:CreateDataSource' :: Text
name = Text
pName_,
        $sel:type':CreateDataSource' :: DataSourceType
type' = DataSourceType
pType_
      }

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

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

-- | The credentials Amazon QuickSight that uses to connect to your
-- underlying source. Currently, only credentials based on user name and
-- password are supported.
createDataSource_credentials :: Lens.Lens' CreateDataSource (Prelude.Maybe DataSourceCredentials)
createDataSource_credentials :: (Maybe DataSourceCredentials -> f (Maybe DataSourceCredentials))
-> CreateDataSource -> f CreateDataSource
createDataSource_credentials = (CreateDataSource -> Maybe (Sensitive DataSourceCredentials))
-> (CreateDataSource
    -> Maybe (Sensitive DataSourceCredentials) -> CreateDataSource)
-> Lens
     CreateDataSource
     CreateDataSource
     (Maybe (Sensitive DataSourceCredentials))
     (Maybe (Sensitive DataSourceCredentials))
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateDataSource' {Maybe (Sensitive DataSourceCredentials)
credentials :: Maybe (Sensitive DataSourceCredentials)
$sel:credentials:CreateDataSource' :: CreateDataSource -> Maybe (Sensitive DataSourceCredentials)
credentials} -> Maybe (Sensitive DataSourceCredentials)
credentials) (\s :: CreateDataSource
s@CreateDataSource' {} Maybe (Sensitive DataSourceCredentials)
a -> CreateDataSource
s {$sel:credentials:CreateDataSource' :: Maybe (Sensitive DataSourceCredentials)
credentials = Maybe (Sensitive DataSourceCredentials)
a} :: CreateDataSource) ((Maybe (Sensitive DataSourceCredentials)
  -> f (Maybe (Sensitive DataSourceCredentials)))
 -> CreateDataSource -> f CreateDataSource)
-> ((Maybe DataSourceCredentials
     -> f (Maybe DataSourceCredentials))
    -> Maybe (Sensitive DataSourceCredentials)
    -> f (Maybe (Sensitive DataSourceCredentials)))
-> (Maybe DataSourceCredentials -> f (Maybe DataSourceCredentials))
-> CreateDataSource
-> f CreateDataSource
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
  (Sensitive DataSourceCredentials)
  (Sensitive DataSourceCredentials)
  DataSourceCredentials
  DataSourceCredentials
-> Iso
     (Maybe (Sensitive DataSourceCredentials))
     (Maybe (Sensitive DataSourceCredentials))
     (Maybe DataSourceCredentials)
     (Maybe DataSourceCredentials)
forall (f :: * -> *) (g :: * -> *) s t a b.
(Functor f, Functor g) =>
AnIso s t a b -> Iso (f s) (g t) (f a) (g b)
Lens.mapping AnIso
  (Sensitive DataSourceCredentials)
  (Sensitive DataSourceCredentials)
  DataSourceCredentials
  DataSourceCredentials
forall a. Iso' (Sensitive a) a
Core._Sensitive

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

-- | A list of resource permissions on the data source.
createDataSource_permissions :: Lens.Lens' CreateDataSource (Prelude.Maybe (Prelude.NonEmpty ResourcePermission))
createDataSource_permissions :: (Maybe (NonEmpty ResourcePermission)
 -> f (Maybe (NonEmpty ResourcePermission)))
-> CreateDataSource -> f CreateDataSource
createDataSource_permissions = (CreateDataSource -> Maybe (NonEmpty ResourcePermission))
-> (CreateDataSource
    -> Maybe (NonEmpty ResourcePermission) -> CreateDataSource)
-> Lens
     CreateDataSource
     CreateDataSource
     (Maybe (NonEmpty ResourcePermission))
     (Maybe (NonEmpty ResourcePermission))
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateDataSource' {Maybe (NonEmpty ResourcePermission)
permissions :: Maybe (NonEmpty ResourcePermission)
$sel:permissions:CreateDataSource' :: CreateDataSource -> Maybe (NonEmpty ResourcePermission)
permissions} -> Maybe (NonEmpty ResourcePermission)
permissions) (\s :: CreateDataSource
s@CreateDataSource' {} Maybe (NonEmpty ResourcePermission)
a -> CreateDataSource
s {$sel:permissions:CreateDataSource' :: Maybe (NonEmpty ResourcePermission)
permissions = Maybe (NonEmpty ResourcePermission)
a} :: CreateDataSource) ((Maybe (NonEmpty ResourcePermission)
  -> f (Maybe (NonEmpty ResourcePermission)))
 -> CreateDataSource -> f CreateDataSource)
-> ((Maybe (NonEmpty ResourcePermission)
     -> f (Maybe (NonEmpty ResourcePermission)))
    -> Maybe (NonEmpty ResourcePermission)
    -> f (Maybe (NonEmpty ResourcePermission)))
-> (Maybe (NonEmpty ResourcePermission)
    -> f (Maybe (NonEmpty ResourcePermission)))
-> CreateDataSource
-> f CreateDataSource
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
  (NonEmpty ResourcePermission)
  (NonEmpty ResourcePermission)
  (NonEmpty ResourcePermission)
  (NonEmpty ResourcePermission)
-> Iso
     (Maybe (NonEmpty ResourcePermission))
     (Maybe (NonEmpty ResourcePermission))
     (Maybe (NonEmpty ResourcePermission))
     (Maybe (NonEmpty ResourcePermission))
forall (f :: * -> *) (g :: * -> *) s t a b.
(Functor f, Functor g) =>
AnIso s t a b -> Iso (f s) (g t) (f a) (g b)
Lens.mapping AnIso
  (NonEmpty ResourcePermission)
  (NonEmpty ResourcePermission)
  (NonEmpty ResourcePermission)
  (NonEmpty ResourcePermission)
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | Contains a map of the key-value pairs for the resource tag or tags
-- assigned to the data source.
createDataSource_tags :: Lens.Lens' CreateDataSource (Prelude.Maybe (Prelude.NonEmpty Tag))
createDataSource_tags :: (Maybe (NonEmpty Tag) -> f (Maybe (NonEmpty Tag)))
-> CreateDataSource -> f CreateDataSource
createDataSource_tags = (CreateDataSource -> Maybe (NonEmpty Tag))
-> (CreateDataSource -> Maybe (NonEmpty Tag) -> CreateDataSource)
-> Lens
     CreateDataSource
     CreateDataSource
     (Maybe (NonEmpty Tag))
     (Maybe (NonEmpty Tag))
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateDataSource' {Maybe (NonEmpty Tag)
tags :: Maybe (NonEmpty Tag)
$sel:tags:CreateDataSource' :: CreateDataSource -> Maybe (NonEmpty Tag)
tags} -> Maybe (NonEmpty Tag)
tags) (\s :: CreateDataSource
s@CreateDataSource' {} Maybe (NonEmpty Tag)
a -> CreateDataSource
s {$sel:tags:CreateDataSource' :: Maybe (NonEmpty Tag)
tags = Maybe (NonEmpty Tag)
a} :: CreateDataSource) ((Maybe (NonEmpty Tag) -> f (Maybe (NonEmpty Tag)))
 -> CreateDataSource -> f CreateDataSource)
-> ((Maybe (NonEmpty Tag) -> f (Maybe (NonEmpty Tag)))
    -> Maybe (NonEmpty Tag) -> f (Maybe (NonEmpty Tag)))
-> (Maybe (NonEmpty Tag) -> f (Maybe (NonEmpty Tag)))
-> CreateDataSource
-> f CreateDataSource
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso (NonEmpty Tag) (NonEmpty Tag) (NonEmpty Tag) (NonEmpty Tag)
-> Iso
     (Maybe (NonEmpty Tag))
     (Maybe (NonEmpty Tag))
     (Maybe (NonEmpty Tag))
     (Maybe (NonEmpty Tag))
forall (f :: * -> *) (g :: * -> *) s t a b.
(Functor f, Functor g) =>
AnIso s t a b -> Iso (f s) (g t) (f a) (g b)
Lens.mapping AnIso (NonEmpty Tag) (NonEmpty Tag) (NonEmpty Tag) (NonEmpty Tag)
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

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

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

-- | A display name for the data source.
createDataSource_name :: Lens.Lens' CreateDataSource Prelude.Text
createDataSource_name :: (Text -> f Text) -> CreateDataSource -> f CreateDataSource
createDataSource_name = (CreateDataSource -> Text)
-> (CreateDataSource -> Text -> CreateDataSource)
-> Lens CreateDataSource CreateDataSource Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateDataSource' {Text
name :: Text
$sel:name:CreateDataSource' :: CreateDataSource -> Text
name} -> Text
name) (\s :: CreateDataSource
s@CreateDataSource' {} Text
a -> CreateDataSource
s {$sel:name:CreateDataSource' :: Text
name = Text
a} :: CreateDataSource)

-- | The type of the data source. To return a list of all data sources, use
-- @ListDataSources@.
--
-- Use @AMAZON_ELASTICSEARCH@ for Amazon OpenSearch Service.
createDataSource_type :: Lens.Lens' CreateDataSource DataSourceType
createDataSource_type :: (DataSourceType -> f DataSourceType)
-> CreateDataSource -> f CreateDataSource
createDataSource_type = (CreateDataSource -> DataSourceType)
-> (CreateDataSource -> DataSourceType -> CreateDataSource)
-> Lens
     CreateDataSource CreateDataSource DataSourceType DataSourceType
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateDataSource' {DataSourceType
type' :: DataSourceType
$sel:type':CreateDataSource' :: CreateDataSource -> DataSourceType
type'} -> DataSourceType
type') (\s :: CreateDataSource
s@CreateDataSource' {} DataSourceType
a -> CreateDataSource
s {$sel:type':CreateDataSource' :: DataSourceType
type' = DataSourceType
a} :: CreateDataSource)

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

instance Prelude.NFData CreateDataSource

instance Core.ToHeaders CreateDataSource where
  toHeaders :: CreateDataSource -> ResponseHeaders
toHeaders =
    ResponseHeaders -> CreateDataSource -> 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.0" ::
                          Prelude.ByteString
                      )
          ]
      )

instance Core.ToJSON CreateDataSource where
  toJSON :: CreateDataSource -> Value
toJSON CreateDataSource' {Maybe (NonEmpty ResourcePermission)
Maybe (NonEmpty Tag)
Maybe (Sensitive DataSourceCredentials)
Maybe SslProperties
Maybe DataSourceParameters
Maybe VpcConnectionProperties
Text
DataSourceType
type' :: DataSourceType
name :: Text
dataSourceId :: Text
awsAccountId :: Text
tags :: Maybe (NonEmpty Tag)
permissions :: Maybe (NonEmpty ResourcePermission)
vpcConnectionProperties :: Maybe VpcConnectionProperties
credentials :: Maybe (Sensitive DataSourceCredentials)
sslProperties :: Maybe SslProperties
dataSourceParameters :: Maybe DataSourceParameters
$sel:type':CreateDataSource' :: CreateDataSource -> DataSourceType
$sel:name:CreateDataSource' :: CreateDataSource -> Text
$sel:dataSourceId:CreateDataSource' :: CreateDataSource -> Text
$sel:awsAccountId:CreateDataSource' :: CreateDataSource -> Text
$sel:tags:CreateDataSource' :: CreateDataSource -> Maybe (NonEmpty Tag)
$sel:permissions:CreateDataSource' :: CreateDataSource -> Maybe (NonEmpty ResourcePermission)
$sel:vpcConnectionProperties:CreateDataSource' :: CreateDataSource -> Maybe VpcConnectionProperties
$sel:credentials:CreateDataSource' :: CreateDataSource -> Maybe (Sensitive DataSourceCredentials)
$sel:sslProperties:CreateDataSource' :: CreateDataSource -> Maybe SslProperties
$sel:dataSourceParameters:CreateDataSource' :: CreateDataSource -> Maybe DataSourceParameters
..} =
    [Pair] -> Value
Core.object
      ( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ (Text
"DataSourceParameters" Text -> DataSourceParameters -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
              (DataSourceParameters -> Pair)
-> Maybe DataSourceParameters -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe DataSourceParameters
dataSourceParameters,
            (Text
"SslProperties" Text -> SslProperties -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (SslProperties -> Pair) -> Maybe SslProperties -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe SslProperties
sslProperties,
            (Text
"Credentials" Text -> Sensitive DataSourceCredentials -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (Sensitive DataSourceCredentials -> Pair)
-> Maybe (Sensitive DataSourceCredentials) -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe (Sensitive DataSourceCredentials)
credentials,
            (Text
"VpcConnectionProperties" Text -> VpcConnectionProperties -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
              (VpcConnectionProperties -> Pair)
-> Maybe VpcConnectionProperties -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe VpcConnectionProperties
vpcConnectionProperties,
            (Text
"Permissions" Text -> NonEmpty ResourcePermission -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (NonEmpty ResourcePermission -> Pair)
-> Maybe (NonEmpty ResourcePermission) -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe (NonEmpty ResourcePermission)
permissions,
            (Text
"Tags" Text -> NonEmpty Tag -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (NonEmpty Tag -> Pair) -> Maybe (NonEmpty Tag) -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe (NonEmpty Tag)
tags,
            Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"DataSourceId" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
dataSourceId),
            Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"Name" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
name),
            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 CreateDataSource where
  toPath :: CreateDataSource -> ByteString
toPath CreateDataSource' {Maybe (NonEmpty ResourcePermission)
Maybe (NonEmpty Tag)
Maybe (Sensitive DataSourceCredentials)
Maybe SslProperties
Maybe DataSourceParameters
Maybe VpcConnectionProperties
Text
DataSourceType
type' :: DataSourceType
name :: Text
dataSourceId :: Text
awsAccountId :: Text
tags :: Maybe (NonEmpty Tag)
permissions :: Maybe (NonEmpty ResourcePermission)
vpcConnectionProperties :: Maybe VpcConnectionProperties
credentials :: Maybe (Sensitive DataSourceCredentials)
sslProperties :: Maybe SslProperties
dataSourceParameters :: Maybe DataSourceParameters
$sel:type':CreateDataSource' :: CreateDataSource -> DataSourceType
$sel:name:CreateDataSource' :: CreateDataSource -> Text
$sel:dataSourceId:CreateDataSource' :: CreateDataSource -> Text
$sel:awsAccountId:CreateDataSource' :: CreateDataSource -> Text
$sel:tags:CreateDataSource' :: CreateDataSource -> Maybe (NonEmpty Tag)
$sel:permissions:CreateDataSource' :: CreateDataSource -> Maybe (NonEmpty ResourcePermission)
$sel:vpcConnectionProperties:CreateDataSource' :: CreateDataSource -> Maybe VpcConnectionProperties
$sel:credentials:CreateDataSource' :: CreateDataSource -> Maybe (Sensitive DataSourceCredentials)
$sel:sslProperties:CreateDataSource' :: CreateDataSource -> Maybe SslProperties
$sel:dataSourceParameters:CreateDataSource' :: CreateDataSource -> Maybe DataSourceParameters
..} =
    [ByteString] -> ByteString
forall a. Monoid a => [a] -> a
Prelude.mconcat
      [ ByteString
"/accounts/",
        Text -> ByteString
forall a. ToByteString a => a -> ByteString
Core.toBS Text
awsAccountId,
        ByteString
"/data-sources"
      ]

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

-- | /See:/ 'newCreateDataSourceResponse' smart constructor.
data CreateDataSourceResponse = CreateDataSourceResponse'
  { -- | The Amazon Web Services request ID for this operation.
    CreateDataSourceResponse -> Maybe Text
requestId :: Prelude.Maybe Prelude.Text,
    -- | The Amazon Resource Name (ARN) of the data source.
    CreateDataSourceResponse -> Maybe Text
arn :: Prelude.Maybe Prelude.Text,
    -- | The status of creating the data source.
    CreateDataSourceResponse -> Maybe ResourceStatus
creationStatus :: Prelude.Maybe ResourceStatus,
    -- | The ID of the data source. This ID is unique per Amazon Web Services
    -- Region for each Amazon Web Services account.
    CreateDataSourceResponse -> Maybe Text
dataSourceId :: Prelude.Maybe Prelude.Text,
    -- | The HTTP status of the request.
    CreateDataSourceResponse -> Int
status :: Prelude.Int
  }
  deriving (CreateDataSourceResponse -> CreateDataSourceResponse -> Bool
(CreateDataSourceResponse -> CreateDataSourceResponse -> Bool)
-> (CreateDataSourceResponse -> CreateDataSourceResponse -> Bool)
-> Eq CreateDataSourceResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: CreateDataSourceResponse -> CreateDataSourceResponse -> Bool
$c/= :: CreateDataSourceResponse -> CreateDataSourceResponse -> Bool
== :: CreateDataSourceResponse -> CreateDataSourceResponse -> Bool
$c== :: CreateDataSourceResponse -> CreateDataSourceResponse -> Bool
Prelude.Eq, ReadPrec [CreateDataSourceResponse]
ReadPrec CreateDataSourceResponse
Int -> ReadS CreateDataSourceResponse
ReadS [CreateDataSourceResponse]
(Int -> ReadS CreateDataSourceResponse)
-> ReadS [CreateDataSourceResponse]
-> ReadPrec CreateDataSourceResponse
-> ReadPrec [CreateDataSourceResponse]
-> Read CreateDataSourceResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [CreateDataSourceResponse]
$creadListPrec :: ReadPrec [CreateDataSourceResponse]
readPrec :: ReadPrec CreateDataSourceResponse
$creadPrec :: ReadPrec CreateDataSourceResponse
readList :: ReadS [CreateDataSourceResponse]
$creadList :: ReadS [CreateDataSourceResponse]
readsPrec :: Int -> ReadS CreateDataSourceResponse
$creadsPrec :: Int -> ReadS CreateDataSourceResponse
Prelude.Read, Int -> CreateDataSourceResponse -> ShowS
[CreateDataSourceResponse] -> ShowS
CreateDataSourceResponse -> String
(Int -> CreateDataSourceResponse -> ShowS)
-> (CreateDataSourceResponse -> String)
-> ([CreateDataSourceResponse] -> ShowS)
-> Show CreateDataSourceResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [CreateDataSourceResponse] -> ShowS
$cshowList :: [CreateDataSourceResponse] -> ShowS
show :: CreateDataSourceResponse -> String
$cshow :: CreateDataSourceResponse -> String
showsPrec :: Int -> CreateDataSourceResponse -> ShowS
$cshowsPrec :: Int -> CreateDataSourceResponse -> ShowS
Prelude.Show, (forall x.
 CreateDataSourceResponse -> Rep CreateDataSourceResponse x)
-> (forall x.
    Rep CreateDataSourceResponse x -> CreateDataSourceResponse)
-> Generic CreateDataSourceResponse
forall x.
Rep CreateDataSourceResponse x -> CreateDataSourceResponse
forall x.
CreateDataSourceResponse -> Rep CreateDataSourceResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep CreateDataSourceResponse x -> CreateDataSourceResponse
$cfrom :: forall x.
CreateDataSourceResponse -> Rep CreateDataSourceResponse x
Prelude.Generic)

-- |
-- Create a value of 'CreateDataSourceResponse' 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:
--
-- 'requestId', 'createDataSourceResponse_requestId' - The Amazon Web Services request ID for this operation.
--
-- 'arn', 'createDataSourceResponse_arn' - The Amazon Resource Name (ARN) of the data source.
--
-- 'creationStatus', 'createDataSourceResponse_creationStatus' - The status of creating the data source.
--
-- 'dataSourceId', 'createDataSourceResponse_dataSourceId' - The ID of the data source. This ID is unique per Amazon Web Services
-- Region for each Amazon Web Services account.
--
-- 'status', 'createDataSourceResponse_status' - The HTTP status of the request.
newCreateDataSourceResponse ::
  -- | 'status'
  Prelude.Int ->
  CreateDataSourceResponse
newCreateDataSourceResponse :: Int -> CreateDataSourceResponse
newCreateDataSourceResponse Int
pStatus_ =
  CreateDataSourceResponse' :: Maybe Text
-> Maybe Text
-> Maybe ResourceStatus
-> Maybe Text
-> Int
-> CreateDataSourceResponse
CreateDataSourceResponse'
    { $sel:requestId:CreateDataSourceResponse' :: Maybe Text
requestId =
        Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:arn:CreateDataSourceResponse' :: Maybe Text
arn = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:creationStatus:CreateDataSourceResponse' :: Maybe ResourceStatus
creationStatus = Maybe ResourceStatus
forall a. Maybe a
Prelude.Nothing,
      $sel:dataSourceId:CreateDataSourceResponse' :: Maybe Text
dataSourceId = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:status:CreateDataSourceResponse' :: Int
status = Int
pStatus_
    }

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

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

-- | The status of creating the data source.
createDataSourceResponse_creationStatus :: Lens.Lens' CreateDataSourceResponse (Prelude.Maybe ResourceStatus)
createDataSourceResponse_creationStatus :: (Maybe ResourceStatus -> f (Maybe ResourceStatus))
-> CreateDataSourceResponse -> f CreateDataSourceResponse
createDataSourceResponse_creationStatus = (CreateDataSourceResponse -> Maybe ResourceStatus)
-> (CreateDataSourceResponse
    -> Maybe ResourceStatus -> CreateDataSourceResponse)
-> Lens
     CreateDataSourceResponse
     CreateDataSourceResponse
     (Maybe ResourceStatus)
     (Maybe ResourceStatus)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateDataSourceResponse' {Maybe ResourceStatus
creationStatus :: Maybe ResourceStatus
$sel:creationStatus:CreateDataSourceResponse' :: CreateDataSourceResponse -> Maybe ResourceStatus
creationStatus} -> Maybe ResourceStatus
creationStatus) (\s :: CreateDataSourceResponse
s@CreateDataSourceResponse' {} Maybe ResourceStatus
a -> CreateDataSourceResponse
s {$sel:creationStatus:CreateDataSourceResponse' :: Maybe ResourceStatus
creationStatus = Maybe ResourceStatus
a} :: CreateDataSourceResponse)

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

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

instance Prelude.NFData CreateDataSourceResponse