{-# 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.SchemaExtensionInfo
-- Copyright   : (c) 2013-2023 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay
-- Stability   : auto-generated
-- Portability : non-portable (GHC extensions)
module Amazonka.DirectoryService.Types.SchemaExtensionInfo where

import qualified Amazonka.Core as Core
import qualified Amazonka.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
import Amazonka.DirectoryService.Types.SchemaExtensionStatus
import qualified Amazonka.Prelude as Prelude

-- | Information about a schema extension.
--
-- /See:/ 'newSchemaExtensionInfo' smart constructor.
data SchemaExtensionInfo = SchemaExtensionInfo'
  { -- | A description of the schema extension.
    SchemaExtensionInfo -> Maybe Text
description :: Prelude.Maybe Prelude.Text,
    -- | The identifier of the directory to which the schema extension is
    -- applied.
    SchemaExtensionInfo -> Maybe Text
directoryId :: Prelude.Maybe Prelude.Text,
    -- | The date and time that the schema extension was completed.
    SchemaExtensionInfo -> Maybe POSIX
endDateTime :: Prelude.Maybe Data.POSIX,
    -- | The identifier of the schema extension.
    SchemaExtensionInfo -> Maybe Text
schemaExtensionId :: Prelude.Maybe Prelude.Text,
    -- | The current status of the schema extension.
    SchemaExtensionInfo -> Maybe SchemaExtensionStatus
schemaExtensionStatus :: Prelude.Maybe SchemaExtensionStatus,
    -- | The reason for the @SchemaExtensionStatus@.
    SchemaExtensionInfo -> Maybe Text
schemaExtensionStatusReason :: Prelude.Maybe Prelude.Text,
    -- | The date and time that the schema extension started being applied to the
    -- directory.
    SchemaExtensionInfo -> Maybe POSIX
startDateTime :: Prelude.Maybe Data.POSIX
  }
  deriving (SchemaExtensionInfo -> SchemaExtensionInfo -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: SchemaExtensionInfo -> SchemaExtensionInfo -> Bool
$c/= :: SchemaExtensionInfo -> SchemaExtensionInfo -> Bool
== :: SchemaExtensionInfo -> SchemaExtensionInfo -> Bool
$c== :: SchemaExtensionInfo -> SchemaExtensionInfo -> Bool
Prelude.Eq, ReadPrec [SchemaExtensionInfo]
ReadPrec SchemaExtensionInfo
Int -> ReadS SchemaExtensionInfo
ReadS [SchemaExtensionInfo]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [SchemaExtensionInfo]
$creadListPrec :: ReadPrec [SchemaExtensionInfo]
readPrec :: ReadPrec SchemaExtensionInfo
$creadPrec :: ReadPrec SchemaExtensionInfo
readList :: ReadS [SchemaExtensionInfo]
$creadList :: ReadS [SchemaExtensionInfo]
readsPrec :: Int -> ReadS SchemaExtensionInfo
$creadsPrec :: Int -> ReadS SchemaExtensionInfo
Prelude.Read, Int -> SchemaExtensionInfo -> ShowS
[SchemaExtensionInfo] -> ShowS
SchemaExtensionInfo -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [SchemaExtensionInfo] -> ShowS
$cshowList :: [SchemaExtensionInfo] -> ShowS
show :: SchemaExtensionInfo -> String
$cshow :: SchemaExtensionInfo -> String
showsPrec :: Int -> SchemaExtensionInfo -> ShowS
$cshowsPrec :: Int -> SchemaExtensionInfo -> ShowS
Prelude.Show, forall x. Rep SchemaExtensionInfo x -> SchemaExtensionInfo
forall x. SchemaExtensionInfo -> Rep SchemaExtensionInfo x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep SchemaExtensionInfo x -> SchemaExtensionInfo
$cfrom :: forall x. SchemaExtensionInfo -> Rep SchemaExtensionInfo x
Prelude.Generic)

-- |
-- Create a value of 'SchemaExtensionInfo' 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:
--
-- 'description', 'schemaExtensionInfo_description' - A description of the schema extension.
--
-- 'directoryId', 'schemaExtensionInfo_directoryId' - The identifier of the directory to which the schema extension is
-- applied.
--
-- 'endDateTime', 'schemaExtensionInfo_endDateTime' - The date and time that the schema extension was completed.
--
-- 'schemaExtensionId', 'schemaExtensionInfo_schemaExtensionId' - The identifier of the schema extension.
--
-- 'schemaExtensionStatus', 'schemaExtensionInfo_schemaExtensionStatus' - The current status of the schema extension.
--
-- 'schemaExtensionStatusReason', 'schemaExtensionInfo_schemaExtensionStatusReason' - The reason for the @SchemaExtensionStatus@.
--
-- 'startDateTime', 'schemaExtensionInfo_startDateTime' - The date and time that the schema extension started being applied to the
-- directory.
newSchemaExtensionInfo ::
  SchemaExtensionInfo
newSchemaExtensionInfo :: SchemaExtensionInfo
newSchemaExtensionInfo =
  SchemaExtensionInfo'
    { $sel:description:SchemaExtensionInfo' :: Maybe Text
description = forall a. Maybe a
Prelude.Nothing,
      $sel:directoryId:SchemaExtensionInfo' :: Maybe Text
directoryId = forall a. Maybe a
Prelude.Nothing,
      $sel:endDateTime:SchemaExtensionInfo' :: Maybe POSIX
endDateTime = forall a. Maybe a
Prelude.Nothing,
      $sel:schemaExtensionId:SchemaExtensionInfo' :: Maybe Text
schemaExtensionId = forall a. Maybe a
Prelude.Nothing,
      $sel:schemaExtensionStatus:SchemaExtensionInfo' :: Maybe SchemaExtensionStatus
schemaExtensionStatus = forall a. Maybe a
Prelude.Nothing,
      $sel:schemaExtensionStatusReason:SchemaExtensionInfo' :: Maybe Text
schemaExtensionStatusReason = forall a. Maybe a
Prelude.Nothing,
      $sel:startDateTime:SchemaExtensionInfo' :: Maybe POSIX
startDateTime = forall a. Maybe a
Prelude.Nothing
    }

-- | A description of the schema extension.
schemaExtensionInfo_description :: Lens.Lens' SchemaExtensionInfo (Prelude.Maybe Prelude.Text)
schemaExtensionInfo_description :: Lens' SchemaExtensionInfo (Maybe Text)
schemaExtensionInfo_description = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SchemaExtensionInfo' {Maybe Text
description :: Maybe Text
$sel:description:SchemaExtensionInfo' :: SchemaExtensionInfo -> Maybe Text
description} -> Maybe Text
description) (\s :: SchemaExtensionInfo
s@SchemaExtensionInfo' {} Maybe Text
a -> SchemaExtensionInfo
s {$sel:description:SchemaExtensionInfo' :: Maybe Text
description = Maybe Text
a} :: SchemaExtensionInfo)

