{-# 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.MQ.Types.LdapServerMetadataInput
-- Copyright   : (c) 2013-2021 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay <brendan.g.hay+amazonka@gmail.com>
-- Stability   : auto-generated
-- Portability : non-portable (GHC extensions)
module Amazonka.MQ.Types.LdapServerMetadataInput where

import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude

-- | Optional. The metadata of the LDAP server used to authenticate and
-- authorize connections to the broker.
--
-- Does not apply to RabbitMQ brokers.
--
-- /See:/ 'newLdapServerMetadataInput' smart constructor.
data LdapServerMetadataInput = LdapServerMetadataInput'
  { -- | Specifies the name of the LDAP attribute for the user group membership.
    LdapServerMetadataInput -> Maybe Text
userRoleName :: Prelude.Maybe Prelude.Text,
    -- | The directory search scope for the user. If set to true, scope is to
    -- search the entire subtree.
    LdapServerMetadataInput -> Maybe Bool
userSearchSubtree :: Prelude.Maybe Prelude.Bool,
    -- | The directory search scope for the role. If set to true, scope is to
    -- search the entire subtree.
    LdapServerMetadataInput -> Maybe Bool
roleSearchSubtree :: Prelude.Maybe Prelude.Bool,
    -- | Specifies the LDAP attribute that identifies the group name attribute in
    -- the object returned from the group membership query.
    LdapServerMetadataInput -> Maybe Text
roleName :: Prelude.Maybe Prelude.Text,
    -- | Specifies the location of the LDAP server such as AWS Directory Service
    -- for Microsoft Active Directory . Optional failover server.
    LdapServerMetadataInput -> [Text]
hosts :: [Prelude.Text],
    -- | The LDAP search filter used to find users within the userBase. The
    -- client\'s username is substituted into the {0} placeholder in the search
    -- filter. For example, if this option is set to (uid={0}) and the received
    -- username is janedoe, the search filter becomes (uid=janedoe) after
    -- string substitution. It will result in matching an entry like
    -- uid=janedoe, ou=Users,ou=corp, dc=corp, dc=example, dc=com.
    LdapServerMetadataInput -> Text
userSearchMatching :: Prelude.Text,
    -- | Select a particular subtree of the directory information tree (DIT) to
    -- search for user entries. The subtree is specified by a DN, which
    -- specifies the base node of the subtree. For example, by setting this
    -- option to ou=Users,ou=corp, dc=corp, dc=example, dc=com, the search for
    -- user entries is restricted to the subtree beneath ou=Users, ou=corp,
    -- dc=corp, dc=example, dc=com.
    LdapServerMetadataInput -> Text
userBase :: Prelude.Text,
    -- | The LDAP search filter used to find roles within the roleBase. The
    -- distinguished name of the user matched by userSearchMatching is
    -- substituted into the {0} placeholder in the search filter. The client\'s
    -- username is substituted into the {1} placeholder. For example, if you
    -- set this option to (member=uid={1})for the user janedoe, the search
    -- filter becomes (member=uid=janedoe) after string substitution. It
    -- matches all role entries that have a member attribute equal to
    -- uid=janedoe under the subtree selected by the roleBase.
    LdapServerMetadataInput -> Text
roleSearchMatching :: Prelude.Text,
    -- | Service account username. A service account is an account in your LDAP
    -- server that has access to initiate a connection. For example,
    -- cn=admin,dc=corp, dc=example, dc=com.
    LdapServerMetadataInput -> Text
serviceAccountUsername :: Prelude.Text,
    -- | The distinguished name of the node in the directory information tree
    -- (DIT) to search for roles or groups. For example, ou=group, ou=corp,
    -- dc=corp, dc=example, dc=com.
    LdapServerMetadataInput -> Text
roleBase :: Prelude.Text,
    -- | Service account password. A service account is an account in your LDAP
    -- server that has access to initiate a connection. For example,
    -- cn=admin,dc=corp, dc=example, dc=com.
    LdapServerMetadataInput -> Text
serviceAccountPassword :: Prelude.Text
  }
  deriving (LdapServerMetadataInput -> LdapServerMetadataInput -> Bool
(LdapServerMetadataInput -> LdapServerMetadataInput -> Bool)
-> (LdapServerMetadataInput -> LdapServerMetadataInput -> Bool)
-> Eq LdapServerMetadataInput
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: LdapServerMetadataInput -> LdapServerMetadataInput -> Bool
$c/= :: LdapServerMetadataInput -> LdapServerMetadataInput -> Bool
== :: LdapServerMetadataInput -> LdapServerMetadataInput -> Bool
$c== :: LdapServerMetadataInput -> LdapServerMetadataInput -> Bool
Prelude.Eq, ReadPrec [LdapServerMetadataInput]
ReadPrec LdapServerMetadataInput
Int -> ReadS LdapServerMetadataInput
ReadS [LdapServerMetadataInput]
(Int -> ReadS LdapServerMetadataInput)
-> ReadS [LdapServerMetadataInput]
-> ReadPrec LdapServerMetadataInput
-> ReadPrec [LdapServerMetadataInput]
-> Read LdapServerMetadataInput
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [LdapServerMetadataInput]
$creadListPrec :: ReadPrec [LdapServerMetadataInput]
readPrec :: ReadPrec LdapServerMetadataInput
$creadPrec :: ReadPrec LdapServerMetadataInput
readList :: ReadS [LdapServerMetadataInput]
$creadList :: ReadS [LdapServerMetadataInput]
readsPrec :: Int -> ReadS LdapServerMetadataInput
$creadsPrec :: Int -> ReadS LdapServerMetadataInput
Prelude.Read, Int -> LdapServerMetadataInput -> ShowS
[LdapServerMetadataInput] -> ShowS
LdapServerMetadataInput -> String
(Int -> LdapServerMetadataInput -> ShowS)
-> (LdapServerMetadataInput -> String)
-> ([LdapServerMetadataInput] -> ShowS)
-> Show LdapServerMetadataInput
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [LdapServerMetadataInput] -> ShowS
$cshowList :: [LdapServerMetadataInput] -> ShowS
show :: LdapServerMetadataInput -> String
$cshow :: LdapServerMetadataInput -> String
showsPrec :: Int -> LdapServerMetadataInput -> ShowS
$cshowsPrec :: Int -> LdapServerMetadataInput -> ShowS
Prelude.Show, (forall x.
 LdapServerMetadataInput -> Rep LdapServerMetadataInput x)
-> (forall x.
    Rep LdapServerMetadataInput x -> LdapServerMetadataInput)
-> Generic LdapServerMetadataInput
forall x. Rep LdapServerMetadataInput x -> LdapServerMetadataInput
forall x. LdapServerMetadataInput -> Rep LdapServerMetadataInput x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep LdapServerMetadataInput x -> LdapServerMetadataInput
$cfrom :: forall x. LdapServerMetadataInput -> Rep LdapServerMetadataInput x
Prelude.Generic)

-- |
-- Create a value of 'LdapServerMetadataInput' 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:
--
-- 'userRoleName', 'ldapServerMetadataInput_userRoleName' - Specifies the name of the LDAP attribute for the user group membership.
--
-- 'userSearchSubtree', 'ldapServerMetadataInput_userSearchSubtree' - The directory search scope for the user. If set to true, scope is to
-- search the entire subtree.
--
-- 'roleSearchSubtree', 'ldapServerMetadataInput_roleSearchSubtree' - The directory search scope for the role. If set to true, scope is to
-- search the entire subtree.
--
-- 'roleName', 'ldapServerMetadataInput_roleName' - Specifies the LDAP attribute that identifies the group name attribute in
-- the object returned from the group membership query.
--
-- 'hosts', 'ldapServerMetadataInput_hosts' - Specifies the location of the LDAP server such as AWS Directory Service
-- for Microsoft Active Directory . Optional failover server.
--
-- 'userSearchMatching', 'ldapServerMetadataInput_userSearchMatching' - The LDAP search filter used to find users within the userBase. The
-- client\'s username is substituted into the {0} placeholder in the search
-- filter. For example, if this option is set to (uid={0}) and the received
-- username is janedoe, the search filter becomes (uid=janedoe) after
-- string substitution. It will result in matching an entry like
-- uid=janedoe, ou=Users,ou=corp, dc=corp, dc=example, dc=com.
--
-- 'userBase', 'ldapServerMetadataInput_userBase' - Select a particular subtree of the directory information tree (DIT) to
-- search for user entries. The subtree is specified by a DN, which
-- specifies the base node of the subtree. For example, by setting this
-- option to ou=Users,ou=corp, dc=corp, dc=example, dc=com, the search for
-- user entries is restricted to the subtree beneath ou=Users, ou=corp,
-- dc=corp, dc=example, dc=com.
--
-- 'roleSearchMatching', 'ldapServerMetadataInput_roleSearchMatching' - The LDAP search filter used to find roles within the roleBase. The
-- distinguished name of the user matched by userSearchMatching is
-- substituted into the {0} placeholder in the search filter. The client\'s
-- username is substituted into the {1} placeholder. For example, if you
-- set this option to (member=uid={1})for the user janedoe, the search
-- filter becomes (member=uid=janedoe) after string substitution. It
-- matches all role entries that have a member attribute equal to
-- uid=janedoe under the subtree selected by the roleBase.
--
-- 'serviceAccountUsername', 'ldapServerMetadataInput_serviceAccountUsername' - Service account username. A service account is an account in your LDAP
-- server that has access to initiate a connection. For example,
-- cn=admin,dc=corp, dc=example, dc=com.
--
-- 'roleBase', 'ldapServerMetadataInput_roleBase' - The distinguished name of the node in the directory information tree
-- (DIT) to search for roles or groups. For example, ou=group, ou=corp,
-- dc=corp, dc=example, dc=com.
--
-- 'serviceAccountPassword', 'ldapServerMetadataInput_serviceAccountPassword' - Service account password. A service account is an account in your LDAP
-- server that has access to initiate a connection. For example,
-- cn=admin,dc=corp, dc=example, dc=com.
newLdapServerMetadataInput ::
  -- | 'userSearchMatching'
  Prelude.Text ->
  -- | 'userBase'
  Prelude.Text ->
  -- | 'roleSearchMatching'
  Prelude.Text ->
  -- | 'serviceAccountUsername'
  Prelude.Text ->
  -- | 'roleBase'
  Prelude.Text ->
  -- | 'serviceAccountPassword'
  Prelude.Text ->
  LdapServerMetadataInput
newLdapServerMetadataInput :: Text
-> Text -> Text -> Text -> Text -> Text -> LdapServerMetadataInput
newLdapServerMetadataInput
  Text
pUserSearchMatching_
  Text
pUserBase_
  Text
pRoleSearchMatching_
  Text
pServiceAccountUsername_
  Text
pRoleBase_
  Text
pServiceAccountPassword_ =
    LdapServerMetadataInput' :: Maybe Text
-> Maybe Bool
-> Maybe Bool
-> Maybe Text
-> [Text]
-> Text
-> Text
-> Text
-> Text
-> Text
-> Text
-> LdapServerMetadataInput
LdapServerMetadataInput'
      { $sel:userRoleName:LdapServerMetadataInput' :: Maybe Text
userRoleName =
          Maybe Text
forall a. Maybe a
Prelude.Nothing,
        $sel:userSearchSubtree:LdapServerMetadataInput' :: Maybe Bool
userSearchSubtree = Maybe Bool
forall a. Maybe a
Prelude.Nothing,
        $sel:roleSearchSubtree:LdapServerMetadataInput' :: Maybe Bool
roleSearchSubtree = Maybe Bool
forall a. Maybe a
Prelude.Nothing,
        $sel:roleName:LdapServerMetadataInput' :: Maybe Text
roleName = Maybe Text
forall a. Maybe a
Prelude.Nothing,
        $sel:hosts:LdapServerMetadataInput' :: [Text]
hosts = [Text]
forall a. Monoid a => a
Prelude.mempty,
        $sel:userSearchMatching:LdapServerMetadataInput' :: Text
userSearchMatching = Text
pUserSearchMatching_,
        $sel:userBase:LdapServerMetadataInput' :: Text
userBase = Text
pUserBase_,
        $sel:roleSearchMatching:LdapServerMetadataInput' :: Text
roleSearchMatching = Text
pRoleSearchMatching_,
        $sel:serviceAccountUsername:LdapServerMetadataInput' :: Text
serviceAccountUsername = Text
pServiceAccountUsername_,
        $sel:roleBase:LdapServerMetadataInput' :: Text
roleBase = Text
pRoleBase_,
        $sel:serviceAccountPassword:LdapServerMetadataInput' :: Text
serviceAccountPassword = Text
pServiceAccountPassword_
      }

-- | Specifies the name of the LDAP attribute for the user group membership.
ldapServerMetadataInput_userRoleName :: Lens.Lens' LdapServerMetadataInput (Prelude.Maybe Prelude.Text)
ldapServerMetadataInput_userRoleName :: (Maybe Text -> f (Maybe Text))
-> LdapServerMetadataInput -> f LdapServerMetadataInput
ldapServerMetadataInput_userRoleName = (LdapServerMetadataInput -> Maybe Text)
-> (LdapServerMetadataInput
    -> Maybe Text -> LdapServerMetadataInput)
-> Lens
     LdapServerMetadataInput
     LdapServerMetadataInput
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\LdapServerMetadataInput' {Maybe Text
userRoleName :: Maybe Text
$sel:userRoleName:LdapServerMetadataInput' :: LdapServerMetadataInput -> Maybe Text
userRoleName} -> Maybe Text
userRoleName) (\s :: LdapServerMetadataInput
s@LdapServerMetadataInput' {} Maybe Text
a -> LdapServerMetadataInput
s {$sel:userRoleName:LdapServerMetadataInput' :: Maybe Text
userRoleName = Maybe Text
a} :: LdapServerMetadataInput)

