{-# 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 #-}

-- Derived from AWS service descriptions, licensed under Apache 2.0.

-- |
-- Module      : Amazonka.Kendra.Types.FsxConfiguration
-- Copyright   : (c) 2013-2023 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay
-- Stability   : auto-generated
-- Portability : non-portable (GHC extensions)
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

-- | Provides the configuration information to connect to Amazon FSx as your
-- data source.
--
-- /See:/ 'newFsxConfiguration' smart constructor.
data FsxConfiguration = FsxConfiguration'
  { -- | A list of regular expression patterns to exclude certain files in your
    -- Amazon FSx file system. Files that match the patterns are excluded from
    -- the index. Files that don\'t match the patterns are included in the
    -- index. If a file matches both an inclusion and exclusion pattern, the
    -- exclusion pattern takes precedence and the file isn\'t included in the
    -- index.
    FsxConfiguration -> Maybe [Text]
exclusionPatterns :: Prelude.Maybe [Prelude.Text],
    -- | A list of @DataSourceToIndexFieldMapping@ objects that map Amazon FSx
    -- data source attributes or field names to Amazon Kendra index field
    -- names. To create custom fields, use the @UpdateIndex@ API before you map
    -- to Amazon FSx fields. For more information, see
    -- <https://docs.aws.amazon.com/kendra/latest/dg/field-mapping.html Mapping data source fields>.
    -- The Amazon FSx data source field names must exist in your Amazon FSx
    -- custom metadata.
    FsxConfiguration -> Maybe (NonEmpty DataSourceToIndexFieldMapping)
fieldMappings :: Prelude.Maybe (Prelude.NonEmpty DataSourceToIndexFieldMapping),
    -- | A list of regular expression patterns to include certain files in your
    -- Amazon FSx file system. Files that match the patterns are included in
    -- the index. Files that don\'t match the patterns are excluded from the
    -- index. If a file matches both an inclusion and exclusion pattern, the
    -- exclusion pattern takes precedence and the file isn\'t included in the
    -- index.
    FsxConfiguration -> Maybe [Text]
inclusionPatterns :: Prelude.Maybe [Prelude.Text],
    -- | The Amazon Resource Name (ARN) of an Secrets Manager secret that
    -- contains the key-value pairs required to connect to your Amazon FSx file
    -- system. Windows is currently the only supported type. The secret must
    -- contain a JSON structure with the following keys:
    --
    -- -   username—The Active Directory user name, along with the Domain Name
    --     System (DNS) domain name. For example, /user\@corp.example.com/. The
    --     Active Directory user account must have read and mounting access to
    --     the Amazon FSx file system for Windows.
    --
    -- -   password—The password of the Active Directory user account with read
    --     and mounting access to the Amazon FSx Windows file system.
    FsxConfiguration -> Maybe Text
secretArn :: Prelude.Maybe Prelude.Text,
    -- | The identifier of the Amazon FSx file system.
    --
    -- You can find your file system ID on the file system dashboard in the
    -- Amazon FSx console. For information on how to create a file system in
    -- Amazon FSx console, using Windows File Server as an example, see
    -- <https://docs.aws.amazon.com/fsx/latest/WindowsGuide/getting-started-step1.html Amazon FSx Getting started guide>.
    FsxConfiguration -> Text
fileSystemId :: Prelude.Text,
    -- | The Amazon FSx file system type. Windows is currently the only supported
    -- type.
    FsxConfiguration -> FsxFileSystemType
fileSystemType :: FsxFileSystemType,
    -- | Configuration information for an Amazon Virtual Private Cloud to connect
    -- to your Amazon FSx. Your Amazon FSx instance must reside inside your
    -- VPC.
    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)

-- |
-- Create a value of 'FsxConfiguration' 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:
--
-- 'exclusionPatterns', 'fsxConfiguration_exclusionPatterns' - A list of regular expression patterns to exclude certain files in your
-- Amazon FSx file system. Files that match the patterns are excluded from
-- the index. Files that don\'t match the patterns are included in the
-- index. If a file matches both an inclusion and exclusion pattern, the
-- exclusion pattern takes precedence and the file isn\'t included in the
-- index.
--
-- 'fieldMappings', 'fsxConfiguration_fieldMappings' - A list of @DataSourceToIndexFieldMapping@ objects that map Amazon FSx
-- data source attributes or field names to Amazon Kendra index field
-- names. To create custom fields, use the @UpdateIndex@ API before you map
-- to Amazon FSx fields. For more information, see
-- <https://docs.aws.amazon.com/kendra/latest/dg/field-mapping.html Mapping data source fields>.
-- The Amazon FSx data source field names must exist in your Amazon FSx
-- custom metadata.
--
-- 'inclusionPatterns', 'fsxConfiguration_inclusionPatterns' - A list of regular expression patterns to include certain files in your
-- Amazon FSx file system. Files that match the patterns are included in
-- the index. Files that don\'t match the patterns are excluded from the
-- index. If a file matches both an inclusion and exclusion pattern, the
-- exclusion pattern takes precedence and the file isn\'t included in the
-- index.
--
-- 'secretArn', 'fsxConfiguration_secretArn' - The Amazon Resource Name (ARN) of an Secrets Manager secret that
-- contains the key-value pairs required to connect to your Amazon FSx file
-- system. Windows is currently the only supported type. The secret must
-- contain a JSON structure with the following keys:
--
-- -   username—The Active Directory user name, along with the Domain Name
--     System (DNS) domain name. For example, /user\@corp.example.com/. The
--     Active Directory user account must have read and mounting access to
--     the Amazon FSx file system for Windows.
--
-- -   password—The password of the Active Directory user account with read
--     and mounting access to the Amazon FSx Windows file system.
--
-- 'fileSystemId', 'fsxConfiguration_fileSystemId' - The identifier of the Amazon FSx file system.
--
-- You can find your file system ID on the file system dashboard in the
-- Amazon FSx console. For information on how to create a file system in
-- Amazon FSx console, using Windows File Server as an example, see
-- <https://docs.aws.amazon.com/fsx/latest/WindowsGuide/getting-started-step1.html Amazon FSx Getting started guide>.
--
-- 'fileSystemType', 'fsxConfiguration_fileSystemType' - The Amazon FSx file system type. Windows is currently the only supported
-- type.
--
-- 'vpcConfiguration', 'fsxConfiguration_vpcConfiguration' - Configuration information for an Amazon Virtual Private Cloud to connect
-- to your Amazon FSx. Your Amazon FSx instance must reside inside your
-- VPC.
newFsxConfiguration ::
  -- | 'fileSystemId'
  Prelude.Text ->
  -- | 'fileSystemType'
  FsxFileSystemType ->
  -- | 'vpcConfiguration'
  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_
      }