-- | The identifier of the directory to which the schema extension is
-- applied.
schemaExtensionInfo_directoryId :: Lens.Lens' SchemaExtensionInfo (Prelude.Maybe Prelude.Text)
schemaExtensionInfo_directoryId :: Lens' SchemaExtensionInfo (Maybe Text)
schemaExtensionInfo_directoryId = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SchemaExtensionInfo' {Maybe Text
directoryId :: Maybe Text
$sel:directoryId:SchemaExtensionInfo' :: SchemaExtensionInfo -> Maybe Text
directoryId} -> Maybe Text
directoryId) (\s :: SchemaExtensionInfo
s@SchemaExtensionInfo' {} Maybe Text
a -> SchemaExtensionInfo
s {$sel:directoryId:SchemaExtensionInfo' :: Maybe Text
directoryId = Maybe Text
a} :: SchemaExtensionInfo)

-- | The date and time that the schema extension was completed.
schemaExtensionInfo_endDateTime :: Lens.Lens' SchemaExtensionInfo (Prelude.Maybe Prelude.UTCTime)
schemaExtensionInfo_endDateTime :: Lens' SchemaExtensionInfo (Maybe UTCTime)
schemaExtensionInfo_endDateTime = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SchemaExtensionInfo' {Maybe POSIX
endDateTime :: Maybe POSIX
$sel:endDateTime:SchemaExtensionInfo' :: SchemaExtensionInfo -> Maybe POSIX
endDateTime} -> Maybe POSIX
endDateTime) (\s :: SchemaExtensionInfo
s@SchemaExtensionInfo' {} Maybe POSIX
a -> SchemaExtensionInfo
s {$sel:endDateTime:SchemaExtensionInfo' :: Maybe POSIX
endDateTime = Maybe POSIX
a} :: SchemaExtensionInfo) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. forall (f :: * -> *) (g :: * -> *) s t a b.
(Functor f, Functor g) =>
AnIso s t a b -> Iso (f s) (g t) (f a) (g b)
Lens.mapping forall (a :: Format). Iso' (Time a) UTCTime
Data._Time

