{-# 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.DirectoryService.Types.RadiusSettings
-- 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.DirectoryService.Types.RadiusSettings where

import qualified Amazonka.Core as Core
import Amazonka.DirectoryService.Types.RadiusAuthenticationProtocol
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude

-- | Contains information about a Remote Authentication Dial In User Service
-- (RADIUS) server.
--
-- /See:/ 'newRadiusSettings' smart constructor.
data RadiusSettings = RadiusSettings'
  { -- | Not currently used.
    RadiusSettings -> Maybe Text
displayLabel :: Prelude.Maybe Prelude.Text,
    -- | The maximum number of times that communication with the RADIUS server is
    -- attempted.
    RadiusSettings -> Maybe Natural
radiusRetries :: Prelude.Maybe Prelude.Natural,
    -- | The protocol specified for your RADIUS endpoints.
    RadiusSettings -> Maybe RadiusAuthenticationProtocol
authenticationProtocol :: Prelude.Maybe RadiusAuthenticationProtocol,
    -- | An array of strings that contains the fully qualified domain name (FQDN)
    -- or IP addresses of the RADIUS server endpoints, or the FQDN or IP
    -- addresses of your RADIUS server load balancer.
    RadiusSettings -> Maybe [Text]
radiusServers :: Prelude.Maybe [Prelude.Text],
    -- | Not currently used.
    RadiusSettings -> Maybe Bool
useSameUsername :: Prelude.Maybe Prelude.Bool,
    -- | Required for enabling RADIUS on the directory.
    RadiusSettings -> Maybe (Sensitive Text)
sharedSecret :: Prelude.Maybe (Core.Sensitive Prelude.Text),
    -- | The amount of time, in seconds, to wait for the RADIUS server to
    -- respond.
    RadiusSettings -> Maybe Natural
radiusTimeout :: Prelude.Maybe Prelude.Natural,
    -- | The port that your RADIUS server is using for communications. Your
    -- self-managed network must allow inbound traffic over this port from the
    -- Directory Service servers.
    RadiusSettings -> Maybe Natural
radiusPort :: Prelude.Maybe Prelude.Natural
  }
  deriving (RadiusSettings -> RadiusSettings -> Bool
(RadiusSettings -> RadiusSettings -> Bool)
-> (RadiusSettings -> RadiusSettings -> Bool) -> Eq RadiusSettings
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: RadiusSettings -> RadiusSettings -> Bool
$c/= :: RadiusSettings -> RadiusSettings -> Bool
== :: RadiusSettings -> RadiusSettings -> Bool
$c== :: RadiusSettings -> RadiusSettings -> Bool
Prelude.Eq, Int -> RadiusSettings -> ShowS
[RadiusSettings] -> ShowS
RadiusSettings -> String
(Int -> RadiusSettings -> ShowS)
-> (RadiusSettings -> String)
-> ([RadiusSettings] -> ShowS)
-> Show RadiusSettings
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [RadiusSettings] -> ShowS
$cshowList :: [RadiusSettings] -> ShowS
show :: RadiusSettings -> String
$cshow :: RadiusSettings -> String
showsPrec :: Int -> RadiusSettings -> ShowS
$cshowsPrec :: Int -> RadiusSettings -> ShowS
Prelude.Show, (forall x. RadiusSettings -> Rep RadiusSettings x)
-> (forall x. Rep RadiusSettings x -> RadiusSettings)
-> Generic RadiusSettings
forall x. Rep RadiusSettings x -> RadiusSettings
forall x. RadiusSettings -> Rep RadiusSettings x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep RadiusSettings x -> RadiusSettings
$cfrom :: forall x. RadiusSettings -> Rep RadiusSettings x
Prelude.Generic)

-- |
-- Create a value of 'RadiusSettings' 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:
--
-- 'displayLabel', 'radiusSettings_displayLabel' - Not currently used.
--
-- 'radiusRetries', 'radiusSettings_radiusRetries' - The maximum number of times that communication with the RADIUS server is
-- attempted.
--
-- 'authenticationProtocol', 'radiusSettings_authenticationProtocol' - The protocol specified for your RADIUS endpoints.
--
-- 'radiusServers', 'radiusSettings_radiusServers' - An array of strings that contains the fully qualified domain name (FQDN)
-- or IP addresses of the RADIUS server endpoints, or the FQDN or IP
-- addresses of your RADIUS server load balancer.
--
-- 'useSameUsername', 'radiusSettings_useSameUsername' - Not currently used.
--
-- 'sharedSecret', 'radiusSettings_sharedSecret' - Required for enabling RADIUS on the directory.
--
-- 'radiusTimeout', 'radiusSettings_radiusTimeout' - The amount of time, in seconds, to wait for the RADIUS server to
-- respond.
--
-- 'radiusPort', 'radiusSettings_radiusPort' - The port that your RADIUS server is using for communications. Your
-- self-managed network must allow inbound traffic over this port from the
-- Directory Service servers.
newRadiusSettings ::
  RadiusSettings
newRadiusSettings :: RadiusSettings
newRadiusSettings =
  RadiusSettings' :: Maybe Text
-> Maybe Natural
-> Maybe RadiusAuthenticationProtocol
-> Maybe [Text]
-> Maybe Bool
-> Maybe (Sensitive Text)
-> Maybe Natural
-> Maybe Natural
-> RadiusSettings
RadiusSettings'
    { $sel:displayLabel:RadiusSettings' :: Maybe Text
displayLabel = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:radiusRetries:RadiusSettings' :: Maybe Natural
radiusRetries = Maybe Natural
forall a. Maybe a
Prelude.Nothing,
      $sel:authenticationProtocol:RadiusSettings' :: Maybe RadiusAuthenticationProtocol
authenticationProtocol = Maybe RadiusAuthenticationProtocol
forall a. Maybe a
Prelude.Nothing,
      $sel:radiusServers:RadiusSettings' :: Maybe [Text]
radiusServers = Maybe [Text]
forall a. Maybe a
Prelude.Nothing,
      $sel:useSameUsername:RadiusSettings' :: Maybe Bool
useSameUsername = Maybe Bool
forall a. Maybe a
Prelude.Nothing,
      $sel:sharedSecret:RadiusSettings' :: Maybe (Sensitive Text)
sharedSecret = Maybe (Sensitive Text)
forall a. Maybe a
Prelude.Nothing,
      $sel:radiusTimeout:RadiusSettings' :: Maybe Natural
radiusTimeout = Maybe Natural
forall a. Maybe a
Prelude.Nothing,
      $sel:radiusPort:RadiusSettings' :: Maybe Natural
radiusPort = Maybe Natural
forall a. Maybe a
Prelude.Nothing
    }

-- | Not currently used.
radiusSettings_displayLabel :: Lens.Lens' RadiusSettings (Prelude.Maybe Prelude.Text)
radiusSettings_displayLabel :: (Maybe Text -> f (Maybe Text))
-> RadiusSettings -> f RadiusSettings
radiusSettings_displayLabel = (RadiusSettings -> Maybe Text)
-> (RadiusSettings -> Maybe Text -> RadiusSettings)
-> Lens RadiusSettings RadiusSettings (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\RadiusSettings' {Maybe Text
displayLabel :: Maybe Text
$sel:displayLabel:RadiusSettings' :: RadiusSettings -> Maybe Text
displayLabel} -> Maybe Text
displayLabel) (\s :: RadiusSettings
s@RadiusSettings' {} Maybe Text
a -> RadiusSettings
s {$sel:displayLabel:RadiusSettings' :: Maybe Text
displayLabel = Maybe Text
a} :: RadiusSettings)