-- | The directory search scope for the user. If set to true, scope is to
-- search the entire subtree.
ldapServerMetadataInput_userSearchSubtree :: Lens.Lens' LdapServerMetadataInput (Prelude.Maybe Prelude.Bool)
ldapServerMetadataInput_userSearchSubtree :: (Maybe Bool -> f (Maybe Bool))
-> LdapServerMetadataInput -> f LdapServerMetadataInput
ldapServerMetadataInput_userSearchSubtree = (LdapServerMetadataInput -> Maybe Bool)
-> (LdapServerMetadataInput
    -> Maybe Bool -> LdapServerMetadataInput)
-> Lens
     LdapServerMetadataInput
     LdapServerMetadataInput
     (Maybe Bool)
     (Maybe Bool)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\LdapServerMetadataInput' {Maybe Bool
userSearchSubtree :: Maybe Bool
$sel:userSearchSubtree:LdapServerMetadataInput' :: LdapServerMetadataInput -> Maybe Bool
userSearchSubtree} -> Maybe Bool
userSearchSubtree) (\s :: LdapServerMetadataInput
s@LdapServerMetadataInput' {} Maybe Bool
a -> LdapServerMetadataInput
s {$sel:userSearchSubtree:LdapServerMetadataInput' :: Maybe Bool
userSearchSubtree = Maybe Bool
a} :: LdapServerMetadataInput)

