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

import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
import Amazonka.SecurityHub.Types.AwsRdsDbSubnetGroupSubnet

-- | Information about the subnet group for the database instance.
--
-- /See:/ 'newAwsRdsDbSubnetGroup' smart constructor.
data AwsRdsDbSubnetGroup = AwsRdsDbSubnetGroup'
  { -- | The name of the subnet group.
    AwsRdsDbSubnetGroup -> Maybe Text
dbSubnetGroupName :: Prelude.Maybe Prelude.Text,
    -- | The VPC ID of the subnet group.
    AwsRdsDbSubnetGroup -> Maybe Text
vpcId :: Prelude.Maybe Prelude.Text,
    -- | A list of subnets in the subnet group.
    AwsRdsDbSubnetGroup -> Maybe [AwsRdsDbSubnetGroupSubnet]
subnets :: Prelude.Maybe [AwsRdsDbSubnetGroupSubnet],
    -- | The description of the subnet group.
    AwsRdsDbSubnetGroup -> Maybe Text
dbSubnetGroupDescription :: Prelude.Maybe Prelude.Text,
    -- | The ARN of the subnet group.
    AwsRdsDbSubnetGroup -> Maybe Text
dbSubnetGroupArn :: Prelude.Maybe Prelude.Text,
    -- | The status of the subnet group.
    AwsRdsDbSubnetGroup -> Maybe Text
subnetGroupStatus :: Prelude.Maybe Prelude.Text
  }
  deriving (AwsRdsDbSubnetGroup -> AwsRdsDbSubnetGroup -> Bool
(AwsRdsDbSubnetGroup -> AwsRdsDbSubnetGroup -> Bool)
-> (AwsRdsDbSubnetGroup -> AwsRdsDbSubnetGroup -> Bool)
-> Eq AwsRdsDbSubnetGroup
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: AwsRdsDbSubnetGroup -> AwsRdsDbSubnetGroup -> Bool
$c/= :: AwsRdsDbSubnetGroup -> AwsRdsDbSubnetGroup -> Bool
== :: AwsRdsDbSubnetGroup -> AwsRdsDbSubnetGroup -> Bool
$c== :: AwsRdsDbSubnetGroup -> AwsRdsDbSubnetGroup -> Bool
Prelude.Eq, ReadPrec [AwsRdsDbSubnetGroup]
ReadPrec AwsRdsDbSubnetGroup
Int -> ReadS AwsRdsDbSubnetGroup
ReadS [AwsRdsDbSubnetGroup]
(Int -> ReadS AwsRdsDbSubnetGroup)
-> ReadS [AwsRdsDbSubnetGroup]
-> ReadPrec AwsRdsDbSubnetGroup
-> ReadPrec [AwsRdsDbSubnetGroup]
-> Read AwsRdsDbSubnetGroup
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [AwsRdsDbSubnetGroup]
$creadListPrec :: ReadPrec [AwsRdsDbSubnetGroup]
readPrec :: ReadPrec AwsRdsDbSubnetGroup
$creadPrec :: ReadPrec AwsRdsDbSubnetGroup
readList :: ReadS [AwsRdsDbSubnetGroup]
$creadList :: ReadS [AwsRdsDbSubnetGroup]
readsPrec :: Int -> ReadS AwsRdsDbSubnetGroup
$creadsPrec :: Int -> ReadS AwsRdsDbSubnetGroup
Prelude.Read, Int -> AwsRdsDbSubnetGroup -> ShowS
[AwsRdsDbSubnetGroup] -> ShowS
AwsRdsDbSubnetGroup -> String
(Int -> AwsRdsDbSubnetGroup -> ShowS)
-> (AwsRdsDbSubnetGroup -> String)
-> ([AwsRdsDbSubnetGroup] -> ShowS)
-> Show AwsRdsDbSubnetGroup
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [AwsRdsDbSubnetGroup] -> ShowS
$cshowList :: [AwsRdsDbSubnetGroup] -> ShowS
show :: AwsRdsDbSubnetGroup -> String
$cshow :: AwsRdsDbSubnetGroup -> String
showsPrec :: Int -> AwsRdsDbSubnetGroup -> ShowS
$cshowsPrec :: Int -> AwsRdsDbSubnetGroup -> ShowS
Prelude.Show, (forall x. AwsRdsDbSubnetGroup -> Rep AwsRdsDbSubnetGroup x)
-> (forall x. Rep AwsRdsDbSubnetGroup x -> AwsRdsDbSubnetGroup)
-> Generic AwsRdsDbSubnetGroup
forall x. Rep AwsRdsDbSubnetGroup x -> AwsRdsDbSubnetGroup
forall x. AwsRdsDbSubnetGroup -> Rep AwsRdsDbSubnetGroup x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep AwsRdsDbSubnetGroup x -> AwsRdsDbSubnetGroup
$cfrom :: forall x. AwsRdsDbSubnetGroup -> Rep AwsRdsDbSubnetGroup x
Prelude.Generic)

