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

import qualified Amazonka.Core as Core
import Amazonka.DirectoryService.Types.DirectoryVpcSettingsDescription
import Amazonka.DirectoryService.Types.RadiusSettings
import Amazonka.DirectoryService.Types.RadiusStatus
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude

-- | Describes the directory owner account details that have been shared to
-- the directory consumer account.
--
-- /See:/ 'newOwnerDirectoryDescription' smart constructor.
data OwnerDirectoryDescription = OwnerDirectoryDescription'
  { -- | Information about the status of the RADIUS server.
    OwnerDirectoryDescription -> Maybe RadiusStatus
radiusStatus :: Prelude.Maybe RadiusStatus,
    -- | Identifier of the Managed Microsoft AD directory in the directory owner
    -- account.
    OwnerDirectoryDescription -> Maybe Text
directoryId :: Prelude.Maybe Prelude.Text,
    -- | A RadiusSettings object that contains information about the RADIUS
    -- server.
    OwnerDirectoryDescription -> Maybe RadiusSettings
radiusSettings :: Prelude.Maybe RadiusSettings,
    -- | Identifier of the directory owner account.
    OwnerDirectoryDescription -> Maybe Text
accountId :: Prelude.Maybe Prelude.Text,
    -- | IP address of the directory’s domain controllers.
    OwnerDirectoryDescription -> Maybe [Text]
dnsIpAddrs :: Prelude.Maybe [Prelude.Text],
    -- | Information about the VPC settings for the directory.
    OwnerDirectoryDescription -> Maybe DirectoryVpcSettingsDescription
vpcSettings :: Prelude.Maybe DirectoryVpcSettingsDescription
  }
  deriving (OwnerDirectoryDescription -> OwnerDirectoryDescription -> Bool
(OwnerDirectoryDescription -> OwnerDirectoryDescription -> Bool)
-> (OwnerDirectoryDescription -> OwnerDirectoryDescription -> Bool)
-> Eq OwnerDirectoryDescription
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: OwnerDirectoryDescription -> OwnerDirectoryDescription -> Bool
$c/= :: OwnerDirectoryDescription -> OwnerDirectoryDescription -> Bool
== :: OwnerDirectoryDescription -> OwnerDirectoryDescription -> Bool
$c== :: OwnerDirectoryDescription -> OwnerDirectoryDescription -> Bool
Prelude.Eq, Int -> OwnerDirectoryDescription -> ShowS
[OwnerDirectoryDescription] -> ShowS
OwnerDirectoryDescription -> String
(Int -> OwnerDirectoryDescription -> ShowS)
-> (OwnerDirectoryDescription -> String)
-> ([OwnerDirectoryDescription] -> ShowS)
-> Show OwnerDirectoryDescription
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [OwnerDirectoryDescription] -> ShowS
$cshowList :: [OwnerDirectoryDescription] -> ShowS
show :: OwnerDirectoryDescription -> String
$cshow :: OwnerDirectoryDescription -> String
showsPrec :: Int -> OwnerDirectoryDescription -> ShowS
$cshowsPrec :: Int -> OwnerDirectoryDescription -> ShowS
Prelude.Show, (forall x.
 OwnerDirectoryDescription -> Rep OwnerDirectoryDescription x)
-> (forall x.
    Rep OwnerDirectoryDescription x -> OwnerDirectoryDescription)
-> Generic OwnerDirectoryDescription
forall x.
Rep OwnerDirectoryDescription x -> OwnerDirectoryDescription
forall x.
OwnerDirectoryDescription -> Rep OwnerDirectoryDescription x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep OwnerDirectoryDescription x -> OwnerDirectoryDescription
$cfrom :: forall x.
OwnerDirectoryDescription -> Rep OwnerDirectoryDescription x
Prelude.Generic)

-- |
-- Create a value of 'OwnerDirectoryDescription' 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:
--
-- 'radiusStatus', 'ownerDirectoryDescription_radiusStatus' - Information about the status of the RADIUS server.
--
-- 'directoryId', 'ownerDirectoryDescription_directoryId' - Identifier of the Managed Microsoft AD directory in the directory owner
-- account.
--
-- 'radiusSettings', 'ownerDirectoryDescription_radiusSettings' - A RadiusSettings object that contains information about the RADIUS
-- server.
--
-- 'accountId', 'ownerDirectoryDescription_accountId' - Identifier of the directory owner account.
--
-- 'dnsIpAddrs', 'ownerDirectoryDescription_dnsIpAddrs' - IP address of the directory’s domain controllers.
--
-- 'vpcSettings', 'ownerDirectoryDescription_vpcSettings' - Information about the VPC settings for the directory.
newOwnerDirectoryDescription ::
  OwnerDirectoryDescription