-- | The directory search scope for the role. If set to true, scope is to
-- search the entire subtree.
ldapServerMetadataInput_roleSearchSubtree :: Lens.Lens' LdapServerMetadataInput (Prelude.Maybe Prelude.Bool)
ldapServerMetadataInput_roleSearchSubtree :: (Maybe Bool -> f (Maybe Bool))
-> LdapServerMetadataInput -> f LdapServerMetadataInput
ldapServerMetadataInput_roleSearchSubtree = (LdapServerMetadataInput -> Maybe Bool)
-> (LdapServerMetadataInput
    -> Maybe Bool -> LdapServerMetadataInput)
-> Lens
     LdapServerMetadataInput
     LdapServerMetadataInput
     (Maybe Bool)
     (Maybe Bool)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\LdapServerMetadataInput' {Maybe Bool
roleSearchSubtree :: Maybe Bool
$sel:roleSearchSubtree:LdapServerMetadataInput' :: LdapServerMetadataInput -> Maybe Bool
roleSearchSubtree} -> Maybe Bool
roleSearchSubtree) (\s :: LdapServerMetadataInput
s@LdapServerMetadataInput' {} Maybe Bool
a -> LdapServerMetadataInput
s {$sel:roleSearchSubtree:LdapServerMetadataInput' :: Maybe Bool
roleSearchSubtree = Maybe Bool
a} :: LdapServerMetadataInput)