-- |
-- Create a value of 'AwsRdsDbSubnetGroup' 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:
--
-- 'dbSubnetGroupName', 'awsRdsDbSubnetGroup_dbSubnetGroupName' - The name of the subnet group.
--
-- 'vpcId', 'awsRdsDbSubnetGroup_vpcId' - The VPC ID of the subnet group.
--
-- 'subnets', 'awsRdsDbSubnetGroup_subnets' - A list of subnets in the subnet group.
--
-- 'dbSubnetGroupDescription', 'awsRdsDbSubnetGroup_dbSubnetGroupDescription' - The description of the subnet group.
--
-- 'dbSubnetGroupArn', 'awsRdsDbSubnetGroup_dbSubnetGroupArn' - The ARN of the subnet group.
--
-- 'subnetGroupStatus', 'awsRdsDbSubnetGroup_subnetGroupStatus' - The status of the subnet group.
newAwsRdsDbSubnetGroup ::
  AwsRdsDbSubnetGroup
newAwsRdsDbSubnetGroup :: AwsRdsDbSubnetGroup
newAwsRdsDbSubnetGroup =
  AwsRdsDbSubnetGroup' :: Maybe Text
-> Maybe Text
-> Maybe [AwsRdsDbSubnetGroupSubnet]
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> AwsRdsDbSubnetGroup
AwsRdsDbSubnetGroup'
    { $sel:dbSubnetGroupName:AwsRdsDbSubnetGroup' :: Maybe Text
dbSubnetGroupName =
        Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:vpcId:AwsRdsDbSubnetGroup' :: Maybe Text
vpcId = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:subnets:AwsRdsDbSubnetGroup' :: Maybe [AwsRdsDbSubnetGroupSubnet]
subnets = Maybe [AwsRdsDbSubnetGroupSubnet]
forall a. Maybe a
Prelude.Nothing,
      $sel:dbSubnetGroupDescription:AwsRdsDbSubnetGroup' :: Maybe Text
dbSubnetGroupDescription = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:dbSubnetGroupArn:AwsRdsDbSubnetGroup' :: Maybe Text
dbSubnetGroupArn = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:subnetGroupStatus:AwsRdsDbSubnetGroup' :: Maybe Text
subnetGroupStatus = Maybe Text
forall a. Maybe a
Prelude.Nothing
    }

