{-# 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.IAM.Types.PasswordPolicy
-- 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.IAM.Types.PasswordPolicy where

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

-- | Contains information about the account password policy.
--
-- This data type is used as a response element in the
-- GetAccountPasswordPolicy operation.
--
-- /See:/ 'newPasswordPolicy' smart constructor.
data PasswordPolicy = PasswordPolicy'
  { -- | Indicates whether passwords in the account expire. Returns true if
    -- @MaxPasswordAge@ contains a value greater than 0. Returns false if
    -- MaxPasswordAge is 0 or not present.
    PasswordPolicy -> Maybe Bool
expirePasswords :: Prelude.Maybe Prelude.Bool,
    -- | Minimum length to require for IAM user passwords.
    PasswordPolicy -> Maybe Natural
minimumPasswordLength :: Prelude.Maybe Prelude.Natural,
    -- | Specifies whether IAM user passwords must contain at least one numeric
    -- character (0 to 9).
    PasswordPolicy -> Maybe Bool
requireNumbers :: Prelude.Maybe Prelude.Bool,
    -- | Specifies the number of previous passwords that IAM users are prevented
    -- from reusing.
    PasswordPolicy -> Maybe Natural
passwordReusePrevention :: Prelude.Maybe Prelude.Natural,
    -- | Specifies whether IAM user passwords must contain at least one lowercase
    -- character (a to z).
    PasswordPolicy -> Maybe Bool
requireLowercaseCharacters :: Prelude.Maybe Prelude.Bool,
    -- | The number of days that an IAM user password is valid.
    PasswordPolicy -> Maybe Natural
maxPasswordAge :: Prelude.Maybe Prelude.Natural,
    -- | Specifies whether IAM users are prevented from setting a new password
    -- after their password has expired.
    PasswordPolicy -> Maybe Bool
hardExpiry :: Prelude.Maybe Prelude.Bool,
    -- | Specifies whether IAM user passwords must contain at least one of the
    -- following symbols:
    --
    -- ! \@ # $ % ^ & * ( ) _ + - = [ ] { } | \'
    PasswordPolicy -> Maybe Bool
requireSymbols :: Prelude.Maybe Prelude.Bool,
    -- | Specifies whether IAM user passwords must contain at least one uppercase
    -- character (A to Z).
    PasswordPolicy -> Maybe Bool
requireUppercaseCharacters :: Prelude.Maybe Prelude.Bool,
    -- | Specifies whether IAM users are allowed to change their own password.
    PasswordPolicy -> Maybe Bool
allowUsersToChangePassword :: Prelude.Maybe Prelude.Bool
  }
  deriving (PasswordPolicy -> PasswordPolicy -> Bool
(PasswordPolicy -> PasswordPolicy -> Bool)
-> (PasswordPolicy -> PasswordPolicy -> Bool) -> Eq PasswordPolicy
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: PasswordPolicy -> PasswordPolicy -> Bool
$c/= :: PasswordPolicy -> PasswordPolicy -> Bool
== :: PasswordPolicy -> PasswordPolicy -> Bool
$c== :: PasswordPolicy -> PasswordPolicy -> Bool
Prelude.Eq, ReadPrec [PasswordPolicy]
ReadPrec PasswordPolicy
Int -> ReadS PasswordPolicy
ReadS [PasswordPolicy]
(Int -> ReadS PasswordPolicy)
-> ReadS [PasswordPolicy]
-> ReadPrec PasswordPolicy
-> ReadPrec [PasswordPolicy]
-> Read PasswordPolicy
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [PasswordPolicy]
$creadListPrec :: ReadPrec [PasswordPolicy]
readPrec :: ReadPrec PasswordPolicy
$creadPrec :: ReadPrec PasswordPolicy
readList :: ReadS [PasswordPolicy]
$creadList :: ReadS [PasswordPolicy]
readsPrec :: Int -> ReadS PasswordPolicy
$creadsPrec :: Int -> ReadS PasswordPolicy
Prelude.Read, Int -> PasswordPolicy -> ShowS
[PasswordPolicy] -> ShowS
PasswordPolicy -> String
(Int -> PasswordPolicy -> ShowS)
-> (PasswordPolicy -> String)
-> ([PasswordPolicy] -> ShowS)
-> Show PasswordPolicy
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [PasswordPolicy] -> ShowS
$cshowList :: [PasswordPolicy] -> ShowS
show :: PasswordPolicy -> String
$cshow :: PasswordPolicy -> String
showsPrec :: Int -> PasswordPolicy -> ShowS
$cshowsPrec :: Int -> PasswordPolicy -> ShowS
Prelude.Show, (forall x. PasswordPolicy -> Rep PasswordPolicy x)
-> (forall x. Rep PasswordPolicy x -> PasswordPolicy)
-> Generic PasswordPolicy
forall x. Rep PasswordPolicy x -> PasswordPolicy
forall x. PasswordPolicy -> Rep PasswordPolicy x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep PasswordPolicy x -> PasswordPolicy
$cfrom :: forall x. PasswordPolicy -> Rep PasswordPolicy x
Prelude.Generic)

-- |
-- Create a value of 'PasswordPolicy' 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:
--
-- 'expirePasswords', 'passwordPolicy_expirePasswords' - Indicates whether passwords in the account expire. Returns true if
-- @MaxPasswordAge@ contains a value greater than 0. Returns false if
-- MaxPasswordAge is 0 or not present.
--
-- 'minimumPasswordLength', 'passwordPolicy_minimumPasswordLength' - Minimum length to require for IAM user passwords.
--
-- 'requireNumbers', 'passwordPolicy_requireNumbers' - Specifies whether IAM user passwords must contain at least one numeric
-- character (0 to 9).
--
-- 'passwordReusePrevention', 'passwordPolicy_passwordReusePrevention' - Specifies the number of previous passwords that IAM users are prevented
-- from reusing.
--
-- 'requireLowercaseCharacters', 'passwordPolicy_requireLowercaseCharacters' - Specifies whether IAM user passwords must contain at least one lowercase
-- character (a to z).
--
-- 'maxPasswordAge', 'passwordPolicy_maxPasswordAge' - The number of days that an IAM user password is valid.
--
-- 'hardExpiry', 'passwordPolicy_hardExpiry' - Specifies whether IAM users are prevented from setting a new password
-- after their password has expired.
--
-- 'requireSymbols', 'passwordPolicy_requireSymbols' - Specifies whether IAM user passwords must contain at least one of the
-- following symbols:
--
-- ! \@ # $ % ^ & * ( ) _ + - = [ ] { } | \'
--
-- 'requireUppercaseCharacters', 'passwordPolicy_requireUppercaseCharacters' - Specifies whether IAM user passwords must contain at least one uppercase
-- character (A to Z).
--
-- 'allowUsersToChangePassword', 'passwordPolicy_allowUsersToChangePassword' - Specifies whether IAM users are allowed to change their own password.
newPasswordPolicy ::
  PasswordPolicy
newPasswordPolicy :: PasswordPolicy
newPasswordPolicy =
  PasswordPolicy' :: Maybe Bool
-> Maybe Natural
-> Maybe Bool
-> Maybe Natural
-> Maybe Bool
-> Maybe Natural
-> Maybe Bool
-> Maybe Bool
-> Maybe Bool
-> Maybe Bool
-> PasswordPolicy
PasswordPolicy'
    { $sel:expirePasswords:PasswordPolicy' :: Maybe Bool
expirePasswords = Maybe Bool
forall a. Maybe a
Prelude.Nothing,
      $sel:minimumPasswordLength:PasswordPolicy' :: Maybe Natural
minimumPasswordLength = Maybe Natural
forall a. Maybe a
Prelude.Nothing,
      $sel:requireNumbers:PasswordPolicy' :: Maybe Bool
requireNumbers = Maybe Bool
forall a. Maybe a
Prelude.Nothing,
      $sel:passwordReusePrevention:PasswordPolicy' :: Maybe Natural
passwordReusePrevention = Maybe Natural
forall a. Maybe a
Prelude.Nothing,
      $sel:requireLowercaseCharacters:PasswordPolicy' :: Maybe Bool
requireLowercaseCharacters = Maybe Bool
forall a. Maybe a
Prelude.Nothing,
      $sel:maxPasswordAge:PasswordPolicy' :: Maybe Natural
maxPasswordAge = Maybe Natural
forall a. Maybe a
Prelude.Nothing,
      $sel:hardExpiry:PasswordPolicy' :: Maybe Bool
hardExpiry = Maybe Bool
forall a. Maybe a
Prelude.Nothing,
      $sel:requireSymbols:PasswordPolicy' :: Maybe Bool
requireSymbols = Maybe Bool
forall a. Maybe a
Prelude.Nothing,
      $sel:requireUppercaseCharacters:PasswordPolicy' :: Maybe Bool
requireUppercaseCharacters = Maybe Bool
forall a. Maybe a
Prelude.Nothing,
      $sel:allowUsersToChangePassword:PasswordPolicy' :: Maybe Bool
allowUsersToChangePassword = Maybe Bool
forall a. Maybe a
Prelude.Nothing
    }

-- | Indicates whether passwords in the account expire. Returns true if
-- @MaxPasswordAge@ contains a value greater than 0. Returns false if
-- MaxPasswordAge is 0 or not present.
passwordPolicy_expirePasswords :: Lens.Lens' PasswordPolicy (Prelude.Maybe Prelude.Bool)
passwordPolicy_expirePasswords :: (Maybe Bool -> f (Maybe Bool))
-> PasswordPolicy -> f PasswordPolicy
passwordPolicy_expirePasswords = (PasswordPolicy -> Maybe Bool)
-> (PasswordPolicy -> Maybe Bool -> PasswordPolicy)
-> Lens PasswordPolicy PasswordPolicy (Maybe Bool) (Maybe Bool)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PasswordPolicy' {Maybe Bool
expirePasswords :: Maybe Bool
$sel:expirePasswords:PasswordPolicy' :: PasswordPolicy -> Maybe Bool
expirePasswords} -> Maybe Bool
expirePasswords) (\s :: PasswordPolicy
s@PasswordPolicy' {} Maybe Bool
a -> PasswordPolicy
s {$sel:expirePasswords:PasswordPolicy' :: Maybe Bool
expirePasswords = Maybe Bool
a} :: PasswordPolicy)