newOwnerDirectoryDescription :: OwnerDirectoryDescription
newOwnerDirectoryDescription =
  OwnerDirectoryDescription' :: Maybe RadiusStatus
-> Maybe Text
-> Maybe RadiusSettings
-> Maybe Text
-> Maybe [Text]
-> Maybe DirectoryVpcSettingsDescription
-> OwnerDirectoryDescription
OwnerDirectoryDescription'
    { $sel:radiusStatus:OwnerDirectoryDescription' :: Maybe RadiusStatus
radiusStatus =
        Maybe RadiusStatus
forall a. Maybe a
Prelude.Nothing,
      $sel:directoryId:OwnerDirectoryDescription' :: Maybe Text
directoryId = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:radiusSettings:OwnerDirectoryDescription' :: Maybe RadiusSettings
radiusSettings = Maybe RadiusSettings
forall a. Maybe a
Prelude.Nothing,
      $sel:accountId:OwnerDirectoryDescription' :: Maybe Text
accountId = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:dnsIpAddrs:OwnerDirectoryDescription' :: Maybe [Text]
dnsIpAddrs = Maybe [Text]
forall a. Maybe a
Prelude.Nothing,
      $sel:vpcSettings:OwnerDirectoryDescription' :: Maybe DirectoryVpcSettingsDescription
vpcSettings = Maybe DirectoryVpcSettingsDescription
forall a. Maybe a
Prelude.Nothing
    }

-- | Information about the status of the RADIUS server.
ownerDirectoryDescription_radiusStatus :: Lens.Lens' OwnerDirectoryDescription (Prelude.Maybe RadiusStatus)
ownerDirectoryDescription_radiusStatus :: (Maybe RadiusStatus -> f (Maybe RadiusStatus))
-> OwnerDirectoryDescription -> f OwnerDirectoryDescription
ownerDirectoryDescription_radiusStatus = (OwnerDirectoryDescription -> Maybe RadiusStatus)
-> (OwnerDirectoryDescription
    -> Maybe RadiusStatus -> OwnerDirectoryDescription)
-> Lens
     OwnerDirectoryDescription
     OwnerDirectoryDescription
     (Maybe RadiusStatus)
     (Maybe RadiusStatus)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\OwnerDirectoryDescription' {Maybe RadiusStatus
radiusStatus :: Maybe RadiusStatus
$sel:radiusStatus:OwnerDirectoryDescription' :: OwnerDirectoryDescription -> Maybe RadiusStatus
radiusStatus} -> Maybe RadiusStatus
radiusStatus) (\s :: OwnerDirectoryDescription
s@OwnerDirectoryDescription' {} Maybe RadiusStatus
a -> OwnerDirectoryDescription
s {$sel:radiusStatus:OwnerDirectoryDescription' :: Maybe RadiusStatus
radiusStatus = Maybe RadiusStatus
a} :: OwnerDirectoryDescription)

-- | Identifier of the Managed Microsoft AD directory in the directory owner
-- account.
ownerDirectoryDescription_directoryId :: Lens.Lens' OwnerDirectoryDescription (Prelude.Maybe Prelude.Text)
ownerDirectoryDescription_directoryId :: (Maybe Text -> f (Maybe Text))
-> OwnerDirectoryDescription -> f OwnerDirectoryDescription
ownerDirectoryDescription_directoryId = (OwnerDirectoryDescription -> Maybe Text)
-> (OwnerDirectoryDescription
    -> Maybe Text -> OwnerDirectoryDescription)
-> Lens
     OwnerDirectoryDescription
     OwnerDirectoryDescription
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\OwnerDirectoryDescription' {Maybe Text
directoryId :: Maybe Text
$sel:directoryId:OwnerDirectoryDescription' :: OwnerDirectoryDescription -> Maybe Text
directoryId} -> Maybe Text
directoryId) (\s :: OwnerDirectoryDescription
s@OwnerDirectoryDescription' {} Maybe Text
a -> OwnerDirectoryDescription
s {$sel:directoryId:OwnerDirectoryDescription' :: Maybe Text
directoryId = Maybe Text
a} :: OwnerDirectoryDescription)

-- | A RadiusSettings object that contains information about the RADIUS
-- server.
ownerDirectoryDescription_radiusSettings :: Lens.Lens' OwnerDirectoryDescription (Prelude.Maybe RadiusSettings)
ownerDirectoryDescription_radiusSettings :: (Maybe RadiusSettings -> f (Maybe RadiusSettings))
-> OwnerDirectoryDescription -> f OwnerDirectoryDescription
ownerDirectoryDescription_radiusSettings = (OwnerDirectoryDescription -> Maybe RadiusSettings)
-> (OwnerDirectoryDescription
    -> Maybe RadiusSettings -> OwnerDirectoryDescription)
