{-# 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.CognitoIdentityProvider.Types.UserPoolDescriptionType
-- 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.CognitoIdentityProvider.Types.UserPoolDescriptionType where

import Amazonka.CognitoIdentityProvider.Types.LambdaConfigType
import Amazonka.CognitoIdentityProvider.Types.StatusType
import qualified Amazonka.Core as Core
import qualified Amazonka.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
import qualified Amazonka.Prelude as Prelude

-- | A user pool description.
--
-- /See:/ 'newUserPoolDescriptionType' smart constructor.
data UserPoolDescriptionType = UserPoolDescriptionType'
  { -- | The date the user pool description was created.
    UserPoolDescriptionType -> Maybe POSIX
creationDate :: Prelude.Maybe Data.POSIX,
    -- | The ID in a user pool description.
    UserPoolDescriptionType -> Maybe Text
id :: Prelude.Maybe Prelude.Text,
    -- | The Lambda configuration information in a user pool description.
    UserPoolDescriptionType -> Maybe LambdaConfigType
lambdaConfig :: Prelude.Maybe LambdaConfigType,
    -- | The date the user pool description was last modified.
    UserPoolDescriptionType -> Maybe POSIX
lastModifiedDate :: Prelude.Maybe Data.POSIX,
    -- | The name in a user pool description.
    UserPoolDescriptionType -> Maybe Text
name :: Prelude.Maybe Prelude.Text,
    -- | The user pool status in a user pool description.
    UserPoolDescriptionType -> Maybe StatusType
status :: Prelude.Maybe StatusType
  }
  deriving (UserPoolDescriptionType -> UserPoolDescriptionType -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: UserPoolDescriptionType -> UserPoolDescriptionType -> Bool
$c/= :: UserPoolDescriptionType -> UserPoolDescriptionType -> Bool
== :: UserPoolDescriptionType -> UserPoolDescriptionType -> Bool
$c== :: UserPoolDescriptionType -> UserPoolDescriptionType -> Bool
Prelude.Eq, ReadPrec [UserPoolDescriptionType]
ReadPrec UserPoolDescriptionType
Int -> ReadS UserPoolDescriptionType
ReadS [UserPoolDescriptionType]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [UserPoolDescriptionType]
$creadListPrec :: ReadPrec [UserPoolDescriptionType]
readPrec :: ReadPrec UserPoolDescriptionType
$creadPrec :: ReadPrec UserPoolDescriptionType
readList :: ReadS [UserPoolDescriptionType]
$creadList :: ReadS [UserPoolDescriptionType]
readsPrec :: Int -> ReadS UserPoolDescriptionType
$creadsPrec :: Int -> ReadS UserPoolDescriptionType
Prelude.Read, Int -> UserPoolDescriptionType -> ShowS
[UserPoolDescriptionType] -> ShowS
UserPoolDescriptionType -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [UserPoolDescriptionType] -> ShowS
$cshowList :: [UserPoolDescriptionType] -> ShowS
show :: UserPoolDescriptionType -> String
$cshow :: UserPoolDescriptionType -> String
showsPrec :: Int -> UserPoolDescriptionType -> ShowS
$cshowsPrec :: Int -> UserPoolDescriptionType -> ShowS
Prelude.Show, forall x. Rep UserPoolDescriptionType x -> UserPoolDescriptionType
forall x. UserPoolDescriptionType -> Rep UserPoolDescriptionType x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep UserPoolDescriptionType x -> UserPoolDescriptionType
$cfrom :: forall x. UserPoolDescriptionType -> Rep UserPoolDescriptionType x
Prelude.Generic)

-- |
-- Create a value of 'UserPoolDescriptionType' 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:
--
-- 'creationDate', 'userPoolDescriptionType_creationDate' - The date the user pool description was created.
--
-- 'id', 'userPoolDescriptionType_id' - The ID in a user pool description.
--
-- 'lambdaConfig', 'userPoolDescriptionType_lambdaConfig' - The Lambda configuration information in a user pool description.
--
-- 'lastModifiedDate', 'userPoolDescriptionType_lastModifiedDate' - The date the user pool description was last modified.
--
-- 'name', 'userPoolDescriptionType_name' - The name in a user pool description.
--
-- 'status', 'userPoolDescriptionType_status' - The user pool status in a user pool description.
newUserPoolDescriptionType ::
  UserPoolDescriptionType
newUserPoolDescriptionType :: UserPoolDescriptionType
newUserPoolDescriptionType =
  UserPoolDescriptionType'
    { $sel:creationDate:UserPoolDescriptionType' :: Maybe POSIX
creationDate =
        forall a. Maybe a
Prelude.Nothing,
      $sel:id:UserPoolDescriptionType' :: Maybe Text
id = forall a. Maybe a
Prelude.Nothing,
      $sel:lambdaConfig:UserPoolDescriptionType' :: Maybe LambdaConfigType
lambdaConfig = forall a. Maybe a
Prelude.Nothing,
      $sel:lastModifiedDate:UserPoolDescriptionType' :: Maybe POSIX
lastModifiedDate = forall a. Maybe a
Prelude.Nothing,
      $sel:name:UserPoolDescriptionType' :: Maybe Text
name = forall a. Maybe a
Prelude.Nothing,
      $sel:status:UserPoolDescriptionType' :: Maybe StatusType
status = forall a. Maybe a
Prelude.Nothing
    }

-- | The date the user pool description was created.
userPoolDescriptionType_creationDate :: Lens.Lens' UserPoolDescriptionType (Prelude.Maybe Prelude.UTCTime)
userPoolDescriptionType_creationDate :: Lens' UserPoolDescriptionType (Maybe UTCTime)
userPoolDescriptionType_creationDate = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UserPoolDescriptionType' {Maybe POSIX
creationDate :: Maybe POSIX
$sel:creationDate:UserPoolDescriptionType' :: UserPoolDescriptionType -> Maybe POSIX
creationDate} -> Maybe POSIX
creationDate) (\s :: UserPoolDescriptionType
s@UserPoolDescriptionType' {} Maybe POSIX
a -> UserPoolDescriptionType
s {$sel:creationDate:UserPoolDescriptionType' :: Maybe POSIX
creationDate = Maybe POSIX
a} :: UserPoolDescriptionType) 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 ID in a user pool description.
userPoolDescriptionType_id :: Lens.Lens' UserPoolDescriptionType (Prelude.Maybe Prelude.Text)
userPoolDescriptionType_id :: Lens' UserPoolDescriptionType (Maybe Text)
userPoolDescriptionType_id = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UserPoolDescriptionType' {Maybe Text
id :: Maybe Text
$sel:id:UserPoolDescriptionType' :: UserPoolDescriptionType -> Maybe Text
id} -> Maybe Text
id) (\s :: UserPoolDescriptionType
s@UserPoolDescriptionType' {} Maybe Text
a -> UserPoolDescriptionType
s {$sel:id:UserPoolDescriptionType' :: Maybe Text
id = Maybe Text
a} :: UserPoolDescriptionType)

