{-# 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.CreateDataSet
-- 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 dataset.
module Amazonka.QuickSight.CreateDataSet
  ( -- * Creating a Request
    CreateDataSet (..),
    newCreateDataSet,

    -- * Request Lenses
    createDataSet_fieldFolders,
    createDataSet_columnGroups,
    createDataSet_dataSetUsageConfiguration,
    createDataSet_rowLevelPermissionTagConfiguration,
    createDataSet_rowLevelPermissionDataSet,
    createDataSet_permissions,
    createDataSet_columnLevelPermissionRules,
    createDataSet_tags,
    createDataSet_logicalTableMap,
    createDataSet_awsAccountId,
    createDataSet_dataSetId,
    createDataSet_name,
    createDataSet_physicalTableMap,
    createDataSet_importMode,

    -- * Destructuring the Response
    CreateDataSetResponse (..),
    newCreateDataSetResponse,

    -- * Response Lenses
    createDataSetResponse_requestId,
    createDataSetResponse_ingestionArn,
    createDataSetResponse_arn,
    createDataSetResponse_ingestionId,
    createDataSetResponse_dataSetId,
    createDataSetResponse_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:/ 'newCreateDataSet' smart constructor.
data CreateDataSet = CreateDataSet'
  { -- | The folder that contains fields and nested subfolders for your dataset.
    CreateDataSet -> Maybe (HashMap Text FieldFolder)
fieldFolders :: Prelude.Maybe (Prelude.HashMap Prelude.Text FieldFolder),
    -- | Groupings of columns that work together in certain Amazon QuickSight
    -- features. Currently, only geospatial hierarchy is supported.
    CreateDataSet -> Maybe (NonEmpty ColumnGroup)
columnGroups :: Prelude.Maybe (Prelude.NonEmpty ColumnGroup),
    CreateDataSet -> Maybe DataSetUsageConfiguration
dataSetUsageConfiguration :: Prelude.Maybe DataSetUsageConfiguration,
    -- | The configuration of tags on a dataset to set row-level security.
    -- Row-level security tags are currently supported for anonymous embedding
    -- only.
    CreateDataSet -> Maybe RowLevelPermissionTagConfiguration
rowLevelPermissionTagConfiguration :: Prelude.Maybe RowLevelPermissionTagConfiguration,
    -- | The row-level security configuration for the data that you want to
    -- create.
    CreateDataSet -> Maybe RowLevelPermissionDataSet
rowLevelPermissionDataSet :: Prelude.Maybe RowLevelPermissionDataSet,
    -- | A list of resource permissions on the dataset.
    CreateDataSet -> Maybe (NonEmpty ResourcePermission)
permissions :: Prelude.Maybe (Prelude.NonEmpty ResourcePermission),
    -- | A set of one or more definitions of a @ ColumnLevelPermissionRule @.
    CreateDataSet -> Maybe (NonEmpty ColumnLevelPermissionRule)
columnLevelPermissionRules :: Prelude.Maybe (Prelude.NonEmpty ColumnLevelPermissionRule),
    -- | Contains a map of the key-value pairs for the resource tag or tags
    -- assigned to the dataset.
    CreateDataSet -> Maybe (NonEmpty Tag)
tags :: Prelude.Maybe (Prelude.NonEmpty Tag),
    -- | Configures the combination and transformation of the data from the
    -- physical tables.
    CreateDataSet -> Maybe (HashMap Text LogicalTable)
logicalTableMap :: Prelude.Maybe (Prelude.HashMap Prelude.Text LogicalTable),
    -- | The Amazon Web Services account ID.
    CreateDataSet -> Text
awsAccountId :: Prelude.Text,
    -- | An ID for the dataset that you want to create. This ID is unique per
    -- Amazon Web Services Region for each Amazon Web Services account.
    CreateDataSet -> Text
dataSetId :: Prelude.Text,
    -- | The display name for the dataset.
    CreateDataSet -> Text
name :: Prelude.Text,
    -- | Declares the physical tables that are available in the underlying data
    -- sources.
    CreateDataSet -> HashMap Text PhysicalTable
physicalTableMap :: Prelude.HashMap Prelude.Text PhysicalTable,
    -- | Indicates whether you want to import the data into SPICE.
    CreateDataSet -> DataSetImportMode
importMode :: DataSetImportMode
  }
  deriving (CreateDataSet -> CreateDataSet -> Bool
(CreateDataSet -> CreateDataSet -> Bool)
-> (CreateDataSet -> CreateDataSet -> Bool) -> Eq CreateDataSet
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: CreateDataSet -> CreateDataSet -> Bool
$c/= :: CreateDataSet -> CreateDataSet -> Bool
== :: CreateDataSet -> CreateDataSet -> Bool
$c== :: CreateDataSet -> CreateDataSet -> Bool
Prelude.Eq, Int -> CreateDataSet -> ShowS
[CreateDataSet] -> ShowS
CreateDataSet -> String
(Int -> CreateDataSet -> ShowS)
-> (CreateDataSet -> String)
-> ([CreateDataSet] -> ShowS)
-> Show CreateDataSet
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [CreateDataSet] -> ShowS
$cshowList :: [CreateDataSet] -> ShowS
show :: CreateDataSet -> String
$cshow :: CreateDataSet -> String
showsPrec :: Int -> CreateDataSet -> ShowS
$cshowsPrec :: Int -> CreateDataSet -> ShowS
Prelude.Show, (forall x. CreateDataSet -> Rep CreateDataSet x)
-> (forall x. Rep CreateDataSet x -> CreateDataSet)
-> Generic CreateDataSet
forall x. Rep CreateDataSet x -> CreateDataSet
forall x. CreateDataSet -> Rep CreateDataSet x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep CreateDataSet x -> CreateDataSet
$cfrom :: forall x. CreateDataSet -> Rep CreateDataSet x
Prelude.Generic)

-- |
-- Create a value of 'CreateDataSet' 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:
--
-- 'fieldFolders', 'createDataSet_fieldFolders' - The folder that contains fields and nested subfolders for your dataset.
--
-- 'columnGroups', 'createDataSet_columnGroups' - Groupings of columns that work together in certain Amazon QuickSight
-- features. Currently, only geospatial hierarchy is supported.
--
-- 'dataSetUsageConfiguration', 'createDataSet_dataSetUsageConfiguration' - Undocumented member.
--
-- 'rowLevelPermissionTagConfiguration', 'createDataSet_rowLevelPermissionTagConfiguration' - The configuration of tags on a dataset to set row-level security.
-- Row-level security tags are currently supported for anonymous embedding
-- only.
--
-- 'rowLevelPermissionDataSet', 'createDataSet_rowLevelPermissionDataSet' - The row-level security configuration for the data that you want to
-- create.
--
-- 'permissions', 'createDataSet_permissions' - A list of resource permissions on the dataset.
--
-- 'columnLevelPermissionRules', 'createDataSet_columnLevelPermissionRules' - A set of one or more definitions of a @ ColumnLevelPermissionRule @.
--
-- 'tags', 'createDataSet_tags' - Contains a map of the key-value pairs for the resource tag or tags
-- assigned to the dataset.
--
-- 'logicalTableMap', 'createDataSet_logicalTableMap' - Configures the combination and transformation of the data from the
-- physical tables.
--
-- 'awsAccountId', 'createDataSet_awsAccountId' - The Amazon Web Services account ID.
--
-- 'dataSetId', 'createDataSet_dataSetId' - An ID for the dataset that you want to create. This ID is unique per
-- Amazon Web Services Region for each Amazon Web Services account.
--
-- 'name', 'createDataSet_name' - The display name for the dataset.
--
-- 'physicalTableMap', 'createDataSet_physicalTableMap' - Declares the physical tables that are available in the underlying data
-- sources.
--
-- 'importMode', 'createDataSet_importMode' - Indicates whether you want to import the data into SPICE.
newCreateDataSet ::
  -- | 'awsAccountId'
  Prelude.Text ->
  -- | 'dataSetId'
  Prelude.Text ->
  -- | 'name'
  Prelude.Text ->
  -- | 'importMode'
  DataSetImportMode ->
  CreateDataSet
newCreateDataSet :: Text -> Text -> Text -> DataSetImportMode -> CreateDataSet
newCreateDataSet
  Text
pAwsAccountId_
  Text
pDataSetId_
  Text
pName_
  DataSetImportMode
pImportMode_ =
    CreateDataSet' :: Maybe (HashMap Text FieldFolder)
-> Maybe (NonEmpty ColumnGroup)
-> Maybe DataSetUsageConfiguration
-> Maybe RowLevelPermissionTagConfiguration
-> Maybe RowLevelPermissionDataSet
-> Maybe (NonEmpty ResourcePermission)
-> Maybe (NonEmpty ColumnLevelPermissionRule)
-> Maybe (NonEmpty Tag)
-> Maybe (HashMap Text LogicalTable)
-> Text
-> Text
-> Text
-> HashMap Text PhysicalTable
-> DataSetImportMode
-> CreateDataSet
CreateDataSet'
      { $sel:fieldFolders:CreateDataSet' :: Maybe (HashMap Text FieldFolder)
fieldFolders = Maybe (HashMap Text FieldFolder)
forall a. Maybe a
Prelude.Nothing,
        $sel:columnGroups:CreateDataSet' :: Maybe (NonEmpty ColumnGroup)
columnGroups = Maybe (NonEmpty ColumnGroup)
forall a. Maybe a
Prelude.Nothing,
        $sel:dataSetUsageConfiguration:CreateDataSet' :: Maybe DataSetUsageConfiguration
dataSetUsageConfiguration = Maybe DataSetUsageConfiguration
forall a. Maybe a
Prelude.Nothing,
        $sel:rowLevelPermissionTagConfiguration:CreateDataSet' :: Maybe RowLevelPermissionTagConfiguration
rowLevelPermissionTagConfiguration = Maybe RowLevelPermissionTagConfiguration
forall a. Maybe a
Prelude.Nothing,
        $sel:rowLevelPermissionDataSet:CreateDataSet' :: Maybe RowLevelPermissionDataSet
rowLevelPermissionDataSet = Maybe RowLevelPermissionDataSet
forall a. Maybe a
Prelude.Nothing,
        $sel:permissions:CreateDataSet' :: Maybe (NonEmpty ResourcePermission)
permissions = Maybe (NonEmpty ResourcePermission)
forall a. Maybe a
Prelude.Nothing,
        $sel:columnLevelPermissionRules:CreateDataSet' :: Maybe (NonEmpty ColumnLevelPermissionRule)
columnLevelPermissionRules = Maybe (NonEmpty ColumnLevelPermissionRule)
forall a. Maybe a
Prelude.Nothing,
        $sel:tags:CreateDataSet' :: Maybe (NonEmpty Tag)
tags = Maybe (NonEmpty Tag)
forall a. Maybe a
Prelude.Nothing,
        $sel:logicalTableMap:CreateDataSet' :: Maybe (HashMap Text LogicalTable)
logicalTableMap = Maybe (HashMap Text LogicalTable)
forall a. Maybe a
Prelude.Nothing,
        $sel:awsAccountId:CreateDataSet' :: Text
awsAccountId = Text
pAwsAccountId_,
        $sel:dataSetId:CreateDataSet' :: Text
dataSetId = Text
pDataSetId_,
        $sel:name:CreateDataSet' :: Text
name = Text
pName_,
        $sel:physicalTableMap:CreateDataSet' :: HashMap Text PhysicalTable
physicalTableMap = HashMap Text PhysicalTable
forall a. Monoid a => a
Prelude.mempty,
        $sel:importMode:CreateDataSet' :: DataSetImportMode
importMode = DataSetImportMode
pImportMode_
      }

-- | The folder that contains fields and nested subfolders for your dataset.
createDataSet_fieldFolders :: Lens.Lens' CreateDataSet (Prelude.Maybe (Prelude.HashMap Prelude.Text FieldFolder))
createDataSet_fieldFolders :: (Maybe (HashMap Text FieldFolder)
 -> f (Maybe (HashMap Text FieldFolder)))
-> CreateDataSet -> f CreateDataSet
createDataSet_fieldFolders = (CreateDataSet -> Maybe (HashMap Text FieldFolder))
-> (CreateDataSet
    -> Maybe (HashMap Text FieldFolder) -> CreateDataSet)
-> Lens
     CreateDataSet
     CreateDataSet
     (Maybe (HashMap Text FieldFolder))
     (Maybe (HashMap Text FieldFolder))
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateDataSet' {Maybe (HashMap Text FieldFolder)
fieldFolders :: Maybe (HashMap Text FieldFolder)
$sel:fieldFolders:CreateDataSet' :: CreateDataSet -> Maybe (HashMap Text FieldFolder)
fieldFolders} -> Maybe (HashMap Text FieldFolder)
fieldFolders) (\s :: CreateDataSet
s@CreateDataSet' {} Maybe (HashMap Text FieldFolder)
a -> CreateDataSet
s {$sel:fieldFolders:CreateDataSet' :: Maybe (HashMap Text FieldFolder)
fieldFolders = Maybe (HashMap Text FieldFolder)
a} :: CreateDataSet) ((Maybe (HashMap Text FieldFolder)
  -> f (Maybe (HashMap Text FieldFolder)))
 -> CreateDataSet -> f CreateDataSet)