-> Lens
     OwnerDirectoryDescription
     OwnerDirectoryDescription
     (Maybe RadiusSettings)
     (Maybe RadiusSettings)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\OwnerDirectoryDescription' {Maybe RadiusSettings
radiusSettings :: Maybe RadiusSettings
$sel:radiusSettings:OwnerDirectoryDescription' :: OwnerDirectoryDescription -> Maybe RadiusSettings
radiusSettings} -> Maybe RadiusSettings
radiusSettings) (\s :: OwnerDirectoryDescription
s@OwnerDirectoryDescription' {} Maybe RadiusSettings
a -> OwnerDirectoryDescription
s {$sel:radiusSettings:OwnerDirectoryDescription' :: Maybe RadiusSettings
radiusSettings = Maybe RadiusSettings
a} :: OwnerDirectoryDescription)

-- | Identifier of the directory owner account.
ownerDirectoryDescription_accountId :: Lens.Lens' OwnerDirectoryDescription (Prelude.Maybe Prelude.Text)
ownerDirectoryDescription_accountId :: (Maybe Text -> f (Maybe Text))
-> OwnerDirectoryDescription -> f OwnerDirectoryDescription
ownerDirectoryDescription_accountId = (OwnerDirectoryDescription -> Maybe Text)
-> (OwnerDirectoryDescription
    -> Maybe Text -> OwnerDirectoryDescription)
-> Lens
     OwnerDirectoryDescription
     OwnerDirectoryDescription
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\OwnerDirectoryDescription' {Maybe Text
accountId :: Maybe Text
$sel:accountId:OwnerDirectoryDescription' :: OwnerDirectoryDescription -> Maybe Text
accountId} -> Maybe Text
accountId) (\s :: OwnerDirectoryDescription
s@OwnerDirectoryDescription' {} Maybe Text
a -> OwnerDirectoryDescription
s {$sel:accountId:OwnerDirectoryDescription' :: Maybe Text
accountId = Maybe Text
a} :: OwnerDirectoryDescription)

-- | IP address of the directory’s domain controllers.
ownerDirectoryDescription_dnsIpAddrs :: Lens.Lens' OwnerDirectoryDescription (Prelude.Maybe [Prelude.Text])
ownerDirectoryDescription_dnsIpAddrs :: (Maybe [Text] -> f (Maybe [Text]))
-> OwnerDirectoryDescription -> f OwnerDirectoryDescription
ownerDirectoryDescription_dnsIpAddrs = (OwnerDirectoryDescription -> Maybe [Text])
-> (OwnerDirectoryDescription
    -> Maybe [Text] -> OwnerDirectoryDescription)
-> Lens
     OwnerDirectoryDescription
     OwnerDirectoryDescription
     (Maybe [Text])
     (Maybe [Text])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\OwnerDirectoryDescription' {Maybe [Text]
dnsIpAddrs :: Maybe [Text]
$sel:dnsIpAddrs:OwnerDirectoryDescription' :: OwnerDirectoryDescription -> Maybe [Text]
dnsIpAddrs} -> Maybe [Text]
dnsIpAddrs) (\s :: OwnerDirectoryDescription
s@OwnerDirectoryDescription' {} Maybe [Text]
a -> OwnerDirectoryDescription
s {$sel:dnsIpAddrs:OwnerDirectoryDescription' :: Maybe [Text]
dnsIpAddrs = Maybe [Text]
a} :: OwnerDirectoryDescription) ((Maybe [Text] -> f (Maybe [Text]))
 -> OwnerDirectoryDescription -> f OwnerDirectoryDescription)
-> ((Maybe [Text] -> f (Maybe [Text]))
    -> Maybe [Text] -> f (Maybe [Text]))
-> (Maybe [Text] -> f (Maybe [Text]))
-> OwnerDirectoryDescription
-> f OwnerDirectoryDescription
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

-- | Information about the VPC settings for the directory.
ownerDirectoryDescription_vpcSettings :: Lens.Lens' OwnerDirectoryDescription (Prelude.Maybe DirectoryVpcSettingsDescription)
ownerDirectoryDescription_vpcSettings :: (Maybe DirectoryVpcSettingsDescription
 -> f (Maybe DirectoryVpcSettingsDescription))
-> OwnerDirectoryDescription -> f OwnerDirectoryDescription
ownerDirectoryDescription_vpcSettings = (OwnerDirectoryDescription
 -> Maybe DirectoryVpcSettingsDescription)
