{-# 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.DirectoryService.Types.LDAPSSettingInfo
-- 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.DirectoryService.Types.LDAPSSettingInfo where

import qualified Amazonka.Core as Core
import Amazonka.DirectoryService.Types.LDAPSStatus
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude

-- | Contains general information about the LDAPS settings.
--
-- /See:/ 'newLDAPSSettingInfo' smart constructor.
data LDAPSSettingInfo = LDAPSSettingInfo'
  { -- | The date and time when the LDAPS settings were last updated.
    LDAPSSettingInfo -> Maybe POSIX
lastUpdatedDateTime :: Prelude.Maybe Core.POSIX,
    -- | Describes a state change for LDAPS.
    LDAPSSettingInfo -> Maybe Text
lDAPSStatusReason :: Prelude.Maybe Prelude.Text,
    -- | The state of the LDAPS settings.
    LDAPSSettingInfo -> Maybe LDAPSStatus
lDAPSStatus :: Prelude.Maybe LDAPSStatus
  }
  deriving (LDAPSSettingInfo -> LDAPSSettingInfo -> Bool
(LDAPSSettingInfo -> LDAPSSettingInfo -> Bool)
-> (LDAPSSettingInfo -> LDAPSSettingInfo -> Bool)
-> Eq LDAPSSettingInfo
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: LDAPSSettingInfo -> LDAPSSettingInfo -> Bool
$c/= :: LDAPSSettingInfo -> LDAPSSettingInfo -> Bool
== :: LDAPSSettingInfo -> LDAPSSettingInfo -> Bool
$c== :: LDAPSSettingInfo -> LDAPSSettingInfo -> Bool
Prelude.Eq, ReadPrec [LDAPSSettingInfo]
ReadPrec LDAPSSettingInfo
Int -> ReadS LDAPSSettingInfo
ReadS [LDAPSSettingInfo]
(Int -> ReadS LDAPSSettingInfo)
-> ReadS [LDAPSSettingInfo]
-> ReadPrec LDAPSSettingInfo
-> ReadPrec [LDAPSSettingInfo]
-> Read LDAPSSettingInfo
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [LDAPSSettingInfo]
$creadListPrec :: ReadPrec [LDAPSSettingInfo]
readPrec :: ReadPrec LDAPSSettingInfo
$creadPrec :: ReadPrec LDAPSSettingInfo
readList :: ReadS [LDAPSSettingInfo]
$creadList :: ReadS [LDAPSSettingInfo]
readsPrec :: Int -> ReadS LDAPSSettingInfo
$creadsPrec :: Int -> ReadS LDAPSSettingInfo
Prelude.Read, Int -> LDAPSSettingInfo -> ShowS
[LDAPSSettingInfo] -> ShowS
LDAPSSettingInfo -> String
(Int -> LDAPSSettingInfo -> ShowS)
-> (LDAPSSettingInfo -> String)
-> ([LDAPSSettingInfo] -> ShowS)
-> Show LDAPSSettingInfo
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [LDAPSSettingInfo] -> ShowS
$cshowList :: [LDAPSSettingInfo] -> ShowS
show :: LDAPSSettingInfo -> String
$cshow :: LDAPSSettingInfo -> String
showsPrec :: Int -> LDAPSSettingInfo -> ShowS
$cshowsPrec :: Int -> LDAPSSettingInfo -> ShowS
Prelude.Show, (forall x. LDAPSSettingInfo -> Rep LDAPSSettingInfo x)
-> (forall x. Rep LDAPSSettingInfo x -> LDAPSSettingInfo)
-> Generic LDAPSSettingInfo
forall x. Rep LDAPSSettingInfo x -> LDAPSSettingInfo
forall x. LDAPSSettingInfo -> Rep LDAPSSettingInfo x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep LDAPSSettingInfo x -> LDAPSSettingInfo
$cfrom :: forall x. LDAPSSettingInfo -> Rep LDAPSSettingInfo x
Prelude.Generic)

-- |
-- Create a value of 'LDAPSSettingInfo' 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:
--
-- 'lastUpdatedDateTime', 'lDAPSSettingInfo_lastUpdatedDateTime' - The date and time when the LDAPS settings were last updated.
--
-- 'lDAPSStatusReason', 'lDAPSSettingInfo_lDAPSStatusReason' - Describes a state change for LDAPS.
--
-- 'lDAPSStatus', 'lDAPSSettingInfo_lDAPSStatus' - The state of the LDAPS settings.
newLDAPSSettingInfo ::
  LDAPSSettingInfo
newLDAPSSettingInfo :: LDAPSSettingInfo
newLDAPSSettingInfo =
  LDAPSSettingInfo' :: Maybe POSIX -> Maybe Text -> Maybe LDAPSStatus -> LDAPSSettingInfo
LDAPSSettingInfo'
    { $sel:lastUpdatedDateTime:LDAPSSettingInfo' :: Maybe POSIX
lastUpdatedDateTime =
        Maybe POSIX
forall a. Maybe a
Prelude.Nothing,
      $sel:lDAPSStatusReason:LDAPSSettingInfo' :: Maybe Text
lDAPSStatusReason = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:lDAPSStatus:LDAPSSettingInfo' :: Maybe LDAPSStatus
lDAPSStatus = Maybe LDAPSStatus
forall a. Maybe a
Prelude.Nothing
    }

-- | The date and time when the LDAPS settings were last updated.
lDAPSSettingInfo_lastUpdatedDateTime :: Lens.Lens' LDAPSSettingInfo (Prelude.Maybe Prelude.UTCTime)
lDAPSSettingInfo_lastUpdatedDateTime :: (Maybe UTCTime -> f (Maybe UTCTime))
-> LDAPSSettingInfo -> f LDAPSSettingInfo
lDAPSSettingInfo_lastUpdatedDateTime = (LDAPSSettingInfo -> Maybe POSIX)
-> (LDAPSSettingInfo -> Maybe POSIX -> LDAPSSettingInfo)
-> Lens
     LDAPSSettingInfo LDAPSSettingInfo (Maybe POSIX) (Maybe POSIX)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\LDAPSSettingInfo' {Maybe POSIX
lastUpdatedDateTime :: Maybe POSIX
$sel:lastUpdatedDateTime:LDAPSSettingInfo' :: LDAPSSettingInfo -> Maybe POSIX
lastUpdatedDateTime} -> Maybe POSIX
lastUpdatedDateTime) (\s :: LDAPSSettingInfo
s@LDAPSSettingInfo' {} Maybe POSIX
a -> LDAPSSettingInfo
s {$sel:lastUpdatedDateTime:LDAPSSettingInfo' :: Maybe POSIX
lastUpdatedDateTime = Maybe POSIX
a} :: LDAPSSettingInfo) ((Maybe POSIX -> f (Maybe POSIX))
 -> LDAPSSettingInfo -> f LDAPSSettingInfo)
