{-# 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.LdapServerMetadataOutput
-- 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.LdapServerMetadataOutput 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.
--
-- /See:/ 'newLdapServerMetadataOutput' smart constructor.
data LdapServerMetadataOutput = LdapServerMetadataOutput'
  { -- | Specifies the name of the LDAP attribute for the user group membership.
    LdapServerMetadataOutput -> 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.
    LdapServerMetadataOutput -> 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.
    LdapServerMetadataOutput -> 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.
    LdapServerMetadataOutput -> 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.
    LdapServerMetadataOutput -> [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.
    LdapServerMetadataOutput -> 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.
    LdapServerMetadataOutput -> 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.
    LdapServerMetadataOutput -> 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.
    LdapServerMetadataOutput -> 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.
    LdapServerMetadataOutput -> Text
roleBase :: Prelude.Text
  }
  deriving (LdapServerMetadataOutput -> LdapServerMetadataOutput -> Bool
(LdapServerMetadataOutput -> LdapServerMetadataOutput -> Bool)
-> (LdapServerMetadataOutput -> LdapServerMetadataOutput -> Bool)
-> Eq LdapServerMetadataOutput
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: LdapServerMetadataOutput -> LdapServerMetadataOutput -> Bool
$c/= :: LdapServerMetadataOutput -> LdapServerMetadataOutput -> Bool
== :: LdapServerMetadataOutput -> LdapServerMetadataOutput -> Bool
$c== :: LdapServerMetadataOutput -> LdapServerMetadataOutput -> Bool
Prelude.Eq, ReadPrec [LdapServerMetadataOutput]
ReadPrec LdapServerMetadataOutput
Int -> ReadS LdapServerMetadataOutput
ReadS [LdapServerMetadataOutput]
(Int -> ReadS LdapServerMetadataOutput)
-> ReadS [LdapServerMetadataOutput]
-> ReadPrec LdapServerMetadataOutput
-> ReadPrec [LdapServerMetadataOutput]
-> Read LdapServerMetadataOutput
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [LdapServerMetadataOutput]
$creadListPrec :: ReadPrec [LdapServerMetadataOutput]
readPrec :: ReadPrec LdapServerMetadataOutput
$creadPrec :: ReadPrec LdapServerMetadataOutput
readList :: ReadS [LdapServerMetadataOutput]
$creadList :: ReadS [LdapServerMetadataOutput]
readsPrec :: Int -> ReadS LdapServerMetadataOutput
$creadsPrec :: Int -> ReadS LdapServerMetadataOutput
Prelude.Read, Int -> LdapServerMetadataOutput -> ShowS
[LdapServerMetadataOutput] -> ShowS
LdapServerMetadataOutput -> String
(Int -> LdapServerMetadataOutput -> ShowS)
-> (LdapServerMetadataOutput -> String)
-> ([LdapServerMetadataOutput] -> ShowS)
-> Show LdapServerMetadataOutput
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [LdapServerMetadataOutput] -> ShowS
$cshowList :: [LdapServerMetadataOutput] -> ShowS
show :: LdapServerMetadataOutput -> String
$cshow :: LdapServerMetadataOutput -> String
showsPrec :: Int -> LdapServerMetadataOutput -> ShowS
$cshowsPrec :: Int -> LdapServerMetadataOutput -> ShowS
Prelude.Show, (forall x.
 LdapServerMetadataOutput -> Rep LdapServerMetadataOutput x)
-> (forall x.
    Rep LdapServerMetadataOutput x -> LdapServerMetadataOutput)
-> Generic LdapServerMetadataOutput
forall x.
Rep LdapServerMetadataOutput x -> LdapServerMetadataOutput
forall x.
LdapServerMetadataOutput -> Rep LdapServerMetadataOutput x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep LdapServerMetadataOutput x -> LdapServerMetadataOutput
$cfrom :: forall x.
LdapServerMetadataOutput -> Rep LdapServerMetadataOutput x
Prelude.Generic)

-- |
-- Create a value of 'LdapServerMetadataOutput' 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', 'ldapServerMetadataOutput_userRoleName' - Specifies the name of the LDAP attribute for the user group membership.
--
-- 'userSearchSubtree', 'ldapServerMetadataOutput_userSearchSubtree' - The directory search scope for the user. If set to true, scope is to
-- search the entire subtree.
--
-- 'roleSearchSubtree', 'ldapServerMetadataOutput_roleSearchSubtree' - The directory search scope for the role. If set to true, scope is to
-- search the entire subtree.
--
-- 'roleName', 'ldapServerMetadataOutput_roleName' - Specifies the LDAP attribute that identifies the group name attribute in
-- the object returned from the group membership query.
--
-- 'hosts', 'ldapServerMetadataOutput_hosts' - Specifies the location of the LDAP server such as AWS Directory Service
-- for Microsoft Active Directory . Optional failover server.
--
-- 'userSearchMatching', 'ldapServerMetadataOutput_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', 'ldapServerMetadataOutput_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', 'ldapServerMetadataOutput_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', 'ldapServerMetadataOutput_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', 'ldapServerMetadataOutput_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.
newLdapServerMetadataOutput ::
  -- | 'userSearchMatching'
  Prelude.Text ->
  -- | 'userBase'
  Prelude.Text ->
  -- | 'roleSearchMatching'
  Prelude.Text ->
  -- | 'serviceAccountUsername'
  Prelude.Text ->
  -- | 'roleBase'
  Prelude.Text ->
  LdapServerMetadataOutput
newLdapServerMetadataOutput :: Text -> Text -> Text -> Text -> Text -> LdapServerMetadataOutput
newLdapServerMetadataOutput
  Text
pUserSearchMatching_
  Text
pUserBase_
  Text
pRoleSearchMatching_
  Text
pServiceAccountUsername_
  Text
pRoleBase_ =
    LdapServerMetadataOutput' :: Maybe Text
-> Maybe Bool
-> Maybe Bool
-> Maybe Text
-> [Text]
-> Text
-> Text
-> Text
-> Text
-> Text
-> LdapServerMetadataOutput
LdapServerMetadataOutput'
      { $sel:userRoleName:LdapServerMetadataOutput' :: Maybe Text
userRoleName =
          Maybe Text
forall a. Maybe a
Prelude.Nothing,
        $sel:userSearchSubtree:LdapServerMetadataOutput' :: Maybe Bool
userSearchSubtree = Maybe Bool
forall a. Maybe a
Prelude.Nothing,
        $sel:roleSearchSubtree:LdapServerMetadataOutput' :: Maybe Bool
roleSearchSubtree = Maybe Bool
forall a. Maybe a
Prelude.Nothing,
        $sel:roleName:LdapServerMetadataOutput' :: Maybe Text
roleName = Maybe Text
forall a. Maybe a
Prelude.Nothing,
        $sel:hosts:LdapServerMetadataOutput' :: [Text]
hosts = [Text]
forall a. Monoid a => a
Prelude.mempty,
        $sel:userSearchMatching:LdapServerMetadataOutput' :: Text
userSearchMatching = Text
pUserSearchMatching_,
        $sel:userBase:LdapServerMetadataOutput' :: Text
userBase = Text
pUserBase_,
        $sel:roleSearchMatching:LdapServerMetadataOutput' :: Text
roleSearchMatching = Text
pRoleSearchMatching_,
        $sel:serviceAccountUsername:LdapServerMetadataOutput' :: Text
serviceAccountUsername = Text
pServiceAccountUsername_,
        $sel:roleBase:LdapServerMetadataOutput' :: Text
roleBase = Text
pRoleBase_
      }

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

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

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

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

-- | Specifies the location of the LDAP server such as AWS Directory Service
-- for Microsoft Active Directory . Optional failover server.
ldapServerMetadataOutput_hosts :: Lens.Lens' LdapServerMetadataOutput [Prelude.Text]
ldapServerMetadataOutput_hosts :: ([Text] -> f [Text])
-> LdapServerMetadataOutput -> f LdapServerMetadataOutput
ldapServerMetadataOutput_hosts = (LdapServerMetadataOutput -> [Text])
-> (LdapServerMetadataOutput -> [Text] -> LdapServerMetadataOutput)
-> Lens
     LdapServerMetadataOutput LdapServerMetadataOutput [Text] [Text]
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\LdapServerMetadataOutput' {[Text]
hosts :: [Text]
$sel:hosts:LdapServerMetadataOutput' :: LdapServerMetadataOutput -> [Text]
hosts} -> [Text]
hosts) (\s :: LdapServerMetadataOutput
s@LdapServerMetadataOutput' {} [Text]
a -> LdapServerMetadataOutput
s {$sel:hosts:LdapServerMetadataOutput' :: [Text]
hosts = [Text]
a} :: LdapServerMetadataOutput) (([Text] -> f [Text])
 -> LdapServerMetadataOutput -> f LdapServerMetadataOutput)