-- | The name of the subnet group.
awsRdsDbSubnetGroup_dbSubnetGroupName :: Lens.Lens' AwsRdsDbSubnetGroup (Prelude.Maybe Prelude.Text)
awsRdsDbSubnetGroup_dbSubnetGroupName :: (Maybe Text -> f (Maybe Text))
-> AwsRdsDbSubnetGroup -> f AwsRdsDbSubnetGroup
awsRdsDbSubnetGroup_dbSubnetGroupName = (AwsRdsDbSubnetGroup -> Maybe Text)
-> (AwsRdsDbSubnetGroup -> Maybe Text -> AwsRdsDbSubnetGroup)
-> Lens
     AwsRdsDbSubnetGroup AwsRdsDbSubnetGroup (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AwsRdsDbSubnetGroup' {Maybe Text
dbSubnetGroupName :: Maybe Text
$sel:dbSubnetGroupName:AwsRdsDbSubnetGroup' :: AwsRdsDbSubnetGroup -> Maybe Text
dbSubnetGroupName} -> Maybe Text
dbSubnetGroupName) (\s :: AwsRdsDbSubnetGroup
s@AwsRdsDbSubnetGroup' {} Maybe Text
a -> AwsRdsDbSubnetGroup
s {$sel:dbSubnetGroupName:AwsRdsDbSubnetGroup' :: Maybe Text
dbSubnetGroupName = Maybe Text
a} :: AwsRdsDbSubnetGroup)

-- | The VPC ID of the subnet group.
awsRdsDbSubnetGroup_vpcId :: Lens.Lens' AwsRdsDbSubnetGroup (Prelude.Maybe Prelude.Text)
awsRdsDbSubnetGroup_vpcId :: (Maybe Text -> f (Maybe Text))
-> AwsRdsDbSubnetGroup -> f AwsRdsDbSubnetGroup
awsRdsDbSubnetGroup_vpcId = (AwsRdsDbSubnetGroup -> Maybe Text)
-> (AwsRdsDbSubnetGroup -> Maybe Text -> AwsRdsDbSubnetGroup)
-> Lens
     AwsRdsDbSubnetGroup AwsRdsDbSubnetGroup (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AwsRdsDbSubnetGroup' {Maybe Text
vpcId :: Maybe Text
$sel:vpcId:AwsRdsDbSubnetGroup' :: AwsRdsDbSubnetGroup -> Maybe Text
vpcId} -> Maybe Text
vpcId) (\s :: AwsRdsDbSubnetGroup
s@AwsRdsDbSubnetGroup' {} Maybe Text
a -> AwsRdsDbSubnetGroup
s {$sel:vpcId:AwsRdsDbSubnetGroup' :: Maybe Text
vpcId = Maybe Text
a} :: AwsRdsDbSubnetGroup)

-- | A list of subnets in the subnet group.
awsRdsDbSubnetGroup_subnets :: Lens.Lens' AwsRdsDbSubnetGroup (Prelude.Maybe [AwsRdsDbSubnetGroupSubnet])
awsRdsDbSubnetGroup_subnets :: (Maybe [AwsRdsDbSubnetGroupSubnet]
 -> f (Maybe [AwsRdsDbSubnetGroupSubnet]))
-> AwsRdsDbSubnetGroup -> f AwsRdsDbSubnetGroup
awsRdsDbSubnetGroup_subnets = (AwsRdsDbSubnetGroup -> Maybe [AwsRdsDbSubnetGroupSubnet])
-> (AwsRdsDbSubnetGroup
    -> Maybe [AwsRdsDbSubnetGroupSubnet] -> AwsRdsDbSubnetGroup)
-> Lens
     AwsRdsDbSubnetGroup
     AwsRdsDbSubnetGroup
     (Maybe [AwsRdsDbSubnetGroupSubnet])
     (Maybe [AwsRdsDbSubnetGroupSubnet])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AwsRdsDbSubnetGroup' {Maybe [AwsRdsDbSubnetGroupSubnet]