-- | The identifier of the schema extension.
schemaExtensionInfo_schemaExtensionId :: Lens.Lens' SchemaExtensionInfo (Prelude.Maybe Prelude.Text)
schemaExtensionInfo_schemaExtensionId :: Lens' SchemaExtensionInfo (Maybe Text)
schemaExtensionInfo_schemaExtensionId = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SchemaExtensionInfo' {Maybe Text
schemaExtensionId :: Maybe Text
$sel:schemaExtensionId:SchemaExtensionInfo' :: SchemaExtensionInfo -> Maybe Text
schemaExtensionId} -> Maybe Text
schemaExtensionId) (\s :: SchemaExtensionInfo
s@SchemaExtensionInfo' {} Maybe Text
a -> SchemaExtensionInfo
s {$sel:schemaExtensionId:SchemaExtensionInfo' :: Maybe Text
schemaExtensionId = Maybe Text
a} :: SchemaExtensionInfo)

-- | The current status of the schema extension.
schemaExtensionInfo_schemaExtensionStatus :: Lens.Lens' SchemaExtensionInfo (Prelude.Maybe SchemaExtensionStatus)
schemaExtensionInfo_schemaExtensionStatus :: Lens' SchemaExtensionInfo (Maybe SchemaExtensionStatus)
schemaExtensionInfo_schemaExtensionStatus = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SchemaExtensionInfo' {Maybe SchemaExtensionStatus
schemaExtensionStatus :: Maybe SchemaExtensionStatus
$sel:schemaExtensionStatus:SchemaExtensionInfo' :: SchemaExtensionInfo -> Maybe SchemaExtensionStatus
schemaExtensionStatus} -> Maybe SchemaExtensionStatus
schemaExtensionStatus) (\s :: SchemaExtensionInfo
s@SchemaExtensionInfo' {} Maybe SchemaExtensionStatus
a -> SchemaExtensionInfo
s {$sel:schemaExtensionStatus:SchemaExtensionInfo' :: Maybe SchemaExtensionStatus
schemaExtensionStatus = Maybe SchemaExtensionStatus
a} :: SchemaExtensionInfo)

-- | The reason for the @SchemaExtensionStatus@.
schemaExtensionInfo_schemaExtensionStatusReason :: Lens.Lens' SchemaExtensionInfo (Prelude.Maybe Prelude.Text)
schemaExtensionInfo_schemaExtensionStatusReason :: Lens' SchemaExtensionInfo (Maybe Text)
schemaExtensionInfo_schemaExtensionStatusReason = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SchemaExtensionInfo' {Maybe Text
schemaExtensionStatusReason :: Maybe Text
$sel:schemaExtensionStatusReason:SchemaExtensionInfo' :: SchemaExtensionInfo -> Maybe Text
schemaExtensionStatusReason} -> Maybe Text
schemaExtensionStatusReason) (\s :: SchemaExtensionInfo
s@SchemaExtensionInfo' {} Maybe Text
a -> SchemaExtensionInfo
s {$sel:schemaExtensionStatusReason:SchemaExtensionInfo' :: Maybe Text
schemaExtensionStatusReason = Maybe Text
a} :: SchemaExtensionInfo)

-- | The date and time that the schema extension started being applied to the
-- directory.
schemaExtensionInfo_startDateTime :: Lens.Lens' SchemaExtensionInfo (Prelude.Maybe Prelude.UTCTime)
schemaExtensionInfo_startDateTime :: Lens' SchemaExtensionInfo (Maybe UTCTime)
schemaExtensionInfo_startDateTime = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SchemaExtensionInfo' {Maybe POSIX
startDateTime :: Maybe POSIX
$sel:startDateTime:SchemaExtensionInfo' :: SchemaExtensionInfo -> Maybe POSIX
startDateTime} -> Maybe POSIX
startDateTime) (\s :: SchemaExtensionInfo
s@SchemaExtensionInfo' {} Maybe POSIX
a -> SchemaExtensionInfo
s {$sel:startDateTime:SchemaExtensionInfo' :: Maybe POSIX
startDateTime = Maybe POSIX
a} :: SchemaExtensionInfo) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. forall (f :: * -> *) (g :: * -> *) s t a b.
(Functor f, Functor g) =>
AnIso s t a b -> Iso (f s) (g t) (f a) (g b)
Lens.mapping forall (a :: Format). Iso' (Time a) UTCTime
Data._Time

