{-# 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.OneDriveConfiguration
-- 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.OneDriveConfiguration 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.OneDriveUsers
import qualified Amazonka.Prelude as Prelude

-- | Provides the configuration information to connect to OneDrive as your
-- data source.
--
-- /See:/ 'newOneDriveConfiguration' smart constructor.
data OneDriveConfiguration = OneDriveConfiguration'
  { -- | @TRUE@ to disable local groups information.
    OneDriveConfiguration -> Maybe Bool
disableLocalGroups :: Prelude.Maybe Prelude.Bool,
    -- | A list of regular expression patterns to exclude certain documents in
    -- your OneDrive. Documents that match the patterns are excluded from the
    -- index. Documents that don\'t match the patterns are included in the
    -- index. If a document matches both an inclusion and exclusion pattern,
    -- the exclusion pattern takes precedence and the document isn\'t included
    -- in the index.
    --
    -- The pattern is applied to the file name.
    OneDriveConfiguration -> Maybe [Text]
exclusionPatterns :: Prelude.Maybe [Prelude.Text],
    -- | A list of @DataSourceToIndexFieldMapping@ objects that map OneDrive data
    -- source attributes or field names to Amazon Kendra index field names. To
    -- create custom fields, use the @UpdateIndex@ API before you map to
    -- OneDrive fields. For more information, see
    -- <https://docs.aws.amazon.com/kendra/latest/dg/field-mapping.html Mapping data source fields>.
    -- The OneDrive data source field names must exist in your OneDrive custom
    -- metadata.
    OneDriveConfiguration
-> Maybe (NonEmpty DataSourceToIndexFieldMapping)
fieldMappings :: Prelude.Maybe (Prelude.NonEmpty DataSourceToIndexFieldMapping),
    -- | A list of regular expression patterns to include certain documents in
    -- your OneDrive. Documents that match the patterns are included in the
    -- index. Documents that don\'t match the patterns are excluded from the
    -- index. If a document matches both an inclusion and exclusion pattern,
    -- the exclusion pattern takes precedence and the document isn\'t included
    -- in the index.
    --
    -- The pattern is applied to the file name.
    OneDriveConfiguration -> Maybe [Text]
inclusionPatterns :: Prelude.Maybe [Prelude.Text],
    -- | The Azure Active Directory domain of the organization.
    OneDriveConfiguration -> Text
tenantDomain :: Prelude.Text,
    -- | The Amazon Resource Name (ARN) of an Secrets Managersecret that contains
    -- the user name and password to connect to OneDrive. The user namd should
    -- be the application ID for the OneDrive application, and the password is
    -- the application key for the OneDrive application.
    OneDriveConfiguration -> Text
secretArn :: Prelude.Text,
    -- | A list of user accounts whose documents should be indexed.
    OneDriveConfiguration -> OneDriveUsers
oneDriveUsers :: OneDriveUsers
  }
  deriving (OneDriveConfiguration -> OneDriveConfiguration -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: OneDriveConfiguration -> OneDriveConfiguration -> Bool
$c/= :: OneDriveConfiguration -> OneDriveConfiguration -> Bool
== :: OneDriveConfiguration -> OneDriveConfiguration -> Bool
$c== :: OneDriveConfiguration -> OneDriveConfiguration -> Bool
Prelude.Eq, ReadPrec [OneDriveConfiguration]
ReadPrec OneDriveConfiguration
Int -> ReadS OneDriveConfiguration
ReadS [OneDriveConfiguration]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [OneDriveConfiguration]
$creadListPrec :: ReadPrec [OneDriveConfiguration]
readPrec :: ReadPrec OneDriveConfiguration
$creadPrec :: ReadPrec OneDriveConfiguration
readList :: ReadS [OneDriveConfiguration]
$creadList :: ReadS [OneDriveConfiguration]
readsPrec :: Int -> ReadS OneDriveConfiguration
$creadsPrec :: Int -> ReadS OneDriveConfiguration
Prelude.Read, Int -> OneDriveConfiguration -> ShowS
[OneDriveConfiguration] -> ShowS
OneDriveConfiguration -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [OneDriveConfiguration] -> ShowS
$cshowList :: [OneDriveConfiguration] -> ShowS
show :: OneDriveConfiguration -> String
$cshow :: OneDriveConfiguration -> String
showsPrec :: Int -> OneDriveConfiguration -> ShowS
$cshowsPrec :: Int -> OneDriveConfiguration -> ShowS
Prelude.Show, forall x. Rep OneDriveConfiguration x -> OneDriveConfiguration
forall x. OneDriveConfiguration -> Rep OneDriveConfiguration x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep OneDriveConfiguration x -> OneDriveConfiguration
$cfrom :: forall x. OneDriveConfiguration -> Rep OneDriveConfiguration x
Prelude.Generic)

-- |
-- Create a value of 'OneDriveConfiguration' 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:
--
-- 'disableLocalGroups', 'oneDriveConfiguration_disableLocalGroups' - @TRUE@ to disable local groups information.
--
-- 'exclusionPatterns', 'oneDriveConfiguration_exclusionPatterns' - A list of regular expression patterns to exclude certain documents in
-- your OneDrive. Documents that match the patterns are excluded from the
-- index. Documents that don\'t match the patterns are included in the
-- index. If a document matches both an inclusion and exclusion pattern,
-- the exclusion pattern takes precedence and the document isn\'t included
-- in the index.
--
-- The pattern is applied to the file name.
--
-- 'fieldMappings', 'oneDriveConfiguration_fieldMappings' - A list of @DataSourceToIndexFieldMapping@ objects that map OneDrive data
-- source attributes or field names to Amazon Kendra index field names. To
-- create custom fields, use the @UpdateIndex@ API before you map to
-- OneDrive fields. For more information, see
-- <https://docs.aws.amazon.com/kendra/latest/dg/field-mapping.html Mapping data source fields>.
-- The OneDrive data source field names must exist in your OneDrive custom
-- metadata.
--
-- 'inclusionPatterns', 'oneDriveConfiguration_inclusionPatterns' - A list of regular expression patterns to include certain documents in
-- your OneDrive. Documents that match the patterns are included in the
-- index. Documents that don\'t match the patterns are excluded from the
-- index. If a document matches both an inclusion and exclusion pattern,
-- the exclusion pattern takes precedence and the document isn\'t included
-- in the index.
--
-- The pattern is applied to the file name.
--
-- 'tenantDomain', 'oneDriveConfiguration_tenantDomain' - The Azure Active Directory domain of the organization.
--
-- 'secretArn', 'oneDriveConfiguration_secretArn' - The Amazon Resource Name (ARN) of an Secrets Managersecret that contains
-- the user name and password to connect to OneDrive. The user namd should
-- be the application ID for the OneDrive application, and the password is
-- the application key for the OneDrive application.
--
-- 'oneDriveUsers', 'oneDriveConfiguration_oneDriveUsers' - A list of user accounts whose documents should be indexed.
newOneDriveConfiguration ::
  -- | 'tenantDomain'
  Prelude.Text ->
  -- | 'secretArn'
  Prelude.Text ->
  -- | 'oneDriveUsers'
  OneDriveUsers ->
  OneDriveConfiguration
newOneDriveConfiguration :: Text -> Text -> OneDriveUsers -> OneDriveConfiguration
newOneDriveConfiguration
  Text
pTenantDomain_
  Text
pSecretArn_
  OneDriveUsers
pOneDriveUsers_ =
    OneDriveConfiguration'
      { $sel:disableLocalGroups:OneDriveConfiguration' :: Maybe Bool
disableLocalGroups =
          forall a. Maybe a
Prelude.Nothing,
        $sel:exclusionPatterns:OneDriveConfiguration' :: Maybe [Text]
exclusionPatterns = forall a. Maybe a
Prelude.Nothing,
        $sel:fieldMappings:OneDriveConfiguration' :: Maybe (NonEmpty DataSourceToIndexFieldMapping)
fieldMappings = forall a. Maybe a
Prelude.Nothing,
        $sel:inclusionPatterns:OneDriveConfiguration' :: Maybe [Text]
inclusionPatterns = forall a. Maybe a
Prelude.Nothing,
        $sel:tenantDomain:OneDriveConfiguration' :: Text
tenantDomain = Text
pTenantDomain_,
        $sel:secretArn:OneDriveConfiguration' :: Text
secretArn = Text
pSecretArn_,
        $sel:oneDriveUsers:OneDriveConfiguration' :: OneDriveUsers
oneDriveUsers = OneDriveUsers
pOneDriveUsers_
      }

-- | @TRUE@ to disable local groups information.
oneDriveConfiguration_disableLocalGroups :: Lens.Lens' OneDriveConfiguration (Prelude.Maybe Prelude.Bool)
oneDriveConfiguration_disableLocalGroups :: Lens' OneDriveConfiguration (Maybe Bool)
oneDriveConfiguration_disableLocalGroups = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\OneDriveConfiguration' {Maybe Bool
disableLocalGroups :: Maybe Bool
$sel:disableLocalGroups:OneDriveConfiguration' :: OneDriveConfiguration -> Maybe Bool
disableLocalGroups} -> Maybe Bool
disableLocalGroups) (\s :: OneDriveConfiguration
s@OneDriveConfiguration' {} Maybe Bool
a -> OneDriveConfiguration
s {$sel:disableLocalGroups:OneDriveConfiguration' :: Maybe Bool
disableLocalGroups = Maybe Bool
a} :: OneDriveConfiguration)

