{-# 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.UserPoolClientDescription
-- 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.UserPoolClientDescription where

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

-- | The description of the user pool client.
--
-- /See:/ 'newUserPoolClientDescription' smart constructor.
data UserPoolClientDescription = UserPoolClientDescription'
  { -- | The ID of the client associated with the user pool.
    UserPoolClientDescription -> Maybe (Sensitive Text)
clientId :: Prelude.Maybe (Data.Sensitive Prelude.Text),
    -- | The client name from the user pool client description.
    UserPoolClientDescription -> Maybe Text
clientName :: Prelude.Maybe Prelude.Text,
    -- | The user pool ID for the user pool where you want to describe the user
    -- pool client.
    UserPoolClientDescription -> Maybe Text
userPoolId :: Prelude.Maybe Prelude.Text
  }
  deriving (UserPoolClientDescription -> UserPoolClientDescription -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: UserPoolClientDescription -> UserPoolClientDescription -> Bool
$c/= :: UserPoolClientDescription -> UserPoolClientDescription -> Bool
== :: UserPoolClientDescription -> UserPoolClientDescription -> Bool
$c== :: UserPoolClientDescription -> UserPoolClientDescription -> Bool
Prelude.Eq, Int -> UserPoolClientDescription -> ShowS
[UserPoolClientDescription] -> ShowS
UserPoolClientDescription -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [UserPoolClientDescription] -> ShowS
$cshowList :: [UserPoolClientDescription] -> ShowS
show :: UserPoolClientDescription -> String
$cshow :: UserPoolClientDescription -> String
showsPrec :: Int -> UserPoolClientDescription -> ShowS
$cshowsPrec :: Int -> UserPoolClientDescription -> ShowS
Prelude.Show, forall x.
Rep UserPoolClientDescription x -> UserPoolClientDescription
forall x.
UserPoolClientDescription -> Rep UserPoolClientDescription x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep UserPoolClientDescription x -> UserPoolClientDescription
$cfrom :: forall x.
UserPoolClientDescription -> Rep UserPoolClientDescription x
Prelude.Generic)

-- |
-- Create a value of 'UserPoolClientDescription' 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:
--
-- 'clientId', 'userPoolClientDescription_clientId' - The ID of the client associated with the user pool.
--
-- 'clientName', 'userPoolClientDescription_clientName' - The client name from the user pool client description.
--
-- 'userPoolId', 'userPoolClientDescription_userPoolId' - The user pool ID for the user pool where you want to describe the user
-- pool client.
newUserPoolClientDescription ::
  UserPoolClientDescription
newUserPoolClientDescription :: UserPoolClientDescription
newUserPoolClientDescription =
  UserPoolClientDescription'
    { $sel:clientId:UserPoolClientDescription' :: Maybe (Sensitive Text)
clientId =
        forall a. Maybe a
Prelude.Nothing,
      $sel:clientName:UserPoolClientDescription' :: Maybe Text
clientName = forall a. Maybe a
Prelude.Nothing,
      $sel:userPoolId:UserPoolClientDescription' :: Maybe Text
userPoolId = forall a. Maybe a
Prelude.Nothing
    }

-- | The ID of the client associated with the user pool.
userPoolClientDescription_clientId :: Lens.Lens' UserPoolClientDescription (Prelude.Maybe Prelude.Text)
userPoolClientDescription_clientId :: Lens' UserPoolClientDescription (Maybe Text)
userPoolClientDescription_clientId = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UserPoolClientDescription' {Maybe (Sensitive Text)
clientId :: Maybe (Sensitive Text)
$sel:clientId:UserPoolClientDescription' :: UserPoolClientDescription -> Maybe (Sensitive Text)
clientId} -> Maybe (Sensitive Text)
clientId) (\s :: UserPoolClientDescription
s@UserPoolClientDescription' {} Maybe (Sensitive Text)
a -> UserPoolClientDescription
s {$sel:clientId:UserPoolClientDescription' :: Maybe (Sensitive Text)
clientId = Maybe (Sensitive Text)
a} :: UserPoolClientDescription) 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. Iso' (Sensitive a) a
Data._Sensitive