-- | Specifies the LDAP attribute that identifies the group name attribute in
-- the object returned from the group membership query.
ldapServerMetadataInput_roleName :: Lens.Lens' LdapServerMetadataInput (Prelude.Maybe Prelude.Text)
ldapServerMetadataInput_roleName :: (Maybe Text -> f (Maybe Text))
-> LdapServerMetadataInput -> f LdapServerMetadataInput
ldapServerMetadataInput_roleName = (LdapServerMetadataInput -> Maybe Text)
-> (LdapServerMetadataInput
    -> Maybe Text -> LdapServerMetadataInput)
-> Lens
     LdapServerMetadataInput
     LdapServerMetadataInput
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\LdapServerMetadataInput' {Maybe Text
roleName :: Maybe Text
$sel:roleName:LdapServerMetadataInput' :: LdapServerMetadataInput -> Maybe Text
roleName} -> Maybe Text
roleName) (\s :: LdapServerMetadataInput
s@LdapServerMetadataInput' {} Maybe Text
a -> LdapServerMetadataInput
s {$sel:roleName:LdapServerMetadataInput' :: Maybe Text
roleName = Maybe Text
a} :: LdapServerMetadataInput)

-- | Specifies the location of the LDAP server such as AWS Directory Service
-- for Microsoft Active Directory . Optional failover server.
ldapServerMetadataInput_hosts :: Lens.Lens' LdapServerMetadataInput [Prelude.Text]
ldapServerMetadataInput_hosts :: ([Text] -> f [Text])
-> LdapServerMetadataInput -> f LdapServerMetadataInput
ldapServerMetadataInput_hosts = (LdapServerMetadataInput -> [Text])
-> (LdapServerMetadataInput -> [Text] -> LdapServerMetadataInput)
-> Lens
     LdapServerMetadataInput LdapServerMetadataInput [Text] [Text]
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\LdapServerMetadataInput' {[Text]
hosts :: [Text]
$sel:hosts:LdapServerMetadataInput' :: LdapServerMetadataInput -> [Text]
hosts} -> [Text]
hosts) (\s :: LdapServerMetadataInput
s@LdapServerMetadataInput' {} [Text]
a -> LdapServerMetadataInput
s {$sel:hosts:LdapServerMetadataInput' :: [Text]
hosts = [Text]
a} :: LdapServerMetadataInput) (([Text] -> f [Text])
 -> LdapServerMetadataInput -> f LdapServerMetadataInput)