-- | The Lambda configuration information in a user pool description.
userPoolDescriptionType_lambdaConfig :: Lens.Lens' UserPoolDescriptionType (Prelude.Maybe LambdaConfigType)
userPoolDescriptionType_lambdaConfig :: Lens' UserPoolDescriptionType (Maybe LambdaConfigType)
userPoolDescriptionType_lambdaConfig = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UserPoolDescriptionType' {Maybe LambdaConfigType
lambdaConfig :: Maybe LambdaConfigType
$sel:lambdaConfig:UserPoolDescriptionType' :: UserPoolDescriptionType -> Maybe LambdaConfigType
lambdaConfig} -> Maybe LambdaConfigType
lambdaConfig) (\s :: UserPoolDescriptionType
s@UserPoolDescriptionType' {} Maybe LambdaConfigType
a -> UserPoolDescriptionType
s {$sel:lambdaConfig:UserPoolDescriptionType' :: Maybe LambdaConfigType
lambdaConfig = Maybe LambdaConfigType
a} :: UserPoolDescriptionType)

-- | The date the user pool description was last modified.
userPoolDescriptionType_lastModifiedDate :: Lens.Lens' UserPoolDescriptionType (Prelude.Maybe Prelude.UTCTime)
userPoolDescriptionType_lastModifiedDate :: Lens' UserPoolDescriptionType (Maybe UTCTime)
userPoolDescriptionType_lastModifiedDate = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UserPoolDescriptionType' {Maybe POSIX
lastModifiedDate :: Maybe POSIX
$sel:lastModifiedDate:UserPoolDescriptionType' :: UserPoolDescriptionType -> Maybe POSIX
lastModifiedDate} -> Maybe POSIX
lastModifiedDate) (\s :: UserPoolDescriptionType
s@UserPoolDescriptionType' {} Maybe POSIX
a -> UserPoolDescriptionType
s {$sel:lastModifiedDate:UserPoolDescriptionType' :: Maybe POSIX
lastModifiedDate = Maybe POSIX
a} :: UserPoolDescriptionType) 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 name in a user pool description.
userPoolDescriptionType_name :: Lens.Lens' UserPoolDescriptionType (Prelude.Maybe Prelude.Text)
userPoolDescriptionType_name :: Lens' UserPoolDescriptionType (Maybe Text)
userPoolDescriptionType_name = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UserPoolDescriptionType' {Maybe Text
name :: Maybe Text
$sel:name:UserPoolDescriptionType' :: UserPoolDescriptionType -> Maybe Text
name} -> Maybe Text
name) (\s :: UserPoolDescriptionType
s@UserPoolDescriptionType' {} Maybe Text
a -> UserPoolDescriptionType
s {$sel:name:UserPoolDescriptionType' :: Maybe Text
name = Maybe Text
a} :: UserPoolDescriptionType)