-- | The client name from the user pool client description.
userPoolClientDescription_clientName :: Lens.Lens' UserPoolClientDescription (Prelude.Maybe Prelude.Text)
userPoolClientDescription_clientName :: Lens' UserPoolClientDescription (Maybe Text)
userPoolClientDescription_clientName = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UserPoolClientDescription' {Maybe Text
clientName :: Maybe Text
$sel:clientName:UserPoolClientDescription' :: UserPoolClientDescription -> Maybe Text
clientName} -> Maybe Text
clientName) (\s :: UserPoolClientDescription
s@UserPoolClientDescription' {} Maybe Text
a -> UserPoolClientDescription
s {$sel:clientName:UserPoolClientDescription' :: Maybe Text
clientName = Maybe Text
a} :: UserPoolClientDescription)

-- | The user pool ID for the user pool where you want to describe the user
-- pool client.
userPoolClientDescription_userPoolId :: Lens.Lens' UserPoolClientDescription (Prelude.Maybe Prelude.Text)
userPoolClientDescription_userPoolId :: Lens' UserPoolClientDescription (Maybe Text)
userPoolClientDescription_userPoolId = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UserPoolClientDescription' {Maybe Text
userPoolId :: Maybe Text
$sel:userPoolId:UserPoolClientDescription' :: UserPoolClientDescription -> Maybe Text
userPoolId} -> Maybe Text
userPoolId) (\s :: UserPoolClientDescription
s@UserPoolClientDescription' {} Maybe Text
a -> UserPoolClientDescription
s {$sel:userPoolId:UserPoolClientDescription' :: Maybe Text
userPoolId = Maybe Text
a} :: UserPoolClientDescription)

instance Data.FromJSON UserPoolClientDescription where
  parseJSON :: Value -> Parser UserPoolClientDescription
parseJSON =
    forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
      String
"UserPoolClientDescription"
      ( \Object
x ->
          Maybe (Sensitive Text)
-> Maybe Text -> Maybe Text -> UserPoolClientDescription
UserPoolClientDescription'
            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
"ClientId")
            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
"ClientName")
            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
"UserPoolId")
      )

instance Prelude.Hashable UserPoolClientDescription where
  hashWithSalt :: Int -> UserPoolClientDescription -> Int
hashWithSalt Int
_salt UserPoolClientDescription' {Maybe Text
Maybe (Sensitive Text)
userPoolId :: Maybe Text
clientName :: Maybe Text
clientId :: Maybe (Sensitive Text)
$sel:userPoolId:UserPoolClientDescription' :: UserPoolClientDescription -> Maybe Text
$sel:clientName:UserPoolClientDescription' :: UserPoolClientDescription -> Maybe Text
$sel:clientId:UserPoolClientDescription' :: UserPoolClientDescription -> Maybe (Sensitive Text)
..} =
    Int
_salt
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe (Sensitive Text)
clientId
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
clientName
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
userPoolId

instance Prelude.NFData UserPoolClientDescription where
  rnf :: UserPoolClientDescription -> ()
rnf UserPoolClientDescription' {Maybe Text
Maybe (Sensitive Text)
userPoolId :: Maybe Text
clientName :: Maybe Text
clientId :: Maybe (Sensitive Text)
$sel:userPoolId:UserPoolClientDescription' :: UserPoolClientDescription -> Maybe Text
$sel:clientName:UserPoolClientDescription' :: UserPoolClientDescription -> Maybe Text
$sel:clientId:UserPoolClientDescription' :: UserPoolClientDescription -> Maybe (Sensitive Text)
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe (Sensitive Text)
clientId
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
clientName
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
userPoolId