{-# 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.GoogleDriveConfiguration
-- 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.GoogleDriveConfiguration 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 qualified Amazonka.Prelude as Prelude

-- | Provides the configuration information to connect to Google Drive as
-- your data source.
--
-- /See:/ 'newGoogleDriveConfiguration' smart constructor.
data GoogleDriveConfiguration = GoogleDriveConfiguration'
  { -- | A list of MIME types to exclude from the index. All documents matching
    -- the specified MIME type are excluded.
    --
    -- For a list of MIME types, see
    -- <https://docs.aws.amazon.com/kendra/latest/dg/data-source-google-drive.html Using a Google Workspace Drive data source>.
    GoogleDriveConfiguration -> Maybe [Text]
excludeMimeTypes :: Prelude.Maybe [Prelude.Text],
    -- | A list of identifiers or shared drives to exclude from the index. All
    -- files and folders stored on the shared drive are excluded.
    GoogleDriveConfiguration -> Maybe [Text]
excludeSharedDrives :: Prelude.Maybe [Prelude.Text],
    -- | A list of email addresses of the users. Documents owned by these users
    -- are excluded from the index. Documents shared with excluded users are
    -- indexed unless they are excluded in another way.
    GoogleDriveConfiguration -> Maybe [Text]
excludeUserAccounts :: Prelude.Maybe [Prelude.Text],
    -- | A list of regular expression patterns to exclude certain items in your
    -- Google Drive, including shared drives and users\' My Drives. Items that
    -- match the patterns are excluded from the index. Items that don\'t match
    -- the patterns are included in the index. If an item matches both an
    -- inclusion and exclusion pattern, the exclusion pattern takes precedence
    -- and the item isn\'t included in the index.
    GoogleDriveConfiguration -> Maybe [Text]
exclusionPatterns :: Prelude.Maybe [Prelude.Text],
    -- | Maps Google Drive data source attributes or field names to Amazon Kendra
    -- index field names. To create custom fields, use the @UpdateIndex@ API
    -- before you map to Google Drive fields. For more information, see
    -- <https://docs.aws.amazon.com/kendra/latest/dg/field-mapping.html Mapping data source fields>.
    -- The Google Drive data source field names must exist in your Google Drive
    -- custom metadata.
    GoogleDriveConfiguration
-> Maybe (NonEmpty DataSourceToIndexFieldMapping)
fieldMappings :: Prelude.Maybe (Prelude.NonEmpty DataSourceToIndexFieldMapping),
    -- | A list of regular expression patterns to include certain items in your
    -- Google Drive, including shared drives and users\' My Drives. Items that
    -- match the patterns are included in the index. Items that don\'t match
    -- the patterns are excluded from the index. If an item matches both an
    -- inclusion and exclusion pattern, the exclusion pattern takes precedence
    -- and the item isn\'t included in the index.
    GoogleDriveConfiguration -> Maybe [Text]
inclusionPatterns :: Prelude.Maybe [Prelude.Text],
    -- | The Amazon Resource Name (ARN) of a Secrets Managersecret that contains
    -- the credentials required to connect to Google Drive. For more
    -- information, see
    -- <https://docs.aws.amazon.com/kendra/latest/dg/data-source-google-drive.html Using a Google Workspace Drive data source>.
    GoogleDriveConfiguration -> Text
secretArn :: Prelude.Text
  }
  deriving (GoogleDriveConfiguration -> GoogleDriveConfiguration -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: GoogleDriveConfiguration -> GoogleDriveConfiguration -> Bool
$c/= :: GoogleDriveConfiguration -> GoogleDriveConfiguration -> Bool
== :: GoogleDriveConfiguration -> GoogleDriveConfiguration -> Bool
$c== :: GoogleDriveConfiguration -> GoogleDriveConfiguration -> Bool
Prelude.Eq, ReadPrec [GoogleDriveConfiguration]
ReadPrec GoogleDriveConfiguration
Int -> ReadS GoogleDriveConfiguration
ReadS [GoogleDriveConfiguration]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [GoogleDriveConfiguration]
$creadListPrec :: ReadPrec [GoogleDriveConfiguration]
readPrec :: ReadPrec GoogleDriveConfiguration
$creadPrec :: ReadPrec GoogleDriveConfiguration
readList :: ReadS [GoogleDriveConfiguration]
$creadList :: ReadS [GoogleDriveConfiguration]
readsPrec :: Int -> ReadS GoogleDriveConfiguration
$creadsPrec :: Int -> ReadS GoogleDriveConfiguration
Prelude.Read, Int -> GoogleDriveConfiguration -> ShowS
[GoogleDriveConfiguration] -> ShowS
GoogleDriveConfiguration -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [GoogleDriveConfiguration] -> ShowS
$cshowList :: [GoogleDriveConfiguration] -> ShowS
show :: GoogleDriveConfiguration -> String
$cshow :: GoogleDriveConfiguration -> String
showsPrec :: Int -> GoogleDriveConfiguration -> ShowS
$cshowsPrec :: Int -> GoogleDriveConfiguration -> ShowS
Prelude.Show, forall x.
Rep GoogleDriveConfiguration x -> GoogleDriveConfiguration
forall x.
GoogleDriveConfiguration -> Rep GoogleDriveConfiguration x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep GoogleDriveConfiguration x -> GoogleDriveConfiguration
$cfrom :: forall x.
GoogleDriveConfiguration -> Rep GoogleDriveConfiguration x
Prelude.Generic)

-- |
-- Create a value of 'GoogleDriveConfiguration' 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:
--
-- 'excludeMimeTypes', 'googleDriveConfiguration_excludeMimeTypes' - A list of MIME types to exclude from the index. All documents matching
-- the specified MIME type are excluded.
--
-- For a list of MIME types, see
-- <https://docs.aws.amazon.com/kendra/latest/dg/data-source-google-drive.html Using a Google Workspace Drive data source>.
--
-- 'excludeSharedDrives', 'googleDriveConfiguration_excludeSharedDrives' - A list of identifiers or shared drives to exclude from the index. All
-- files and folders stored on the shared drive are excluded.
--
-- 'excludeUserAccounts', 'googleDriveConfiguration_excludeUserAccounts' - A list of email addresses of the users. Documents owned by these users
-- are excluded from the index. Documents shared with excluded users are
-- indexed unless they are excluded in another way.
--
-- 'exclusionPatterns', 'googleDriveConfiguration_exclusionPatterns' - A list of regular expression patterns to exclude certain items in your
-- Google Drive, including shared drives and users\' My Drives. Items that
-- match the patterns are excluded from the index. Items that don\'t match
-- the patterns are included in the index. If an item matches both an
-- inclusion and exclusion pattern, the exclusion pattern takes precedence
-- and the item isn\'t included in the index.
--
-- 'fieldMappings', 'googleDriveConfiguration_fieldMappings' - Maps Google Drive data source attributes or field names to Amazon Kendra
-- index field names. To create custom fields, use the @UpdateIndex@ API
-- before you map to Google Drive fields. For more information, see
-- <https://docs.aws.amazon.com/kendra/latest/dg/field-mapping.html Mapping data source fields>.
-- The Google Drive data source field names must exist in your Google Drive
-- custom metadata.
--
-- 'inclusionPatterns', 'googleDriveConfiguration_inclusionPatterns' - A list of regular expression patterns to include certain items in your
-- Google Drive, including shared drives and users\' My Drives. Items that
-- match the patterns are included in the index. Items that don\'t match
-- the patterns are excluded from the index. If an item matches both an
-- inclusion and exclusion pattern, the exclusion pattern takes precedence
-- and the item isn\'t included in the index.
--
-- 'secretArn', 'googleDriveConfiguration_secretArn' - The Amazon Resource Name (ARN) of a Secrets Managersecret that contains
-- the credentials required to connect to Google Drive. For more
-- information, see
-- <https://docs.aws.amazon.com/kendra/latest/dg/data-source-google-drive.html Using a Google Workspace Drive data source>.
newGoogleDriveConfiguration ::
  -- | 'secretArn'
  Prelude.Text ->
  GoogleDriveConfiguration
newGoogleDriveConfiguration :: Text -> GoogleDriveConfiguration
newGoogleDriveConfiguration Text
pSecretArn_ =
  GoogleDriveConfiguration'
    { $sel:excludeMimeTypes:GoogleDriveConfiguration' :: Maybe [Text]
excludeMimeTypes =
        forall a. Maybe a
Prelude.Nothing,
      $sel:excludeSharedDrives:GoogleDriveConfiguration' :: Maybe [Text]
excludeSharedDrives = forall a. Maybe a
Prelude.Nothing,
      $sel:excludeUserAccounts:GoogleDriveConfiguration' :: Maybe [Text]
excludeUserAccounts = forall a. Maybe a
Prelude.Nothing,
      $sel:exclusionPatterns:GoogleDriveConfiguration' :: Maybe [Text]
exclusionPatterns = forall a. Maybe a
Prelude.Nothing,
      $sel:fieldMappings:GoogleDriveConfiguration' :: Maybe (NonEmpty DataSourceToIndexFieldMapping)
fieldMappings = forall a. Maybe a
Prelude.Nothing,
      $sel:inclusionPatterns:GoogleDriveConfiguration' :: Maybe [Text]
inclusionPatterns = forall a. Maybe a
Prelude.Nothing,
      $sel:secretArn:GoogleDriveConfiguration' :: Text
secretArn = Text
pSecretArn_
    }

-- | A list of MIME types to exclude from the index. All documents matching
-- the specified MIME type are excluded.
--
-- For a list of MIME types, see
-- <https://docs.aws.amazon.com/kendra/latest/dg/data-source-google-drive.html Using a Google Workspace Drive data source>.
googleDriveConfiguration_excludeMimeTypes :: Lens.Lens' GoogleDriveConfiguration (Prelude.Maybe [Prelude.Text])
googleDriveConfiguration_excludeMimeTypes :: Lens' GoogleDriveConfiguration (Maybe [Text])
googleDriveConfiguration_excludeMimeTypes = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GoogleDriveConfiguration' {Maybe [Text]
excludeMimeTypes :: Maybe [Text]
$sel:excludeMimeTypes:GoogleDriveConfiguration' :: GoogleDriveConfiguration -> Maybe [Text]
excludeMimeTypes} -> Maybe [Text]
excludeMimeTypes) (\s :: GoogleDriveConfiguration
s@GoogleDriveConfiguration' {} Maybe [Text]
a -> GoogleDriveConfiguration
s {$sel:excludeMimeTypes:GoogleDriveConfiguration' :: Maybe [Text]
excludeMimeTypes = Maybe [Text]
a} :: GoogleDriveConfiguration) 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 identifiers or shared drives to exclude from the index. All
-- files and folders stored on the shared drive are excluded.
googleDriveConfiguration_excludeSharedDrives :: Lens.Lens' GoogleDriveConfiguration (Prelude.Maybe [Prelude.Text])
googleDriveConfiguration_excludeSharedDrives :: Lens' GoogleDriveConfiguration (Maybe [Text])
googleDriveConfiguration_excludeSharedDrives = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GoogleDriveConfiguration' {Maybe [Text]
excludeSharedDrives :: Maybe [Text]
$sel:excludeSharedDrives:GoogleDriveConfiguration' :: GoogleDriveConfiguration -> Maybe [Text]
excludeSharedDrives} -> Maybe [Text]
excludeSharedDrives) (\s :: GoogleDriveConfiguration
s@GoogleDriveConfiguration' {} Maybe [Text]
a -> GoogleDriveConfiguration
s {$sel:excludeSharedDrives:GoogleDriveConfiguration' :: Maybe [Text]
excludeSharedDrives = Maybe [Text]
a} :: GoogleDriveConfiguration) 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 email addresses of the users. Documents owned by these users
-- are excluded from the index. Documents shared with excluded users are
-- indexed unless they are excluded in another way.
googleDriveConfiguration_excludeUserAccounts :: Lens.Lens' GoogleDriveConfiguration (Prelude.Maybe [Prelude.Text])
googleDriveConfiguration_excludeUserAccounts :: Lens' GoogleDriveConfiguration (Maybe [Text])
googleDriveConfiguration_excludeUserAccounts = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GoogleDriveConfiguration' {Maybe [Text]
excludeUserAccounts :: Maybe [Text]
$sel:excludeUserAccounts:GoogleDriveConfiguration' :: GoogleDriveConfiguration -> Maybe [Text]
excludeUserAccounts} -> Maybe [Text]
excludeUserAccounts) (\s :: GoogleDriveConfiguration
s@GoogleDriveConfiguration' {} Maybe [Text]
a -> GoogleDriveConfiguration
s {$sel:excludeUserAccounts:GoogleDriveConfiguration' :: Maybe [Text]
excludeUserAccounts = Maybe [Text]
a} :: GoogleDriveConfiguration) 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 exclude certain items in your
-- Google Drive, including shared drives and users\' My Drives. Items that
-- match the patterns are excluded from the index. Items that don\'t match
-- the patterns are included in the index. If an item matches both an
-- inclusion and exclusion pattern, the exclusion pattern takes precedence
-- and the item isn\'t included in the index.
googleDriveConfiguration_exclusionPatterns :: Lens.Lens' GoogleDriveConfiguration (Prelude.Maybe [Prelude.Text])
googleDriveConfiguration_exclusionPatterns :: Lens' GoogleDriveConfiguration (Maybe [Text])
googleDriveConfiguration_exclusionPatterns = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GoogleDriveConfiguration' {Maybe [Text]
exclusionPatterns :: Maybe [Text]
$sel:exclusionPatterns:GoogleDriveConfiguration' :: GoogleDriveConfiguration -> Maybe [Text]
exclusionPatterns} -> Maybe [Text]
exclusionPatterns) (\s :: GoogleDriveConfiguration
s@GoogleDriveConfiguration' {} Maybe [Text]
a -> GoogleDriveConfiguration
s {$sel:exclusionPatterns:GoogleDriveConfiguration' :: Maybe [Text]
exclusionPatterns = Maybe [Text]
a} :: GoogleDriveConfiguration) 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

