{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE DuplicateRecordFields #-}
{-# LANGUAGE NamedFieldPuns #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE RecordWildCards #-}
{-# LANGUAGE StrictData #-}
{-# LANGUAGE NoImplicitPrelude #-}
{-# OPTIONS_GHC -fno-warn-unused-imports #-}
{-# OPTIONS_GHC -fno-warn-unused-matches #-}
module Amazonka.Kendra.Types.FsxConfiguration where
import qualified Amazonka.Core as Core
import qualified Amazonka.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
import Amazonka.Kendra.Types.DataSourceToIndexFieldMapping
import Amazonka.Kendra.Types.DataSourceVpcConfiguration
import Amazonka.Kendra.Types.FsxFileSystemType
import qualified Amazonka.Prelude as Prelude
data FsxConfiguration = FsxConfiguration'
{
FsxConfiguration -> Maybe [Text]
exclusionPatterns :: Prelude.Maybe [Prelude.Text],
FsxConfiguration -> Maybe (NonEmpty DataSourceToIndexFieldMapping)
fieldMappings :: Prelude.Maybe (Prelude.NonEmpty DataSourceToIndexFieldMapping),
FsxConfiguration -> Maybe [Text]
inclusionPatterns :: Prelude.Maybe [Prelude.Text],
FsxConfiguration -> Maybe Text
secretArn :: Prelude.Maybe Prelude.Text,
FsxConfiguration -> Text
fileSystemId :: Prelude.Text,
FsxConfiguration -> FsxFileSystemType
fileSystemType :: FsxFileSystemType,
FsxConfiguration -> DataSourceVpcConfiguration
vpcConfiguration :: DataSourceVpcConfiguration
}
deriving (FsxConfiguration -> FsxConfiguration -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: FsxConfiguration -> FsxConfiguration -> Bool
$c/= :: FsxConfiguration -> FsxConfiguration -> Bool
== :: FsxConfiguration -> FsxConfiguration -> Bool
$c== :: FsxConfiguration -> FsxConfiguration -> Bool
Prelude.Eq, ReadPrec [FsxConfiguration]
ReadPrec FsxConfiguration
Int -> ReadS FsxConfiguration
ReadS [FsxConfiguration]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [FsxConfiguration]
$creadListPrec :: ReadPrec [FsxConfiguration]
readPrec :: ReadPrec FsxConfiguration
$creadPrec :: ReadPrec FsxConfiguration
readList :: ReadS [FsxConfiguration]
$creadList :: ReadS [FsxConfiguration]
readsPrec :: Int -> ReadS FsxConfiguration
$creadsPrec :: Int -> ReadS FsxConfiguration
Prelude.Read, Int -> FsxConfiguration -> ShowS
[FsxConfiguration] -> ShowS
FsxConfiguration -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [FsxConfiguration] -> ShowS
$cshowList :: [FsxConfiguration] -> ShowS
show :: FsxConfiguration -> String
$cshow :: FsxConfiguration -> String
showsPrec :: Int -> FsxConfiguration -> ShowS
$cshowsPrec :: Int -> FsxConfiguration -> ShowS
Prelude.Show, forall x. Rep FsxConfiguration x -> FsxConfiguration
forall x. FsxConfiguration -> Rep FsxConfiguration x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep FsxConfiguration x -> FsxConfiguration
$cfrom :: forall x. FsxConfiguration -> Rep FsxConfiguration x
Prelude.Generic)
newFsxConfiguration ::
Prelude.Text ->
FsxFileSystemType ->
DataSourceVpcConfiguration ->
FsxConfiguration
newFsxConfiguration :: Text
-> FsxFileSystemType
-> DataSourceVpcConfiguration
-> FsxConfiguration
newFsxConfiguration
Text
pFileSystemId_
FsxFileSystemType
pFileSystemType_
DataSourceVpcConfiguration
pVpcConfiguration_ =
FsxConfiguration'
{ $sel:exclusionPatterns:FsxConfiguration' :: Maybe [Text]
exclusionPatterns =
forall a. Maybe a
Prelude.Nothing,
$sel:fieldMappings:FsxConfiguration' :: Maybe (NonEmpty DataSourceToIndexFieldMapping)
fieldMappings = forall a. Maybe a
Prelude.Nothing,
$sel:inclusionPatterns:FsxConfiguration' :: Maybe [Text]
inclusionPatterns = forall a. Maybe a
Prelude.Nothing,
$sel:secretArn:FsxConfiguration' :: Maybe Text
secretArn = forall a. Maybe a
Prelude.Nothing,
$sel:fileSystemId:FsxConfiguration' :: Text
fileSystemId = Text
pFileSystemId_,
$sel:fileSystemType:FsxConfiguration' :: FsxFileSystemType
fileSystemType = FsxFileSystemType
pFileSystemType_,
$sel:vpcConfiguration:FsxConfiguration' :: DataSourceVpcConfiguration
vpcConfiguration = DataSourceVpcConfiguration
pVpcConfiguration_
}
fsxConfiguration_exclusionPatterns :: Lens.Lens' FsxConfiguration (Prelude.Maybe [Prelude.Text])
fsxConfiguration_exclusionPatterns :: Lens' FsxConfiguration (Maybe [Text])
fsxConfiguration_exclusionPatterns = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\FsxConfiguration' {Maybe [Text]
exclusionPatterns :: Maybe [Text]
$sel:exclusionPatterns:FsxConfiguration' :: FsxConfiguration -> Maybe [Text]
exclusionPatterns} -> Maybe [Text]
exclusionPatterns) (\s :: FsxConfiguration
s@FsxConfiguration' {} Maybe [Text]
a -> FsxConfiguration
s {$sel:exclusionPatterns:FsxConfiguration' :: Maybe [Text]
exclusionPatterns = Maybe [Text]
a} :: FsxConfiguration) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. forall (f :: * -> *) (g :: * -> *) s t a b.
(Functor f, Functor g) =>
AnIso s t a b -> Iso (f s) (g t) (f a) (g b)
Lens.mapping forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced
fsxConfiguration_fieldMappings :: Lens.Lens' FsxConfiguration (Prelude.Maybe (Prelude.NonEmpty DataSourceToIndexFieldMapping))
fsxConfiguration_fieldMappings :: Lens'
FsxConfiguration (Maybe (NonEmpty DataSourceToIndexFieldMapping))
fsxConfiguration_fieldMappings = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\FsxConfiguration' {Maybe (NonEmpty DataSourceToIndexFieldMapping)
fieldMappings :: Maybe (NonEmpty DataSourceToIndexFieldMapping)
$sel:fieldMappings:FsxConfiguration' :: FsxConfiguration -> Maybe (NonEmpty DataSourceToIndexFieldMapping)
fieldMappings} -> Maybe (NonEmpty DataSourceToIndexFieldMapping)
fieldMappings) (\s :: FsxConfiguration
s@FsxConfiguration' {} Maybe (NonEmpty DataSourceToIndexFieldMapping)
a -> FsxConfiguration
s {$sel:fieldMappings:FsxConfiguration' :: Maybe (NonEmpty DataSourceToIndexFieldMapping)
fieldMappings = Maybe (NonEmpty DataSourceToIndexFieldMapping)
a} :: FsxConfiguration) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. forall (f :: * -> *) (g :: * -> *) s t a b.
(Functor f, Functor g) =>
AnIso s t a b -> Iso (f s) (g t) (f a) (g b)
Lens.mapping forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced
fsxConfiguration_inclusionPatterns :: Lens.Lens' FsxConfiguration (Prelude.Maybe [Prelude.Text])
fsxConfiguration_inclusionPatterns :: Lens' FsxConfiguration (Maybe [Text])
fsxConfiguration_inclusionPatterns = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\FsxConfiguration' {Maybe [Text]
inclusionPatterns :: Maybe [Text]
$sel:inclusionPatterns:FsxConfiguration' :: FsxConfiguration -> Maybe [Text]
inclusionPatterns} -> Maybe [Text]
inclusionPatterns) (\s :: FsxConfiguration
s@FsxConfiguration' {} Maybe [Text]
a -> FsxConfiguration
s {$sel:inclusionPatterns:FsxConfiguration' :: Maybe [Text]
inclusionPatterns = Maybe [Text]
a} :: FsxConfiguration) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. forall (f :: * -> *) (g :: * -> *) s t a b.
(Functor f, Functor g) =>
AnIso s t a b -> Iso (f s) (g t) (f a) (g b)
Lens.mapping forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced
fsxConfiguration_secretArn :: Lens.Lens' FsxConfiguration (Prelude.Maybe Prelude.Text)
fsxConfiguration_secretArn :: Lens' FsxConfiguration (Maybe Text)
fsxConfiguration_secretArn = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\FsxConfiguration' {Maybe Text
secretArn :: Maybe Text
$sel:secretArn:FsxConfiguration' :: FsxConfiguration -> Maybe Text
secretArn} -> Maybe Text
secretArn) (\s :: FsxConfiguration
s@FsxConfiguration' {} Maybe Text
a -> FsxConfiguration
s {$sel:secretArn:FsxConfiguration' :: Maybe Text
secretArn = Maybe Text
a} :: FsxConfiguration)
fsxConfiguration_fileSystemId :: Lens.Lens' FsxConfiguration Prelude.Text
fsxConfiguration_fileSystemId :: Lens' FsxConfiguration Text
fsxConfiguration_fileSystemId = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\FsxConfiguration' {Text
fileSystemId :: Text
$sel:fileSystemId:FsxConfiguration' :: FsxConfiguration -> Text
fileSystemId} -> Text
fileSystemId) (\s :: FsxConfiguration
s@FsxConfiguration' {} Text
a -> FsxConfiguration
s {$sel:fileSystemId:FsxConfiguration' :: Text
fileSystemId = Text
a} :: FsxConfiguration)
fsxConfiguration_fileSystemType :: Lens.Lens' FsxConfiguration FsxFileSystemType
fsxConfiguration_fileSystemType :: Lens' FsxConfiguration FsxFileSystemType
fsxConfiguration_fileSystemType = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\FsxConfiguration' {FsxFileSystemType
fileSystemType :: FsxFileSystemType
$sel:fileSystemType:FsxConfiguration' :: FsxConfiguration -> FsxFileSystemType
fileSystemType} -> FsxFileSystemType
fileSystemType) (\s :: FsxConfiguration
s@FsxConfiguration' {} FsxFileSystemType
a -> FsxConfiguration
s {$sel:fileSystemType:FsxConfiguration' :: FsxFileSystemType
fileSystemType = FsxFileSystemType
a} :: FsxConfiguration)
fsxConfiguration_vpcConfiguration :: Lens.Lens' FsxConfiguration DataSourceVpcConfiguration
fsxConfiguration_vpcConfiguration :: Lens' FsxConfiguration DataSourceVpcConfiguration
fsxConfiguration_vpcConfiguration = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\FsxConfiguration' {DataSourceVpcConfiguration
vpcConfiguration :: DataSourceVpcConfiguration
$sel:vpcConfiguration:FsxConfiguration' :: FsxConfiguration -> DataSourceVpcConfiguration
vpcConfiguration} -> DataSourceVpcConfiguration
vpcConfiguration) (\s :: FsxConfiguration
s@FsxConfiguration' {} DataSourceVpcConfiguration
a -> FsxConfiguration
s {$sel:vpcConfiguration:FsxConfiguration' :: DataSourceVpcConfiguration
vpcConfiguration = DataSourceVpcConfiguration
a} :: FsxConfiguration)
instance Data.FromJSON FsxConfiguration where
parseJSON :: Value -> Parser FsxConfiguration
parseJSON =
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
String
"FsxConfiguration"
( \Object
x ->
Maybe [Text]
-> Maybe (NonEmpty DataSourceToIndexFieldMapping)
-> Maybe [Text]
-> Maybe Text
-> Text
-> FsxFileSystemType
-> DataSourceVpcConfiguration
-> FsxConfiguration
FsxConfiguration'
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> ( Object
x
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"ExclusionPatterns"
forall a. Parser (Maybe a) -> a -> Parser a
Data..!= forall a. Monoid a => a
Prelude.mempty
)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"FieldMappings")
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ( Object
x
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"InclusionPatterns"
forall a. Parser (Maybe a) -> a -> Parser a
Data..!= forall a. Monoid a => a
Prelude.mempty
)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"SecretArn")
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser a
Data..: Key
"FileSystemId")
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser a
Data..: Key
"FileSystemType")
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser a
Data..: Key
"VpcConfiguration")
)
instance Prelude.Hashable FsxConfiguration where
hashWithSalt :: Int -> FsxConfiguration -> Int
hashWithSalt Int
_salt FsxConfiguration' {Maybe [Text]
Maybe (NonEmpty DataSourceToIndexFieldMapping)
Maybe Text
Text
DataSourceVpcConfiguration
FsxFileSystemType
vpcConfiguration :: DataSourceVpcConfiguration
fileSystemType :: FsxFileSystemType
fileSystemId :: Text
secretArn :: Maybe Text
inclusionPatterns :: Maybe [Text]
fieldMappings :: Maybe (NonEmpty DataSourceToIndexFieldMapping)
exclusionPatterns :: Maybe [Text]
$sel:vpcConfiguration:FsxConfiguration' :: FsxConfiguration -> DataSourceVpcConfiguration
$sel:fileSystemType:FsxConfiguration' :: FsxConfiguration -> FsxFileSystemType
$sel:fileSystemId:FsxConfiguration' :: FsxConfiguration -> Text
$sel:secretArn:FsxConfiguration' :: FsxConfiguration -> Maybe Text
$sel:inclusionPatterns:FsxConfiguration' :: FsxConfiguration -> Maybe [Text]
$sel:fieldMappings:FsxConfiguration' :: FsxConfiguration -> Maybe (NonEmpty DataSourceToIndexFieldMapping)
$sel:exclusionPatterns:FsxConfiguration' :: FsxConfiguration -> Maybe [Text]
..} =
Int
_salt
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe [Text]
exclusionPatterns
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe (NonEmpty DataSourceToIndexFieldMapping)
fieldMappings
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe [Text]
inclusionPatterns
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
secretArn
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
fileSystemId
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` FsxFileSystemType
fileSystemType
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` DataSourceVpcConfiguration
vpcConfiguration
instance Prelude.NFData FsxConfiguration where
rnf :: FsxConfiguration -> ()
rnf FsxConfiguration' {Maybe [Text]
Maybe (NonEmpty DataSourceToIndexFieldMapping)
Maybe Text
Text
DataSourceVpcConfiguration
FsxFileSystemType
vpcConfiguration :: DataSourceVpcConfiguration
fileSystemType :: FsxFileSystemType
fileSystemId :: Text
secretArn :: Maybe Text
inclusionPatterns :: Maybe [Text]
fieldMappings :: Maybe (NonEmpty DataSourceToIndexFieldMapping)
exclusionPatterns :: Maybe [Text]
$sel:vpcConfiguration:FsxConfiguration' :: FsxConfiguration -> DataSourceVpcConfiguration
$sel:fileSystemType:FsxConfiguration' :: FsxConfiguration -> FsxFileSystemType
$sel:fileSystemId:FsxConfiguration' :: FsxConfiguration -> Text
$sel:secretArn:FsxConfiguration' :: FsxConfiguration -> Maybe Text
$sel:inclusionPatterns:FsxConfiguration' :: FsxConfiguration -> Maybe [Text]
$sel:fieldMappings:FsxConfiguration' :: FsxConfiguration -> Maybe (NonEmpty DataSourceToIndexFieldMapping)
$sel:exclusionPatterns:FsxConfiguration' :: FsxConfiguration -> Maybe [Text]
..} =
forall a. NFData a => a -> ()
Prelude.rnf Maybe [Text]
exclusionPatterns
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe (NonEmpty DataSourceToIndexFieldMapping)
fieldMappings
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe [Text]
inclusionPatterns
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
secretArn
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
fileSystemId
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf FsxFileSystemType
fileSystemType
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf DataSourceVpcConfiguration
vpcConfiguration
instance Data.ToJSON FsxConfiguration where
toJSON :: FsxConfiguration -> Value
toJSON FsxConfiguration' {Maybe [Text]
Maybe (NonEmpty DataSourceToIndexFieldMapping)
Maybe Text
Text
DataSourceVpcConfiguration
FsxFileSystemType
vpcConfiguration :: DataSourceVpcConfiguration
fileSystemType :: FsxFileSystemType
fileSystemId :: Text
secretArn :: Maybe Text
inclusionPatterns :: Maybe [Text]
fieldMappings :: Maybe (NonEmpty DataSourceToIndexFieldMapping)
exclusionPatterns :: Maybe [Text]
$sel:vpcConfiguration:FsxConfiguration' :: FsxConfiguration -> DataSourceVpcConfiguration
$sel:fileSystemType:FsxConfiguration' :: FsxConfiguration -> FsxFileSystemType
$sel:fileSystemId:FsxConfiguration' :: FsxConfiguration -> Text
$sel:secretArn:FsxConfiguration' :: FsxConfiguration -> Maybe Text
$sel:inclusionPatterns:FsxConfiguration' :: FsxConfiguration -> Maybe [Text]
$sel:fieldMappings:FsxConfiguration' :: FsxConfiguration -> Maybe (NonEmpty DataSourceToIndexFieldMapping)
$sel:exclusionPatterns:FsxConfiguration' :: FsxConfiguration -> Maybe [Text]
..} =
[Pair] -> Value
Data.object
( forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ (Key
"ExclusionPatterns" 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 [Text]
exclusionPatterns,
(Key
"FieldMappings" 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 (NonEmpty DataSourceToIndexFieldMapping)
fieldMappings,
(Key
"InclusionPatterns" 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 [Text]
inclusionPatterns,
(Key
"SecretArn" 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 Text
secretArn,
forall a. a -> Maybe a
Prelude.Just (Key
"FileSystemId" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= Text
fileSystemId),
forall a. a -> Maybe a
Prelude.Just
(Key
"FileSystemType" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= FsxFileSystemType
fileSystemType),
forall a. a -> Maybe a
Prelude.Just
(Key
"VpcConfiguration" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= DataSourceVpcConfiguration
vpcConfiguration)
]
)