-- | A list of regular expression patterns to exclude certain documents in
-- your OneDrive. Documents that match the patterns are excluded from the
-- index. Documents that don\'t match the patterns are included in the
-- index. If a document matches both an inclusion and exclusion pattern,
-- the exclusion pattern takes precedence and the document isn\'t included
-- in the index.
--
-- The pattern is applied to the file name.
oneDriveConfiguration_exclusionPatterns :: Lens.Lens' OneDriveConfiguration (Prelude.Maybe [Prelude.Text])
oneDriveConfiguration_exclusionPatterns :: Lens' OneDriveConfiguration (Maybe [Text])
oneDriveConfiguration_exclusionPatterns = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\OneDriveConfiguration' {Maybe [Text]
exclusionPatterns :: Maybe [Text]
$sel:exclusionPatterns:OneDriveConfiguration' :: OneDriveConfiguration -> Maybe [Text]
exclusionPatterns} -> Maybe [Text]
exclusionPatterns) (\s :: OneDriveConfiguration
s@OneDriveConfiguration' {} Maybe [Text]
a -> OneDriveConfiguration
s {$sel:exclusionPatterns:OneDriveConfiguration' :: Maybe [Text]
exclusionPatterns = Maybe [Text]
a} :: OneDriveConfiguration) 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 OneDrive data
-- source attributes or field names to Amazon Kendra index field names. To
-- create custom fields, use the @UpdateIndex@ API before you map to
-- OneDrive fields. For more information, see
-- <https://docs.aws.amazon.com/kendra/latest/dg/field-mapping.html Mapping data source fields>.
-- The OneDrive data source field names must exist in your OneDrive custom
-- metadata.
oneDriveConfiguration_fieldMappings :: Lens.Lens' OneDriveConfiguration (Prelude.Maybe (Prelude.NonEmpty DataSourceToIndexFieldMapping))
oneDriveConfiguration_fieldMappings :: Lens'
  OneDriveConfiguration
  (Maybe (NonEmpty DataSourceToIndexFieldMapping))