instance Data.FromJSON SchemaExtensionInfo where
  parseJSON :: Value -> Parser SchemaExtensionInfo
parseJSON =
    forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
      String
"SchemaExtensionInfo"
      ( \Object
x ->
          Maybe Text
-> Maybe Text
-> Maybe POSIX
-> Maybe Text
-> Maybe SchemaExtensionStatus
-> Maybe Text
-> Maybe POSIX
-> SchemaExtensionInfo
SchemaExtensionInfo'
            forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"Description")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"DirectoryId")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"EndDateTime")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"SchemaExtensionId")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"SchemaExtensionStatus")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"SchemaExtensionStatusReason")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"StartDateTime")
      )

instance Prelude.Hashable SchemaExtensionInfo where
  hashWithSalt :: Int -> SchemaExtensionInfo -> Int
hashWithSalt Int
_salt SchemaExtensionInfo' {Maybe Text
Maybe POSIX
Maybe SchemaExtensionStatus
startDateTime :: Maybe POSIX
schemaExtensionStatusReason :: Maybe Text
schemaExtensionStatus :: Maybe SchemaExtensionStatus
schemaExtensionId :: Maybe Text
endDateTime :: Maybe POSIX
directoryId :: Maybe Text
description :: Maybe Text
$sel:startDateTime:SchemaExtensionInfo' :: SchemaExtensionInfo -> Maybe POSIX
$sel:schemaExtensionStatusReason:SchemaExtensionInfo' :: SchemaExtensionInfo -> Maybe Text
$sel:schemaExtensionStatus:SchemaExtensionInfo' :: SchemaExtensionInfo -> Maybe SchemaExtensionStatus
$sel:schemaExtensionId:SchemaExtensionInfo' :: SchemaExtensionInfo -> Maybe Text
$sel:endDateTime:SchemaExtensionInfo' :: SchemaExtensionInfo -> Maybe POSIX
$sel:directoryId:SchemaExtensionInfo' :: SchemaExtensionInfo -> Maybe Text
$sel:description:SchemaExtensionInfo' :: SchemaExtensionInfo -> Maybe Text
..} =
    Int
_salt
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
description
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
directoryId
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe POSIX
endDateTime
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
schemaExtensionId
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe SchemaExtensionStatus
schemaExtensionStatus
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
schemaExtensionStatusReason
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe POSIX
startDateTime

instance Prelude.NFData SchemaExtensionInfo where
  rnf :: SchemaExtensionInfo -> ()
rnf SchemaExtensionInfo' {Maybe Text
Maybe POSIX
Maybe SchemaExtensionStatus
startDateTime :: Maybe POSIX
schemaExtensionStatusReason :: Maybe Text
schemaExtensionStatus :: Maybe SchemaExtensionStatus
schemaExtensionId :: Maybe Text
endDateTime :: Maybe POSIX
directoryId :: Maybe Text
description :: Maybe Text
$sel:startDateTime:SchemaExtensionInfo' :: SchemaExtensionInfo -> Maybe POSIX
$sel:schemaExtensionStatusReason:SchemaExtensionInfo' :: SchemaExtensionInfo -> Maybe Text
$sel:schemaExtensionStatus:SchemaExtensionInfo' :: SchemaExtensionInfo -> Maybe SchemaExtensionStatus
$sel:schemaExtensionId:SchemaExtensionInfo' :: SchemaExtensionInfo -> Maybe Text
$sel:endDateTime:SchemaExtensionInfo' :: SchemaExtensionInfo -> Maybe POSIX
$sel:directoryId:SchemaExtensionInfo' :: SchemaExtensionInfo -> Maybe Text
$sel:description:SchemaExtensionInfo' :: SchemaExtensionInfo -> Maybe Text
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
description
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
directoryId
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe POSIX
endDateTime
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
schemaExtensionId
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe SchemaExtensionStatus
schemaExtensionStatus
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
schemaExtensionStatusReason
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe POSIX
startDateTime