-- | The maximum number of times that communication with the RADIUS server is
-- attempted.
radiusSettings_radiusRetries :: Lens.Lens' RadiusSettings (Prelude.Maybe Prelude.Natural)
radiusSettings_radiusRetries :: (Maybe Natural -> f (Maybe Natural))
-> RadiusSettings -> f RadiusSettings
radiusSettings_radiusRetries = (RadiusSettings -> Maybe Natural)
-> (RadiusSettings -> Maybe Natural -> RadiusSettings)
-> Lens
     RadiusSettings RadiusSettings (Maybe Natural) (Maybe Natural)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\RadiusSettings' {Maybe Natural
radiusRetries :: Maybe Natural
$sel:radiusRetries:RadiusSettings' :: RadiusSettings -> Maybe Natural
radiusRetries} -> Maybe Natural
radiusRetries) (\s :: RadiusSettings
s@RadiusSettings' {} Maybe Natural
a -> RadiusSettings
s {$sel:radiusRetries:RadiusSettings' :: Maybe Natural
radiusRetries = Maybe Natural
a} :: RadiusSettings)

-- | The protocol specified for your RADIUS endpoints.
radiusSettings_authenticationProtocol :: Lens.Lens' RadiusSettings (Prelude.Maybe RadiusAuthenticationProtocol)
radiusSettings_authenticationProtocol :: (Maybe RadiusAuthenticationProtocol
 -> f (Maybe RadiusAuthenticationProtocol))