-> ((Maybe (HashMap Text FieldFolder)
     -> f (Maybe (HashMap Text FieldFolder)))
    -> Maybe (HashMap Text FieldFolder)
    -> f (Maybe (HashMap Text FieldFolder)))
-> (Maybe (HashMap Text FieldFolder)
    -> f (Maybe (HashMap Text FieldFolder)))
-> CreateDataSet
-> f CreateDataSet
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
  (HashMap Text FieldFolder)
  (HashMap Text FieldFolder)
  (HashMap Text FieldFolder)
  (HashMap Text FieldFolder)
-> Iso
     (Maybe (HashMap Text FieldFolder))
     (Maybe (HashMap Text FieldFolder))
     (Maybe (HashMap Text FieldFolder))
     (Maybe (HashMap Text FieldFolder))
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
  (HashMap Text FieldFolder)
  (HashMap Text FieldFolder)
  (HashMap Text FieldFolder)
  (HashMap Text FieldFolder)
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | Groupings of columns that work together in certain Amazon QuickSight
-- features. Currently, only geospatial hierarchy is supported.
createDataSet_columnGroups :: Lens.Lens' CreateDataSet (Prelude.Maybe (Prelude.NonEmpty ColumnGroup))
createDataSet_columnGroups :: (Maybe (NonEmpty ColumnGroup) -> f (Maybe (NonEmpty ColumnGroup)))
-> CreateDataSet -> f CreateDataSet
createDataSet_columnGroups = (CreateDataSet -> Maybe (NonEmpty ColumnGroup))
-> (CreateDataSet -> Maybe (NonEmpty ColumnGroup) -> CreateDataSet)
-> Lens
     CreateDataSet
     CreateDataSet
     (Maybe (NonEmpty ColumnGroup))
     (Maybe (NonEmpty ColumnGroup))
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateDataSet' {Maybe (NonEmpty ColumnGroup)
columnGroups :: Maybe (NonEmpty ColumnGroup)
$sel:columnGroups:CreateDataSet' :: CreateDataSet -> Maybe (NonEmpty ColumnGroup)
columnGroups} -> Maybe (NonEmpty ColumnGroup)
columnGroups) (\s :: CreateDataSet
s@CreateDataSet' {} Maybe (NonEmpty ColumnGroup)
a -> CreateDataSet
s {$sel:columnGroups:CreateDataSet' :: Maybe (NonEmpty ColumnGroup)
columnGroups = Maybe (NonEmpty ColumnGroup)
a} :: CreateDataSet) ((Maybe (NonEmpty ColumnGroup) -> f (Maybe (NonEmpty ColumnGroup)))
 -> CreateDataSet -> f CreateDataSet)