-> ((Maybe UTCTime -> f (Maybe UTCTime))
    -> Maybe POSIX -> f (Maybe POSIX))
-> (Maybe UTCTime -> f (Maybe UTCTime))
-> LDAPSSettingInfo
-> f LDAPSSettingInfo
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso POSIX POSIX UTCTime UTCTime
-> Iso (Maybe POSIX) (Maybe POSIX) (Maybe UTCTime) (Maybe UTCTime)
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 AnIso POSIX POSIX UTCTime UTCTime
forall (a :: Format). Iso' (Time a) UTCTime
Core._Time

-- | Describes a state change for LDAPS.
lDAPSSettingInfo_lDAPSStatusReason :: Lens.Lens' LDAPSSettingInfo (Prelude.Maybe Prelude.Text)
lDAPSSettingInfo_lDAPSStatusReason :: (Maybe Text -> f (Maybe Text))
-> LDAPSSettingInfo -> f LDAPSSettingInfo
lDAPSSettingInfo_lDAPSStatusReason = (LDAPSSettingInfo -> Maybe Text)
-> (LDAPSSettingInfo -> Maybe Text -> LDAPSSettingInfo)
-> Lens LDAPSSettingInfo LDAPSSettingInfo (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\LDAPSSettingInfo' {Maybe Text
lDAPSStatusReason :: Maybe Text
$sel:lDAPSStatusReason:LDAPSSettingInfo' :: LDAPSSettingInfo -> Maybe Text
lDAPSStatusReason} -> Maybe Text
lDAPSStatusReason) (\s :: LDAPSSettingInfo
s@LDAPSSettingInfo' {} Maybe Text
a -> LDAPSSettingInfo
s {$sel:lDAPSStatusReason:LDAPSSettingInfo' :: Maybe Text
lDAPSStatusReason = Maybe Text
a} :: LDAPSSettingInfo)