subnets :: Maybe [AwsRdsDbSubnetGroupSubnet]
$sel:subnets:AwsRdsDbSubnetGroup' :: AwsRdsDbSubnetGroup -> Maybe [AwsRdsDbSubnetGroupSubnet]
subnets} -> Maybe [AwsRdsDbSubnetGroupSubnet]
subnets) (\s :: AwsRdsDbSubnetGroup
s@AwsRdsDbSubnetGroup' {} Maybe [AwsRdsDbSubnetGroupSubnet]
a -> AwsRdsDbSubnetGroup
s {$sel:subnets:AwsRdsDbSubnetGroup' :: Maybe [AwsRdsDbSubnetGroupSubnet]
subnets = Maybe [AwsRdsDbSubnetGroupSubnet]
a} :: AwsRdsDbSubnetGroup) ((Maybe [AwsRdsDbSubnetGroupSubnet]
  -> f (Maybe [AwsRdsDbSubnetGroupSubnet]))
 -> AwsRdsDbSubnetGroup -> f AwsRdsDbSubnetGroup)
-> ((Maybe [AwsRdsDbSubnetGroupSubnet]
     -> f (Maybe [AwsRdsDbSubnetGroupSubnet]))
    -> Maybe [AwsRdsDbSubnetGroupSubnet]
    -> f (Maybe [AwsRdsDbSubnetGroupSubnet]))
-> (Maybe [AwsRdsDbSubnetGroupSubnet]
    -> f (Maybe [AwsRdsDbSubnetGroupSubnet]))
-> AwsRdsDbSubnetGroup
-> f AwsRdsDbSubnetGroup
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
  [AwsRdsDbSubnetGroupSubnet]
  [AwsRdsDbSubnetGroupSubnet]
  [AwsRdsDbSubnetGroupSubnet]
  [AwsRdsDbSubnetGroupSubnet]
-> Iso
     (Maybe [AwsRdsDbSubnetGroupSubnet])
     (Maybe [AwsRdsDbSubnetGroupSubnet])
     (Maybe [AwsRdsDbSubnetGroupSubnet])
     (Maybe [AwsRdsDbSubnetGroupSubnet])
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
  [AwsRdsDbSubnetGroupSubnet]
  [AwsRdsDbSubnetGroupSubnet]
  [AwsRdsDbSubnetGroupSubnet]
  [AwsRdsDbSubnetGroupSubnet]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | The description of the subnet group.
awsRdsDbSubnetGroup_dbSubnetGroupDescription :: Lens.Lens' AwsRdsDbSubnetGroup (Prelude.Maybe Prelude.Text)
awsRdsDbSubnetGroup_dbSubnetGroupDescription :: (Maybe Text -> f (Maybe Text))
-> AwsRdsDbSubnetGroup -> f AwsRdsDbSubnetGroup
awsRdsDbSubnetGroup_dbSubnetGroupDescription = (AwsRdsDbSubnetGroup -> Maybe Text)
-> (AwsRdsDbSubnetGroup -> Maybe Text -> AwsRdsDbSubnetGroup)
-> Lens
     AwsRdsDbSubnetGroup AwsRdsDbSubnetGroup (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AwsRdsDbSubnetGroup' {Maybe Text
dbSubnetGroupDescription :: Maybe Text
$sel:dbSubnetGroupDescription:AwsRdsDbSubnetGroup' :: AwsRdsDbSubnetGroup -> Maybe Text
dbSubnetGroupDescription} -> Maybe Text
dbSubnetGroupDescription) (\s :: AwsRdsDbSubnetGroup
s@AwsRdsDbSubnetGroup' {} Maybe Text
a -> AwsRdsDbSubnetGroup
s {$sel:dbSubnetGroupDescription:AwsRdsDbSubnetGroup' :: Maybe Text
dbSubnetGroupDescription = Maybe Text
a} :: AwsRdsDbSubnetGroup)