-> RadiusSettings -> f RadiusSettings
radiusSettings_authenticationProtocol = (RadiusSettings -> Maybe RadiusAuthenticationProtocol)
-> (RadiusSettings
    -> Maybe RadiusAuthenticationProtocol -> RadiusSettings)
-> Lens
     RadiusSettings
     RadiusSettings
     (Maybe RadiusAuthenticationProtocol)
     (Maybe RadiusAuthenticationProtocol)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\RadiusSettings' {Maybe RadiusAuthenticationProtocol
authenticationProtocol :: Maybe RadiusAuthenticationProtocol
$sel:authenticationProtocol:RadiusSettings' :: RadiusSettings -> Maybe RadiusAuthenticationProtocol
authenticationProtocol} -> Maybe RadiusAuthenticationProtocol
authenticationProtocol) (\s :: RadiusSettings
s@RadiusSettings' {} Maybe RadiusAuthenticationProtocol
a -> RadiusSettings
s {$sel:authenticationProtocol:RadiusSettings' :: Maybe RadiusAuthenticationProtocol
authenticationProtocol = Maybe RadiusAuthenticationProtocol
a} :: RadiusSettings)

-- | An array of strings that contains the fully qualified domain name (FQDN)
-- or IP addresses of the RADIUS server endpoints, or the FQDN or IP
-- addresses of your RADIUS server load balancer.
radiusSettings_radiusServers :: Lens.Lens' RadiusSettings (Prelude.Maybe [Prelude.Text])
radiusSettings_radiusServers :: (Maybe [Text] -> f (Maybe [Text]))
-> RadiusSettings -> f RadiusSettings
radiusSettings_radiusServers = (RadiusSettings -> Maybe [Text])
-> (RadiusSettings -> Maybe [Text] -> RadiusSettings)
-> Lens RadiusSettings RadiusSettings (Maybe [Text]) (Maybe [Text])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\RadiusSettings' {Maybe [Text]
radiusServers :: Maybe [Text]
$sel:radiusServers:RadiusSettings' :: RadiusSettings -> Maybe [Text]
radiusServers} -> Maybe [Text]
radiusServers) (\s :: RadiusSettings
s@RadiusSettings' {} Maybe [Text]
a -> RadiusSettings
s {$sel:radiusServers:RadiusSettings' :: Maybe [Text]
radiusServers = Maybe [Text]
a} :: RadiusSettings) ((Maybe [Text] -> f (Maybe [Text]))
 -> RadiusSettings -> f RadiusSettings)
-> ((Maybe [Text] -> f (Maybe [Text]))
    -> Maybe [Text] -> f (Maybe [Text]))
