{-# 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.SecurityHub.Types.AwsRdsDbDomainMembership
-- 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.SecurityHub.Types.AwsRdsDbDomainMembership where

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

-- | Information about an Active Directory domain membership record
-- associated with the DB instance.
--
-- /See:/ 'newAwsRdsDbDomainMembership' smart constructor.
data AwsRdsDbDomainMembership = AwsRdsDbDomainMembership'
  { -- | The status of the Active Directory Domain membership for the DB
    -- instance.
    AwsRdsDbDomainMembership -> Maybe Text
status :: Prelude.Maybe Prelude.Text,
    -- | The fully qualified domain name of the Active Directory domain.
    AwsRdsDbDomainMembership -> Maybe Text
fqdn :: Prelude.Maybe Prelude.Text,
    -- | The identifier of the Active Directory domain.
    AwsRdsDbDomainMembership -> Maybe Text
domain :: Prelude.Maybe Prelude.Text,
    -- | The name of the IAM role to use when making API calls to the Directory
    -- Service.
    AwsRdsDbDomainMembership -> Maybe Text
iamRoleName :: Prelude.Maybe Prelude.Text
  }
  deriving (AwsRdsDbDomainMembership -> AwsRdsDbDomainMembership -> Bool
(AwsRdsDbDomainMembership -> AwsRdsDbDomainMembership -> Bool)
-> (AwsRdsDbDomainMembership -> AwsRdsDbDomainMembership -> Bool)
-> Eq AwsRdsDbDomainMembership
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: AwsRdsDbDomainMembership -> AwsRdsDbDomainMembership -> Bool
$c/= :: AwsRdsDbDomainMembership -> AwsRdsDbDomainMembership -> Bool
== :: AwsRdsDbDomainMembership -> AwsRdsDbDomainMembership -> Bool
$c== :: AwsRdsDbDomainMembership -> AwsRdsDbDomainMembership -> Bool
Prelude.Eq, ReadPrec [AwsRdsDbDomainMembership]
ReadPrec AwsRdsDbDomainMembership
Int -> ReadS AwsRdsDbDomainMembership
ReadS [AwsRdsDbDomainMembership]
(Int -> ReadS AwsRdsDbDomainMembership)
-> ReadS [AwsRdsDbDomainMembership]
-> ReadPrec AwsRdsDbDomainMembership
-> ReadPrec [AwsRdsDbDomainMembership]
-> Read AwsRdsDbDomainMembership
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [AwsRdsDbDomainMembership]
$creadListPrec :: ReadPrec [AwsRdsDbDomainMembership]
readPrec :: ReadPrec AwsRdsDbDomainMembership
$creadPrec :: ReadPrec AwsRdsDbDomainMembership
readList :: ReadS [AwsRdsDbDomainMembership]
$creadList :: ReadS [AwsRdsDbDomainMembership]
readsPrec :: Int -> ReadS AwsRdsDbDomainMembership
$creadsPrec :: Int -> ReadS AwsRdsDbDomainMembership
Prelude.Read, Int -> AwsRdsDbDomainMembership -> ShowS
[AwsRdsDbDomainMembership] -> ShowS
AwsRdsDbDomainMembership -> String
(Int -> AwsRdsDbDomainMembership -> ShowS)
-> (AwsRdsDbDomainMembership -> String)
-> ([AwsRdsDbDomainMembership] -> ShowS)
-> Show AwsRdsDbDomainMembership
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [AwsRdsDbDomainMembership] -> ShowS
$cshowList :: [AwsRdsDbDomainMembership] -> ShowS
show :: AwsRdsDbDomainMembership -> String
$cshow :: AwsRdsDbDomainMembership -> String
showsPrec :: Int -> AwsRdsDbDomainMembership -> ShowS
$cshowsPrec :: Int -> AwsRdsDbDomainMembership -> ShowS
Prelude.Show, (forall x.
 AwsRdsDbDomainMembership -> Rep AwsRdsDbDomainMembership x)
-> (forall x.
    Rep AwsRdsDbDomainMembership x -> AwsRdsDbDomainMembership)
-> Generic AwsRdsDbDomainMembership
forall x.
Rep AwsRdsDbDomainMembership x -> AwsRdsDbDomainMembership
forall x.
AwsRdsDbDomainMembership -> Rep AwsRdsDbDomainMembership x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep AwsRdsDbDomainMembership x -> AwsRdsDbDomainMembership
$cfrom :: forall x.
AwsRdsDbDomainMembership -> Rep AwsRdsDbDomainMembership x
Prelude.Generic)

-- |
-- Create a value of 'AwsRdsDbDomainMembership' 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:
--
-- 'status', 'awsRdsDbDomainMembership_status' - The status of the Active Directory Domain membership for the DB
-- instance.
--
-- 'fqdn', 'awsRdsDbDomainMembership_fqdn' - The fully qualified domain name of the Active Directory domain.
--
-- 'domain', 'awsRdsDbDomainMembership_domain' - The identifier of the Active Directory domain.
--
-- 'iamRoleName', 'awsRdsDbDomainMembership_iamRoleName' - The name of the IAM role to use when making API calls to the Directory
-- Service.
newAwsRdsDbDomainMembership ::
  AwsRdsDbDomainMembership
newAwsRdsDbDomainMembership :: AwsRdsDbDomainMembership
newAwsRdsDbDomainMembership =
  AwsRdsDbDomainMembership' :: Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> AwsRdsDbDomainMembership
AwsRdsDbDomainMembership'
    { $sel:status:AwsRdsDbDomainMembership' :: Maybe Text
status = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:fqdn:AwsRdsDbDomainMembership' :: Maybe Text
fqdn = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:domain:AwsRdsDbDomainMembership' :: Maybe Text
domain = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:iamRoleName:AwsRdsDbDomainMembership' :: Maybe Text
iamRoleName = Maybe Text
forall a. Maybe a
Prelude.Nothing
    }

-- | The status of the Active Directory Domain membership for the DB
-- instance.
awsRdsDbDomainMembership_status :: Lens.Lens' AwsRdsDbDomainMembership (Prelude.Maybe Prelude.Text)
awsRdsDbDomainMembership_status :: (Maybe Text -> f (Maybe Text))
-> AwsRdsDbDomainMembership -> f AwsRdsDbDomainMembership
awsRdsDbDomainMembership_status = (AwsRdsDbDomainMembership -> Maybe Text)
-> (AwsRdsDbDomainMembership
    -> Maybe Text -> AwsRdsDbDomainMembership)
-> Lens
     AwsRdsDbDomainMembership
     AwsRdsDbDomainMembership
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AwsRdsDbDomainMembership' {Maybe Text
status :: Maybe Text
$sel:status:AwsRdsDbDomainMembership' :: AwsRdsDbDomainMembership -> Maybe Text
status} -> Maybe Text
status) (\s :: AwsRdsDbDomainMembership
s@AwsRdsDbDomainMembership' {} Maybe Text
a -> AwsRdsDbDomainMembership
s {$sel:status:AwsRdsDbDomainMembership' :: Maybe Text
status = Maybe Text
a} :: AwsRdsDbDomainMembership)