-> (([Text] -> f [Text]) -> [Text] -> f [Text])
-> ([Text] -> f [Text])
-> LdapServerMetadataOutput
-> f LdapServerMetadataOutput
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.
ldapServerMetadataOutput_userSearchMatching :: Lens.Lens' LdapServerMetadataOutput Prelude.Text
ldapServerMetadataOutput_userSearchMatching :: (Text -> f Text)
-> LdapServerMetadataOutput -> f LdapServerMetadataOutput
ldapServerMetadataOutput_userSearchMatching = (LdapServerMetadataOutput -> Text)
-> (LdapServerMetadataOutput -> Text -> LdapServerMetadataOutput)
-> Lens LdapServerMetadataOutput LdapServerMetadataOutput Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\LdapServerMetadataOutput' {Text
userSearchMatching :: Text
$sel:userSearchMatching:LdapServerMetadataOutput' :: LdapServerMetadataOutput -> Text
userSearchMatching} -> Text
userSearchMatching) (\s :: LdapServerMetadataOutput
s@LdapServerMetadataOutput' {} Text
a -> LdapServerMetadataOutput
s {$sel:userSearchMatching:LdapServerMetadataOutput' :: Text
userSearchMatching = Text
a} :: LdapServerMetadataOutput)

-- | 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.
ldapServerMetadataOutput_userBase :: Lens.Lens' LdapServerMetadataOutput Prelude.Text
ldapServerMetadataOutput_userBase :: (Text -> f Text)
-> LdapServerMetadataOutput -> f LdapServerMetadataOutput
ldapServerMetadataOutput_userBase = (LdapServerMetadataOutput -> Text)
-> (LdapServerMetadataOutput -> Text -> LdapServerMetadataOutput)
-> Lens LdapServerMetadataOutput LdapServerMetadataOutput Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\LdapServerMetadataOutput' {Text
userBase :: Text
$sel:userBase:LdapServerMetadataOutput' :: LdapServerMetadataOutput -> Text
userBase} -> Text
userBase) (\s :: LdapServerMetadataOutput
s@LdapServerMetadataOutput' {} Text
a -> LdapServerMetadataOutput
s {$sel:userBase:LdapServerMetadataOutput' :: Text
userBase = Text
a} :: LdapServerMetadataOutput)