-> (([Text] -> f [Text]) -> [Text] -> f [Text])
-> ([Text] -> f [Text])
-> LdapServerMetadataInput
-> f LdapServerMetadataInput
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. ([Text] -> f [Text]) -> [Text] -> f [Text]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | The LDAP search filter used to find users within the userBase. The
-- client\'s username is substituted into the {0} placeholder in the search
-- filter. For example, if this option is set to (uid={0}) and the received
-- username is janedoe, the search filter becomes (uid=janedoe) after
-- string substitution. It will result in matching an entry like
-- uid=janedoe, ou=Users,ou=corp, dc=corp, dc=example, dc=com.
ldapServerMetadataInput_userSearchMatching :: Lens.Lens' LdapServerMetadataInput Prelude.Text
ldapServerMetadataInput_userSearchMatching :: (Text -> f Text)
-> LdapServerMetadataInput -> f LdapServerMetadataInput
ldapServerMetadataInput_userSearchMatching = (LdapServerMetadataInput -> Text)
-> (LdapServerMetadataInput -> Text -> LdapServerMetadataInput)
-> Lens LdapServerMetadataInput LdapServerMetadataInput Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\LdapServerMetadataInput' {Text
userSearchMatching :: Text
$sel:userSearchMatching:LdapServerMetadataInput' :: LdapServerMetadataInput -> Text
userSearchMatching} -> Text
userSearchMatching) (\s :: LdapServerMetadataInput
s@LdapServerMetadataInput' {} Text
a -> LdapServerMetadataInput
s {$sel:userSearchMatching:LdapServerMetadataInput' :: Text
userSearchMatching = Text
a} :: LdapServerMetadataInput)

-- | Select a particular subtree of the directory information tree (DIT) to
-- search for user entries. The subtree is specified by a DN, which
-- specifies the base node of the subtree. For example, by setting this
-- option to ou=Users,ou=corp, dc=corp, dc=example, dc=com, the search for
-- user entries is restricted to the subtree beneath ou=Users, ou=corp,
-- dc=corp, dc=example, dc=com.
ldapServerMetadataInput_userBase :: Lens.Lens' LdapServerMetadataInput Prelude.Text
ldapServerMetadataInput_userBase :: (Text -> f Text)
-> LdapServerMetadataInput -> f LdapServerMetadataInput
ldapServerMetadataInput_userBase = (LdapServerMetadataInput -> Text)
-> (LdapServerMetadataInput -> Text -> LdapServerMetadataInput)
-> Lens LdapServerMetadataInput LdapServerMetadataInput Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\LdapServerMetadataInput' {Text
userBase :: Text
$sel:userBase:LdapServerMetadataInput' :: LdapServerMetadataInput -> Text
userBase} -> Text
userBase) (\s :: LdapServerMetadataInput
s@LdapServerMetadataInput' {} Text
a -> LdapServerMetadataInput
s {$sel:userBase:LdapServerMetadataInput' :: Text
userBase = Text
a} :: LdapServerMetadataInput)