-> ((Maybe (NonEmpty ColumnGroup)
     -> f (Maybe (NonEmpty ColumnGroup)))
    -> Maybe (NonEmpty ColumnGroup)
    -> f (Maybe (NonEmpty ColumnGroup)))
-> (Maybe (NonEmpty ColumnGroup)
    -> f (Maybe (NonEmpty ColumnGroup)))
-> CreateDataSet
-> f CreateDataSet
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
  (NonEmpty ColumnGroup)
  (NonEmpty ColumnGroup)
  (NonEmpty ColumnGroup)
  (NonEmpty ColumnGroup)
-> Iso
     (Maybe (NonEmpty ColumnGroup))
     (Maybe (NonEmpty ColumnGroup))
     (Maybe (NonEmpty ColumnGroup))
     (Maybe (NonEmpty ColumnGroup))
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 ColumnGroup)
  (NonEmpty ColumnGroup)
  (NonEmpty ColumnGroup)
  (NonEmpty ColumnGroup)
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | Undocumented member.
createDataSet_dataSetUsageConfiguration :: Lens.Lens' CreateDataSet (Prelude.Maybe DataSetUsageConfiguration)
createDataSet_dataSetUsageConfiguration :: (Maybe DataSetUsageConfiguration
 -> f (Maybe DataSetUsageConfiguration))
-> CreateDataSet -> f CreateDataSet
createDataSet_dataSetUsageConfiguration = (CreateDataSet -> Maybe DataSetUsageConfiguration)
-> (CreateDataSet
    -> Maybe DataSetUsageConfiguration -> CreateDataSet)
-> Lens
     CreateDataSet
     CreateDataSet
     (Maybe DataSetUsageConfiguration)
     (Maybe DataSetUsageConfiguration)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateDataSet' {Maybe DataSetUsageConfiguration
dataSetUsageConfiguration :: Maybe DataSetUsageConfiguration
$sel:dataSetUsageConfiguration:CreateDataSet' :: CreateDataSet -> Maybe DataSetUsageConfiguration
dataSetUsageConfiguration} -> Maybe DataSetUsageConfiguration
dataSetUsageConfiguration) (\s :: CreateDataSet
s@CreateDataSet' {} Maybe DataSetUsageConfiguration
a -> CreateDataSet
s {$sel:dataSetUsageConfiguration:CreateDataSet' :: Maybe DataSetUsageConfiguration
dataSetUsageConfiguration = Maybe DataSetUsageConfiguration
a} :: CreateDataSet)

-- | The configuration of tags on a dataset to set row-level security.
-- Row-level security tags are currently supported for anonymous embedding
-- only.
createDataSet_rowLevelPermissionTagConfiguration :: Lens.Lens' CreateDataSet (Prelude.Maybe RowLevelPermissionTagConfiguration)
createDataSet_rowLevelPermissionTagConfiguration :: (Maybe RowLevelPermissionTagConfiguration
 -> f (Maybe RowLevelPermissionTagConfiguration))
-> CreateDataSet -> f CreateDataSet
createDataSet_rowLevelPermissionTagConfiguration = (CreateDataSet -> Maybe RowLevelPermissionTagConfiguration)
-> (CreateDataSet
    -> Maybe RowLevelPermissionTagConfiguration -> CreateDataSet)
-> Lens
     CreateDataSet
     CreateDataSet
     (Maybe RowLevelPermissionTagConfiguration)
     (Maybe RowLevelPermissionTagConfiguration)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateDataSet' {Maybe RowLevelPermissionTagConfiguration
rowLevelPermissionTagConfiguration :: Maybe RowLevelPermissionTagConfiguration
$sel:rowLevelPermissionTagConfiguration:CreateDataSet' :: CreateDataSet -> Maybe RowLevelPermissionTagConfiguration
rowLevelPermissionTagConfiguration} -> Maybe RowLevelPermissionTagConfiguration
rowLevelPermissionTagConfiguration) (\s :: CreateDataSet
s@CreateDataSet' {} Maybe RowLevelPermissionTagConfiguration
a -> CreateDataSet
s {$sel:rowLevelPermissionTagConfiguration:CreateDataSet' :: Maybe RowLevelPermissionTagConfiguration
rowLevelPermissionTagConfiguration = Maybe RowLevelPermissionTagConfiguration
a} :: CreateDataSet)

-- | The row-level security configuration for the data that you want to
-- create.
createDataSet_rowLevelPermissionDataSet :: Lens.Lens' CreateDataSet (Prelude.Maybe RowLevelPermissionDataSet)
createDataSet_rowLevelPermissionDataSet :: (Maybe RowLevelPermissionDataSet
 -> f (Maybe RowLevelPermissionDataSet))
-> CreateDataSet -> f CreateDataSet
createDataSet_rowLevelPermissionDataSet = (CreateDataSet -> Maybe RowLevelPermissionDataSet)
-> (CreateDataSet
    -> Maybe RowLevelPermissionDataSet -> CreateDataSet)
