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

import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude

-- | Contains information about the directory.
--
-- /See:/ 'newDirectoryVpcSettingsDescription' smart constructor.
data DirectoryVpcSettingsDescription = DirectoryVpcSettingsDescription'
  { -- | The identifiers of the subnets for the directory servers.
    DirectoryVpcSettingsDescription -> Maybe [Text]
subnetIds :: Prelude.Maybe [Prelude.Text],
    -- | The identifier of the VPC that the directory is in.
    DirectoryVpcSettingsDescription -> Maybe Text
vpcId :: Prelude.Maybe Prelude.Text,
    -- | The domain controller security group identifier for the directory.
    DirectoryVpcSettingsDescription -> Maybe Text
securityGroupId :: Prelude.Maybe Prelude.Text,
    -- | The list of Availability Zones that the directory is in.
    DirectoryVpcSettingsDescription -> Maybe [Text]
availabilityZones :: Prelude.Maybe [Prelude.Text]
  }
  deriving (DirectoryVpcSettingsDescription
-> DirectoryVpcSettingsDescription -> Bool
(DirectoryVpcSettingsDescription
 -> DirectoryVpcSettingsDescription -> Bool)
-> (DirectoryVpcSettingsDescription
    -> DirectoryVpcSettingsDescription -> Bool)
-> Eq DirectoryVpcSettingsDescription
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DirectoryVpcSettingsDescription
-> DirectoryVpcSettingsDescription -> Bool
$c/= :: DirectoryVpcSettingsDescription
-> DirectoryVpcSettingsDescription -> Bool
== :: DirectoryVpcSettingsDescription
-> DirectoryVpcSettingsDescription -> Bool
$c== :: DirectoryVpcSettingsDescription
-> DirectoryVpcSettingsDescription -> Bool
Prelude.Eq, ReadPrec [DirectoryVpcSettingsDescription]
ReadPrec DirectoryVpcSettingsDescription
Int -> ReadS DirectoryVpcSettingsDescription
ReadS [DirectoryVpcSettingsDescription]
(Int -> ReadS DirectoryVpcSettingsDescription)
-> ReadS [DirectoryVpcSettingsDescription]
-> ReadPrec DirectoryVpcSettingsDescription
-> ReadPrec [DirectoryVpcSettingsDescription]
-> Read DirectoryVpcSettingsDescription
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DirectoryVpcSettingsDescription]
$creadListPrec :: ReadPrec [DirectoryVpcSettingsDescription]
readPrec :: ReadPrec DirectoryVpcSettingsDescription
$creadPrec :: ReadPrec DirectoryVpcSettingsDescription
readList :: ReadS [DirectoryVpcSettingsDescription]
$creadList :: ReadS [DirectoryVpcSettingsDescription]
readsPrec :: Int -> ReadS DirectoryVpcSettingsDescription
$creadsPrec :: Int -> ReadS DirectoryVpcSettingsDescription
Prelude.Read, Int -> DirectoryVpcSettingsDescription -> ShowS
[DirectoryVpcSettingsDescription] -> ShowS
DirectoryVpcSettingsDescription -> String
(Int -> DirectoryVpcSettingsDescription -> ShowS)
-> (DirectoryVpcSettingsDescription -> String)
-> ([DirectoryVpcSettingsDescription] -> ShowS)
-> Show DirectoryVpcSettingsDescription
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DirectoryVpcSettingsDescription] -> ShowS
$cshowList :: [DirectoryVpcSettingsDescription] -> ShowS
show :: DirectoryVpcSettingsDescription -> String
$cshow :: DirectoryVpcSettingsDescription -> String
showsPrec :: Int -> DirectoryVpcSettingsDescription -> ShowS
$cshowsPrec :: Int -> DirectoryVpcSettingsDescription -> ShowS
Prelude.Show, (forall x.
 DirectoryVpcSettingsDescription
 -> Rep DirectoryVpcSettingsDescription x)
-> (forall x.
    Rep DirectoryVpcSettingsDescription x
    -> DirectoryVpcSettingsDescription)
-> Generic DirectoryVpcSettingsDescription
forall x.
Rep DirectoryVpcSettingsDescription x
-> DirectoryVpcSettingsDescription
forall x.
DirectoryVpcSettingsDescription
-> Rep DirectoryVpcSettingsDescription x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep DirectoryVpcSettingsDescription x
-> DirectoryVpcSettingsDescription
$cfrom :: forall x.
DirectoryVpcSettingsDescription
-> Rep DirectoryVpcSettingsDescription x
Prelude.Generic)

-- |
-- Create a value of 'DirectoryVpcSettingsDescription' 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:
--
-- 'subnetIds', 'directoryVpcSettingsDescription_subnetIds' - The identifiers of the subnets for the directory servers.
--
-- 'vpcId', 'directoryVpcSettingsDescription_vpcId' - The identifier of the VPC that the directory is in.
--
-- 'securityGroupId', 'directoryVpcSettingsDescription_securityGroupId' - The domain controller security group identifier for the directory.
--
-- 'availabilityZones', 'directoryVpcSettingsDescription_availabilityZones' - The list of Availability Zones that the directory is in.
newDirectoryVpcSettingsDescription ::
  DirectoryVpcSettingsDescription