-- | The LDAP search filter used to find roles within the roleBase. The
-- distinguished name of the user matched by userSearchMatching is
-- substituted into the {0} placeholder in the search filter. The client\'s
-- username is substituted into the {1} placeholder. For example, if you
-- set this option to (member=uid={1})for the user janedoe, the search
-- filter becomes (member=uid=janedoe) after string substitution. It
-- matches all role entries that have a member attribute equal to
-- uid=janedoe under the subtree selected by the roleBase.
ldapServerMetadataInput_roleSearchMatching :: Lens.Lens' LdapServerMetadataInput Prelude.Text
ldapServerMetadataInput_roleSearchMatching :: (Text -> f Text)
-> LdapServerMetadataInput -> f LdapServerMetadataInput
ldapServerMetadataInput_roleSearchMatching = (LdapServerMetadataInput -> Text)
-> (LdapServerMetadataInput -> Text -> LdapServerMetadataInput)
-> Lens LdapServerMetadataInput LdapServerMetadataInput Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\LdapServerMetadataInput' {Text
roleSearchMatching :: Text
$sel:roleSearchMatching:LdapServerMetadataInput' :: LdapServerMetadataInput -> Text
roleSearchMatching} -> Text
roleSearchMatching) (\s :: LdapServerMetadataInput
s@LdapServerMetadataInput' {} Text
a -> LdapServerMetadataInput
s {$sel:roleSearchMatching:LdapServerMetadataInput' :: Text
roleSearchMatching = Text
a} :: LdapServerMetadataInput)

-- | Service account username. A service account is an account in your LDAP
-- server that has access to initiate a connection. For example,
-- cn=admin,dc=corp, dc=example, dc=com.
ldapServerMetadataInput_serviceAccountUsername :: Lens.Lens' LdapServerMetadataInput Prelude.Text
ldapServerMetadataInput_serviceAccountUsername :: (Text -> f Text)
-> LdapServerMetadataInput -> f LdapServerMetadataInput
ldapServerMetadataInput_serviceAccountUsername = (LdapServerMetadataInput -> Text)
-> (LdapServerMetadataInput -> Text -> LdapServerMetadataInput)
-> Lens LdapServerMetadataInput LdapServerMetadataInput Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\LdapServerMetadataInput' {Text
serviceAccountUsername :: Text
$sel:serviceAccountUsername:LdapServerMetadataInput' :: LdapServerMetadataInput -> Text
serviceAccountUsername} -> Text
serviceAccountUsername) (\s :: LdapServerMetadataInput
s@LdapServerMetadataInput' {} Text
a -> LdapServerMetadataInput
s {$sel:serviceAccountUsername:LdapServerMetadataInput' :: Text
serviceAccountUsername = Text
a} :: LdapServerMetadataInput)

-- | The distinguished name of the node in the directory information tree
-- (DIT) to search for roles or groups. For example, ou=group, ou=corp,
-- dc=corp, dc=example, dc=com.
ldapServerMetadataInput_roleBase :: Lens.Lens' LdapServerMetadataInput Prelude.Text
ldapServerMetadataInput_roleBase :: (Text -> f Text)
-> LdapServerMetadataInput -> f LdapServerMetadataInput
ldapServerMetadataInput_roleBase = (LdapServerMetadataInput -> Text)
-> (LdapServerMetadataInput -> Text -> LdapServerMetadataInput)
-> Lens LdapServerMetadataInput LdapServerMetadataInput Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\LdapServerMetadataInput' {Text
roleBase :: Text
$sel:roleBase:LdapServerMetadataInput' :: LdapServerMetadataInput -> Text
roleBase} -> Text
roleBase) (\s :: LdapServerMetadataInput
s@LdapServerMetadataInput' {} Text
a -> LdapServerMetadataInput
s {$sel:roleBase:LdapServerMetadataInput' :: Text
roleBase = Text
a} :: LdapServerMetadataInput)