-> (Maybe [Text] -> f (Maybe [Text]))
-> RadiusSettings
-> f RadiusSettings
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso [Text] [Text] [Text] [Text]
-> Iso (Maybe [Text]) (Maybe [Text]) (Maybe [Text]) (Maybe [Text])
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 [Text] [Text] [Text] [Text]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | Not currently used.
radiusSettings_useSameUsername :: Lens.Lens' RadiusSettings (Prelude.Maybe Prelude.Bool)
radiusSettings_useSameUsername :: (Maybe Bool -> f (Maybe Bool))
-> RadiusSettings -> f RadiusSettings
radiusSettings_useSameUsername = (RadiusSettings -> Maybe Bool)
-> (RadiusSettings -> Maybe Bool -> RadiusSettings)
-> Lens RadiusSettings RadiusSettings (Maybe Bool) (Maybe Bool)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\RadiusSettings' {Maybe Bool
useSameUsername :: Maybe Bool
$sel:useSameUsername:RadiusSettings' :: RadiusSettings -> Maybe Bool
useSameUsername} -> Maybe Bool
useSameUsername) (\s :: RadiusSettings
s@RadiusSettings' {} Maybe Bool
a -> RadiusSettings
s {$sel:useSameUsername:RadiusSettings' :: Maybe Bool
useSameUsername = Maybe Bool
a} :: RadiusSettings)

-- | Required for enabling RADIUS on the directory.
radiusSettings_sharedSecret :: Lens.Lens' RadiusSettings (Prelude.Maybe Prelude.Text)
radiusSettings_sharedSecret :: (Maybe Text -> f (Maybe Text))
-> RadiusSettings -> f RadiusSettings
radiusSettings_sharedSecret = (RadiusSettings -> Maybe (Sensitive Text))
-> (RadiusSettings -> Maybe (Sensitive Text) -> RadiusSettings)
-> Lens
     RadiusSettings
     RadiusSettings
     (Maybe (Sensitive Text))
     (Maybe (Sensitive Text))
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\RadiusSettings' {Maybe (Sensitive Text)
sharedSecret :: Maybe (Sensitive Text)
$sel:sharedSecret:RadiusSettings' :: RadiusSettings -> Maybe (Sensitive Text)
sharedSecret} -> Maybe (Sensitive Text)
sharedSecret) (\s :: RadiusSettings
s@RadiusSettings' {} Maybe (Sensitive Text)
a -> RadiusSettings
s {$sel:sharedSecret:RadiusSettings' :: Maybe (Sensitive Text)
sharedSecret = Maybe (Sensitive Text)
a} :: RadiusSettings) ((Maybe (Sensitive Text) -> f (Maybe (Sensitive Text)))
 -> RadiusSettings -> f RadiusSettings)
-> ((Maybe Text -> f (Maybe Text))
    -> Maybe (Sensitive Text) -> f (Maybe (Sensitive Text)))
-> (Maybe Text -> f (Maybe Text))
-> RadiusSettings
-> f RadiusSettings
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso (Sensitive Text) (Sensitive Text) Text Text
-> Iso
     (Maybe (Sensitive Text))
     (Maybe (Sensitive Text))
     (Maybe Text)
     (Maybe Text)
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 (Sensitive Text) (Sensitive Text) Text Text
forall a. Iso' (Sensitive a) a
Core._Sensitive

-- | The amount of time, in seconds, to wait for the RADIUS server to
-- respond.
radiusSettings_radiusTimeout :: Lens.Lens' RadiusSettings (Prelude.Maybe Prelude.Natural)
radiusSettings_radiusTimeout :: (Maybe Natural -> f (Maybe Natural))
-> RadiusSettings -> f RadiusSettings
radiusSettings_radiusTimeout = (RadiusSettings -> Maybe Natural)
-> (RadiusSettings -> Maybe Natural -> RadiusSettings)
-> Lens
     RadiusSettings RadiusSettings (Maybe Natural) (Maybe Natural)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\RadiusSettings' {Maybe Natural
radiusTimeout :: Maybe Natural
$sel:radiusTimeout:RadiusSettings' :: RadiusSettings -> Maybe Natural
radiusTimeout} -> Maybe Natural
radiusTimeout) (\s :: RadiusSettings
s@RadiusSettings' {} Maybe Natural
a -> RadiusSettings
s {$sel:radiusTimeout:RadiusSettings' :: Maybe Natural
radiusTimeout = Maybe Natural
a} :: RadiusSettings)