-- | Minimum length to require for IAM user passwords.
passwordPolicy_minimumPasswordLength :: Lens.Lens' PasswordPolicy (Prelude.Maybe Prelude.Natural)
passwordPolicy_minimumPasswordLength :: (Maybe Natural -> f (Maybe Natural))
-> PasswordPolicy -> f PasswordPolicy
passwordPolicy_minimumPasswordLength = (PasswordPolicy -> Maybe Natural)
-> (PasswordPolicy -> Maybe Natural -> PasswordPolicy)
-> Lens
     PasswordPolicy PasswordPolicy (Maybe Natural) (Maybe Natural)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PasswordPolicy' {Maybe Natural
minimumPasswordLength :: Maybe Natural
$sel:minimumPasswordLength:PasswordPolicy' :: PasswordPolicy -> Maybe Natural
minimumPasswordLength} -> Maybe Natural
minimumPasswordLength) (\s :: PasswordPolicy
s@PasswordPolicy' {} Maybe Natural
a -> PasswordPolicy
s {$sel:minimumPasswordLength:PasswordPolicy' :: Maybe Natural
minimumPasswordLength = Maybe Natural
a} :: PasswordPolicy)

-- | Specifies whether IAM user passwords must contain at least one numeric
-- character (0 to 9).
passwordPolicy_requireNumbers :: Lens.Lens' PasswordPolicy (Prelude.Maybe Prelude.Bool)
passwordPolicy_requireNumbers :: (Maybe Bool -> f (Maybe Bool))
-> PasswordPolicy -> f PasswordPolicy
passwordPolicy_requireNumbers = (PasswordPolicy -> Maybe Bool)
-> (PasswordPolicy -> Maybe Bool -> PasswordPolicy)
-> Lens PasswordPolicy PasswordPolicy (Maybe Bool) (Maybe Bool)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PasswordPolicy' {Maybe Bool
requireNumbers :: Maybe Bool
$sel:requireNumbers:PasswordPolicy' :: PasswordPolicy -> Maybe Bool
requireNumbers} -> Maybe Bool
requireNumbers) (\s :: PasswordPolicy
s@PasswordPolicy' {} Maybe Bool
a -> PasswordPolicy
s {$sel:requireNumbers:PasswordPolicy' :: Maybe Bool
requireNumbers = Maybe Bool
a} :: PasswordPolicy)