newDirectoryVpcSettingsDescription :: DirectoryVpcSettingsDescription
newDirectoryVpcSettingsDescription =
  DirectoryVpcSettingsDescription' :: Maybe [Text]
-> Maybe Text
-> Maybe Text
-> Maybe [Text]
-> DirectoryVpcSettingsDescription
DirectoryVpcSettingsDescription'
    { $sel:subnetIds:DirectoryVpcSettingsDescription' :: Maybe [Text]
subnetIds =
        Maybe [Text]
forall a. Maybe a
Prelude.Nothing,
      $sel:vpcId:DirectoryVpcSettingsDescription' :: Maybe Text
vpcId = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:securityGroupId:DirectoryVpcSettingsDescription' :: Maybe Text
securityGroupId = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:availabilityZones:DirectoryVpcSettingsDescription' :: Maybe [Text]
availabilityZones = Maybe [Text]
forall a. Maybe a
Prelude.Nothing
    }

-- | The identifiers of the subnets for the directory servers.
directoryVpcSettingsDescription_subnetIds :: Lens.Lens' DirectoryVpcSettingsDescription (Prelude.Maybe [Prelude.Text])
directoryVpcSettingsDescription_subnetIds :: (Maybe [Text] -> f (Maybe [Text]))
-> DirectoryVpcSettingsDescription
-> f DirectoryVpcSettingsDescription
directoryVpcSettingsDescription_subnetIds = (DirectoryVpcSettingsDescription -> Maybe [Text])
-> (DirectoryVpcSettingsDescription
    -> Maybe [Text] -> DirectoryVpcSettingsDescription)
-> Lens
     DirectoryVpcSettingsDescription
     DirectoryVpcSettingsDescription
     (Maybe [Text])
     (Maybe [Text])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DirectoryVpcSettingsDescription' {Maybe [Text]
subnetIds :: Maybe [Text]
$sel:subnetIds:DirectoryVpcSettingsDescription' :: DirectoryVpcSettingsDescription -> Maybe [Text]
subnetIds} -> Maybe [Text]
subnetIds) (\s :: DirectoryVpcSettingsDescription
s@DirectoryVpcSettingsDescription' {} Maybe [Text]
a -> DirectoryVpcSettingsDescription
s {$sel:subnetIds:DirectoryVpcSettingsDescription' :: Maybe [Text]
subnetIds = Maybe [Text]
a} :: DirectoryVpcSettingsDescription) ((Maybe [Text] -> f (Maybe [Text]))
 -> DirectoryVpcSettingsDescription
 -> f DirectoryVpcSettingsDescription)
-> ((Maybe [Text] -> f (Maybe [Text]))
    -> Maybe [Text] -> f (Maybe [Text]))
-> (Maybe [Text] -> f (Maybe [Text]))
-> DirectoryVpcSettingsDescription
-> f DirectoryVpcSettingsDescription
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

-- | The identifier of the VPC that the directory is in.
directoryVpcSettingsDescription_vpcId :: Lens.Lens' DirectoryVpcSettingsDescription (Prelude.Maybe Prelude.Text)
directoryVpcSettingsDescription_vpcId :: (Maybe Text -> f (Maybe Text))
-> DirectoryVpcSettingsDescription
-> f DirectoryVpcSettingsDescription
directoryVpcSettingsDescription_vpcId = (DirectoryVpcSettingsDescription -> Maybe Text)
-> (DirectoryVpcSettingsDescription
    -> Maybe Text -> DirectoryVpcSettingsDescription)
-> Lens
     DirectoryVpcSettingsDescription
     DirectoryVpcSettingsDescription
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DirectoryVpcSettingsDescription' {Maybe Text
vpcId :: Maybe Text
$sel:vpcId:DirectoryVpcSettingsDescription' :: DirectoryVpcSettingsDescription -> Maybe Text
vpcId} -> Maybe Text
vpcId) (\s :: DirectoryVpcSettingsDescription
s@DirectoryVpcSettingsDescription' {} Maybe Text
a -> DirectoryVpcSettingsDescription
s {$sel:vpcId:DirectoryVpcSettingsDescription' :: Maybe Text
vpcId = Maybe Text
a} :: DirectoryVpcSettingsDescription)

-- | The domain controller security group identifier for the directory.
directoryVpcSettingsDescription_securityGroupId :: Lens.Lens' DirectoryVpcSettingsDescription (Prelude.Maybe Prelude.Text)
directoryVpcSettingsDescription_securityGroupId :: (Maybe Text -> f (Maybe Text))
-> DirectoryVpcSettingsDescription
-> f DirectoryVpcSettingsDescription
directoryVpcSettingsDescription_securityGroupId = (DirectoryVpcSettingsDescription -> Maybe Text)
-> (DirectoryVpcSettingsDescription
    -> Maybe Text -> DirectoryVpcSettingsDescription)