oneDriveConfiguration_fieldMappings = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\OneDriveConfiguration' {Maybe (NonEmpty DataSourceToIndexFieldMapping)
fieldMappings :: Maybe (NonEmpty DataSourceToIndexFieldMapping)
$sel:fieldMappings:OneDriveConfiguration' :: OneDriveConfiguration
-> Maybe (NonEmpty DataSourceToIndexFieldMapping)
fieldMappings} -> Maybe (NonEmpty DataSourceToIndexFieldMapping)
fieldMappings) (\s :: OneDriveConfiguration
s@OneDriveConfiguration' {} Maybe (NonEmpty DataSourceToIndexFieldMapping)
a -> OneDriveConfiguration
s {$sel:fieldMappings:OneDriveConfiguration' :: Maybe (NonEmpty DataSourceToIndexFieldMapping)
fieldMappings = Maybe (NonEmpty DataSourceToIndexFieldMapping)
a} :: OneDriveConfiguration) 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 documents in
-- your OneDrive. Documents that match the patterns are included in the
-- index. Documents that don\'t match the patterns are excluded from the
-- index. If a document matches both an inclusion and exclusion pattern,
-- the exclusion pattern takes precedence and the document isn\'t included
-- in the index.
--
-- The pattern is applied to the file name.
oneDriveConfiguration_inclusionPatterns :: Lens.Lens' OneDriveConfiguration (Prelude.Maybe [Prelude.Text])
oneDriveConfiguration_inclusionPatterns :: Lens' OneDriveConfiguration (Maybe [Text])
oneDriveConfiguration_inclusionPatterns = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\OneDriveConfiguration' {Maybe [Text]
inclusionPatterns :: Maybe [Text]
$sel:inclusionPatterns:OneDriveConfiguration' :: OneDriveConfiguration -> Maybe [Text]
inclusionPatterns} -> Maybe [Text]
inclusionPatterns) (\s :: OneDriveConfiguration
s@OneDriveConfiguration' {} Maybe [Text]
a -> OneDriveConfiguration
s {$sel:inclusionPatterns:OneDriveConfiguration' :: Maybe [Text]
inclusionPatterns = Maybe [Text]
a} :: OneDriveConfiguration) 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 Azure Active Directory domain of the organization.
oneDriveConfiguration_tenantDomain :: Lens.Lens' OneDriveConfiguration Prelude.Text
oneDriveConfiguration_tenantDomain :: Lens' OneDriveConfiguration Text
oneDriveConfiguration_tenantDomain = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\OneDriveConfiguration' {Text
tenantDomain :: Text
$sel:tenantDomain:OneDriveConfiguration' :: OneDriveConfiguration -> Text
tenantDomain} -> Text
tenantDomain) (\s :: OneDriveConfiguration
s@OneDriveConfiguration' {} Text
a -> OneDriveConfiguration
s {$sel:tenantDomain:OneDriveConfiguration' :: Text
tenantDomain = Text
a} :: OneDriveConfiguration)