-- | The state of the LDAPS settings.
lDAPSSettingInfo_lDAPSStatus :: Lens.Lens' LDAPSSettingInfo (Prelude.Maybe LDAPSStatus)
lDAPSSettingInfo_lDAPSStatus :: (Maybe LDAPSStatus -> f (Maybe LDAPSStatus))
-> LDAPSSettingInfo -> f LDAPSSettingInfo
lDAPSSettingInfo_lDAPSStatus = (LDAPSSettingInfo -> Maybe LDAPSStatus)
-> (LDAPSSettingInfo -> Maybe LDAPSStatus -> LDAPSSettingInfo)
-> Lens
     LDAPSSettingInfo
     LDAPSSettingInfo
     (Maybe LDAPSStatus)
     (Maybe LDAPSStatus)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\LDAPSSettingInfo' {Maybe LDAPSStatus
lDAPSStatus :: Maybe LDAPSStatus
$sel:lDAPSStatus:LDAPSSettingInfo' :: LDAPSSettingInfo -> Maybe LDAPSStatus
lDAPSStatus} -> Maybe LDAPSStatus
lDAPSStatus) (\s :: LDAPSSettingInfo
s@LDAPSSettingInfo' {} Maybe LDAPSStatus
a -> LDAPSSettingInfo
s {$sel:lDAPSStatus:LDAPSSettingInfo' :: Maybe LDAPSStatus
lDAPSStatus = Maybe LDAPSStatus
a} :: LDAPSSettingInfo)

instance Core.FromJSON LDAPSSettingInfo where
  parseJSON :: Value -> Parser LDAPSSettingInfo
parseJSON =
    String
-> (Object -> Parser LDAPSSettingInfo)
-> Value
-> Parser LDAPSSettingInfo
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
      String
"LDAPSSettingInfo"
      ( \Object
x ->
          Maybe POSIX -> Maybe Text -> Maybe LDAPSStatus -> LDAPSSettingInfo
LDAPSSettingInfo'
            (Maybe POSIX
 -> Maybe Text -> Maybe LDAPSStatus -> LDAPSSettingInfo)
-> Parser (Maybe POSIX)
-> Parser (Maybe Text -> Maybe LDAPSStatus -> LDAPSSettingInfo)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Parser (Maybe POSIX)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"LastUpdatedDateTime")
            Parser (Maybe Text -> Maybe LDAPSStatus -> LDAPSSettingInfo)
-> Parser (Maybe Text)
-> Parser (Maybe LDAPSStatus -> LDAPSSettingInfo)
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
"LDAPSStatusReason")
            Parser (Maybe LDAPSStatus -> LDAPSSettingInfo)
-> Parser (Maybe LDAPSStatus) -> Parser LDAPSSettingInfo
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe LDAPSStatus)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"LDAPSStatus")
      )

instance Prelude.Hashable LDAPSSettingInfo

instance Prelude.NFData LDAPSSettingInfo