-- | The port that your RADIUS server is using for communications. Your
-- self-managed network must allow inbound traffic over this port from the
-- Directory Service servers.
radiusSettings_radiusPort :: Lens.Lens' RadiusSettings (Prelude.Maybe Prelude.Natural)
radiusSettings_radiusPort :: (Maybe Natural -> f (Maybe Natural))
-> RadiusSettings -> f RadiusSettings
radiusSettings_radiusPort = (RadiusSettings -> Maybe Natural)
-> (RadiusSettings -> Maybe Natural -> RadiusSettings)
-> Lens
     RadiusSettings RadiusSettings (Maybe Natural) (Maybe Natural)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\RadiusSettings' {Maybe Natural
radiusPort :: Maybe Natural
$sel:radiusPort:RadiusSettings' :: RadiusSettings -> Maybe Natural
radiusPort} -> Maybe Natural
radiusPort) (\s :: RadiusSettings
s@RadiusSettings' {} Maybe Natural
a -> RadiusSettings
s {$sel:radiusPort:RadiusSettings' :: Maybe Natural
radiusPort = Maybe Natural
a} :: RadiusSettings)

instance Core.FromJSON RadiusSettings where
  parseJSON :: Value -> Parser RadiusSettings
parseJSON =
    String
-> (Object -> Parser RadiusSettings)
-> Value
-> Parser RadiusSettings
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
      String
"RadiusSettings"
      ( \Object
x ->
          Maybe Text
-> Maybe Natural
-> Maybe RadiusAuthenticationProtocol
-> Maybe [Text]
-> Maybe Bool
-> Maybe (Sensitive Text)
-> Maybe Natural
-> Maybe Natural
-> RadiusSettings
RadiusSettings'
            (Maybe Text
 -> Maybe Natural
 -> Maybe RadiusAuthenticationProtocol
 -> Maybe [Text]
 -> Maybe Bool
 -> Maybe (Sensitive Text)
 -> Maybe Natural
 -> Maybe Natural
 -> RadiusSettings)
-> Parser (Maybe Text)
-> Parser
     (Maybe Natural
      -> Maybe RadiusAuthenticationProtocol
      -> Maybe [Text]
      -> Maybe Bool
      -> Maybe (Sensitive Text)
      -> Maybe Natural
      -> Maybe Natural
      -> RadiusSettings)
forall (f :: * -> *) a b. Functor 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
"DisplayLabel")
            Parser
  (Maybe Natural
   -> Maybe RadiusAuthenticationProtocol
   -> Maybe [Text]
   -> Maybe Bool
   -> Maybe (Sensitive Text)
   -> Maybe Natural
   -> Maybe Natural
   -> RadiusSettings)
-> Parser (Maybe Natural)
-> Parser
     (Maybe RadiusAuthenticationProtocol
      -> Maybe [Text]
      -> Maybe Bool
      -> Maybe (Sensitive Text)
      -> Maybe Natural
      -> Maybe Natural
      -> RadiusSettings)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Natural)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"RadiusRetries")
            Parser
  (Maybe RadiusAuthenticationProtocol
   -> Maybe [Text]
   -> Maybe Bool
   -> Maybe (Sensitive Text)
   -> Maybe Natural
   -> Maybe Natural
   -> RadiusSettings)
-> Parser (Maybe RadiusAuthenticationProtocol)
-> Parser
     (Maybe [Text]
      -> Maybe Bool
      -> Maybe (Sensitive Text)
      -> Maybe Natural
      -> Maybe Natural
      -> RadiusSettings)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe RadiusAuthenticationProtocol)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"AuthenticationProtocol")
            Parser
  (Maybe [Text]
   -> Maybe Bool
   -> Maybe (Sensitive Text)
   -> Maybe Natural
   -> Maybe Natural
   -> RadiusSettings)
-> Parser (Maybe [Text])
-> Parser
     (Maybe Bool
      -> Maybe (Sensitive Text)
      -> Maybe Natural
      -> Maybe Natural
      -> RadiusSettings)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe (Maybe [Text]))
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"RadiusServers" Parser (Maybe (Maybe [Text]))
-> Maybe [Text] -> Parser (Maybe [Text])
forall a. Parser (Maybe a) -> a -> Parser a
Core..!= Maybe [Text]
forall a. Monoid a => a
Prelude.mempty)
            Parser
  (Maybe Bool
   -> Maybe (Sensitive Text)
   -> Maybe Natural
   -> Maybe Natural
   -> RadiusSettings)