-- | The ARN of the subnet group.
awsRdsDbSubnetGroup_dbSubnetGroupArn :: Lens.Lens' AwsRdsDbSubnetGroup (Prelude.Maybe Prelude.Text)
awsRdsDbSubnetGroup_dbSubnetGroupArn :: (Maybe Text -> f (Maybe Text))
-> AwsRdsDbSubnetGroup -> f AwsRdsDbSubnetGroup
awsRdsDbSubnetGroup_dbSubnetGroupArn = (AwsRdsDbSubnetGroup -> Maybe Text)
-> (AwsRdsDbSubnetGroup -> Maybe Text -> AwsRdsDbSubnetGroup)
-> Lens
     AwsRdsDbSubnetGroup AwsRdsDbSubnetGroup (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AwsRdsDbSubnetGroup' {Maybe Text
dbSubnetGroupArn :: Maybe Text
$sel:dbSubnetGroupArn:AwsRdsDbSubnetGroup' :: AwsRdsDbSubnetGroup -> Maybe Text
dbSubnetGroupArn} -> Maybe Text
dbSubnetGroupArn) (\s :: AwsRdsDbSubnetGroup
s@AwsRdsDbSubnetGroup' {} Maybe Text
a -> AwsRdsDbSubnetGroup
s {$sel:dbSubnetGroupArn:AwsRdsDbSubnetGroup' :: Maybe Text
dbSubnetGroupArn = Maybe Text
a} :: AwsRdsDbSubnetGroup)

-- | The status of the subnet group.
awsRdsDbSubnetGroup_subnetGroupStatus :: Lens.Lens' AwsRdsDbSubnetGroup (Prelude.Maybe Prelude.Text)
awsRdsDbSubnetGroup_subnetGroupStatus :: (Maybe Text -> f (Maybe Text))
-> AwsRdsDbSubnetGroup -> f AwsRdsDbSubnetGroup
awsRdsDbSubnetGroup_subnetGroupStatus = (AwsRdsDbSubnetGroup -> Maybe Text)
-> (AwsRdsDbSubnetGroup -> Maybe Text -> AwsRdsDbSubnetGroup)
-> Lens
     AwsRdsDbSubnetGroup AwsRdsDbSubnetGroup (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AwsRdsDbSubnetGroup' {Maybe Text
subnetGroupStatus :: Maybe Text
$sel:subnetGroupStatus:AwsRdsDbSubnetGroup' :: AwsRdsDbSubnetGroup -> Maybe Text
subnetGroupStatus} -> Maybe Text
subnetGroupStatus) (\s :: AwsRdsDbSubnetGroup
s@AwsRdsDbSubnetGroup' {} Maybe Text
a -> AwsRdsDbSubnetGroup
s {$sel:subnetGroupStatus:AwsRdsDbSubnetGroup' :: Maybe Text
subnetGroupStatus = Maybe Text
a} :: AwsRdsDbSubnetGroup)

instance Core.FromJSON AwsRdsDbSubnetGroup where
  parseJSON :: Value -> Parser AwsRdsDbSubnetGroup
parseJSON =
    String
-> (Object -> Parser AwsRdsDbSubnetGroup)
-> Value
-> Parser AwsRdsDbSubnetGroup
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
      String
"AwsRdsDbSubnetGroup"
      ( \Object
x ->
          Maybe Text
-> Maybe Text
-> Maybe [AwsRdsDbSubnetGroupSubnet]
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> AwsRdsDbSubnetGroup
AwsRdsDbSubnetGroup'
            (Maybe Text
 -> Maybe Text
 -> Maybe [AwsRdsDbSubnetGroupSubnet]
 -> Maybe Text
 -> Maybe Text
 -> Maybe Text
 -> AwsRdsDbSubnetGroup)
-> Parser (Maybe Text)
-> Parser
     (Maybe Text
      -> Maybe [AwsRdsDbSubnetGroupSubnet]
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> AwsRdsDbSubnetGroup)
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
"DbSubnetGroupName")
            Parser
  (Maybe Text
   -> Maybe [AwsRdsDbSubnetGroupSubnet]
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> AwsRdsDbSubnetGroup)
-> Parser (Maybe Text)
-> Parser
     (Maybe [AwsRdsDbSubnetGroupSubnet]
      -> Maybe Text -> Maybe Text -> Maybe Text -> AwsRdsDbSubnetGroup)
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 [AwsRdsDbSubnetGroupSubnet]
   -> Maybe Text -> Maybe Text -> Maybe Text -> AwsRdsDbSubnetGroup)