-- | Maps Google Drive data source attributes or field names to Amazon Kendra
-- index field names. To create custom fields, use the @UpdateIndex@ API
-- before you map to Google Drive fields. For more information, see
-- <https://docs.aws.amazon.com/kendra/latest/dg/field-mapping.html Mapping data source fields>.
-- The Google Drive data source field names must exist in your Google Drive
-- custom metadata.
googleDriveConfiguration_fieldMappings :: Lens.Lens' GoogleDriveConfiguration (Prelude.Maybe (Prelude.NonEmpty DataSourceToIndexFieldMapping))
googleDriveConfiguration_fieldMappings :: Lens'
  GoogleDriveConfiguration
  (Maybe (NonEmpty DataSourceToIndexFieldMapping))
googleDriveConfiguration_fieldMappings = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GoogleDriveConfiguration' {Maybe (NonEmpty DataSourceToIndexFieldMapping)
fieldMappings :: Maybe (NonEmpty DataSourceToIndexFieldMapping)
$sel:fieldMappings:GoogleDriveConfiguration' :: GoogleDriveConfiguration
-> Maybe (NonEmpty DataSourceToIndexFieldMapping)
fieldMappings} -> Maybe (NonEmpty DataSourceToIndexFieldMapping)
fieldMappings) (\s :: GoogleDriveConfiguration
s@GoogleDriveConfiguration' {} Maybe (NonEmpty DataSourceToIndexFieldMapping)
a -> GoogleDriveConfiguration
s {$sel:fieldMappings:GoogleDriveConfiguration' :: Maybe (NonEmpty DataSourceToIndexFieldMapping)
fieldMappings = Maybe (NonEmpty DataSourceToIndexFieldMapping)
a} :: GoogleDriveConfiguration) 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 items in your
-- Google Drive, including shared drives and users\' My Drives. Items that
-- match the patterns are included in the index. Items that don\'t match
-- the patterns are excluded from the index. If an item matches both an
-- inclusion and exclusion pattern, the exclusion pattern takes precedence
-- and the item isn\'t included in the index.
googleDriveConfiguration_inclusionPatterns :: Lens.Lens' GoogleDriveConfiguration (Prelude.Maybe [Prelude.Text])
googleDriveConfiguration_inclusionPatterns :: Lens' GoogleDriveConfiguration (Maybe [Text])
googleDriveConfiguration_inclusionPatterns = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GoogleDriveConfiguration' {Maybe [Text]
inclusionPatterns :: Maybe [Text]
$sel:inclusionPatterns:GoogleDriveConfiguration' :: GoogleDriveConfiguration -> Maybe [Text]
inclusionPatterns} -> Maybe [Text]
inclusionPatterns) (\s :: GoogleDriveConfiguration
s@GoogleDriveConfiguration' {} Maybe [Text]
a -> GoogleDriveConfiguration
s {$sel:inclusionPatterns:GoogleDriveConfiguration' :: Maybe [Text]
inclusionPatterns = Maybe [Text]
a} :: GoogleDriveConfiguration) 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 a Secrets Managersecret that contains
-- the credentials required to connect to Google Drive. For more
-- information, see
-- <https://docs.aws.amazon.com/kendra/latest/dg/data-source-google-drive.html Using a Google Workspace Drive data source>.
googleDriveConfiguration_secretArn :: Lens.Lens' GoogleDriveConfiguration Prelude.Text
googleDriveConfiguration_secretArn :: Lens' GoogleDriveConfiguration Text
googleDriveConfiguration_secretArn = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GoogleDriveConfiguration' {Text
secretArn :: Text
$sel:secretArn:GoogleDriveConfiguration' :: GoogleDriveConfiguration -> Text
secretArn} -> Text
secretArn) (\s :: GoogleDriveConfiguration
s@GoogleDriveConfiguration' {} Text
a -> GoogleDriveConfiguration
s {$sel:secretArn:GoogleDriveConfiguration' :: Text
secretArn = Text
a} :: GoogleDriveConfiguration)