-> Parser (Maybe Bool)
-> Parser
     (Maybe (Sensitive Text)
      -> Maybe Natural -> Maybe Natural -> RadiusSettings)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Bool)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"UseSameUsername")
            Parser
  (Maybe (Sensitive Text)
   -> Maybe Natural -> Maybe Natural -> RadiusSettings)
-> Parser (Maybe (Sensitive Text))
-> Parser (Maybe Natural -> Maybe Natural -> RadiusSettings)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe (Sensitive Text))
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"SharedSecret")
            Parser (Maybe Natural -> Maybe Natural -> RadiusSettings)
-> Parser (Maybe Natural)
-> Parser (Maybe Natural -> RadiusSettings)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Natural)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"RadiusTimeout")
            Parser (Maybe Natural -> RadiusSettings)
-> Parser (Maybe Natural) -> Parser RadiusSettings
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Natural)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"RadiusPort")
      )

instance Prelude.Hashable RadiusSettings

instance Prelude.NFData RadiusSettings

instance Core.ToJSON RadiusSettings where
  toJSON :: RadiusSettings -> Value
toJSON RadiusSettings' {Maybe Bool
Maybe Natural
Maybe [Text]
Maybe Text
Maybe (Sensitive Text)
Maybe RadiusAuthenticationProtocol
radiusPort :: Maybe Natural
radiusTimeout :: Maybe Natural
sharedSecret :: Maybe (Sensitive Text)
useSameUsername :: Maybe Bool
radiusServers :: Maybe [Text]
authenticationProtocol :: Maybe RadiusAuthenticationProtocol
radiusRetries :: Maybe Natural
displayLabel :: Maybe Text
$sel:radiusPort:RadiusSettings' :: RadiusSettings -> Maybe Natural
$sel:radiusTimeout:RadiusSettings' :: RadiusSettings -> Maybe Natural
$sel:sharedSecret:RadiusSettings' :: RadiusSettings -> Maybe (Sensitive Text)
$sel:useSameUsername:RadiusSettings' :: RadiusSettings -> Maybe Bool
$sel:radiusServers:RadiusSettings' :: RadiusSettings -> Maybe [Text]
$sel:authenticationProtocol:RadiusSettings' :: RadiusSettings -> Maybe RadiusAuthenticationProtocol
$sel:radiusRetries:RadiusSettings' :: RadiusSettings -> Maybe Natural
$sel:displayLabel:RadiusSettings' :: RadiusSettings -> Maybe Text
..} =
    [Pair] -> Value
Core.object
      ( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ (Text
"DisplayLabel" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (Text -> Pair) -> Maybe Text -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
displayLabel,
            (Text
"RadiusRetries" Text -> Natural -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (Natural -> Pair) -> Maybe Natural -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Natural
radiusRetries,
            (Text
"AuthenticationProtocol" Text -> RadiusAuthenticationProtocol -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
              (RadiusAuthenticationProtocol -> Pair)
-> Maybe RadiusAuthenticationProtocol -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe RadiusAuthenticationProtocol
authenticationProtocol,
            (Text
"RadiusServers" Text -> [Text] -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) ([Text] -> Pair) -> Maybe [Text] -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe [Text]
radiusServers,
            (Text
"UseSameUsername" Text -> Bool -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
              (Bool -> Pair) -> Maybe Bool -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Bool
useSameUsername,
            (Text
"SharedSecret" Text -> Sensitive Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (Sensitive Text -> Pair) -> Maybe (Sensitive Text) -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe (Sensitive Text)
sharedSecret,
            (Text
"RadiusTimeout" Text -> Natural -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (Natural -> Pair) -> Maybe Natural -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Natural
radiusTimeout,
            (Text
"RadiusPort" Text -> Natural -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (Natural -> Pair) -> Maybe Natural -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Natural
radiusPort
          ]
      )