-> Parser (Maybe [AwsRdsDbSubnetGroupSubnet])
-> Parser
     (Maybe Text -> Maybe Text -> Maybe Text -> AwsRdsDbSubnetGroup)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object
-> Text -> Parser (Maybe (Maybe [AwsRdsDbSubnetGroupSubnet]))
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"Subnets" Parser (Maybe (Maybe [AwsRdsDbSubnetGroupSubnet]))
-> Maybe [AwsRdsDbSubnetGroupSubnet]
-> Parser (Maybe [AwsRdsDbSubnetGroupSubnet])
forall a. Parser (Maybe a) -> a -> Parser a
Core..!= Maybe [AwsRdsDbSubnetGroupSubnet]
forall a. Monoid a => a
Prelude.mempty)
            Parser
  (Maybe Text -> Maybe Text -> Maybe Text -> AwsRdsDbSubnetGroup)
-> Parser (Maybe Text)
-> Parser (Maybe Text -> Maybe Text -> AwsRdsDbSubnetGroup)
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
"DbSubnetGroupDescription")
            Parser (Maybe Text -> Maybe Text -> AwsRdsDbSubnetGroup)
-> Parser (Maybe Text)
-> Parser (Maybe Text -> AwsRdsDbSubnetGroup)
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
"DbSubnetGroupArn")
            Parser (Maybe Text -> AwsRdsDbSubnetGroup)
-> Parser (Maybe Text) -> Parser AwsRdsDbSubnetGroup
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
"SubnetGroupStatus")
      )

instance Prelude.Hashable AwsRdsDbSubnetGroup

instance Prelude.NFData AwsRdsDbSubnetGroup

instance Core.ToJSON AwsRdsDbSubnetGroup where
  toJSON :: AwsRdsDbSubnetGroup -> Value
toJSON AwsRdsDbSubnetGroup' {Maybe [AwsRdsDbSubnetGroupSubnet]
Maybe Text
subnetGroupStatus :: Maybe Text
dbSubnetGroupArn :: Maybe Text
dbSubnetGroupDescription :: Maybe Text
subnets :: Maybe [AwsRdsDbSubnetGroupSubnet]
vpcId :: Maybe Text
dbSubnetGroupName :: Maybe Text
$sel:subnetGroupStatus:AwsRdsDbSubnetGroup' :: AwsRdsDbSubnetGroup -> Maybe Text
$sel:dbSubnetGroupArn:AwsRdsDbSubnetGroup' :: AwsRdsDbSubnetGroup -> Maybe Text
$sel:dbSubnetGroupDescription:AwsRdsDbSubnetGroup' :: AwsRdsDbSubnetGroup -> Maybe Text
$sel:subnets:AwsRdsDbSubnetGroup' :: AwsRdsDbSubnetGroup -> Maybe [AwsRdsDbSubnetGroupSubnet]
$sel:vpcId:AwsRdsDbSubnetGroup' :: AwsRdsDbSubnetGroup -> Maybe Text
$sel:dbSubnetGroupName:AwsRdsDbSubnetGroup' :: AwsRdsDbSubnetGroup -> Maybe Text
..} =
    [Pair] -> Value
Core.object
      ( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ (Text
"DbSubnetGroupName" 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
dbSubnetGroupName,
            (Text
"VpcId" 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
vpcId,
            (Text
"Subnets" Text -> [AwsRdsDbSubnetGroupSubnet] -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) ([AwsRdsDbSubnetGroupSubnet] -> Pair)
-> Maybe [AwsRdsDbSubnetGroupSubnet] -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe [AwsRdsDbSubnetGroupSubnet]
subnets,
            (Text
"DbSubnetGroupDescription" 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
dbSubnetGroupDescription,
            (Text
"DbSubnetGroupArn" 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
dbSubnetGroupArn,
            (Text
"SubnetGroupStatus" 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
subnetGroupStatus
          ]
      )