-- | Service account password. A service account is an account in your LDAP
-- server that has access to initiate a connection. For example,
-- cn=admin,dc=corp, dc=example, dc=com.
ldapServerMetadataInput_serviceAccountPassword :: Lens.Lens' LdapServerMetadataInput Prelude.Text
ldapServerMetadataInput_serviceAccountPassword :: (Text -> f Text)
-> LdapServerMetadataInput -> f LdapServerMetadataInput
ldapServerMetadataInput_serviceAccountPassword = (LdapServerMetadataInput -> Text)
-> (LdapServerMetadataInput -> Text -> LdapServerMetadataInput)
-> Lens LdapServerMetadataInput LdapServerMetadataInput Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\LdapServerMetadataInput' {Text
serviceAccountPassword :: Text
$sel:serviceAccountPassword:LdapServerMetadataInput' :: LdapServerMetadataInput -> Text
serviceAccountPassword} -> Text
serviceAccountPassword) (\s :: LdapServerMetadataInput
s@LdapServerMetadataInput' {} Text
a -> LdapServerMetadataInput
s {$sel:serviceAccountPassword:LdapServerMetadataInput' :: Text
serviceAccountPassword = Text
a} :: LdapServerMetadataInput)

instance Prelude.Hashable LdapServerMetadataInput

instance Prelude.NFData LdapServerMetadataInput

instance Core.ToJSON LdapServerMetadataInput where
  toJSON :: LdapServerMetadataInput -> Value
toJSON LdapServerMetadataInput' {[Text]
Maybe Bool
Maybe Text
Text
serviceAccountPassword :: Text
roleBase :: Text
serviceAccountUsername :: Text
roleSearchMatching :: Text
userBase :: Text
userSearchMatching :: Text
hosts :: [Text]
roleName :: Maybe Text
roleSearchSubtree :: Maybe Bool
userSearchSubtree :: Maybe Bool
userRoleName :: Maybe Text
$sel:serviceAccountPassword:LdapServerMetadataInput' :: LdapServerMetadataInput -> Text
$sel:roleBase:LdapServerMetadataInput' :: LdapServerMetadataInput -> Text
$sel:serviceAccountUsername:LdapServerMetadataInput' :: LdapServerMetadataInput -> Text
$sel:roleSearchMatching:LdapServerMetadataInput' :: LdapServerMetadataInput -> Text
$sel:userBase:LdapServerMetadataInput' :: LdapServerMetadataInput -> Text
$sel:userSearchMatching:LdapServerMetadataInput' :: LdapServerMetadataInput -> Text
$sel:hosts:LdapServerMetadataInput' :: LdapServerMetadataInput -> [Text]
$sel:roleName:LdapServerMetadataInput' :: LdapServerMetadataInput -> Maybe Text
$sel:roleSearchSubtree:LdapServerMetadataInput' :: LdapServerMetadataInput -> Maybe Bool
$sel:userSearchSubtree:LdapServerMetadataInput' :: LdapServerMetadataInput -> Maybe Bool
$sel:userRoleName:LdapServerMetadataInput' :: LdapServerMetadataInput -> Maybe Text
..} =
    [Pair] -> Value
Core.object
      ( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ (Text
"userRoleName" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (Text -> Pair) -> Maybe Text -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
userRoleName,
            (Text
"userSearchSubtree" Text -> Bool -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
              (Bool -> Pair) -> Maybe Bool -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Bool
userSearchSubtree,
            (Text
"roleSearchSubtree" Text -> Bool -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
              (Bool -> Pair) -> Maybe Bool -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Bool
roleSearchSubtree,
            (Text
"roleName" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (Text -> Pair) -> Maybe Text -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
roleName,
            Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"hosts" Text -> [Text] -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= [Text]
hosts),
            Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just
              (Text
"userSearchMatching" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
userSearchMatching),
            Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"userBase" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
userBase),
            Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just
              (Text
"roleSearchMatching" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
roleSearchMatching),
            Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just
              ( Text
"serviceAccountUsername"
                  Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
serviceAccountUsername
              ),
            Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"roleBase" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
roleBase),
            Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just
              ( Text
"serviceAccountPassword"
                  Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
serviceAccountPassword
              )
          ]
      )