instance Data.FromJSON GoogleDriveConfiguration where
  parseJSON :: Value -> Parser GoogleDriveConfiguration
parseJSON =
    forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
      String
"GoogleDriveConfiguration"
      ( \Object
x ->
          Maybe [Text]
-> Maybe [Text]
-> Maybe [Text]
-> Maybe [Text]
-> Maybe (NonEmpty DataSourceToIndexFieldMapping)
-> Maybe [Text]
-> Text
-> GoogleDriveConfiguration
GoogleDriveConfiguration'
            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
"ExcludeMimeTypes"
                            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
"ExcludeSharedDrives"
                            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
"ExcludeUserAccounts"
                            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
"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 a
Data..: Key
"SecretArn")
      )

instance Prelude.Hashable GoogleDriveConfiguration where
  hashWithSalt :: Int -> GoogleDriveConfiguration -> Int
hashWithSalt Int
_salt GoogleDriveConfiguration' {Maybe [Text]
Maybe (NonEmpty DataSourceToIndexFieldMapping)
Text
secretArn :: Text
inclusionPatterns :: Maybe [Text]
fieldMappings :: Maybe (NonEmpty DataSourceToIndexFieldMapping)
exclusionPatterns :: Maybe [Text]
excludeUserAccounts :: Maybe [Text]
excludeSharedDrives :: Maybe [Text]
excludeMimeTypes :: Maybe [Text]
$sel:secretArn:GoogleDriveConfiguration' :: GoogleDriveConfiguration -> Text
$sel:inclusionPatterns:GoogleDriveConfiguration' :: GoogleDriveConfiguration -> Maybe [Text]
$sel:fieldMappings:GoogleDriveConfiguration' :: GoogleDriveConfiguration
-> Maybe (NonEmpty DataSourceToIndexFieldMapping)
$sel:exclusionPatterns:GoogleDriveConfiguration' :: GoogleDriveConfiguration -> Maybe [Text]
$sel:excludeUserAccounts:GoogleDriveConfiguration' :: GoogleDriveConfiguration -> Maybe [Text]
$sel:excludeSharedDrives:GoogleDriveConfiguration' :: GoogleDriveConfiguration -> Maybe [Text]
$sel:excludeMimeTypes:GoogleDriveConfiguration' :: GoogleDriveConfiguration -> Maybe [Text]
..} =
    Int