-- | The user pool status in a user pool description.
userPoolDescriptionType_status :: Lens.Lens' UserPoolDescriptionType (Prelude.Maybe StatusType)
userPoolDescriptionType_status :: Lens' UserPoolDescriptionType (Maybe StatusType)
userPoolDescriptionType_status = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UserPoolDescriptionType' {Maybe StatusType
status :: Maybe StatusType
$sel:status:UserPoolDescriptionType' :: UserPoolDescriptionType -> Maybe StatusType
status} -> Maybe StatusType
status) (\s :: UserPoolDescriptionType
s@UserPoolDescriptionType' {} Maybe StatusType
a -> UserPoolDescriptionType
s {$sel:status:UserPoolDescriptionType' :: Maybe StatusType
status = Maybe StatusType
a} :: UserPoolDescriptionType)

instance Data.FromJSON UserPoolDescriptionType where
  parseJSON :: Value -> Parser UserPoolDescriptionType
parseJSON =
    forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
      String
"UserPoolDescriptionType"
      ( \Object
x ->
          Maybe POSIX
-> Maybe Text
-> Maybe LambdaConfigType
-> Maybe POSIX
-> Maybe Text
-> Maybe StatusType
-> UserPoolDescriptionType
UserPoolDescriptionType'
            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
"CreationDate")
            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
"Id")
            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
"LambdaConfig")
            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
"LastModifiedDate")
            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
"Name")
            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
"Status")
      )

instance Prelude.Hashable UserPoolDescriptionType where
  hashWithSalt :: Int -> UserPoolDescriptionType -> Int
hashWithSalt Int
_salt UserPoolDescriptionType' {Maybe Text
Maybe POSIX
Maybe LambdaConfigType
Maybe StatusType
status :: Maybe StatusType
name :: Maybe Text
lastModifiedDate :: Maybe POSIX
lambdaConfig :: Maybe LambdaConfigType
id :: Maybe Text
creationDate :: Maybe POSIX
$sel:status:UserPoolDescriptionType' :: UserPoolDescriptionType -> Maybe StatusType
$sel:name:UserPoolDescriptionType' :: UserPoolDescriptionType -> Maybe Text
$sel:lastModifiedDate:UserPoolDescriptionType' :: UserPoolDescriptionType -> Maybe POSIX
$sel:lambdaConfig:UserPoolDescriptionType' :: UserPoolDescriptionType -> Maybe LambdaConfigType
$sel:id:UserPoolDescriptionType' :: UserPoolDescriptionType -> Maybe Text
$sel:creationDate:UserPoolDescriptionType' :: UserPoolDescriptionType -> Maybe POSIX
..} =
    Int
_salt
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe POSIX
creationDate
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
id
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe LambdaConfigType
lambdaConfig
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe POSIX
lastModifiedDate
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
name
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe StatusType
status

instance Prelude.NFData UserPoolDescriptionType where
  rnf :: UserPoolDescriptionType -> ()
rnf UserPoolDescriptionType' {Maybe Text
Maybe POSIX
Maybe LambdaConfigType
Maybe StatusType
status :: Maybe StatusType
name :: Maybe Text
lastModifiedDate :: Maybe POSIX
lambdaConfig :: Maybe LambdaConfigType
id :: Maybe Text
creationDate :: Maybe POSIX
$sel:status:UserPoolDescriptionType' :: UserPoolDescriptionType -> Maybe StatusType
$sel:name:UserPoolDescriptionType' :: UserPoolDescriptionType -> Maybe Text
$sel:lastModifiedDate:UserPoolDescriptionType' :: UserPoolDescriptionType -> Maybe POSIX
$sel:lambdaConfig:UserPoolDescriptionType' :: UserPoolDescriptionType -> Maybe LambdaConfigType
$sel:id:UserPoolDescriptionType' :: UserPoolDescriptionType -> Maybe Text
$sel:creationDate:UserPoolDescriptionType' :: UserPoolDescriptionType -> Maybe POSIX
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe POSIX
creationDate
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
id
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe LambdaConfigType
lambdaConfig
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe POSIX
lastModifiedDate
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
name
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe StatusType
status