-> Lens
     CreateDataSet
     CreateDataSet
     (Maybe RowLevelPermissionDataSet)
     (Maybe RowLevelPermissionDataSet)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateDataSet' {Maybe RowLevelPermissionDataSet
rowLevelPermissionDataSet :: Maybe RowLevelPermissionDataSet
$sel:rowLevelPermissionDataSet:CreateDataSet' :: CreateDataSet -> Maybe RowLevelPermissionDataSet
rowLevelPermissionDataSet} -> Maybe RowLevelPermissionDataSet
rowLevelPermissionDataSet) (\s :: CreateDataSet
s@CreateDataSet' {} Maybe RowLevelPermissionDataSet
a -> CreateDataSet
s {$sel:rowLevelPermissionDataSet:CreateDataSet' :: Maybe RowLevelPermissionDataSet
rowLevelPermissionDataSet = Maybe RowLevelPermissionDataSet
a} :: CreateDataSet)

-- | A list of resource permissions on the dataset.
createDataSet_permissions :: Lens.Lens' CreateDataSet (Prelude.Maybe (Prelude.NonEmpty ResourcePermission))
createDataSet_permissions :: (Maybe (NonEmpty ResourcePermission)
 -> f (Maybe (NonEmpty ResourcePermission)))
-> CreateDataSet -> f CreateDataSet
createDataSet_permissions = (CreateDataSet -> Maybe (NonEmpty ResourcePermission))
-> (CreateDataSet
    -> Maybe (NonEmpty ResourcePermission) -> CreateDataSet)
-> Lens
     CreateDataSet
     CreateDataSet
     (Maybe (NonEmpty ResourcePermission))
     (Maybe (NonEmpty ResourcePermission))
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateDataSet' {Maybe (NonEmpty ResourcePermission)
permissions :: Maybe (NonEmpty ResourcePermission)
$sel:permissions:CreateDataSet' :: CreateDataSet -> Maybe (NonEmpty ResourcePermission)
permissions} -> Maybe (NonEmpty ResourcePermission)
permissions) (\s :: CreateDataSet
s@CreateDataSet' {} Maybe (NonEmpty ResourcePermission)
a -> CreateDataSet
s {$sel:permissions:CreateDataSet' :: Maybe (NonEmpty ResourcePermission)
permissions = Maybe (NonEmpty ResourcePermission)
a} :: CreateDataSet) ((Maybe (NonEmpty ResourcePermission)
  -> f (Maybe (NonEmpty ResourcePermission)))
 -> CreateDataSet -> f CreateDataSet)
-> ((Maybe (NonEmpty ResourcePermission)
     -> f (Maybe (NonEmpty ResourcePermission)))
    -> Maybe (NonEmpty ResourcePermission)
    -> f (Maybe (NonEmpty ResourcePermission)))
-> (Maybe (NonEmpty ResourcePermission)
    -> f (Maybe (NonEmpty ResourcePermission)))
-> CreateDataSet
-> f CreateDataSet
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

-- | A set of one or more definitions of a @ ColumnLevelPermissionRule @.
createDataSet_columnLevelPermissionRules :: Lens.Lens' CreateDataSet (Prelude.Maybe (Prelude.NonEmpty ColumnLevelPermissionRule))
createDataSet_columnLevelPermissionRules :: (Maybe (NonEmpty ColumnLevelPermissionRule)
 -> f (Maybe (NonEmpty ColumnLevelPermissionRule)))
-> CreateDataSet -> f CreateDataSet
createDataSet_columnLevelPermissionRules = (CreateDataSet -> Maybe (NonEmpty ColumnLevelPermissionRule))
-> (CreateDataSet
    -> Maybe (NonEmpty ColumnLevelPermissionRule) -> CreateDataSet)
-> Lens
     CreateDataSet
     CreateDataSet
     (Maybe (NonEmpty ColumnLevelPermissionRule))
     (Maybe (NonEmpty ColumnLevelPermissionRule))
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateDataSet' {Maybe (NonEmpty ColumnLevelPermissionRule)
columnLevelPermissionRules :: Maybe (NonEmpty ColumnLevelPermissionRule)
$sel:columnLevelPermissionRules:CreateDataSet' :: CreateDataSet -> Maybe (NonEmpty ColumnLevelPermissionRule)
columnLevelPermissionRules} -> Maybe (NonEmpty ColumnLevelPermissionRule)
columnLevelPermissionRules) (\s :: CreateDataSet
s@CreateDataSet' {} Maybe (NonEmpty ColumnLevelPermissionRule)
a -> CreateDataSet
s {$sel:columnLevelPermissionRules:CreateDataSet' :: Maybe (NonEmpty ColumnLevelPermissionRule)
columnLevelPermissionRules = Maybe (NonEmpty ColumnLevelPermissionRule)
a} :: CreateDataSet) ((Maybe (NonEmpty ColumnLevelPermissionRule)
  -> f (Maybe (NonEmpty ColumnLevelPermissionRule)))
 -> CreateDataSet -> f CreateDataSet)
-> ((Maybe (NonEmpty ColumnLevelPermissionRule)
     -> f (Maybe (NonEmpty ColumnLevelPermissionRule)))
    -> Maybe (NonEmpty ColumnLevelPermissionRule)
    -> f (Maybe (NonEmpty ColumnLevelPermissionRule)))
-> (Maybe (NonEmpty ColumnLevelPermissionRule)
    -> f (Maybe (NonEmpty ColumnLevelPermissionRule)))
-> CreateDataSet
-> f CreateDataSet
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
  (NonEmpty ColumnLevelPermissionRule)
  (NonEmpty ColumnLevelPermissionRule)
  (NonEmpty ColumnLevelPermissionRule)
  (NonEmpty ColumnLevelPermissionRule)
-> Iso
     (Maybe (NonEmpty ColumnLevelPermissionRule))
     (Maybe (NonEmpty ColumnLevelPermissionRule))
     (Maybe (NonEmpty ColumnLevelPermissionRule))
     (Maybe (NonEmpty ColumnLevelPermissionRule))
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 ColumnLevelPermissionRule)
  (NonEmpty ColumnLevelPermissionRule)
  (NonEmpty ColumnLevelPermissionRule)
  (NonEmpty ColumnLevelPermissionRule)
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 dataset.
createDataSet_tags :: Lens.Lens' CreateDataSet (Prelude.Maybe (Prelude.NonEmpty Tag))
createDataSet_tags :: (Maybe (NonEmpty Tag) -> f (Maybe (NonEmpty Tag)))
-> CreateDataSet -> f CreateDataSet
createDataSet_tags = (CreateDataSet -> Maybe (NonEmpty Tag))
-> (CreateDataSet -> Maybe (NonEmpty Tag) -> CreateDataSet)
-> Lens
     CreateDataSet
     CreateDataSet
     (Maybe (NonEmpty Tag))
     (Maybe (NonEmpty Tag))
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateDataSet' {Maybe (NonEmpty Tag)
tags :: Maybe (NonEmpty Tag)
$sel:tags:CreateDataSet' :: CreateDataSet -> Maybe (NonEmpty Tag)
tags} -> Maybe (NonEmpty Tag)
tags) (\s :: CreateDataSet
s@CreateDataSet' {} Maybe (NonEmpty Tag)
a -> CreateDataSet
s {$sel:tags:CreateDataSet' :: Maybe (NonEmpty Tag)
tags = Maybe (NonEmpty Tag)
a} :: CreateDataSet) ((Maybe (NonEmpty Tag) -> f (Maybe (NonEmpty Tag)))
 -> CreateDataSet -> f CreateDataSet)
