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

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

-- | A user pool description.
--
-- /See:/ 'newUserPoolDescriptionType' smart constructor.
data UserPoolDescriptionType = UserPoolDescriptionType'
  { -- | The user pool status in a user pool description.
    UserPoolDescriptionType -> Maybe StatusType
status :: Prelude.Maybe StatusType,
    -- | The date the user pool description was last modified.
    UserPoolDescriptionType -> Maybe POSIX
lastModifiedDate :: Prelude.Maybe Core.POSIX,
    -- | The name in a user pool description.
    UserPoolDescriptionType -> Maybe Text
name :: Prelude.Maybe Prelude.Text,
    -- | The ID in a user pool description.
    UserPoolDescriptionType -> Maybe Text
id :: Prelude.Maybe Prelude.Text,
    -- | The date the user pool description was created.
    UserPoolDescriptionType -> Maybe POSIX
creationDate :: Prelude.Maybe Core.POSIX,
    -- | The Lambda configuration information in a user pool description.
    UserPoolDescriptionType -> Maybe LambdaConfigType
lambdaConfig :: Prelude.Maybe LambdaConfigType
  }
  deriving (UserPoolDescriptionType -> UserPoolDescriptionType -> Bool
(UserPoolDescriptionType -> UserPoolDescriptionType -> Bool)
-> (UserPoolDescriptionType -> UserPoolDescriptionType -> Bool)
-> Eq UserPoolDescriptionType
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]
(Int -> ReadS UserPoolDescriptionType)
-> ReadS [UserPoolDescriptionType]
-> ReadPrec UserPoolDescriptionType
-> ReadPrec [UserPoolDescriptionType]
-> Read 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
(Int -> UserPoolDescriptionType -> ShowS)
-> (UserPoolDescriptionType -> String)
-> ([UserPoolDescriptionType] -> ShowS)
-> Show UserPoolDescriptionType
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.
 UserPoolDescriptionType -> Rep UserPoolDescriptionType x)
-> (forall x.
    Rep UserPoolDescriptionType x -> UserPoolDescriptionType)
-> Generic UserPoolDescriptionType
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:
--
-- 'status', 'userPoolDescriptionType_status' - The user pool status 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.
--
-- 'id', 'userPoolDescriptionType_id' - The ID in a user pool description.
--
-- 'creationDate', 'userPoolDescriptionType_creationDate' - The date the user pool description was created.
--
-- 'lambdaConfig', 'userPoolDescriptionType_lambdaConfig' - The Lambda configuration information in a user pool description.
newUserPoolDescriptionType ::
  UserPoolDescriptionType
newUserPoolDescriptionType :: UserPoolDescriptionType
newUserPoolDescriptionType =
  UserPoolDescriptionType' :: Maybe StatusType
-> Maybe POSIX
-> Maybe Text
-> Maybe Text
-> Maybe POSIX
-> Maybe LambdaConfigType
-> UserPoolDescriptionType
UserPoolDescriptionType'
    { $sel:status:UserPoolDescriptionType' :: Maybe StatusType
status = Maybe StatusType
forall a. Maybe a
Prelude.Nothing,
      $sel:lastModifiedDate:UserPoolDescriptionType' :: Maybe POSIX
lastModifiedDate = Maybe POSIX
forall a. Maybe a
Prelude.Nothing,
      $sel:name:UserPoolDescriptionType' :: Maybe Text
name = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:id:UserPoolDescriptionType' :: Maybe Text
id = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:creationDate:UserPoolDescriptionType' :: Maybe POSIX
creationDate = Maybe POSIX
forall a. Maybe a
Prelude.Nothing,
      $sel:lambdaConfig:UserPoolDescriptionType' :: Maybe LambdaConfigType
lambdaConfig = Maybe LambdaConfigType
forall a. Maybe a
Prelude.Nothing
    }

-- | The user pool status in a user pool description.
userPoolDescriptionType_status :: Lens.Lens' UserPoolDescriptionType (Prelude.Maybe StatusType)
userPoolDescriptionType_status :: (Maybe StatusType -> f (Maybe StatusType))
-> UserPoolDescriptionType -> f UserPoolDescriptionType
userPoolDescriptionType_status = (UserPoolDescriptionType -> Maybe StatusType)
-> (UserPoolDescriptionType
    -> Maybe StatusType -> UserPoolDescriptionType)
-> Lens
     UserPoolDescriptionType
     UserPoolDescriptionType
     (Maybe StatusType)
     (Maybe StatusType)
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)