-- | The fully qualified domain name of the Active Directory domain.
awsRdsDbDomainMembership_fqdn :: Lens.Lens' AwsRdsDbDomainMembership (Prelude.Maybe Prelude.Text)
awsRdsDbDomainMembership_fqdn :: (Maybe Text -> f (Maybe Text))
-> AwsRdsDbDomainMembership -> f AwsRdsDbDomainMembership
awsRdsDbDomainMembership_fqdn = (AwsRdsDbDomainMembership -> Maybe Text)
-> (AwsRdsDbDomainMembership
    -> Maybe Text -> AwsRdsDbDomainMembership)
-> Lens
     AwsRdsDbDomainMembership
     AwsRdsDbDomainMembership
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AwsRdsDbDomainMembership' {Maybe Text
fqdn :: Maybe Text
$sel:fqdn:AwsRdsDbDomainMembership' :: AwsRdsDbDomainMembership -> Maybe Text
fqdn} -> Maybe Text
fqdn) (\s :: AwsRdsDbDomainMembership
s@AwsRdsDbDomainMembership' {} Maybe Text
a -> AwsRdsDbDomainMembership
s {$sel:fqdn:AwsRdsDbDomainMembership' :: Maybe Text
fqdn = Maybe Text
a} :: AwsRdsDbDomainMembership)

-- | The identifier of the Active Directory domain.
awsRdsDbDomainMembership_domain :: Lens.Lens' AwsRdsDbDomainMembership (Prelude.Maybe Prelude.Text)
awsRdsDbDomainMembership_domain :: (Maybe Text -> f (Maybe Text))
-> AwsRdsDbDomainMembership -> f AwsRdsDbDomainMembership
awsRdsDbDomainMembership_domain = (AwsRdsDbDomainMembership -> Maybe Text)
-> (AwsRdsDbDomainMembership
    -> Maybe Text -> AwsRdsDbDomainMembership)