-> ((Maybe (NonEmpty Tag) -> f (Maybe (NonEmpty Tag)))
    -> Maybe (NonEmpty Tag) -> f (Maybe (NonEmpty Tag)))
-> (Maybe (NonEmpty Tag) -> f (Maybe (NonEmpty Tag)))
-> CreateDataSet
-> f CreateDataSet
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

-- | Configures the combination and transformation of the data from the
-- physical tables.
createDataSet_logicalTableMap :: Lens.Lens' CreateDataSet (Prelude.Maybe (Prelude.HashMap Prelude.Text LogicalTable))
createDataSet_logicalTableMap :: (Maybe (HashMap Text LogicalTable)
 -> f (Maybe (HashMap Text LogicalTable)))
-> CreateDataSet -> f CreateDataSet
createDataSet_logicalTableMap = (CreateDataSet -> Maybe (HashMap Text LogicalTable))
-> (CreateDataSet
    -> Maybe (HashMap Text LogicalTable) -> CreateDataSet)
-> Lens
     CreateDataSet
     CreateDataSet
     (Maybe (HashMap Text LogicalTable))
     (Maybe (HashMap Text LogicalTable))
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateDataSet' {Maybe (HashMap Text LogicalTable)
logicalTableMap :: Maybe (HashMap Text LogicalTable)
$sel:logicalTableMap:CreateDataSet' :: CreateDataSet -> Maybe (HashMap Text LogicalTable)
logicalTableMap} -> Maybe (HashMap Text LogicalTable)
logicalTableMap) (\s :: CreateDataSet
s@CreateDataSet' {} Maybe (HashMap Text LogicalTable)
a -> CreateDataSet
s {$sel:logicalTableMap:CreateDataSet' :: Maybe (HashMap Text LogicalTable)
logicalTableMap = Maybe (HashMap Text LogicalTable)
a} :: CreateDataSet) ((Maybe (HashMap Text LogicalTable)
  -> f (Maybe (HashMap Text LogicalTable)))
 -> CreateDataSet -> f CreateDataSet)
-> ((Maybe (HashMap Text LogicalTable)
     -> f (Maybe (HashMap Text LogicalTable)))
    -> Maybe (HashMap Text LogicalTable)
    -> f (Maybe (HashMap Text LogicalTable)))
-> (Maybe (HashMap Text LogicalTable)
    -> f (Maybe (HashMap Text LogicalTable)))
-> CreateDataSet
-> f CreateDataSet
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
  (HashMap Text LogicalTable)
  (HashMap Text LogicalTable)
  (HashMap Text LogicalTable)
  (HashMap Text LogicalTable)
-> Iso
     (Maybe (HashMap Text LogicalTable))
     (Maybe (HashMap Text LogicalTable))
     (Maybe (HashMap Text LogicalTable))
     (Maybe (HashMap Text LogicalTable))
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
  (HashMap Text LogicalTable)
  (HashMap Text LogicalTable)
  (HashMap Text LogicalTable)
  (HashMap Text LogicalTable)
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

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

-- | An ID for the dataset that you want to create. This ID is unique per
-- Amazon Web Services Region for each Amazon Web Services account.
createDataSet_dataSetId :: Lens.Lens' CreateDataSet Prelude.Text
createDataSet_dataSetId :: (Text -> f Text) -> CreateDataSet -> f CreateDataSet
createDataSet_dataSetId = (CreateDataSet -> Text)
-> (CreateDataSet -> Text -> CreateDataSet)
-> Lens CreateDataSet CreateDataSet Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateDataSet' {Text
dataSetId :: Text
$sel:dataSetId:CreateDataSet' :: CreateDataSet -> Text
dataSetId} -> Text
dataSetId) (\s :: CreateDataSet
s@CreateDataSet' {} Text
a -> CreateDataSet
s {$sel:dataSetId:CreateDataSet' :: Text
dataSetId = Text
a} :: CreateDataSet)

-- | The display name for the dataset.
createDataSet_name :: Lens.Lens' CreateDataSet Prelude.Text
createDataSet_name :: (Text -> f Text) -> CreateDataSet -> f CreateDataSet
createDataSet_name = (CreateDataSet -> Text)
-> (CreateDataSet -> Text -> CreateDataSet)
-> Lens CreateDataSet CreateDataSet Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateDataSet' {Text
name :: Text
$sel:name:CreateDataSet' :: CreateDataSet -> Text
name} -> Text
name) (\s :: CreateDataSet
s@CreateDataSet' {} Text
a -> CreateDataSet
s {$sel:name:CreateDataSet' :: Text
name = Text
a} :: CreateDataSet)

-- | Declares the physical tables that are available in the underlying data
-- sources.
createDataSet_physicalTableMap :: Lens.Lens' CreateDataSet (Prelude.HashMap Prelude.Text PhysicalTable)
createDataSet_physicalTableMap :: (HashMap Text PhysicalTable -> f (HashMap Text PhysicalTable))
-> CreateDataSet -> f CreateDataSet
createDataSet_physicalTableMap = (CreateDataSet -> HashMap Text PhysicalTable)
-> (CreateDataSet -> HashMap Text PhysicalTable -> CreateDataSet)
-> Lens
     CreateDataSet
     CreateDataSet
     (HashMap Text PhysicalTable)
     (HashMap Text PhysicalTable)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateDataSet' {HashMap Text PhysicalTable
physicalTableMap :: HashMap Text PhysicalTable
$sel:physicalTableMap:CreateDataSet' :: CreateDataSet -> HashMap Text PhysicalTable
physicalTableMap} -> HashMap Text PhysicalTable
physicalTableMap) (\s :: CreateDataSet
s@CreateDataSet' {} HashMap Text PhysicalTable
a -> CreateDataSet
s {$sel:physicalTableMap:CreateDataSet' :: HashMap Text PhysicalTable
physicalTableMap = HashMap Text PhysicalTable
a} :: CreateDataSet) ((HashMap Text PhysicalTable -> f (HashMap Text PhysicalTable))
 -> CreateDataSet -> f CreateDataSet)
-> ((HashMap Text PhysicalTable -> f (HashMap Text PhysicalTable))
    -> HashMap Text PhysicalTable -> f (HashMap Text PhysicalTable))
