{-# 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.QuickSight.CreateDataSource
(
CreateDataSource (..),
newCreateDataSource,
createDataSource_dataSourceParameters,
createDataSource_sslProperties,
createDataSource_credentials,
createDataSource_vpcConnectionProperties,
createDataSource_permissions,
createDataSource_tags,
createDataSource_awsAccountId,
createDataSource_dataSourceId,
createDataSource_name,
createDataSource_type,
CreateDataSourceResponse (..),
newCreateDataSourceResponse,
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
data CreateDataSource = CreateDataSource'
{
CreateDataSource -> Maybe DataSourceParameters
dataSourceParameters :: Prelude.Maybe DataSourceParameters,
CreateDataSource -> Maybe SslProperties
sslProperties :: Prelude.Maybe SslProperties,
CreateDataSource -> Maybe (Sensitive DataSourceCredentials)
credentials :: Prelude.Maybe (Core.Sensitive DataSourceCredentials),
CreateDataSource -> Maybe VpcConnectionProperties
vpcConnectionProperties :: Prelude.Maybe VpcConnectionProperties,
CreateDataSource -> Maybe (NonEmpty ResourcePermission)
permissions :: Prelude.Maybe (Prelude.NonEmpty ResourcePermission),
CreateDataSource -> Maybe (NonEmpty Tag)
tags :: Prelude.Maybe (Prelude.NonEmpty Tag),
CreateDataSource -> Text
awsAccountId :: Prelude.Text,
CreateDataSource -> Text
dataSourceId :: Prelude.Text,
CreateDataSource -> Text
name :: Prelude.Text,
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)
newCreateDataSource ::
Prelude.Text ->
Prelude.Text ->
Prelude.Text ->
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_
}
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)
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)
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
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)
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
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
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)
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)
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)
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
data CreateDataSourceResponse = CreateDataSourceResponse'
{
CreateDataSourceResponse -> Maybe Text
requestId :: Prelude.Maybe Prelude.Text,
CreateDataSourceResponse -> Maybe Text
arn :: Prelude.Maybe Prelude.Text,
CreateDataSourceResponse -> Maybe ResourceStatus
creationStatus :: Prelude.Maybe ResourceStatus,
CreateDataSourceResponse -> Maybe Text
dataSourceId :: Prelude.Maybe Prelude.Text,
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)
newCreateDataSourceResponse ::
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_
}
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)
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)
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)
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)
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