-- | 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.
ldapServerMetadataOutput_roleSearchMatching :: Lens.Lens' LdapServerMetadataOutput Prelude.Text
ldapServerMetadataOutput_roleSearchMatching :: (Text -> f Text)
-> LdapServerMetadataOutput -> f LdapServerMetadataOutput
ldapServerMetadataOutput_roleSearchMatching = (LdapServerMetadataOutput -> Text)
-> (LdapServerMetadataOutput -> Text -> LdapServerMetadataOutput)
-> Lens LdapServerMetadataOutput LdapServerMetadataOutput Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\LdapServerMetadataOutput' {Text
roleSearchMatching :: Text
$sel:roleSearchMatching:LdapServerMetadataOutput' :: LdapServerMetadataOutput -> Text
roleSearchMatching} -> Text
roleSearchMatching) (\s :: LdapServerMetadataOutput
s@LdapServerMetadataOutput' {} Text
a -> LdapServerMetadataOutput
s {$sel:roleSearchMatching:LdapServerMetadataOutput' :: Text
roleSearchMatching = Text
a} :: LdapServerMetadataOutput)

-- | 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.
ldapServerMetadataOutput_serviceAccountUsername :: Lens.Lens' LdapServerMetadataOutput Prelude.Text
ldapServerMetadataOutput_serviceAccountUsername :: (Text -> f Text)
-> LdapServerMetadataOutput -> f LdapServerMetadataOutput
ldapServerMetadataOutput_serviceAccountUsername = (LdapServerMetadataOutput -> Text)
-> (LdapServerMetadataOutput -> Text -> LdapServerMetadataOutput)
-> Lens LdapServerMetadataOutput LdapServerMetadataOutput Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\LdapServerMetadataOutput' {Text
serviceAccountUsername :: Text
$sel:serviceAccountUsername:LdapServerMetadataOutput' :: LdapServerMetadataOutput -> Text
serviceAccountUsername} -> Text
serviceAccountUsername) (\s :: LdapServerMetadataOutput
s@LdapServerMetadataOutput' {} Text
a -> LdapServerMetadataOutput
s {$sel:serviceAccountUsername:LdapServerMetadataOutput' :: Text
serviceAccountUsername = Text
a} :: LdapServerMetadataOutput)

-- | 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.
ldapServerMetadataOutput_roleBase :: Lens.Lens' LdapServerMetadataOutput Prelude.Text
ldapServerMetadataOutput_roleBase :: (Text -> f Text)
-> LdapServerMetadataOutput -> f LdapServerMetadataOutput
ldapServerMetadataOutput_roleBase = (LdapServerMetadataOutput -> Text)
-> (LdapServerMetadataOutput -> Text -> LdapServerMetadataOutput)
-> Lens LdapServerMetadataOutput LdapServerMetadataOutput Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\LdapServerMetadataOutput' {Text
roleBase :: Text
$sel:roleBase:LdapServerMetadataOutput' :: LdapServerMetadataOutput -> Text
roleBase} -> Text
roleBase) (\s :: LdapServerMetadataOutput
s@LdapServerMetadataOutput' {} Text
a -> LdapServerMetadataOutput
s {$sel:roleBase:LdapServerMetadataOutput' :: Text
roleBase = Text
a} :: LdapServerMetadataOutput)

