{-# 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.Redshift.Types.AuthenticationProfile
-- 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.Redshift.Types.AuthenticationProfile 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
import Amazonka.Redshift.Internal

-- | Describes an authentication profile.
--
-- /See:/ 'newAuthenticationProfile' smart constructor.
data AuthenticationProfile = AuthenticationProfile'
  { -- | The content of the authentication profile in JSON format. The maximum
    -- length of the JSON string is determined by a quota for your account.
    AuthenticationProfile -> Maybe Text
authenticationProfileContent :: Prelude.Maybe Prelude.Text,
    -- | The name of the authentication profile.
    AuthenticationProfile -> Maybe Text
authenticationProfileName :: Prelude.Maybe Prelude.Text
  }
  deriving (AuthenticationProfile -> AuthenticationProfile -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: AuthenticationProfile -> AuthenticationProfile -> Bool
$c/= :: AuthenticationProfile -> AuthenticationProfile -> Bool
== :: AuthenticationProfile -> AuthenticationProfile -> Bool
$c== :: AuthenticationProfile -> AuthenticationProfile -> Bool
Prelude.Eq, ReadPrec [AuthenticationProfile]
ReadPrec AuthenticationProfile
Int -> ReadS AuthenticationProfile
ReadS [AuthenticationProfile]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [AuthenticationProfile]
$creadListPrec :: ReadPrec [AuthenticationProfile]
readPrec :: ReadPrec AuthenticationProfile
$creadPrec :: ReadPrec AuthenticationProfile
readList :: ReadS [AuthenticationProfile]
$creadList :: ReadS [AuthenticationProfile]
readsPrec :: Int -> ReadS AuthenticationProfile
$creadsPrec :: Int -> ReadS AuthenticationProfile
Prelude.Read, Int -> AuthenticationProfile -> ShowS
[AuthenticationProfile] -> ShowS
AuthenticationProfile -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [AuthenticationProfile] -> ShowS
$cshowList :: [AuthenticationProfile] -> ShowS
show :: AuthenticationProfile -> String
$cshow :: AuthenticationProfile -> String
showsPrec :: Int -> AuthenticationProfile -> ShowS
$cshowsPrec :: Int -> AuthenticationProfile -> ShowS
Prelude.Show, forall x. Rep AuthenticationProfile x -> AuthenticationProfile
forall x. AuthenticationProfile -> Rep AuthenticationProfile x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep AuthenticationProfile x -> AuthenticationProfile
$cfrom :: forall x. AuthenticationProfile -> Rep AuthenticationProfile x
Prelude.Generic)

-- |
-- Create a value of 'AuthenticationProfile' 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:
--
-- 'authenticationProfileContent', 'authenticationProfile_authenticationProfileContent' - The content of the authentication profile in JSON format. The maximum
-- length of the JSON string is determined by a quota for your account.
--
-- 'authenticationProfileName', 'authenticationProfile_authenticationProfileName' - The name of the authentication profile.
newAuthenticationProfile ::
  AuthenticationProfile
newAuthenticationProfile :: AuthenticationProfile
newAuthenticationProfile =
  AuthenticationProfile'
    { $sel:authenticationProfileContent:AuthenticationProfile' :: Maybe Text
authenticationProfileContent =
        forall a. Maybe a
Prelude.Nothing,
      $sel:authenticationProfileName:AuthenticationProfile' :: Maybe Text
authenticationProfileName = forall a. Maybe a
Prelude.Nothing
    }

-- | The content of the authentication profile in JSON format. The maximum
-- length of the JSON string is determined by a quota for your account.
authenticationProfile_authenticationProfileContent :: Lens.Lens' AuthenticationProfile (Prelude.Maybe Prelude.Text)
authenticationProfile_authenticationProfileContent :: Lens' AuthenticationProfile (Maybe Text)
authenticationProfile_authenticationProfileContent = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AuthenticationProfile' {Maybe Text
authenticationProfileContent :: Maybe Text
$sel:authenticationProfileContent:AuthenticationProfile' :: AuthenticationProfile -> Maybe Text
authenticationProfileContent} -> Maybe Text
authenticationProfileContent) (\s :: AuthenticationProfile
s@AuthenticationProfile' {} Maybe Text
a -> AuthenticationProfile
s {$sel:authenticationProfileContent:AuthenticationProfile' :: Maybe Text
authenticationProfileContent = Maybe Text
a} :: AuthenticationProfile)

-- | The name of the authentication profile.
authenticationProfile_authenticationProfileName :: Lens.Lens' AuthenticationProfile (Prelude.Maybe Prelude.Text)
authenticationProfile_authenticationProfileName :: Lens' AuthenticationProfile (Maybe Text)
authenticationProfile_authenticationProfileName = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AuthenticationProfile' {Maybe Text
authenticationProfileName :: Maybe Text
$sel:authenticationProfileName:AuthenticationProfile' :: AuthenticationProfile -> Maybe Text
authenticationProfileName} -> Maybe Text
authenticationProfileName) (\s :: AuthenticationProfile
s@AuthenticationProfile' {} Maybe Text
a -> AuthenticationProfile
s {$sel:authenticationProfileName:AuthenticationProfile' :: Maybe Text
authenticationProfileName = Maybe Text
a} :: AuthenticationProfile)

instance Data.FromXML AuthenticationProfile where
  parseXML :: [Node] -> Either String AuthenticationProfile
parseXML [Node]
x =
    Maybe Text -> Maybe Text -> AuthenticationProfile
AuthenticationProfile'
      forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> ([Node]
x forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Data..@? Text
"AuthenticationProfileContent")
      forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ([Node]
x forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Data..@? Text
"AuthenticationProfileName")

instance Prelude.Hashable AuthenticationProfile where
  hashWithSalt :: Int -> AuthenticationProfile -> Int
hashWithSalt Int
_salt AuthenticationProfile' {Maybe Text
authenticationProfileName :: Maybe Text
authenticationProfileContent :: Maybe Text
$sel:authenticationProfileName:AuthenticationProfile' :: AuthenticationProfile -> Maybe Text
$sel:authenticationProfileContent:AuthenticationProfile' :: AuthenticationProfile -> Maybe Text
..} =
    Int
_salt
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
authenticationProfileContent
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
authenticationProfileName

instance Prelude.NFData AuthenticationProfile where
  rnf :: AuthenticationProfile -> ()
rnf AuthenticationProfile' {Maybe Text
authenticationProfileName :: Maybe Text
authenticationProfileContent :: Maybe Text
$sel:authenticationProfileName:AuthenticationProfile' :: AuthenticationProfile -> Maybe Text
$sel:authenticationProfileContent:AuthenticationProfile' :: AuthenticationProfile -> Maybe Text
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
authenticationProfileContent
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
authenticationProfileName