-- | The date the user pool description was last modified.
userPoolDescriptionType_lastModifiedDate :: Lens.Lens' UserPoolDescriptionType (Prelude.Maybe Prelude.UTCTime)
userPoolDescriptionType_lastModifiedDate :: (Maybe UTCTime -> f (Maybe UTCTime))
-> UserPoolDescriptionType -> f UserPoolDescriptionType
userPoolDescriptionType_lastModifiedDate = (UserPoolDescriptionType -> Maybe POSIX)
-> (UserPoolDescriptionType
    -> Maybe POSIX -> UserPoolDescriptionType)
-> Lens
     UserPoolDescriptionType
     UserPoolDescriptionType
     (Maybe POSIX)
     (Maybe POSIX)
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) ((Maybe POSIX -> f (Maybe POSIX))
 -> UserPoolDescriptionType -> f UserPoolDescriptionType)
-> ((Maybe UTCTime -> f (Maybe UTCTime))
    -> Maybe POSIX -> f (Maybe POSIX))
-> (Maybe UTCTime -> f (Maybe UTCTime))
-> UserPoolDescriptionType
-> f UserPoolDescriptionType
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

-- | The name in a user pool description.
userPoolDescriptionType_name :: Lens.Lens' UserPoolDescriptionType (Prelude.Maybe Prelude.Text)
userPoolDescriptionType_name :: (Maybe Text -> f (Maybe Text))
-> UserPoolDescriptionType -> f UserPoolDescriptionType
userPoolDescriptionType_name = (UserPoolDescriptionType -> Maybe Text)
-> (UserPoolDescriptionType
    -> Maybe Text -> UserPoolDescriptionType)
-> Lens
     UserPoolDescriptionType
     UserPoolDescriptionType
     (Maybe Text)
     (Maybe Text)
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 ID in a user pool description.
userPoolDescriptionType_id :: Lens.Lens' UserPoolDescriptionType (Prelude.Maybe Prelude.Text)
userPoolDescriptionType_id :: (Maybe Text -> f (Maybe Text))
-> UserPoolDescriptionType -> f UserPoolDescriptionType
userPoolDescriptionType_id = (UserPoolDescriptionType -> Maybe Text)
-> (UserPoolDescriptionType
    -> Maybe Text -> UserPoolDescriptionType)
-> Lens
     UserPoolDescriptionType
     UserPoolDescriptionType
     (Maybe Text)
     (Maybe Text)
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 date the user pool description was created.
userPoolDescriptionType_creationDate :: Lens.Lens' UserPoolDescriptionType (Prelude.Maybe Prelude.UTCTime)
userPoolDescriptionType_creationDate :: (Maybe UTCTime -> f (Maybe UTCTime))
-> UserPoolDescriptionType -> f UserPoolDescriptionType
userPoolDescriptionType_creationDate = (UserPoolDescriptionType -> Maybe POSIX)
-> (UserPoolDescriptionType
    -> Maybe POSIX -> UserPoolDescriptionType)
-> Lens
     UserPoolDescriptionType
     UserPoolDescriptionType
     (Maybe POSIX)
     (Maybe POSIX)
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) ((Maybe POSIX -> f (Maybe POSIX))
 -> UserPoolDescriptionType -> f UserPoolDescriptionType)
-> ((Maybe UTCTime -> f (Maybe UTCTime))
    -> Maybe POSIX -> f (Maybe POSIX))
-> (Maybe UTCTime -> f (Maybe UTCTime))
-> UserPoolDescriptionType
-> f UserPoolDescriptionType
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

-- | The Lambda configuration information in a user pool description.
userPoolDescriptionType_lambdaConfig :: Lens.Lens' UserPoolDescriptionType (Prelude.Maybe LambdaConfigType)
userPoolDescriptionType_lambdaConfig :: (Maybe LambdaConfigType -> f (Maybe LambdaConfigType))
-> UserPoolDescriptionType -> f UserPoolDescriptionType
userPoolDescriptionType_lambdaConfig = (UserPoolDescriptionType -> Maybe LambdaConfigType)
-> (UserPoolDescriptionType
    -> Maybe LambdaConfigType -> UserPoolDescriptionType)
-> Lens
     UserPoolDescriptionType
     UserPoolDescriptionType
     (Maybe LambdaConfigType)
     (Maybe LambdaConfigType)
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)

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

instance Prelude.Hashable UserPoolDescriptionType

instance Prelude.NFData UserPoolDescriptionType