-- | Specifies the number of previous passwords that IAM users are prevented
-- from reusing.
passwordPolicy_passwordReusePrevention :: Lens.Lens' PasswordPolicy (Prelude.Maybe Prelude.Natural)
passwordPolicy_passwordReusePrevention :: (Maybe Natural -> f (Maybe Natural))
-> PasswordPolicy -> f PasswordPolicy
passwordPolicy_passwordReusePrevention = (PasswordPolicy -> Maybe Natural)
-> (PasswordPolicy -> Maybe Natural -> PasswordPolicy)
-> Lens
     PasswordPolicy PasswordPolicy (Maybe Natural) (Maybe Natural)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PasswordPolicy' {Maybe Natural
passwordReusePrevention :: Maybe Natural
$sel:passwordReusePrevention:PasswordPolicy' :: PasswordPolicy -> Maybe Natural
passwordReusePrevention} -> Maybe Natural
passwordReusePrevention) (\s :: PasswordPolicy
s@PasswordPolicy' {} Maybe Natural
a -> PasswordPolicy
s {$sel:passwordReusePrevention:PasswordPolicy' :: Maybe Natural
passwordReusePrevention = Maybe Natural
a} :: PasswordPolicy)

-- | Specifies whether IAM user passwords must contain at least one lowercase
-- character (a to z).
passwordPolicy_requireLowercaseCharacters :: Lens.Lens' PasswordPolicy (Prelude.Maybe Prelude.Bool)
passwordPolicy_requireLowercaseCharacters :: (Maybe Bool -> f (Maybe Bool))
-> PasswordPolicy -> f PasswordPolicy
passwordPolicy_requireLowercaseCharacters = (PasswordPolicy -> Maybe Bool)
-> (PasswordPolicy -> Maybe Bool -> PasswordPolicy)
-> Lens PasswordPolicy PasswordPolicy (Maybe Bool) (Maybe Bool)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PasswordPolicy' {Maybe Bool
requireLowercaseCharacters :: Maybe Bool
$sel:requireLowercaseCharacters:PasswordPolicy' :: PasswordPolicy -> Maybe Bool
requireLowercaseCharacters} -> Maybe Bool
requireLowercaseCharacters) (\s :: PasswordPolicy
s@PasswordPolicy' {} Maybe Bool
a -> PasswordPolicy
s {$sel:requireLowercaseCharacters:PasswordPolicy' :: Maybe Bool
requireLowercaseCharacters = Maybe Bool
a} :: PasswordPolicy)