instance Core.FromJSON LdapServerMetadataOutput where
  parseJSON :: Value -> Parser LdapServerMetadataOutput
parseJSON =
    String
-> (Object -> Parser LdapServerMetadataOutput)
-> Value
-> Parser LdapServerMetadataOutput
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
      String
"LdapServerMetadataOutput"
      ( \Object
x ->
          Maybe Text
-> Maybe Bool
-> Maybe Bool
-> Maybe Text
-> [Text]
-> Text
-> Text
-> Text
-> Text
-> Text
-> LdapServerMetadataOutput
LdapServerMetadataOutput'
            (Maybe Text
 -> Maybe Bool
 -> Maybe Bool
 -> Maybe Text
 -> [Text]
 -> Text
 -> Text
 -> Text
 -> Text
 -> Text
 -> LdapServerMetadataOutput)
-> Parser (Maybe Text)
-> Parser
     (Maybe Bool
      -> Maybe Bool
      -> Maybe Text
      -> [Text]
      -> Text
      -> Text
      -> Text
      -> Text
      -> Text
      -> LdapServerMetadataOutput)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"userRoleName")
            Parser
  (Maybe Bool
   -> Maybe Bool
   -> Maybe Text
   -> [Text]
   -> Text
   -> Text
   -> Text
   -> Text
   -> Text
   -> LdapServerMetadataOutput)
-> Parser (Maybe Bool)
-> Parser
     (Maybe Bool
      -> Maybe Text
      -> [Text]
      -> Text
      -> Text
      -> Text
      -> Text
      -> Text
      -> LdapServerMetadataOutput)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Bool)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"userSearchSubtree")
            Parser
  (Maybe Bool
   -> Maybe Text
   -> [Text]
   -> Text
   -> Text
   -> Text
   -> Text
   -> Text
   -> LdapServerMetadataOutput)
-> Parser (Maybe Bool)
-> Parser
     (Maybe Text
      -> [Text]
      -> Text
      -> Text
      -> Text
      -> Text
      -> Text
      -> LdapServerMetadataOutput)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Bool)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"roleSearchSubtree")
            Parser
  (Maybe Text
   -> [Text]
   -> Text
   -> Text
   -> Text
   -> Text
   -> Text
   -> LdapServerMetadataOutput)
-> Parser (Maybe Text)
-> Parser
     ([Text]
      -> Text
      -> Text
      -> Text
      -> Text
      -> Text
      -> LdapServerMetadataOutput)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"roleName")
            Parser
  ([Text]
   -> Text
   -> Text
   -> Text
   -> Text
   -> Text
   -> LdapServerMetadataOutput)
-> Parser [Text]
-> Parser
     (Text -> Text -> Text -> Text -> Text -> LdapServerMetadataOutput)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe [Text])
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"hosts" Parser (Maybe [Text]) -> [Text] -> Parser [Text]
forall a. Parser (Maybe a) -> a -> Parser a
Core..!= [Text]
forall a. Monoid a => a
Prelude.mempty)
            Parser
  (Text -> Text -> Text -> Text -> Text -> LdapServerMetadataOutput)
-> Parser Text
-> Parser
     (Text -> Text -> Text -> Text -> LdapServerMetadataOutput)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser Text
forall a. FromJSON a => Object -> Text -> Parser a
Core..: Text
"userSearchMatching")
            Parser (Text -> Text -> Text -> Text -> LdapServerMetadataOutput)
-> Parser Text
-> Parser (Text -> Text -> Text -> LdapServerMetadataOutput)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser Text
forall a. FromJSON a => Object -> Text -> Parser a
Core..: Text
"userBase")
            Parser (Text -> Text -> Text -> LdapServerMetadataOutput)
-> Parser Text -> Parser (Text -> Text -> LdapServerMetadataOutput)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser Text
forall a. FromJSON a => Object -> Text -> Parser a
Core..: Text
"roleSearchMatching")
            Parser (Text -> Text -> LdapServerMetadataOutput)
-> Parser Text -> Parser (Text -> LdapServerMetadataOutput)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser Text
forall a. FromJSON a => Object -> Text -> Parser a
Core..: Text
"serviceAccountUsername")
            Parser (Text -> LdapServerMetadataOutput)
-> Parser Text -> Parser LdapServerMetadataOutput
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser Text
forall a. FromJSON a => Object -> Text -> Parser a
Core..: Text
"roleBase")
      )

instance Prelude.Hashable LdapServerMetadataOutput

instance Prelude.NFData LdapServerMetadataOutput