_salt
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe [Text]
excludeMimeTypes
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe [Text]
excludeSharedDrives
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe [Text]
excludeUserAccounts
      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` Text
secretArn

instance Prelude.NFData GoogleDriveConfiguration where
  rnf :: GoogleDriveConfiguration -> ()
rnf GoogleDriveConfiguration' {Maybe [Text]
Maybe (NonEmpty DataSourceToIndexFieldMapping)
Text
secretArn :: Text
inclusionPatterns :: Maybe [Text]
fieldMappings :: Maybe (NonEmpty DataSourceToIndexFieldMapping)
exclusionPatterns :: Maybe [Text]
excludeUserAccounts :: Maybe [Text]
excludeSharedDrives :: Maybe [Text]
excludeMimeTypes :: Maybe [Text]
$sel:secretArn:GoogleDriveConfiguration' :: GoogleDriveConfiguration -> Text
$sel:inclusionPatterns:GoogleDriveConfiguration' :: GoogleDriveConfiguration -> Maybe [Text]
$sel:fieldMappings:GoogleDriveConfiguration' :: GoogleDriveConfiguration
-> Maybe (NonEmpty DataSourceToIndexFieldMapping)
$sel:exclusionPatterns:GoogleDriveConfiguration' :: GoogleDriveConfiguration -> Maybe [Text]
$sel:excludeUserAccounts:GoogleDriveConfiguration' :: GoogleDriveConfiguration -> Maybe [Text]
$sel:excludeSharedDrives:GoogleDriveConfiguration' :: GoogleDriveConfiguration -> Maybe [Text]
$sel:excludeMimeTypes:GoogleDriveConfiguration' :: GoogleDriveConfiguration -> Maybe [Text]
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe [Text]
excludeMimeTypes
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe [Text]
excludeSharedDrives
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe [Text]
excludeUserAccounts
      seq :: forall a b. a -> b -> b
`Prelude.seq` 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 Text
secretArn

instance Data.ToJSON GoogleDriveConfiguration where
  toJSON :: GoogleDriveConfiguration -> Value
toJSON GoogleDriveConfiguration' {Maybe [Text]
Maybe (NonEmpty DataSourceToIndexFieldMapping)
Text
secretArn :: Text
inclusionPatterns :: Maybe [Text]
fieldMappings :: Maybe (NonEmpty DataSourceToIndexFieldMapping)
exclusionPatterns :: Maybe [Text]
excludeUserAccounts :: Maybe [Text]
excludeSharedDrives :: Maybe [Text]
excludeMimeTypes :: Maybe [Text]
$sel:secretArn:GoogleDriveConfiguration' :: GoogleDriveConfiguration -> Text
$sel:inclusionPatterns:GoogleDriveConfiguration' :: GoogleDriveConfiguration -> Maybe [Text]
$sel:fieldMappings:GoogleDriveConfiguration' :: GoogleDriveConfiguration
-> Maybe (NonEmpty DataSourceToIndexFieldMapping)
$sel:exclusionPatterns:GoogleDriveConfiguration' :: GoogleDriveConfiguration -> Maybe [Text]
$sel:excludeUserAccounts:GoogleDriveConfiguration' :: GoogleDriveConfiguration -> Maybe [Text]
$sel:excludeSharedDrives:GoogleDriveConfiguration' :: GoogleDriveConfiguration -> Maybe [Text]
$sel:excludeMimeTypes:GoogleDriveConfiguration' :: GoogleDriveConfiguration -> Maybe [Text]
..} =
    [Pair] -> Value
Data.object
      ( forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ (Key
"ExcludeMimeTypes" 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]
excludeMimeTypes,
            (Key
"ExcludeSharedDrives" 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]
excludeSharedDrives,
            (Key
"ExcludeUserAccounts" 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]
excludeUserAccounts,
            (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,
            forall a. a -> Maybe a
Prelude.Just (Key
"SecretArn" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= Text
secretArn)
          ]
      )