-- | The number of days that an IAM user password is valid.
passwordPolicy_maxPasswordAge :: Lens.Lens' PasswordPolicy (Prelude.Maybe Prelude.Natural)
passwordPolicy_maxPasswordAge :: (Maybe Natural -> f (Maybe Natural))
-> PasswordPolicy -> f PasswordPolicy
passwordPolicy_maxPasswordAge = (PasswordPolicy -> Maybe Natural)
-> (PasswordPolicy -> Maybe Natural -> PasswordPolicy)
-> Lens
     PasswordPolicy PasswordPolicy (Maybe Natural) (Maybe Natural)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PasswordPolicy' {Maybe Natural
maxPasswordAge :: Maybe Natural
$sel:maxPasswordAge:PasswordPolicy' :: PasswordPolicy -> Maybe Natural
maxPasswordAge} -> Maybe Natural
maxPasswordAge) (\s :: PasswordPolicy
s@PasswordPolicy' {} Maybe Natural
a -> PasswordPolicy
s {$sel:maxPasswordAge:PasswordPolicy' :: Maybe Natural
maxPasswordAge = Maybe Natural
a} :: PasswordPolicy)

-- | Specifies whether IAM users are prevented from setting a new password
-- after their password has expired.
passwordPolicy_hardExpiry :: Lens.Lens' PasswordPolicy (Prelude.Maybe Prelude.Bool)
passwordPolicy_hardExpiry :: (Maybe Bool -> f (Maybe Bool))
-> PasswordPolicy -> f PasswordPolicy
passwordPolicy_hardExpiry = (PasswordPolicy -> Maybe Bool)
-> (PasswordPolicy -> Maybe Bool -> PasswordPolicy)
-> Lens PasswordPolicy PasswordPolicy (Maybe Bool) (Maybe Bool)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PasswordPolicy' {Maybe Bool
hardExpiry :: Maybe Bool
$sel:hardExpiry:PasswordPolicy' :: PasswordPolicy -> Maybe Bool
hardExpiry} -> Maybe Bool
hardExpiry) (\s :: PasswordPolicy
s@PasswordPolicy' {} Maybe Bool
a -> PasswordPolicy
s {$sel:hardExpiry:PasswordPolicy' :: Maybe Bool
hardExpiry = Maybe Bool
a} :: PasswordPolicy)

