{-# 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.EC2.Types.ClientLoginBannerResponseOptions
-- 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.EC2.Types.ClientLoginBannerResponseOptions where

import qualified Amazonka.Core as Core
import qualified Amazonka.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
import Amazonka.EC2.Internal
import qualified Amazonka.Prelude as Prelude

-- | Current state of options for customizable text banner that will be
-- displayed on Amazon Web Services provided clients when a VPN session is
-- established.
--
-- /See:/ 'newClientLoginBannerResponseOptions' smart constructor.
data ClientLoginBannerResponseOptions = ClientLoginBannerResponseOptions'
  { -- | Customizable text that will be displayed in a banner on Amazon Web
    -- Services provided clients when a VPN session is established. UTF-8
    -- encoded characters only. Maximum of 1400 characters.
    ClientLoginBannerResponseOptions -> Maybe Text
bannerText :: Prelude.Maybe Prelude.Text,
    -- | Current state of text banner feature.
    --
    -- Valid values: @true | false@
    ClientLoginBannerResponseOptions -> Maybe Bool
enabled :: Prelude.Maybe Prelude.Bool
  }
  deriving (ClientLoginBannerResponseOptions
-> ClientLoginBannerResponseOptions -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ClientLoginBannerResponseOptions
-> ClientLoginBannerResponseOptions -> Bool
$c/= :: ClientLoginBannerResponseOptions
-> ClientLoginBannerResponseOptions -> Bool
== :: ClientLoginBannerResponseOptions
-> ClientLoginBannerResponseOptions -> Bool
$c== :: ClientLoginBannerResponseOptions
-> ClientLoginBannerResponseOptions -> Bool
Prelude.Eq, ReadPrec [ClientLoginBannerResponseOptions]
ReadPrec ClientLoginBannerResponseOptions
Int -> ReadS ClientLoginBannerResponseOptions
ReadS [ClientLoginBannerResponseOptions]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ClientLoginBannerResponseOptions]
$creadListPrec :: ReadPrec [ClientLoginBannerResponseOptions]
readPrec :: ReadPrec ClientLoginBannerResponseOptions
$creadPrec :: ReadPrec ClientLoginBannerResponseOptions
readList :: ReadS [ClientLoginBannerResponseOptions]
$creadList :: ReadS [ClientLoginBannerResponseOptions]
readsPrec :: Int -> ReadS ClientLoginBannerResponseOptions
$creadsPrec :: Int -> ReadS ClientLoginBannerResponseOptions
Prelude.Read, Int -> ClientLoginBannerResponseOptions -> ShowS
[ClientLoginBannerResponseOptions] -> ShowS
ClientLoginBannerResponseOptions -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ClientLoginBannerResponseOptions] -> ShowS
$cshowList :: [ClientLoginBannerResponseOptions] -> ShowS
show :: ClientLoginBannerResponseOptions -> String
$cshow :: ClientLoginBannerResponseOptions -> String
showsPrec :: Int -> ClientLoginBannerResponseOptions -> ShowS
$cshowsPrec :: Int -> ClientLoginBannerResponseOptions -> ShowS
Prelude.Show, forall x.
Rep ClientLoginBannerResponseOptions x
-> ClientLoginBannerResponseOptions
forall x.
ClientLoginBannerResponseOptions
-> Rep ClientLoginBannerResponseOptions x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep ClientLoginBannerResponseOptions x
-> ClientLoginBannerResponseOptions
$cfrom :: forall x.
ClientLoginBannerResponseOptions
-> Rep ClientLoginBannerResponseOptions x
Prelude.Generic)

-- |
-- Create a value of 'ClientLoginBannerResponseOptions' 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:
--
-- 'bannerText', 'clientLoginBannerResponseOptions_bannerText' - Customizable text that will be displayed in a banner on Amazon Web
-- Services provided clients when a VPN session is established. UTF-8
-- encoded characters only. Maximum of 1400 characters.
--
-- 'enabled', 'clientLoginBannerResponseOptions_enabled' - Current state of text banner feature.
--
-- Valid values: @true | false@
newClientLoginBannerResponseOptions ::
  ClientLoginBannerResponseOptions