-- | A list of regular expression patterns to exclude certain files in your
-- Amazon FSx file system. Files that match the patterns are excluded from
-- the index. Files that don\'t match the patterns are included in the
-- index. If a file matches both an inclusion and exclusion pattern, the
-- exclusion pattern takes precedence and the file isn\'t included in the
-- index.
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

-- | A list of @DataSourceToIndexFieldMapping@ objects that map Amazon FSx
-- data source attributes or field names to Amazon Kendra index field
-- names. To create custom fields, use the @UpdateIndex@ API before you map
-- to Amazon FSx fields. For more information, see
-- <https://docs.aws.amazon.com/kendra/latest/dg/field-mapping.html Mapping data source fields>.
-- The Amazon FSx data source field names must exist in your Amazon FSx
-- custom metadata.
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

-- | A list of regular expression patterns to include certain files in your
-- Amazon FSx file system. Files that match the patterns are included in
-- the index. Files that don\'t match the patterns are excluded from the
-- index. If a file matches both an inclusion and exclusion pattern, the
-- exclusion pattern takes precedence and the file isn\'t included in the
-- index.
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

-- | The Amazon Resource Name (ARN) of an Secrets Manager secret that
-- contains the key-value pairs required to connect to your Amazon FSx file
-- system. Windows is currently the only supported type. The secret must
-- contain a JSON structure with the following keys:
--
-- -   username—The Active Directory user name, along with the Domain Name
--     System (DNS) domain name. For example, /user\@corp.example.com/. The
--     Active Directory user account must have read and mounting access to
--     the Amazon FSx file system for Windows.
--
-- -   password—The password of the Active Directory user account with read
--     and mounting access to the Amazon FSx Windows file system.
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)

-- | The identifier of the Amazon FSx file system.
--
-- You can find your file system ID on the file system dashboard in the
-- Amazon FSx console. For information on how to create a file system in
-- Amazon FSx console, using Windows File Server as an example, see
-- <https://docs.aws.amazon.com/fsx/latest/WindowsGuide/getting-started-step1.html Amazon FSx Getting started guide>.
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)

-- | The Amazon FSx file system type. Windows is currently the only supported
-- type.
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)

-- | Configuration information for an Amazon Virtual Private Cloud to connect
-- to your Amazon FSx. Your Amazon FSx instance must reside inside your
-- VPC.
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)
          ]
      )