-- | Specifies whether IAM user passwords must contain at least one of the
-- following symbols:
--
-- ! \@ # $ % ^ & * ( ) _ + - = [ ] { } | \'
passwordPolicy_requireSymbols :: Lens.Lens' PasswordPolicy (Prelude.Maybe Prelude.Bool)
passwordPolicy_requireSymbols :: (Maybe Bool -> f (Maybe Bool))
-> PasswordPolicy -> f PasswordPolicy
passwordPolicy_requireSymbols = (PasswordPolicy -> Maybe Bool)
-> (PasswordPolicy -> Maybe Bool -> PasswordPolicy)
-> Lens PasswordPolicy PasswordPolicy (Maybe Bool) (Maybe Bool)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PasswordPolicy' {Maybe Bool
requireSymbols :: Maybe Bool
$sel:requireSymbols:PasswordPolicy' :: PasswordPolicy -> Maybe Bool
requireSymbols} -> Maybe Bool
requireSymbols) (\s :: PasswordPolicy
s@PasswordPolicy' {} Maybe Bool
a -> PasswordPolicy
s {$sel:requireSymbols:PasswordPolicy' :: Maybe Bool
requireSymbols = Maybe Bool
a} :: PasswordPolicy)

-- | Specifies whether IAM user passwords must contain at least one uppercase
-- character (A to Z).
passwordPolicy_requireUppercaseCharacters :: Lens.Lens' PasswordPolicy (Prelude.Maybe Prelude.Bool)
passwordPolicy_requireUppercaseCharacters :: (Maybe Bool -> f (Maybe Bool))
-> PasswordPolicy -> f PasswordPolicy
passwordPolicy_requireUppercaseCharacters = (PasswordPolicy -> Maybe Bool)
-> (PasswordPolicy -> Maybe Bool -> PasswordPolicy)
-> Lens PasswordPolicy PasswordPolicy (Maybe Bool) (Maybe Bool)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PasswordPolicy' {Maybe Bool
requireUppercaseCharacters :: Maybe Bool
$sel:requireUppercaseCharacters:PasswordPolicy' :: PasswordPolicy -> Maybe Bool
requireUppercaseCharacters} -> Maybe Bool
requireUppercaseCharacters) (\s :: PasswordPolicy
s@PasswordPolicy' {} Maybe Bool
a -> PasswordPolicy
s {$sel:requireUppercaseCharacters:PasswordPolicy' :: Maybe Bool
requireUppercaseCharacters = Maybe Bool
a} :: PasswordPolicy)