-> Lens
     DirectoryVpcSettingsDescription
     DirectoryVpcSettingsDescription
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DirectoryVpcSettingsDescription' {Maybe Text
securityGroupId :: Maybe Text
$sel:securityGroupId:DirectoryVpcSettingsDescription' :: DirectoryVpcSettingsDescription -> Maybe Text
securityGroupId} -> Maybe Text
securityGroupId) (\s :: DirectoryVpcSettingsDescription
s@DirectoryVpcSettingsDescription' {} Maybe Text
a -> DirectoryVpcSettingsDescription
s {$sel:securityGroupId:DirectoryVpcSettingsDescription' :: Maybe Text
securityGroupId = Maybe Text
a} :: DirectoryVpcSettingsDescription)

-- | The list of Availability Zones that the directory is in.
directoryVpcSettingsDescription_availabilityZones :: Lens.Lens' DirectoryVpcSettingsDescription (Prelude.Maybe [Prelude.Text])
directoryVpcSettingsDescription_availabilityZones :: (Maybe [Text] -> f (Maybe [Text]))
-> DirectoryVpcSettingsDescription
-> f DirectoryVpcSettingsDescription
directoryVpcSettingsDescription_availabilityZones = (DirectoryVpcSettingsDescription -> Maybe [Text])
-> (DirectoryVpcSettingsDescription
    -> Maybe [Text] -> DirectoryVpcSettingsDescription)
-> Lens
     DirectoryVpcSettingsDescription
     DirectoryVpcSettingsDescription
     (Maybe [Text])
     (Maybe [Text])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DirectoryVpcSettingsDescription' {Maybe [Text]
availabilityZones :: Maybe [Text]
$sel:availabilityZones:DirectoryVpcSettingsDescription' :: DirectoryVpcSettingsDescription -> Maybe [Text]
availabilityZones} -> Maybe [Text]
availabilityZones) (\s :: DirectoryVpcSettingsDescription
s@DirectoryVpcSettingsDescription' {} Maybe [Text]
a -> DirectoryVpcSettingsDescription
s {$sel:availabilityZones:DirectoryVpcSettingsDescription' :: Maybe [Text]
availabilityZones = Maybe [Text]
a} :: DirectoryVpcSettingsDescription) ((Maybe [Text] -> f (Maybe [Text]))
 -> DirectoryVpcSettingsDescription
 -> f DirectoryVpcSettingsDescription)
-> ((Maybe [Text] -> f (Maybe [Text]))
    -> Maybe [Text] -> f (Maybe [Text]))
-> (Maybe [Text] -> f (Maybe [Text]))
-> DirectoryVpcSettingsDescription
-> f DirectoryVpcSettingsDescription
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

instance
  Core.FromJSON
    DirectoryVpcSettingsDescription
  where
  parseJSON :: Value -> Parser DirectoryVpcSettingsDescription
parseJSON =
    String
-> (Object -> Parser DirectoryVpcSettingsDescription)
-> Value
-> Parser DirectoryVpcSettingsDescription
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
      String
"DirectoryVpcSettingsDescription"
      ( \Object
x ->
          Maybe [Text]
-> Maybe Text
-> Maybe Text
-> Maybe [Text]
-> DirectoryVpcSettingsDescription
DirectoryVpcSettingsDescription'
            (Maybe [Text]
 -> Maybe Text
 -> Maybe Text
 -> Maybe [Text]
 -> DirectoryVpcSettingsDescription)
-> Parser (Maybe [Text])
-> Parser
     (Maybe Text
      -> Maybe Text -> Maybe [Text] -> DirectoryVpcSettingsDescription)
forall (f :: * -> *) a b. Functor 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
"SubnetIds" 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 Text
   -> Maybe Text -> Maybe [Text] -> DirectoryVpcSettingsDescription)
-> Parser (Maybe Text)
-> Parser
     (Maybe Text -> Maybe [Text] -> DirectoryVpcSettingsDescription)
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
"VpcId")
            Parser
  (Maybe Text -> Maybe [Text] -> DirectoryVpcSettingsDescription)
-> Parser (Maybe Text)
-> Parser (Maybe [Text] -> DirectoryVpcSettingsDescription)
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
"SecurityGroupId")
            Parser (Maybe [Text] -> DirectoryVpcSettingsDescription)
-> Parser (Maybe [Text]) -> Parser DirectoryVpcSettingsDescription
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
"AvailabilityZones"
                            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
                        )
      )

instance
  Prelude.Hashable
    DirectoryVpcSettingsDescription

instance
  Prelude.NFData
    DirectoryVpcSettingsDescription