-- | The Amazon Resource Name (ARN) of an Secrets Managersecret that contains
-- the user name and password to connect to OneDrive. The user namd should
-- be the application ID for the OneDrive application, and the password is
-- the application key for the OneDrive application.
oneDriveConfiguration_secretArn :: Lens.Lens' OneDriveConfiguration Prelude.Text
oneDriveConfiguration_secretArn :: Lens' OneDriveConfiguration Text
oneDriveConfiguration_secretArn = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\OneDriveConfiguration' {Text
secretArn :: Text
$sel:secretArn:OneDriveConfiguration' :: OneDriveConfiguration -> Text
secretArn} -> Text
secretArn) (\s :: OneDriveConfiguration
s@OneDriveConfiguration' {} Text
a -> OneDriveConfiguration
s {$sel:secretArn:OneDriveConfiguration' :: Text
secretArn = Text
a} :: OneDriveConfiguration)

-- | A list of user accounts whose documents should be indexed.
oneDriveConfiguration_oneDriveUsers :: Lens.Lens' OneDriveConfiguration OneDriveUsers
oneDriveConfiguration_oneDriveUsers :: Lens' OneDriveConfiguration OneDriveUsers
oneDriveConfiguration_oneDriveUsers = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\OneDriveConfiguration' {OneDriveUsers
oneDriveUsers :: OneDriveUsers
$sel:oneDriveUsers:OneDriveConfiguration' :: OneDriveConfiguration -> OneDriveUsers
oneDriveUsers} -> OneDriveUsers
oneDriveUsers) (\s :: OneDriveConfiguration
s@OneDriveConfiguration' {} OneDriveUsers
a -> OneDriveConfiguration
s {$sel:oneDriveUsers:OneDriveConfiguration' :: OneDriveUsers
oneDriveUsers = OneDriveUsers
a} :: OneDriveConfiguration)

instance Data.FromJSON OneDriveConfiguration where
  parseJSON :: Value -> Parser OneDriveConfiguration
parseJSON =
    forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
      String
"OneDriveConfiguration"
      ( \Object
x ->
          Maybe Bool
-> Maybe [Text]
-> Maybe (NonEmpty DataSourceToIndexFieldMapping)
-> Maybe [Text]
-> Text
-> Text
-> OneDriveUsers
-> OneDriveConfiguration
OneDriveConfiguration'
            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
"DisableLocalGroups")
            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
"TenantDomain")
            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")
            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
"OneDriveUsers")
      )

instance Prelude.Hashable OneDriveConfiguration where
  hashWithSalt :: Int -> OneDriveConfiguration -> Int