-- | Specifies whether IAM users are allowed to change their own password.
passwordPolicy_allowUsersToChangePassword :: Lens.Lens' PasswordPolicy (Prelude.Maybe Prelude.Bool)
passwordPolicy_allowUsersToChangePassword :: (Maybe Bool -> f (Maybe Bool))
-> PasswordPolicy -> f PasswordPolicy
passwordPolicy_allowUsersToChangePassword = (PasswordPolicy -> Maybe Bool)
-> (PasswordPolicy -> Maybe Bool -> PasswordPolicy)
-> Lens PasswordPolicy PasswordPolicy (Maybe Bool) (Maybe Bool)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PasswordPolicy' {Maybe Bool
allowUsersToChangePassword :: Maybe Bool
$sel:allowUsersToChangePassword:PasswordPolicy' :: PasswordPolicy -> Maybe Bool
allowUsersToChangePassword} -> Maybe Bool
allowUsersToChangePassword) (\s :: PasswordPolicy
s@PasswordPolicy' {} Maybe Bool
a -> PasswordPolicy
s {$sel:allowUsersToChangePassword:PasswordPolicy' :: Maybe Bool
allowUsersToChangePassword = Maybe Bool
a} :: PasswordPolicy)

instance Core.FromXML PasswordPolicy where
  parseXML :: [Node] -> Either String PasswordPolicy
parseXML [Node]
x =
    Maybe Bool
-> Maybe Natural
-> Maybe Bool
-> Maybe Natural
-> Maybe Bool
-> Maybe Natural
-> Maybe Bool
-> Maybe Bool
-> Maybe Bool
-> Maybe Bool
-> PasswordPolicy
PasswordPolicy'
      (Maybe Bool
 -> Maybe Natural
 -> Maybe Bool
 -> Maybe Natural
 -> Maybe Bool
 -> Maybe Natural
 -> Maybe Bool
 -> Maybe Bool
 -> Maybe Bool
 -> Maybe Bool
 -> PasswordPolicy)
-> Either String (Maybe Bool)
-> Either
     String
     (Maybe Natural
      -> Maybe Bool
      -> Maybe Natural
      -> Maybe Bool
      -> Maybe Natural
      -> Maybe Bool
      -> Maybe Bool
      -> Maybe Bool
      -> Maybe Bool
      -> PasswordPolicy)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> ([Node]
x [Node] -> Text -> Either String (Maybe Bool)
forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Core..@? Text
"ExpirePasswords")
      Either
  String
  (Maybe Natural
   -> Maybe Bool
   -> Maybe Natural
   -> Maybe Bool
   -> Maybe Natural
   -> Maybe Bool
   -> Maybe Bool
   -> Maybe Bool
   -> Maybe Bool
   -> PasswordPolicy)
-> Either String (Maybe Natural)
-> Either
     String
     (Maybe Bool
      -> Maybe Natural
      -> Maybe Bool
      -> Maybe Natural
      -> Maybe Bool
      -> Maybe Bool
      -> Maybe Bool
      -> Maybe Bool
      -> PasswordPolicy)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ([Node]
x [Node] -> Text -> Either String (Maybe Natural)
forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Core..@? Text
"MinimumPasswordLength")
      Either
  String
  (Maybe Bool
   -> Maybe Natural
   -> Maybe Bool
   -> Maybe Natural
   -> Maybe Bool
   -> Maybe Bool
   -> Maybe Bool
   -> Maybe Bool
   -> PasswordPolicy)