-> (HashMap Text PhysicalTable -> f (HashMap Text PhysicalTable))
-> CreateDataSet
-> f CreateDataSet
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. (HashMap Text PhysicalTable -> f (HashMap Text PhysicalTable))
-> HashMap Text PhysicalTable -> f (HashMap Text PhysicalTable)
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | Indicates whether you want to import the data into SPICE.
createDataSet_importMode :: Lens.Lens' CreateDataSet DataSetImportMode
createDataSet_importMode :: (DataSetImportMode -> f DataSetImportMode)
-> CreateDataSet -> f CreateDataSet
createDataSet_importMode = (CreateDataSet -> DataSetImportMode)
-> (CreateDataSet -> DataSetImportMode -> CreateDataSet)
-> Lens
     CreateDataSet CreateDataSet DataSetImportMode DataSetImportMode
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateDataSet' {DataSetImportMode
importMode :: DataSetImportMode
$sel:importMode:CreateDataSet' :: CreateDataSet -> DataSetImportMode
importMode} -> DataSetImportMode
importMode) (\s :: CreateDataSet
s@CreateDataSet' {} DataSetImportMode
a -> CreateDataSet
s {$sel:importMode:CreateDataSet' :: DataSetImportMode
importMode = DataSetImportMode
a} :: CreateDataSet)

instance Core.AWSRequest CreateDataSet where
  type
    AWSResponse CreateDataSet =
      CreateDataSetResponse
  request :: CreateDataSet -> Request CreateDataSet
request = Service -> CreateDataSet -> Request CreateDataSet
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON Service
defaultService
  response :: Logger
-> Service
-> Proxy CreateDataSet
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse CreateDataSet)))
response =
    (Int
 -> ResponseHeaders
 -> Object
 -> Either String (AWSResponse CreateDataSet))
-> Logger
-> Service
-> Proxy CreateDataSet
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse CreateDataSet)))
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 Text
-> Maybe Text
-> Maybe Text
-> Int
-> CreateDataSetResponse
CreateDataSetResponse'
            (Maybe Text
 -> Maybe Text
 -> Maybe Text
 -> Maybe Text
 -> Maybe Text
 -> Int
 -> CreateDataSetResponse)
-> Either String (Maybe Text)
-> Either
     String
     (Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Int
      -> CreateDataSetResponse)
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 Text
   -> Maybe Text
   -> Maybe Text
   -> Int
   -> CreateDataSetResponse)
-> Either String (Maybe Text)
-> Either
     String
     (Maybe Text
      -> Maybe Text -> Maybe Text -> Int -> CreateDataSetResponse)
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
"IngestionArn")
            Either
  String
  (Maybe Text
   -> Maybe Text -> Maybe Text -> Int -> CreateDataSetResponse)
-> Either String (Maybe Text)
-> Either
     String (Maybe Text -> Maybe Text -> Int -> CreateDataSetResponse)
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 Text -> Maybe Text -> Int -> CreateDataSetResponse)
-> Either String (Maybe Text)
-> Either String (Maybe Text -> Int -> CreateDataSetResponse)
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
"IngestionId")
            Either String (Maybe Text -> Int -> CreateDataSetResponse)
-> Either String (Maybe Text)
-> Either String (Int -> CreateDataSetResponse)
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
"DataSetId")
            Either String (Int -> CreateDataSetResponse)
-> Either String Int -> Either String CreateDataSetResponse
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 CreateDataSet

instance Prelude.NFData CreateDataSet

instance Core.ToHeaders CreateDataSet where
  toHeaders :: CreateDataSet -> ResponseHeaders
toHeaders =
    ResponseHeaders -> CreateDataSet -> 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 CreateDataSet where
  toJSON :: CreateDataSet -> Value
toJSON CreateDataSet' {Maybe (NonEmpty ColumnLevelPermissionRule)
Maybe (NonEmpty ColumnGroup)
Maybe (NonEmpty ResourcePermission)
Maybe (NonEmpty Tag)
Maybe (HashMap Text FieldFolder)
Maybe (HashMap Text LogicalTable)
Maybe DataSetUsageConfiguration
Maybe RowLevelPermissionTagConfiguration
Maybe RowLevelPermissionDataSet
Text
HashMap Text PhysicalTable
DataSetImportMode
importMode :: DataSetImportMode
physicalTableMap :: HashMap Text PhysicalTable
name :: Text
dataSetId :: Text
awsAccountId :: Text
logicalTableMap :: Maybe (HashMap Text LogicalTable)
tags :: Maybe (NonEmpty Tag)
columnLevelPermissionRules :: Maybe (NonEmpty ColumnLevelPermissionRule)
permissions :: Maybe (NonEmpty ResourcePermission)
rowLevelPermissionDataSet :: Maybe RowLevelPermissionDataSet
rowLevelPermissionTagConfiguration :: Maybe RowLevelPermissionTagConfiguration
dataSetUsageConfiguration :: Maybe DataSetUsageConfiguration
columnGroups :: Maybe (NonEmpty ColumnGroup)
fieldFolders :: Maybe (HashMap Text FieldFolder)
$sel:importMode:CreateDataSet' :: CreateDataSet -> DataSetImportMode
$sel:physicalTableMap:CreateDataSet' :: CreateDataSet -> HashMap Text PhysicalTable
$sel:name:CreateDataSet' :: CreateDataSet -> Text
$sel:dataSetId:CreateDataSet' :: CreateDataSet -> Text
$sel:awsAccountId:CreateDataSet' :: CreateDataSet -> Text
$sel:logicalTableMap:CreateDataSet' :: CreateDataSet -> Maybe (HashMap Text LogicalTable)
$sel:tags:CreateDataSet' :: CreateDataSet -> Maybe (NonEmpty Tag)
$sel:columnLevelPermissionRules:CreateDataSet' :: CreateDataSet -> Maybe (NonEmpty ColumnLevelPermissionRule)
$sel:permissions:CreateDataSet' :: CreateDataSet -> Maybe (NonEmpty ResourcePermission)
$sel:rowLevelPermissionDataSet:CreateDataSet' :: CreateDataSet -> Maybe RowLevelPermissionDataSet
$sel:rowLevelPermissionTagConfiguration:CreateDataSet' :: CreateDataSet -> Maybe RowLevelPermissionTagConfiguration
$sel:dataSetUsageConfiguration:CreateDataSet' :: CreateDataSet -> Maybe DataSetUsageConfiguration
$sel:columnGroups:CreateDataSet' :: CreateDataSet -> Maybe (NonEmpty ColumnGroup)
$sel:fieldFolders:CreateDataSet' :: CreateDataSet -> Maybe (HashMap Text FieldFolder)
..} =
    [Pair] -> Value