newClientLoginBannerResponseOptions :: ClientLoginBannerResponseOptions
newClientLoginBannerResponseOptions =
  ClientLoginBannerResponseOptions'
    { $sel:bannerText:ClientLoginBannerResponseOptions' :: Maybe Text
bannerText =
        forall a. Maybe a
Prelude.Nothing,
      $sel:enabled:ClientLoginBannerResponseOptions' :: Maybe Bool
enabled = forall a. Maybe a
Prelude.Nothing
    }

-- | Customizable text that will be displayed in a banner on Amazon Web
-- Services provided clients when a VPN session is established. UTF-8
-- encoded characters only. Maximum of 1400 characters.
clientLoginBannerResponseOptions_bannerText :: Lens.Lens' ClientLoginBannerResponseOptions (Prelude.Maybe Prelude.Text)
clientLoginBannerResponseOptions_bannerText :: Lens' ClientLoginBannerResponseOptions (Maybe Text)
clientLoginBannerResponseOptions_bannerText = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ClientLoginBannerResponseOptions' {Maybe Text
bannerText :: Maybe Text
$sel:bannerText:ClientLoginBannerResponseOptions' :: ClientLoginBannerResponseOptions -> Maybe Text
bannerText} -> Maybe Text
bannerText) (\s :: ClientLoginBannerResponseOptions
s@ClientLoginBannerResponseOptions' {} Maybe Text
a -> ClientLoginBannerResponseOptions
s {$sel:bannerText:ClientLoginBannerResponseOptions' :: Maybe Text
bannerText = Maybe Text
a} :: ClientLoginBannerResponseOptions)

-- | Current state of text banner feature.
--
-- Valid values: @true | false@
clientLoginBannerResponseOptions_enabled :: Lens.Lens' ClientLoginBannerResponseOptions (Prelude.Maybe Prelude.Bool)
clientLoginBannerResponseOptions_enabled :: Lens' ClientLoginBannerResponseOptions (Maybe Bool)
clientLoginBannerResponseOptions_enabled = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ClientLoginBannerResponseOptions' {Maybe Bool
enabled :: Maybe Bool
$sel:enabled:ClientLoginBannerResponseOptions' :: ClientLoginBannerResponseOptions -> Maybe Bool
enabled} -> Maybe Bool
enabled) (\s :: ClientLoginBannerResponseOptions
s@ClientLoginBannerResponseOptions' {} Maybe Bool
a -> ClientLoginBannerResponseOptions
s {$sel:enabled:ClientLoginBannerResponseOptions' :: Maybe Bool
enabled = Maybe Bool
a} :: ClientLoginBannerResponseOptions)

instance
  Data.FromXML
    ClientLoginBannerResponseOptions
  where
  parseXML :: [Node] -> Either String ClientLoginBannerResponseOptions
parseXML [Node]
x =
    Maybe Text -> Maybe Bool -> ClientLoginBannerResponseOptions
ClientLoginBannerResponseOptions'
      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
"bannerText")
      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
"enabled")

instance
  Prelude.Hashable
    ClientLoginBannerResponseOptions
  where
  hashWithSalt :: Int -> ClientLoginBannerResponseOptions -> Int
hashWithSalt
    Int
_salt
    ClientLoginBannerResponseOptions' {Maybe Bool
Maybe Text
enabled :: Maybe Bool
bannerText :: Maybe Text
$sel:enabled:ClientLoginBannerResponseOptions' :: ClientLoginBannerResponseOptions -> Maybe Bool
$sel:bannerText:ClientLoginBannerResponseOptions' :: ClientLoginBannerResponseOptions -> Maybe Text
..} =
      Int
_salt
        forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
bannerText
        forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Bool
enabled

instance
  Prelude.NFData
    ClientLoginBannerResponseOptions
  where
  rnf :: ClientLoginBannerResponseOptions -> ()
rnf ClientLoginBannerResponseOptions' {Maybe Bool
Maybe Text
enabled :: Maybe Bool
bannerText :: Maybe Text
$sel:enabled:ClientLoginBannerResponseOptions' :: ClientLoginBannerResponseOptions -> Maybe Bool
$sel:bannerText:ClientLoginBannerResponseOptions' :: ClientLoginBannerResponseOptions -> Maybe Text
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
bannerText
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Bool
enabled