-> Either String (Maybe Bool)
-> Either
     String
     (Maybe Natural
      -> Maybe Bool
      -> Maybe Natural
      -> Maybe Bool
      -> Maybe Bool
      -> Maybe Bool
      -> Maybe Bool
      -> PasswordPolicy)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ([Node]
x [Node] -> Text -> Either String (Maybe Bool)
forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Core..@? Text
"RequireNumbers")
      Either
  String
  (Maybe Natural
   -> Maybe Bool
   -> Maybe Natural
   -> Maybe Bool
   -> Maybe Bool
   -> Maybe Bool
   -> Maybe Bool
   -> PasswordPolicy)
-> Either String (Maybe Natural)
-> Either
     String
     (Maybe Bool
      -> Maybe Natural
      -> Maybe Bool
      -> Maybe Bool
      -> Maybe Bool
      -> Maybe Bool
      -> PasswordPolicy)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ([Node]
x [Node] -> Text -> Either String (Maybe Natural)
forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Core..@? Text
"PasswordReusePrevention")
      Either
  String
  (Maybe Bool
   -> Maybe Natural
   -> Maybe Bool
   -> Maybe Bool
   -> Maybe Bool
   -> Maybe Bool
   -> PasswordPolicy)
-> Either String (Maybe Bool)
-> Either
     String
     (Maybe Natural
      -> Maybe Bool
      -> Maybe Bool
      -> Maybe Bool
      -> Maybe Bool
      -> PasswordPolicy)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ([Node]
x [Node] -> Text -> Either String (Maybe Bool)
forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Core..@? Text
"RequireLowercaseCharacters")
      Either
  String
  (Maybe Natural
   -> Maybe Bool
   -> Maybe Bool
   -> Maybe Bool
   -> Maybe Bool
   -> PasswordPolicy)
-> Either String (Maybe Natural)
-> Either
     String
     (Maybe Bool
      -> Maybe Bool -> Maybe Bool -> Maybe Bool -> PasswordPolicy)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ([Node]
x [Node] -> Text -> Either String (Maybe Natural)
forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Core..@? Text
"MaxPasswordAge")
      Either
  String
  (Maybe Bool
   -> Maybe Bool -> Maybe Bool -> Maybe Bool -> PasswordPolicy)
-> Either String (Maybe Bool)
-> Either
     String (Maybe Bool -> Maybe Bool -> Maybe Bool -> PasswordPolicy)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ([Node]
x [Node] -> Text -> Either String (Maybe Bool)
forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Core..@? Text
"HardExpiry")
      Either
  String (Maybe Bool -> Maybe Bool -> Maybe Bool -> PasswordPolicy)
-> Either String (Maybe Bool)
-> Either String (Maybe Bool -> Maybe Bool -> PasswordPolicy)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ([Node]
x [Node] -> Text -> Either String (Maybe Bool)
forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Core..@? Text
"RequireSymbols")
      Either String (Maybe Bool -> Maybe Bool -> PasswordPolicy)
-> Either String (Maybe Bool)
-> Either String (Maybe Bool -> PasswordPolicy)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ([Node]
x [Node] -> Text -> Either String (Maybe Bool)
forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Core..@? Text
"RequireUppercaseCharacters")
      Either String (Maybe Bool -> PasswordPolicy)
-> Either String (Maybe Bool) -> Either String PasswordPolicy
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ([Node]
x [Node] -> Text -> Either String (Maybe Bool)
forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Core..@? Text
"AllowUsersToChangePassword")

instance Prelude.Hashable PasswordPolicy

instance Prelude.NFData PasswordPolicy