{-# 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.ClientLoginBannerOptions
-- 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.ClientLoginBannerOptions 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

-- | Options for enabling a customizable text banner that will be displayed
-- on Amazon Web Services provided clients when a VPN session is
-- established.
--
-- /See:/ 'newClientLoginBannerOptions' smart constructor.
data ClientLoginBannerOptions = ClientLoginBannerOptions'
  { -- | 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.
    ClientLoginBannerOptions -> Maybe Text
bannerText :: Prelude.Maybe Prelude.Text,
    -- | Enable or disable a customizable text banner that will be displayed on
    -- Amazon Web Services provided clients when a VPN session is established.
    --
    -- Valid values: @true | false@
    --
    -- Default value: @false@
    ClientLoginBannerOptions -> Maybe Bool
enabled :: Prelude.Maybe Prelude.Bool
  }
  deriving (ClientLoginBannerOptions -> ClientLoginBannerOptions -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ClientLoginBannerOptions -> ClientLoginBannerOptions -> Bool
$c/= :: ClientLoginBannerOptions -> ClientLoginBannerOptions -> Bool
== :: ClientLoginBannerOptions -> ClientLoginBannerOptions -> Bool
$c== :: ClientLoginBannerOptions -> ClientLoginBannerOptions -> Bool
Prelude.Eq, ReadPrec [ClientLoginBannerOptions]
ReadPrec ClientLoginBannerOptions
Int -> ReadS ClientLoginBannerOptions
ReadS [ClientLoginBannerOptions]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ClientLoginBannerOptions]
$creadListPrec :: ReadPrec [ClientLoginBannerOptions]
readPrec :: ReadPrec ClientLoginBannerOptions
$creadPrec :: ReadPrec ClientLoginBannerOptions
readList :: ReadS [ClientLoginBannerOptions]
$creadList :: ReadS [ClientLoginBannerOptions]
readsPrec :: Int -> ReadS ClientLoginBannerOptions
$creadsPrec :: Int -> ReadS ClientLoginBannerOptions
Prelude.Read, Int -> ClientLoginBannerOptions -> ShowS
[ClientLoginBannerOptions] -> ShowS
ClientLoginBannerOptions -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ClientLoginBannerOptions] -> ShowS
$cshowList :: [ClientLoginBannerOptions] -> ShowS
show :: ClientLoginBannerOptions -> String
$cshow :: ClientLoginBannerOptions -> String
showsPrec :: Int -> ClientLoginBannerOptions -> ShowS
$cshowsPrec :: Int -> ClientLoginBannerOptions -> ShowS
Prelude.Show, forall x.
Rep ClientLoginBannerOptions x -> ClientLoginBannerOptions
forall x.
ClientLoginBannerOptions -> Rep ClientLoginBannerOptions x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep ClientLoginBannerOptions x -> ClientLoginBannerOptions
$cfrom :: forall x.
ClientLoginBannerOptions -> Rep ClientLoginBannerOptions x
Prelude.Generic)

-- |
-- Create a value of 'ClientLoginBannerOptions' 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', 'clientLoginBannerOptions_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', 'clientLoginBannerOptions_enabled' - Enable or disable a customizable text banner that will be displayed on
-- Amazon Web Services provided clients when a VPN session is established.
--
-- Valid values: @true | false@
--
-- Default value: @false@
newClientLoginBannerOptions ::
  ClientLoginBannerOptions
newClientLoginBannerOptions :: ClientLoginBannerOptions
newClientLoginBannerOptions =
  ClientLoginBannerOptions'
    { $sel:bannerText:ClientLoginBannerOptions' :: Maybe Text
bannerText =
        forall a. Maybe a
Prelude.Nothing,
      $sel:enabled:ClientLoginBannerOptions' :: 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.
clientLoginBannerOptions_bannerText :: Lens.Lens' ClientLoginBannerOptions (Prelude.Maybe Prelude.Text)
clientLoginBannerOptions_bannerText :: Lens' ClientLoginBannerOptions (Maybe Text)
clientLoginBannerOptions_bannerText = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ClientLoginBannerOptions' {Maybe Text
bannerText :: Maybe Text
$sel:bannerText:ClientLoginBannerOptions' :: ClientLoginBannerOptions -> Maybe Text
bannerText} -> Maybe Text
bannerText) (\s :: ClientLoginBannerOptions
s@ClientLoginBannerOptions' {} Maybe Text
a -> ClientLoginBannerOptions
s {$sel:bannerText:ClientLoginBannerOptions' :: Maybe Text
bannerText = Maybe Text
a} :: ClientLoginBannerOptions)

-- | Enable or disable a customizable text banner that will be displayed on
-- Amazon Web Services provided clients when a VPN session is established.
--
-- Valid values: @true | false@
--
-- Default value: @false@
clientLoginBannerOptions_enabled :: Lens.Lens' ClientLoginBannerOptions (Prelude.Maybe Prelude.Bool)
clientLoginBannerOptions_enabled :: Lens' ClientLoginBannerOptions (Maybe Bool)
clientLoginBannerOptions_enabled = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ClientLoginBannerOptions' {Maybe Bool
enabled :: Maybe Bool
$sel:enabled:ClientLoginBannerOptions' :: ClientLoginBannerOptions -> Maybe Bool
enabled} -> Maybe Bool
enabled) (\s :: ClientLoginBannerOptions
s@ClientLoginBannerOptions' {} Maybe Bool
a -> ClientLoginBannerOptions
s {$sel:enabled:ClientLoginBannerOptions' :: Maybe Bool
enabled = Maybe Bool
a} :: ClientLoginBannerOptions)

instance Prelude.Hashable ClientLoginBannerOptions where
  hashWithSalt :: Int -> ClientLoginBannerOptions -> Int
hashWithSalt Int
_salt ClientLoginBannerOptions' {Maybe Bool
Maybe Text
enabled :: Maybe Bool
bannerText :: Maybe Text
$sel:enabled:ClientLoginBannerOptions' :: ClientLoginBannerOptions -> Maybe Bool
$sel:bannerText:ClientLoginBannerOptions' :: ClientLoginBannerOptions -> 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 ClientLoginBannerOptions where
  rnf :: ClientLoginBannerOptions -> ()
rnf ClientLoginBannerOptions' {Maybe Bool
Maybe Text
enabled :: Maybe Bool
bannerText :: Maybe Text
$sel:enabled:ClientLoginBannerOptions' :: ClientLoginBannerOptions -> Maybe Bool
$sel:bannerText:ClientLoginBannerOptions' :: ClientLoginBannerOptions -> 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

instance Data.ToQuery ClientLoginBannerOptions where
  toQuery :: ClientLoginBannerOptions -> QueryString
toQuery ClientLoginBannerOptions' {Maybe Bool
Maybe Text
enabled :: Maybe Bool
bannerText :: Maybe Text
$sel:enabled:ClientLoginBannerOptions' :: ClientLoginBannerOptions -> Maybe Bool
$sel:bannerText:ClientLoginBannerOptions' :: ClientLoginBannerOptions -> Maybe Text
..} =
    forall a. Monoid a => [a] -> a
Prelude.mconcat
      [ ByteString
"BannerText" forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: Maybe Text
bannerText,
        ByteString
"Enabled" forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: Maybe Bool
enabled
      ]