-> Lens
     AwsRdsDbDomainMembership
     AwsRdsDbDomainMembership
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AwsRdsDbDomainMembership' {Maybe Text
domain :: Maybe Text
$sel:domain:AwsRdsDbDomainMembership' :: AwsRdsDbDomainMembership -> Maybe Text
domain} -> Maybe Text
domain) (\s :: AwsRdsDbDomainMembership
s@AwsRdsDbDomainMembership' {} Maybe Text
a -> AwsRdsDbDomainMembership
s {$sel:domain:AwsRdsDbDomainMembership' :: Maybe Text
domain = Maybe Text
a} :: AwsRdsDbDomainMembership)

-- | The name of the IAM role to use when making API calls to the Directory
-- Service.
awsRdsDbDomainMembership_iamRoleName :: Lens.Lens' AwsRdsDbDomainMembership (Prelude.Maybe Prelude.Text)
awsRdsDbDomainMembership_iamRoleName :: (Maybe Text -> f (Maybe Text))
-> AwsRdsDbDomainMembership -> f AwsRdsDbDomainMembership
awsRdsDbDomainMembership_iamRoleName = (AwsRdsDbDomainMembership -> Maybe Text)
-> (AwsRdsDbDomainMembership
    -> Maybe Text -> AwsRdsDbDomainMembership)
-> Lens
     AwsRdsDbDomainMembership
     AwsRdsDbDomainMembership
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AwsRdsDbDomainMembership' {Maybe Text
iamRoleName :: Maybe Text
$sel:iamRoleName:AwsRdsDbDomainMembership' :: AwsRdsDbDomainMembership -> Maybe Text
iamRoleName} -> Maybe Text
iamRoleName) (\s :: AwsRdsDbDomainMembership
s@AwsRdsDbDomainMembership' {} Maybe Text
a -> AwsRdsDbDomainMembership
s {$sel:iamRoleName:AwsRdsDbDomainMembership' :: Maybe Text
iamRoleName = Maybe Text
a} :: AwsRdsDbDomainMembership)

instance Core.FromJSON AwsRdsDbDomainMembership where
  parseJSON :: Value -> Parser AwsRdsDbDomainMembership
parseJSON =
    String
-> (Object -> Parser AwsRdsDbDomainMembership)
-> Value
-> Parser AwsRdsDbDomainMembership
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
      String
"AwsRdsDbDomainMembership"
      ( \Object
x ->
          Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> AwsRdsDbDomainMembership
AwsRdsDbDomainMembership'
            (Maybe Text
 -> Maybe Text
 -> Maybe Text
 -> Maybe Text
 -> AwsRdsDbDomainMembership)
-> Parser (Maybe Text)
-> Parser
     (Maybe Text
      -> Maybe Text -> Maybe Text -> AwsRdsDbDomainMembership)
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
"Status")
            Parser
  (Maybe Text
   -> Maybe Text -> Maybe Text -> AwsRdsDbDomainMembership)
-> Parser (Maybe Text)
-> Parser (Maybe Text -> Maybe Text -> AwsRdsDbDomainMembership)
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
"Fqdn")
            Parser (Maybe Text -> Maybe Text -> AwsRdsDbDomainMembership)
-> Parser (Maybe Text)
-> Parser (Maybe Text -> AwsRdsDbDomainMembership)
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
"Domain")
            Parser (Maybe Text -> AwsRdsDbDomainMembership)
-> Parser (Maybe Text) -> Parser AwsRdsDbDomainMembership
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
"IamRoleName")
      )

instance Prelude.Hashable AwsRdsDbDomainMembership

instance Prelude.NFData AwsRdsDbDomainMembership

instance Core.ToJSON AwsRdsDbDomainMembership where
  toJSON :: AwsRdsDbDomainMembership -> Value
toJSON AwsRdsDbDomainMembership' {Maybe Text
iamRoleName :: Maybe Text
domain :: Maybe Text
fqdn :: Maybe Text
status :: Maybe Text
$sel:iamRoleName:AwsRdsDbDomainMembership' :: AwsRdsDbDomainMembership -> Maybe Text
$sel:domain:AwsRdsDbDomainMembership' :: AwsRdsDbDomainMembership -> Maybe Text
$sel:fqdn:AwsRdsDbDomainMembership' :: AwsRdsDbDomainMembership -> Maybe Text
$sel:status:AwsRdsDbDomainMembership' :: AwsRdsDbDomainMembership -> Maybe Text
..} =
    [Pair] -> Value
Core.object
      ( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ (Text
"Status" 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
status,
            (Text
"Fqdn" 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
fqdn,
            (Text
"Domain" 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
domain,
            (Text
"IamRoleName" 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
iamRoleName
          ]
      )