{-# 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.CreateIngestion
(
CreateIngestion (..),
newCreateIngestion,
createIngestion_ingestionType,
createIngestion_dataSetId,
createIngestion_ingestionId,
createIngestion_awsAccountId,
CreateIngestionResponse (..),
newCreateIngestionResponse,
createIngestionResponse_arn,
createIngestionResponse_ingestionId,
createIngestionResponse_ingestionStatus,
createIngestionResponse_requestId,
createIngestionResponse_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
data CreateIngestion = CreateIngestion'
{
CreateIngestion -> Maybe IngestionType
ingestionType :: Prelude.Maybe IngestionType,
CreateIngestion -> Text
dataSetId :: Prelude.Text,
CreateIngestion -> Text
ingestionId :: Prelude.Text,
CreateIngestion -> Text
awsAccountId :: Prelude.Text
}
deriving (CreateIngestion -> CreateIngestion -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: CreateIngestion -> CreateIngestion -> Bool
$c/= :: CreateIngestion -> CreateIngestion -> Bool
== :: CreateIngestion -> CreateIngestion -> Bool
$c== :: CreateIngestion -> CreateIngestion -> Bool
Prelude.Eq, ReadPrec [CreateIngestion]
ReadPrec CreateIngestion
Int -> ReadS CreateIngestion
ReadS [CreateIngestion]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [CreateIngestion]
$creadListPrec :: ReadPrec [CreateIngestion]
readPrec :: ReadPrec CreateIngestion
$creadPrec :: ReadPrec CreateIngestion
readList :: ReadS [CreateIngestion]
$creadList :: ReadS [CreateIngestion]
readsPrec :: Int -> ReadS CreateIngestion
$creadsPrec :: Int -> ReadS CreateIngestion
Prelude.Read, Int -> CreateIngestion -> ShowS
[CreateIngestion] -> ShowS
CreateIngestion -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [CreateIngestion] -> ShowS
$cshowList :: [CreateIngestion] -> ShowS
show :: CreateIngestion -> String
$cshow :: CreateIngestion -> String
showsPrec :: Int -> CreateIngestion -> ShowS
$cshowsPrec :: Int -> CreateIngestion -> ShowS
Prelude.Show, forall x. Rep CreateIngestion x -> CreateIngestion
forall x. CreateIngestion -> Rep CreateIngestion x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep CreateIngestion x -> CreateIngestion
$cfrom :: forall x. CreateIngestion -> Rep CreateIngestion x
Prelude.Generic)
newCreateIngestion ::
Prelude.Text ->
Prelude.Text ->
Prelude.Text ->
CreateIngestion
newCreateIngestion :: Text -> Text -> Text -> CreateIngestion
newCreateIngestion
Text
pDataSetId_
Text
pIngestionId_
Text
pAwsAccountId_ =
CreateIngestion'
{ $sel:ingestionType:CreateIngestion' :: Maybe IngestionType
ingestionType = forall a. Maybe a
Prelude.Nothing,
$sel:dataSetId:CreateIngestion' :: Text
dataSetId = Text
pDataSetId_,
$sel:ingestionId:CreateIngestion' :: Text
ingestionId = Text
pIngestionId_,
$sel:awsAccountId:CreateIngestion' :: Text
awsAccountId = Text
pAwsAccountId_
}
createIngestion_ingestionType :: Lens.Lens' CreateIngestion (Prelude.Maybe IngestionType)
createIngestion_ingestionType :: Lens' CreateIngestion (Maybe IngestionType)
createIngestion_ingestionType = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateIngestion' {Maybe IngestionType
ingestionType :: Maybe IngestionType
$sel:ingestionType:CreateIngestion' :: CreateIngestion -> Maybe IngestionType
ingestionType} -> Maybe IngestionType
ingestionType) (\s :: CreateIngestion
s@CreateIngestion' {} Maybe IngestionType
a -> CreateIngestion
s {$sel:ingestionType:CreateIngestion' :: Maybe IngestionType
ingestionType = Maybe IngestionType
a} :: CreateIngestion)
createIngestion_dataSetId :: Lens.Lens' CreateIngestion Prelude.Text
createIngestion_dataSetId :: Lens' CreateIngestion Text
createIngestion_dataSetId = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateIngestion' {Text
dataSetId :: Text
$sel:dataSetId:CreateIngestion' :: CreateIngestion -> Text
dataSetId} -> Text
dataSetId) (\s :: CreateIngestion
s@CreateIngestion' {} Text
a -> CreateIngestion
s {$sel:dataSetId:CreateIngestion' :: Text
dataSetId = Text
a} :: CreateIngestion)
createIngestion_ingestionId :: Lens.Lens' CreateIngestion Prelude.Text
createIngestion_ingestionId :: Lens' CreateIngestion Text
createIngestion_ingestionId = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateIngestion' {Text
ingestionId :: Text
$sel:ingestionId:CreateIngestion' :: CreateIngestion -> Text
ingestionId} -> Text
ingestionId) (\s :: CreateIngestion
s@CreateIngestion' {} Text
a -> CreateIngestion
s {$sel:ingestionId:CreateIngestion' :: Text
ingestionId = Text
a} :: CreateIngestion)
createIngestion_awsAccountId :: Lens.Lens' CreateIngestion Prelude.Text
createIngestion_awsAccountId :: Lens' CreateIngestion Text
createIngestion_awsAccountId = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateIngestion' {Text
awsAccountId :: Text
$sel:awsAccountId:CreateIngestion' :: CreateIngestion -> Text
awsAccountId} -> Text
awsAccountId) (\s :: CreateIngestion
s@CreateIngestion' {} Text
a -> CreateIngestion
s {$sel:awsAccountId:CreateIngestion' :: Text
awsAccountId = Text
a} :: CreateIngestion)
instance Core.AWSRequest CreateIngestion where
type
AWSResponse CreateIngestion =
CreateIngestionResponse
request :: (Service -> Service) -> CreateIngestion -> Request CreateIngestion
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 CreateIngestion
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse CreateIngestion)))
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 IngestionStatus
-> Maybe Text
-> Int
-> CreateIngestionResponse
CreateIngestionResponse'
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
"IngestionId")
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
"IngestionStatus")
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.<*> (forall (f :: * -> *) a. Applicative f => a -> f a
Prelude.pure (forall a. Enum a => a -> Int
Prelude.fromEnum Int
s))
)
instance Prelude.Hashable CreateIngestion where
hashWithSalt :: Int -> CreateIngestion -> Int
hashWithSalt Int
_salt CreateIngestion' {Maybe IngestionType
Text
awsAccountId :: Text
ingestionId :: Text
dataSetId :: Text
ingestionType :: Maybe IngestionType
$sel:awsAccountId:CreateIngestion' :: CreateIngestion -> Text
$sel:ingestionId:CreateIngestion' :: CreateIngestion -> Text
$sel:dataSetId:CreateIngestion' :: CreateIngestion -> Text
$sel:ingestionType:CreateIngestion' :: CreateIngestion -> Maybe IngestionType
..} =
Int
_salt
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe IngestionType
ingestionType
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
dataSetId
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
ingestionId
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
awsAccountId
instance Prelude.NFData CreateIngestion where
rnf :: CreateIngestion -> ()
rnf CreateIngestion' {Maybe IngestionType
Text
awsAccountId :: Text
ingestionId :: Text
dataSetId :: Text
ingestionType :: Maybe IngestionType
$sel:awsAccountId:CreateIngestion' :: CreateIngestion -> Text
$sel:ingestionId:CreateIngestion' :: CreateIngestion -> Text
$sel:dataSetId:CreateIngestion' :: CreateIngestion -> Text
$sel:ingestionType:CreateIngestion' :: CreateIngestion -> Maybe IngestionType
..} =
forall a. NFData a => a -> ()
Prelude.rnf Maybe IngestionType
ingestionType
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
dataSetId
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
ingestionId
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
awsAccountId
instance Data.ToHeaders CreateIngestion where
toHeaders :: CreateIngestion -> 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 CreateIngestion where
toJSON :: CreateIngestion -> Value
toJSON CreateIngestion' {Maybe IngestionType
Text
awsAccountId :: Text
ingestionId :: Text
dataSetId :: Text
ingestionType :: Maybe IngestionType
$sel:awsAccountId:CreateIngestion' :: CreateIngestion -> Text
$sel:ingestionId:CreateIngestion' :: CreateIngestion -> Text
$sel:dataSetId:CreateIngestion' :: CreateIngestion -> Text
$sel:ingestionType:CreateIngestion' :: CreateIngestion -> Maybe IngestionType
..} =
[Pair] -> Value
Data.object
( forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ (Key
"IngestionType" 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 IngestionType
ingestionType
]
)
instance Data.ToPath CreateIngestion where
toPath :: CreateIngestion -> ByteString
toPath CreateIngestion' {Maybe IngestionType
Text
awsAccountId :: Text
ingestionId :: Text
dataSetId :: Text
ingestionType :: Maybe IngestionType
$sel:awsAccountId:CreateIngestion' :: CreateIngestion -> Text
$sel:ingestionId:CreateIngestion' :: CreateIngestion -> Text
$sel:dataSetId:CreateIngestion' :: CreateIngestion -> Text
$sel:ingestionType:CreateIngestion' :: CreateIngestion -> Maybe IngestionType
..} =
forall a. Monoid a => [a] -> a
Prelude.mconcat
[ ByteString
"/accounts/",
forall a. ToByteString a => a -> ByteString
Data.toBS Text
awsAccountId,
ByteString
"/data-sets/",
forall a. ToByteString a => a -> ByteString
Data.toBS Text
dataSetId,
ByteString
"/ingestions/",
forall a. ToByteString a => a -> ByteString
Data.toBS Text
ingestionId
]
instance Data.ToQuery CreateIngestion where
toQuery :: CreateIngestion -> QueryString
toQuery = forall a b. a -> b -> a
Prelude.const forall a. Monoid a => a
Prelude.mempty
data CreateIngestionResponse = CreateIngestionResponse'
{
CreateIngestionResponse -> Maybe Text
arn :: Prelude.Maybe Prelude.Text,
CreateIngestionResponse -> Maybe Text
ingestionId :: Prelude.Maybe Prelude.Text,
CreateIngestionResponse -> Maybe IngestionStatus
ingestionStatus :: Prelude.Maybe IngestionStatus,
CreateIngestionResponse -> Maybe Text
requestId :: Prelude.Maybe Prelude.Text,
CreateIngestionResponse -> Int
status :: Prelude.Int
}
deriving (CreateIngestionResponse -> CreateIngestionResponse -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: CreateIngestionResponse -> CreateIngestionResponse -> Bool
$c/= :: CreateIngestionResponse -> CreateIngestionResponse -> Bool
== :: CreateIngestionResponse -> CreateIngestionResponse -> Bool
$c== :: CreateIngestionResponse -> CreateIngestionResponse -> Bool
Prelude.Eq, ReadPrec [CreateIngestionResponse]
ReadPrec CreateIngestionResponse
Int -> ReadS CreateIngestionResponse
ReadS [CreateIngestionResponse]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [CreateIngestionResponse]
$creadListPrec :: ReadPrec [CreateIngestionResponse]
readPrec :: ReadPrec CreateIngestionResponse
$creadPrec :: ReadPrec CreateIngestionResponse
readList :: ReadS [CreateIngestionResponse]
$creadList :: ReadS [CreateIngestionResponse]
readsPrec :: Int -> ReadS CreateIngestionResponse
$creadsPrec :: Int -> ReadS CreateIngestionResponse
Prelude.Read, Int -> CreateIngestionResponse -> ShowS
[CreateIngestionResponse] -> ShowS
CreateIngestionResponse -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [CreateIngestionResponse] -> ShowS
$cshowList :: [CreateIngestionResponse] -> ShowS
show :: CreateIngestionResponse -> String
$cshow :: CreateIngestionResponse -> String
showsPrec :: Int -> CreateIngestionResponse -> ShowS
$cshowsPrec :: Int -> CreateIngestionResponse -> ShowS
Prelude.Show, forall x. Rep CreateIngestionResponse x -> CreateIngestionResponse
forall x. CreateIngestionResponse -> Rep CreateIngestionResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep CreateIngestionResponse x -> CreateIngestionResponse
$cfrom :: forall x. CreateIngestionResponse -> Rep CreateIngestionResponse x
Prelude.Generic)
newCreateIngestionResponse ::
Prelude.Int ->
CreateIngestionResponse
newCreateIngestionResponse :: Int -> CreateIngestionResponse
newCreateIngestionResponse Int
pStatus_ =
CreateIngestionResponse'
{ $sel:arn:CreateIngestionResponse' :: Maybe Text
arn = forall a. Maybe a
Prelude.Nothing,
$sel:ingestionId:CreateIngestionResponse' :: Maybe Text
ingestionId = forall a. Maybe a
Prelude.Nothing,
$sel:ingestionStatus:CreateIngestionResponse' :: Maybe IngestionStatus
ingestionStatus = forall a. Maybe a
Prelude.Nothing,
$sel:requestId:CreateIngestionResponse' :: Maybe Text
requestId = forall a. Maybe a
Prelude.Nothing,
$sel:status:CreateIngestionResponse' :: Int
status = Int
pStatus_
}
createIngestionResponse_arn :: Lens.Lens' CreateIngestionResponse (Prelude.Maybe Prelude.Text)
createIngestionResponse_arn :: Lens' CreateIngestionResponse (Maybe Text)
createIngestionResponse_arn = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateIngestionResponse' {Maybe Text
arn :: Maybe Text
$sel:arn:CreateIngestionResponse' :: CreateIngestionResponse -> Maybe Text
arn} -> Maybe Text
arn) (\s :: CreateIngestionResponse
s@CreateIngestionResponse' {} Maybe Text
a -> CreateIngestionResponse
s {$sel:arn:CreateIngestionResponse' :: Maybe Text
arn = Maybe Text
a} :: CreateIngestionResponse)
createIngestionResponse_ingestionId :: Lens.Lens' CreateIngestionResponse (Prelude.Maybe Prelude.Text)
createIngestionResponse_ingestionId :: Lens' CreateIngestionResponse (Maybe Text)
createIngestionResponse_ingestionId = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateIngestionResponse' {Maybe Text
ingestionId :: Maybe Text
$sel:ingestionId:CreateIngestionResponse' :: CreateIngestionResponse -> Maybe Text
ingestionId} -> Maybe Text
ingestionId) (\s :: CreateIngestionResponse
s@CreateIngestionResponse' {} Maybe Text
a -> CreateIngestionResponse
s {$sel:ingestionId:CreateIngestionResponse' :: Maybe Text
ingestionId = Maybe Text
a} :: CreateIngestionResponse)
createIngestionResponse_ingestionStatus :: Lens.Lens' CreateIngestionResponse (Prelude.Maybe IngestionStatus)
createIngestionResponse_ingestionStatus :: Lens' CreateIngestionResponse (Maybe IngestionStatus)
createIngestionResponse_ingestionStatus = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateIngestionResponse' {Maybe IngestionStatus
ingestionStatus :: Maybe IngestionStatus
$sel:ingestionStatus:CreateIngestionResponse' :: CreateIngestionResponse -> Maybe IngestionStatus
ingestionStatus} -> Maybe IngestionStatus
ingestionStatus) (\s :: CreateIngestionResponse
s@CreateIngestionResponse' {} Maybe IngestionStatus
a -> CreateIngestionResponse
s {$sel:ingestionStatus:CreateIngestionResponse' :: Maybe IngestionStatus
ingestionStatus = Maybe IngestionStatus
a} :: CreateIngestionResponse)
createIngestionResponse_requestId :: Lens.Lens' CreateIngestionResponse (Prelude.Maybe Prelude.Text)
createIngestionResponse_requestId :: Lens' CreateIngestionResponse (Maybe Text)
createIngestionResponse_requestId = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateIngestionResponse' {Maybe Text
requestId :: Maybe Text
$sel:requestId:CreateIngestionResponse' :: CreateIngestionResponse -> Maybe Text
requestId} -> Maybe Text
requestId) (\s :: CreateIngestionResponse
s@CreateIngestionResponse' {} Maybe Text
a -> CreateIngestionResponse
s {$sel:requestId:CreateIngestionResponse' :: Maybe Text
requestId = Maybe Text
a} :: CreateIngestionResponse)
createIngestionResponse_status :: Lens.Lens' CreateIngestionResponse Prelude.Int
createIngestionResponse_status :: Lens' CreateIngestionResponse Int
createIngestionResponse_status = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateIngestionResponse' {Int
status :: Int
$sel:status:CreateIngestionResponse' :: CreateIngestionResponse -> Int
status} -> Int
status) (\s :: CreateIngestionResponse
s@CreateIngestionResponse' {} Int
a -> CreateIngestionResponse
s {$sel:status:CreateIngestionResponse' :: Int
status = Int
a} :: CreateIngestionResponse)
instance Prelude.NFData CreateIngestionResponse where
rnf :: CreateIngestionResponse -> ()
rnf CreateIngestionResponse' {Int
Maybe Text
Maybe IngestionStatus
status :: Int
requestId :: Maybe Text
ingestionStatus :: Maybe IngestionStatus
ingestionId :: Maybe Text
arn :: Maybe Text
$sel:status:CreateIngestionResponse' :: CreateIngestionResponse -> Int
$sel:requestId:CreateIngestionResponse' :: CreateIngestionResponse -> Maybe Text
$sel:ingestionStatus:CreateIngestionResponse' :: CreateIngestionResponse -> Maybe IngestionStatus
$sel:ingestionId:CreateIngestionResponse' :: CreateIngestionResponse -> Maybe Text
$sel:arn:CreateIngestionResponse' :: CreateIngestionResponse -> 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
ingestionId
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe IngestionStatus
ingestionStatus
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 Int
status