hashWithSalt Int
_salt OneDriveConfiguration' {Maybe Bool
Maybe [Text]
Maybe (NonEmpty DataSourceToIndexFieldMapping)
Text
OneDriveUsers
oneDriveUsers :: OneDriveUsers
secretArn :: Text
tenantDomain :: Text
inclusionPatterns :: Maybe [Text]
fieldMappings :: Maybe (NonEmpty DataSourceToIndexFieldMapping)
exclusionPatterns :: Maybe [Text]
disableLocalGroups :: Maybe Bool
$sel:oneDriveUsers:OneDriveConfiguration' :: OneDriveConfiguration -> OneDriveUsers
$sel:secretArn:OneDriveConfiguration' :: OneDriveConfiguration -> Text
$sel:tenantDomain:OneDriveConfiguration' :: OneDriveConfiguration -> Text
$sel:inclusionPatterns:OneDriveConfiguration' :: OneDriveConfiguration -> Maybe [Text]
$sel:fieldMappings:OneDriveConfiguration' :: OneDriveConfiguration
-> Maybe (NonEmpty DataSourceToIndexFieldMapping)
$sel:exclusionPatterns:OneDriveConfiguration' :: OneDriveConfiguration -> Maybe [Text]
$sel:disableLocalGroups:OneDriveConfiguration' :: OneDriveConfiguration -> Maybe Bool
..} =
    Int
_salt
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Bool
disableLocalGroups
      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
tenantDomain
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
secretArn
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` OneDriveUsers
oneDriveUsers

instance Prelude.NFData OneDriveConfiguration where
  rnf :: OneDriveConfiguration -> ()
rnf OneDriveConfiguration' {Maybe Bool
Maybe [Text]
Maybe (NonEmpty DataSourceToIndexFieldMapping)
Text
OneDriveUsers
oneDriveUsers :: OneDriveUsers
secretArn :: Text
tenantDomain :: Text
inclusionPatterns :: Maybe [Text]
fieldMappings :: Maybe (NonEmpty DataSourceToIndexFieldMapping)
exclusionPatterns :: Maybe [Text]
disableLocalGroups :: Maybe Bool
$sel:oneDriveUsers:OneDriveConfiguration' :: OneDriveConfiguration -> OneDriveUsers
$sel:secretArn:OneDriveConfiguration' :: OneDriveConfiguration -> Text
$sel:tenantDomain:OneDriveConfiguration' :: OneDriveConfiguration -> Text
$sel:inclusionPatterns:OneDriveConfiguration' :: OneDriveConfiguration -> Maybe [Text]
$sel:fieldMappings:OneDriveConfiguration' :: OneDriveConfiguration
-> Maybe (NonEmpty DataSourceToIndexFieldMapping)
$sel:exclusionPatterns:OneDriveConfiguration' :: OneDriveConfiguration -> Maybe [Text]
$sel:disableLocalGroups:OneDriveConfiguration' :: OneDriveConfiguration -> Maybe Bool
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe Bool
disableLocalGroups
      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
tenantDomain
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
secretArn
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf OneDriveUsers
oneDriveUsers

instance Data.ToJSON OneDriveConfiguration where
  toJSON :: OneDriveConfiguration -> Value
toJSON OneDriveConfiguration' {Maybe Bool
Maybe [Text]
Maybe (NonEmpty DataSourceToIndexFieldMapping)
Text
OneDriveUsers
oneDriveUsers :: OneDriveUsers
secretArn :: Text
tenantDomain :: Text
inclusionPatterns :: Maybe [Text]
fieldMappings :: Maybe (NonEmpty DataSourceToIndexFieldMapping)
exclusionPatterns :: Maybe [Text]
disableLocalGroups :: Maybe Bool
$sel:oneDriveUsers:OneDriveConfiguration' :: OneDriveConfiguration -> OneDriveUsers
$sel:secretArn:OneDriveConfiguration' :: OneDriveConfiguration -> Text
$sel:tenantDomain:OneDriveConfiguration' :: OneDriveConfiguration -> Text
$sel:inclusionPatterns:OneDriveConfiguration' :: OneDriveConfiguration -> Maybe [Text]
$sel:fieldMappings:OneDriveConfiguration' :: OneDriveConfiguration
-> Maybe (NonEmpty DataSourceToIndexFieldMapping)
$sel:exclusionPatterns:OneDriveConfiguration' :: OneDriveConfiguration -> Maybe [Text]
$sel:disableLocalGroups:OneDriveConfiguration' :: OneDriveConfiguration -> Maybe Bool
..} =
    [Pair] -> Value
Data.object
      ( forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ (Key
"DisableLocalGroups" 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 Bool
disableLocalGroups,
            (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
"TenantDomain" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= Text
tenantDomain),
            forall a. a -> Maybe a
Prelude.Just (Key
"SecretArn" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= Text
secretArn),
            forall a. a -> Maybe a
Prelude.Just
              (Key
"OneDriveUsers" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= OneDriveUsers
oneDriveUsers)
          ]
      )