-> (OwnerDirectoryDescription
    -> Maybe DirectoryVpcSettingsDescription
    -> OwnerDirectoryDescription)
-> Lens
     OwnerDirectoryDescription
     OwnerDirectoryDescription
     (Maybe DirectoryVpcSettingsDescription)
     (Maybe DirectoryVpcSettingsDescription)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\OwnerDirectoryDescription' {Maybe DirectoryVpcSettingsDescription
vpcSettings :: Maybe DirectoryVpcSettingsDescription
$sel:vpcSettings:OwnerDirectoryDescription' :: OwnerDirectoryDescription -> Maybe DirectoryVpcSettingsDescription
vpcSettings} -> Maybe DirectoryVpcSettingsDescription
vpcSettings) (\s :: OwnerDirectoryDescription
s@OwnerDirectoryDescription' {} Maybe DirectoryVpcSettingsDescription
a -> OwnerDirectoryDescription
s {$sel:vpcSettings:OwnerDirectoryDescription' :: Maybe DirectoryVpcSettingsDescription
vpcSettings = Maybe DirectoryVpcSettingsDescription
a} :: OwnerDirectoryDescription)

instance Core.FromJSON OwnerDirectoryDescription where
  parseJSON :: Value -> Parser OwnerDirectoryDescription
parseJSON =
    String
-> (Object -> Parser OwnerDirectoryDescription)
-> Value
-> Parser OwnerDirectoryDescription
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
      String
"OwnerDirectoryDescription"
      ( \Object
x ->
          Maybe RadiusStatus
-> Maybe Text
-> Maybe RadiusSettings
-> Maybe Text
-> Maybe [Text]
-> Maybe DirectoryVpcSettingsDescription
-> OwnerDirectoryDescription
OwnerDirectoryDescription'
            (Maybe RadiusStatus
 -> Maybe Text
 -> Maybe RadiusSettings
 -> Maybe Text
 -> Maybe [Text]
 -> Maybe DirectoryVpcSettingsDescription
 -> OwnerDirectoryDescription)
-> Parser (Maybe RadiusStatus)
-> Parser
     (Maybe Text
      -> Maybe RadiusSettings
      -> Maybe Text
      -> Maybe [Text]
      -> Maybe DirectoryVpcSettingsDescription
      -> OwnerDirectoryDescription)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Parser (Maybe RadiusStatus)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"RadiusStatus")
            Parser
  (Maybe Text
   -> Maybe RadiusSettings
   -> Maybe Text
   -> Maybe [Text]
   -> Maybe DirectoryVpcSettingsDescription
   -> OwnerDirectoryDescription)
-> Parser (Maybe Text)
-> Parser
     (Maybe RadiusSettings
      -> Maybe Text
      -> Maybe [Text]
      -> Maybe DirectoryVpcSettingsDescription
      -> OwnerDirectoryDescription)
forall (f :: * -> *) a b. Applicative f => 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
"DirectoryId")
            Parser
  (Maybe RadiusSettings
   -> Maybe Text
   -> Maybe [Text]
   -> Maybe DirectoryVpcSettingsDescription
   -> OwnerDirectoryDescription)
-> Parser (Maybe RadiusSettings)
-> Parser
     (Maybe Text
      -> Maybe [Text]
      -> Maybe DirectoryVpcSettingsDescription
      -> OwnerDirectoryDescription)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe RadiusSettings)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"RadiusSettings")
            Parser
  (Maybe Text
   -> Maybe [Text]
   -> Maybe DirectoryVpcSettingsDescription
   -> OwnerDirectoryDescription)
-> Parser (Maybe Text)
-> Parser
     (Maybe [Text]
      -> Maybe DirectoryVpcSettingsDescription
      -> OwnerDirectoryDescription)
forall (f :: * -> *) a b. Applicative f => 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
"AccountId")
            Parser
  (Maybe [Text]
   -> Maybe DirectoryVpcSettingsDescription
   -> OwnerDirectoryDescription)
-> Parser (Maybe [Text])
-> Parser
     (Maybe DirectoryVpcSettingsDescription
      -> OwnerDirectoryDescription)
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
"DnsIpAddrs" 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 DirectoryVpcSettingsDescription
   -> OwnerDirectoryDescription)
-> Parser (Maybe DirectoryVpcSettingsDescription)
-> Parser OwnerDirectoryDescription
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe DirectoryVpcSettingsDescription)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"VpcSettings")
      )

instance Prelude.Hashable OwnerDirectoryDescription

instance Prelude.NFData OwnerDirectoryDescription