Core.object
      ( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ (Text
"FieldFolders" Text -> HashMap Text FieldFolder -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (HashMap Text FieldFolder -> Pair)
-> Maybe (HashMap Text FieldFolder) -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe (HashMap Text FieldFolder)
fieldFolders,
            (Text
"ColumnGroups" Text -> NonEmpty ColumnGroup -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (NonEmpty ColumnGroup -> Pair)
-> Maybe (NonEmpty ColumnGroup) -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe (NonEmpty ColumnGroup)
columnGroups,
            (Text
"DataSetUsageConfiguration" Text -> DataSetUsageConfiguration -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
              (DataSetUsageConfiguration -> Pair)
-> Maybe DataSetUsageConfiguration -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe DataSetUsageConfiguration
dataSetUsageConfiguration,
            (Text
"RowLevelPermissionTagConfiguration" Text -> RowLevelPermissionTagConfiguration -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
              (RowLevelPermissionTagConfiguration -> Pair)
-> Maybe RowLevelPermissionTagConfiguration -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe RowLevelPermissionTagConfiguration
rowLevelPermissionTagConfiguration,
            (Text
"RowLevelPermissionDataSet" Text -> RowLevelPermissionDataSet -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
              (RowLevelPermissionDataSet -> Pair)
-> Maybe RowLevelPermissionDataSet -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe RowLevelPermissionDataSet
rowLevelPermissionDataSet,
            (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
"ColumnLevelPermissionRules" Text -> NonEmpty ColumnLevelPermissionRule -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
              (NonEmpty ColumnLevelPermissionRule -> Pair)
-> Maybe (NonEmpty ColumnLevelPermissionRule) -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe (NonEmpty ColumnLevelPermissionRule)
columnLevelPermissionRules,
            (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,
            (Text
"LogicalTableMap" Text -> HashMap Text LogicalTable -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
              (HashMap Text LogicalTable -> Pair)
-> Maybe (HashMap Text LogicalTable) -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe (HashMap Text LogicalTable)
logicalTableMap,
            Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"DataSetId" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
dataSetId),
            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
"PhysicalTableMap" Text -> HashMap Text PhysicalTable -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= HashMap Text PhysicalTable
physicalTableMap),
            Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"ImportMode" Text -> DataSetImportMode -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= DataSetImportMode
importMode)
          ]
      )

instance Core.ToPath CreateDataSet where
  toPath :: CreateDataSet -> ByteString
toPath CreateDataSet' {Maybe (NonEmpty ColumnLevelPermissionRule)
Maybe (NonEmpty ColumnGroup)
Maybe (NonEmpty ResourcePermission)
Maybe (NonEmpty Tag)
Maybe (HashMap Text FieldFolder)
Maybe (HashMap Text LogicalTable)
Maybe DataSetUsageConfiguration
Maybe RowLevelPermissionTagConfiguration
Maybe RowLevelPermissionDataSet
Text
HashMap Text PhysicalTable
DataSetImportMode
importMode :: DataSetImportMode
physicalTableMap :: HashMap Text PhysicalTable
name :: Text
dataSetId :: Text
awsAccountId :: Text
logicalTableMap :: Maybe (HashMap Text LogicalTable)
tags :: Maybe (NonEmpty Tag)
columnLevelPermissionRules :: Maybe (NonEmpty ColumnLevelPermissionRule)
permissions :: Maybe (NonEmpty ResourcePermission)
rowLevelPermissionDataSet :: Maybe RowLevelPermissionDataSet
rowLevelPermissionTagConfiguration :: Maybe RowLevelPermissionTagConfiguration
dataSetUsageConfiguration :: Maybe DataSetUsageConfiguration
columnGroups :: Maybe (NonEmpty ColumnGroup)
fieldFolders :: Maybe (HashMap Text FieldFolder)
$sel:importMode:CreateDataSet' :: CreateDataSet -> DataSetImportMode
$sel:physicalTableMap:CreateDataSet' :: CreateDataSet -> HashMap Text PhysicalTable
$sel:name:CreateDataSet' :: CreateDataSet -> Text
$sel:dataSetId:CreateDataSet' :: CreateDataSet -> Text
$sel:awsAccountId:CreateDataSet' :: CreateDataSet -> Text
$sel:logicalTableMap:CreateDataSet' :: CreateDataSet -> Maybe (HashMap Text LogicalTable)
$sel:tags:CreateDataSet' :: CreateDataSet -> Maybe (NonEmpty Tag)
$sel:columnLevelPermissionRules:CreateDataSet' :: CreateDataSet -> Maybe (NonEmpty ColumnLevelPermissionRule)
$sel:permissions:CreateDataSet' :: CreateDataSet -> Maybe (NonEmpty ResourcePermission)
$sel:rowLevelPermissionDataSet:CreateDataSet' :: CreateDataSet -> Maybe RowLevelPermissionDataSet
$sel:rowLevelPermissionTagConfiguration:CreateDataSet' :: CreateDataSet -> Maybe RowLevelPermissionTagConfiguration
$sel:dataSetUsageConfiguration:CreateDataSet' :: CreateDataSet -> Maybe DataSetUsageConfiguration
$sel:columnGroups:CreateDataSet' :: CreateDataSet -> Maybe (NonEmpty ColumnGroup)
$sel:fieldFolders:CreateDataSet' :: CreateDataSet -> Maybe (HashMap Text FieldFolder)
..} =
    [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-sets"]

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

-- | /See:/ 'newCreateDataSetResponse' smart constructor.
data CreateDataSetResponse = CreateDataSetResponse'
  { -- | The Amazon Web Services request ID for this operation.
    CreateDataSetResponse -> Maybe Text
requestId :: Prelude.Maybe Prelude.Text,
    -- | The ARN for the ingestion, which is triggered as a result of dataset
    -- creation if the import mode is SPICE.
    CreateDataSetResponse -> Maybe Text
ingestionArn :: Prelude.Maybe Prelude.Text,
    -- | The Amazon Resource Name (ARN) of the dataset.
    CreateDataSetResponse -> Maybe Text
arn :: Prelude.Maybe Prelude.Text,
    -- | The ID of the ingestion, which is triggered as a result of dataset
    -- creation if the import mode is SPICE.
    CreateDataSetResponse -> Maybe Text
ingestionId :: Prelude.Maybe Prelude.Text,
    -- | The ID for the dataset that you want to create. This ID is unique per
    -- Amazon Web Services Region for each Amazon Web Services account.
    CreateDataSetResponse -> Maybe Text
dataSetId :: Prelude.Maybe Prelude.Text,
    -- | The HTTP status of the request.
    CreateDataSetResponse -> Int
status :: Prelude.Int
  }
  deriving (CreateDataSetResponse -> CreateDataSetResponse -> Bool
(CreateDataSetResponse -> CreateDataSetResponse -> Bool)
-> (CreateDataSetResponse -> CreateDataSetResponse -> Bool)
-> Eq CreateDataSetResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: CreateDataSetResponse -> CreateDataSetResponse -> Bool
$c/= :: CreateDataSetResponse -> CreateDataSetResponse -> Bool
== :: CreateDataSetResponse -> CreateDataSetResponse -> Bool
$c== :: CreateDataSetResponse -> CreateDataSetResponse -> Bool
Prelude.Eq, ReadPrec [CreateDataSetResponse]
ReadPrec CreateDataSetResponse
Int -> ReadS CreateDataSetResponse
ReadS [CreateDataSetResponse]
(Int -> ReadS CreateDataSetResponse)
-> ReadS [CreateDataSetResponse]
-> ReadPrec CreateDataSetResponse
-> ReadPrec [CreateDataSetResponse]
-> Read CreateDataSetResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [CreateDataSetResponse]
$creadListPrec :: ReadPrec [CreateDataSetResponse]
readPrec :: ReadPrec CreateDataSetResponse
$creadPrec :: ReadPrec CreateDataSetResponse
readList :: ReadS [CreateDataSetResponse]
$creadList :: ReadS [CreateDataSetResponse]
readsPrec :: Int -> ReadS CreateDataSetResponse
$creadsPrec :: Int -> ReadS CreateDataSetResponse
Prelude.Read, Int -> CreateDataSetResponse -> ShowS
[CreateDataSetResponse] -> ShowS
CreateDataSetResponse -> String
(Int -> CreateDataSetResponse -> ShowS)
-> (CreateDataSetResponse -> String)
-> ([CreateDataSetResponse] -> ShowS)
-> Show CreateDataSetResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [CreateDataSetResponse] -> ShowS
$cshowList :: [CreateDataSetResponse] -> ShowS
show :: CreateDataSetResponse -> String
$cshow :: CreateDataSetResponse -> String
showsPrec :: Int -> CreateDataSetResponse -> ShowS
$cshowsPrec :: Int -> CreateDataSetResponse -> ShowS
Prelude.Show, (forall x. CreateDataSetResponse -> Rep CreateDataSetResponse x)
-> (forall x. Rep CreateDataSetResponse x -> CreateDataSetResponse)
-> Generic CreateDataSetResponse
forall x. Rep CreateDataSetResponse x -> CreateDataSetResponse
forall x. CreateDataSetResponse -> Rep CreateDataSetResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep CreateDataSetResponse x -> CreateDataSetResponse
$cfrom :: forall x. CreateDataSetResponse -> Rep CreateDataSetResponse x
Prelude.Generic)

-- |
-- Create a value of 'CreateDataSetResponse' 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', 'createDataSetResponse_requestId' - The Amazon Web Services request ID for this operation.
--
-- 'ingestionArn', 'createDataSetResponse_ingestionArn' - The ARN for the ingestion, which is triggered as a result of dataset
-- creation if the import mode is SPICE.
--
-- 'arn', 'createDataSetResponse_arn' - The Amazon Resource Name (ARN) of the dataset.
--
-- 'ingestionId', 'createDataSetResponse_ingestionId' - The ID of the ingestion, which is triggered as a result of dataset
-- creation if the import mode is SPICE.
--
-- 'dataSetId', 'createDataSetResponse_dataSetId' - The ID for the dataset that you want to create. This ID is unique per
-- Amazon Web Services Region for each Amazon Web Services account.
--
-- 'status', 'createDataSetResponse_status' - The HTTP status of the request.
newCreateDataSetResponse ::
  -- | 'status'
  Prelude.Int ->
  CreateDataSetResponse
newCreateDataSetResponse :: Int -> CreateDataSetResponse
newCreateDataSetResponse Int
pStatus_ =
  CreateDataSetResponse' :: Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Int
-> CreateDataSetResponse
CreateDataSetResponse'
    { $sel:requestId:CreateDataSetResponse' :: Maybe Text
requestId = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:ingestionArn:CreateDataSetResponse' :: Maybe Text
ingestionArn = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:arn:CreateDataSetResponse' :: Maybe Text
arn = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:ingestionId:CreateDataSetResponse' :: Maybe Text
ingestionId = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:dataSetId:CreateDataSetResponse' :: Maybe Text
dataSetId = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:status:CreateDataSetResponse' :: Int
status = Int
pStatus_
    }

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

-- | The ARN for the ingestion, which is triggered as a result of dataset
-- creation if the import mode is SPICE.
createDataSetResponse_ingestionArn :: Lens.Lens' CreateDataSetResponse (Prelude.Maybe Prelude.Text)
createDataSetResponse_ingestionArn :: (Maybe Text -> f (Maybe Text))
-> CreateDataSetResponse -> f CreateDataSetResponse
createDataSetResponse_ingestionArn = (CreateDataSetResponse -> Maybe Text)
-> (CreateDataSetResponse -> Maybe Text -> CreateDataSetResponse)
-> Lens
     CreateDataSetResponse
     CreateDataSetResponse
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateDataSetResponse' {Maybe Text
ingestionArn :: Maybe Text
$sel:ingestionArn:CreateDataSetResponse' :: CreateDataSetResponse -> Maybe Text
ingestionArn} -> Maybe Text
ingestionArn) (\s :: CreateDataSetResponse
s@CreateDataSetResponse' {} Maybe Text
a -> CreateDataSetResponse
s {$sel:ingestionArn:CreateDataSetResponse' :: Maybe Text
ingestionArn = Maybe Text
a} :: CreateDataSetResponse)

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

-- | The ID of the ingestion, which is triggered as a result of dataset
-- creation if the import mode is SPICE.
createDataSetResponse_ingestionId :: Lens.Lens' CreateDataSetResponse (Prelude.Maybe Prelude.Text)
createDataSetResponse_ingestionId :: (Maybe Text -> f (Maybe Text))
-> CreateDataSetResponse -> f CreateDataSetResponse
createDataSetResponse_ingestionId = (CreateDataSetResponse -> Maybe Text)
-> (CreateDataSetResponse -> Maybe Text -> CreateDataSetResponse)
-> Lens
     CreateDataSetResponse
     CreateDataSetResponse
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateDataSetResponse' {Maybe Text
ingestionId :: Maybe Text
$sel:ingestionId:CreateDataSetResponse' :: CreateDataSetResponse -> Maybe Text
ingestionId} -> Maybe Text
ingestionId) (\s :: CreateDataSetResponse
s@CreateDataSetResponse' {} Maybe Text
a -> CreateDataSetResponse
s {$sel:ingestionId:CreateDataSetResponse' :: Maybe Text
ingestionId = Maybe Text
a} :: CreateDataSetResponse)

-- | The ID for the dataset that you want to create. This ID is unique per
-- Amazon Web Services Region for each Amazon Web Services account.
createDataSetResponse_dataSetId :: Lens.Lens' CreateDataSetResponse (Prelude.Maybe Prelude.Text)
createDataSetResponse_dataSetId :: (Maybe Text -> f (Maybe Text))
-> CreateDataSetResponse -> f CreateDataSetResponse
createDataSetResponse_dataSetId = (CreateDataSetResponse -> Maybe Text)
-> (CreateDataSetResponse -> Maybe Text -> CreateDataSetResponse)
-> Lens
     CreateDataSetResponse
     CreateDataSetResponse
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateDataSetResponse' {Maybe Text
dataSetId :: Maybe Text
$sel:dataSetId:CreateDataSetResponse' :: CreateDataSetResponse -> Maybe Text
dataSetId} -> Maybe Text
dataSetId) (\s :: CreateDataSetResponse
s@CreateDataSetResponse' {} Maybe Text
a -> CreateDataSetResponse
s {$sel:dataSetId:CreateDataSetResponse' :: Maybe Text
dataSetId = Maybe Text
a} :: CreateDataSetResponse)

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

instance Prelude.NFData CreateDataSetResponse