{-# 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.ApiGatewayV2.Types.VpcLink
-- 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.ApiGatewayV2.Types.VpcLink where

import Amazonka.ApiGatewayV2.Types.VpcLinkStatus
import Amazonka.ApiGatewayV2.Types.VpcLinkVersion
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude

-- | Represents a VPC link.
--
-- /See:/ 'newVpcLink' smart constructor.
data VpcLink = VpcLink'
  { -- | The timestamp when the VPC link was created.
    VpcLink -> Maybe POSIX
createdDate :: Prelude.Maybe Core.POSIX,
    -- | The version of the VPC link.
    VpcLink -> Maybe VpcLinkVersion
vpcLinkVersion :: Prelude.Maybe VpcLinkVersion,
    -- | A message summarizing the cause of the status of the VPC link.
    VpcLink -> Maybe Text
vpcLinkStatusMessage :: Prelude.Maybe Prelude.Text,
    -- | Tags for the VPC link.
    VpcLink -> Maybe (HashMap Text Text)
tags :: Prelude.Maybe (Prelude.HashMap Prelude.Text Prelude.Text),
    -- | The status of the VPC link.
    VpcLink -> Maybe VpcLinkStatus
vpcLinkStatus :: Prelude.Maybe VpcLinkStatus,
    -- | The ID of the VPC link.
    VpcLink -> Text
vpcLinkId :: Prelude.Text,
    -- | A list of security group IDs for the VPC link.
    VpcLink -> [Text]
securityGroupIds :: [Prelude.Text],
    -- | A list of subnet IDs to include in the VPC link.
    VpcLink -> [Text]
subnetIds :: [Prelude.Text],
    -- | The name of the VPC link.
    VpcLink -> Text
name :: Prelude.Text
  }
  deriving (VpcLink -> VpcLink -> Bool
(VpcLink -> VpcLink -> Bool)
-> (VpcLink -> VpcLink -> Bool) -> Eq VpcLink
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: VpcLink -> VpcLink -> Bool
$c/= :: VpcLink -> VpcLink -> Bool
== :: VpcLink -> VpcLink -> Bool
$c== :: VpcLink -> VpcLink -> Bool
Prelude.Eq, ReadPrec [VpcLink]
ReadPrec VpcLink
Int -> ReadS VpcLink
ReadS [VpcLink]
(Int -> ReadS VpcLink)
-> ReadS [VpcLink]
-> ReadPrec VpcLink
-> ReadPrec [VpcLink]
-> Read VpcLink
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [VpcLink]
$creadListPrec :: ReadPrec [VpcLink]
readPrec :: ReadPrec VpcLink
$creadPrec :: ReadPrec VpcLink
readList :: ReadS [VpcLink]
$creadList :: ReadS [VpcLink]
readsPrec :: Int -> ReadS VpcLink
$creadsPrec :: Int -> ReadS VpcLink
Prelude.Read, Int -> VpcLink -> ShowS
[VpcLink] -> ShowS
VpcLink -> String
(Int -> VpcLink -> ShowS)
-> (VpcLink -> String) -> ([VpcLink] -> ShowS) -> Show VpcLink
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [VpcLink] -> ShowS
$cshowList :: [VpcLink] -> ShowS
show :: VpcLink -> String
$cshow :: VpcLink -> String
showsPrec :: Int -> VpcLink -> ShowS
$cshowsPrec :: Int -> VpcLink -> ShowS
Prelude.Show, (forall x. VpcLink -> Rep VpcLink x)
-> (forall x. Rep VpcLink x -> VpcLink) -> Generic VpcLink
forall x. Rep VpcLink x -> VpcLink
forall x. VpcLink -> Rep VpcLink x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep VpcLink x -> VpcLink
$cfrom :: forall x. VpcLink -> Rep VpcLink x
Prelude.Generic)

-- |
-- Create a value of 'VpcLink' 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:
--
-- 'createdDate', 'vpcLink_createdDate' - The timestamp when the VPC link was created.
--
-- 'vpcLinkVersion', 'vpcLink_vpcLinkVersion' - The version of the VPC link.
--
-- 'vpcLinkStatusMessage', 'vpcLink_vpcLinkStatusMessage' - A message summarizing the cause of the status of the VPC link.
--
-- 'tags', 'vpcLink_tags' - Tags for the VPC link.
--
-- 'vpcLinkStatus', 'vpcLink_vpcLinkStatus' - The status of the VPC link.
--
-- 'vpcLinkId', 'vpcLink_vpcLinkId' - The ID of the VPC link.
--
-- 'securityGroupIds', 'vpcLink_securityGroupIds' - A list of security group IDs for the VPC link.
--
-- 'subnetIds', 'vpcLink_subnetIds' - A list of subnet IDs to include in the VPC link.
--
-- 'name', 'vpcLink_name' - The name of the VPC link.
newVpcLink ::
  -- | 'vpcLinkId'
  Prelude.Text ->
  -- | 'name'
  Prelude.Text ->
  VpcLink
newVpcLink :: Text -> Text -> VpcLink
newVpcLink Text
pVpcLinkId_ Text
pName_ =
  VpcLink' :: Maybe POSIX
-> Maybe VpcLinkVersion
-> Maybe Text
-> Maybe (HashMap Text Text)
-> Maybe VpcLinkStatus
-> Text
-> [Text]
-> [Text]
-> Text
-> VpcLink
VpcLink'
    { $sel:createdDate:VpcLink' :: Maybe POSIX
createdDate = Maybe POSIX
forall a. Maybe a
Prelude.Nothing,
      $sel:vpcLinkVersion:VpcLink' :: Maybe VpcLinkVersion
vpcLinkVersion = Maybe VpcLinkVersion
forall a. Maybe a
Prelude.Nothing,
      $sel:vpcLinkStatusMessage:VpcLink' :: Maybe Text
vpcLinkStatusMessage = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:tags:VpcLink' :: Maybe (HashMap Text Text)
tags = Maybe (HashMap Text Text)
forall a. Maybe a
Prelude.Nothing,
      $sel:vpcLinkStatus:VpcLink' :: Maybe VpcLinkStatus
vpcLinkStatus = Maybe VpcLinkStatus
forall a. Maybe a
Prelude.Nothing,
      $sel:vpcLinkId:VpcLink' :: Text
vpcLinkId = Text
pVpcLinkId_,
      $sel:securityGroupIds:VpcLink' :: [Text]
securityGroupIds = [Text]
forall a. Monoid a => a
Prelude.mempty,
      $sel:subnetIds:VpcLink' :: [Text]
subnetIds = [Text]
forall a. Monoid a => a
Prelude.mempty,
      $sel:name:VpcLink' :: Text
name = Text
pName_
    }

-- | The timestamp when the VPC link was created.
vpcLink_createdDate :: Lens.Lens' VpcLink (Prelude.Maybe Prelude.UTCTime)
vpcLink_createdDate :: (Maybe UTCTime -> f (Maybe UTCTime)) -> VpcLink -> f VpcLink
vpcLink_createdDate = (VpcLink -> Maybe POSIX)
-> (VpcLink -> Maybe POSIX -> VpcLink)
-> Lens VpcLink VpcLink (Maybe POSIX) (Maybe POSIX)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\VpcLink' {Maybe POSIX
createdDate :: Maybe POSIX
$sel:createdDate:VpcLink' :: VpcLink -> Maybe POSIX
createdDate} -> Maybe POSIX
createdDate) (\s :: VpcLink
s@VpcLink' {} Maybe POSIX
a -> VpcLink
s {$sel:createdDate:VpcLink' :: Maybe POSIX
createdDate = Maybe POSIX
a} :: VpcLink) ((Maybe POSIX -> f (Maybe POSIX)) -> VpcLink -> f VpcLink)
-> ((Maybe UTCTime -> f (Maybe UTCTime))
    -> Maybe POSIX -> f (Maybe POSIX))
-> (Maybe UTCTime -> f (Maybe UTCTime))
-> VpcLink
-> f VpcLink
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso POSIX POSIX UTCTime UTCTime
-> Iso (Maybe POSIX) (Maybe POSIX) (Maybe UTCTime) (Maybe UTCTime)
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 POSIX POSIX UTCTime UTCTime
forall (a :: Format). Iso' (Time a) UTCTime
Core._Time

-- | The version of the VPC link.
vpcLink_vpcLinkVersion :: Lens.Lens' VpcLink (Prelude.Maybe VpcLinkVersion)
vpcLink_vpcLinkVersion :: (Maybe VpcLinkVersion -> f (Maybe VpcLinkVersion))
-> VpcLink -> f VpcLink
vpcLink_vpcLinkVersion = (VpcLink -> Maybe VpcLinkVersion)
-> (VpcLink -> Maybe VpcLinkVersion -> VpcLink)
-> Lens
     VpcLink VpcLink (Maybe VpcLinkVersion) (Maybe VpcLinkVersion)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\VpcLink' {Maybe VpcLinkVersion
vpcLinkVersion :: Maybe VpcLinkVersion
$sel:vpcLinkVersion:VpcLink' :: VpcLink -> Maybe VpcLinkVersion
vpcLinkVersion} -> Maybe VpcLinkVersion
vpcLinkVersion) (\s :: VpcLink
s@VpcLink' {} Maybe VpcLinkVersion
a -> VpcLink
s {$sel:vpcLinkVersion:VpcLink' :: Maybe VpcLinkVersion
vpcLinkVersion = Maybe VpcLinkVersion
a} :: VpcLink)

-- | A message summarizing the cause of the status of the VPC link.
vpcLink_vpcLinkStatusMessage :: Lens.Lens' VpcLink (Prelude.Maybe Prelude.Text)
vpcLink_vpcLinkStatusMessage :: (Maybe Text -> f (Maybe Text)) -> VpcLink -> f VpcLink
vpcLink_vpcLinkStatusMessage = (VpcLink -> Maybe Text)
-> (VpcLink -> Maybe Text -> VpcLink)
-> Lens VpcLink VpcLink (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\VpcLink' {Maybe Text
vpcLinkStatusMessage :: Maybe Text
$sel:vpcLinkStatusMessage:VpcLink' :: VpcLink -> Maybe Text
vpcLinkStatusMessage} -> Maybe Text
vpcLinkStatusMessage) (\s :: VpcLink
s@VpcLink' {} Maybe Text
a -> VpcLink
s {$sel:vpcLinkStatusMessage:VpcLink' :: Maybe Text
vpcLinkStatusMessage = Maybe Text
a} :: VpcLink)

-- | Tags for the VPC link.
vpcLink_tags :: Lens.Lens' VpcLink (Prelude.Maybe (Prelude.HashMap Prelude.Text Prelude.Text))
vpcLink_tags :: (Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
-> VpcLink -> f VpcLink
vpcLink_tags = (VpcLink -> Maybe (HashMap Text Text))
-> (VpcLink -> Maybe (HashMap Text Text) -> VpcLink)
-> Lens
     VpcLink
     VpcLink
     (Maybe (HashMap Text Text))
     (Maybe (HashMap Text Text))
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\VpcLink' {Maybe (HashMap Text Text)
tags :: Maybe (HashMap Text Text)
$sel:tags:VpcLink' :: VpcLink -> Maybe (HashMap Text Text)
tags} -> Maybe (HashMap Text Text)
tags) (\s :: VpcLink
s@VpcLink' {} Maybe (HashMap Text Text)
a -> VpcLink
s {$sel:tags:VpcLink' :: Maybe (HashMap Text Text)
tags = Maybe (HashMap Text Text)
a} :: VpcLink) ((Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
 -> VpcLink -> f VpcLink)
-> ((Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
    -> Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
-> (Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
-> VpcLink
-> f VpcLink
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
  (HashMap Text Text)
  (HashMap Text Text)
  (HashMap Text Text)
  (HashMap Text Text)
-> Iso
     (Maybe (HashMap Text Text))
     (Maybe (HashMap Text Text))
     (Maybe (HashMap Text Text))
     (Maybe (HashMap Text 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
  (HashMap Text Text)
  (HashMap Text Text)
  (HashMap Text Text)
  (HashMap Text Text)
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | The status of the VPC link.
vpcLink_vpcLinkStatus :: Lens.Lens' VpcLink (Prelude.Maybe VpcLinkStatus)
vpcLink_vpcLinkStatus :: (Maybe VpcLinkStatus -> f (Maybe VpcLinkStatus))
-> VpcLink -> f VpcLink
vpcLink_vpcLinkStatus = (VpcLink -> Maybe VpcLinkStatus)
-> (VpcLink -> Maybe VpcLinkStatus -> VpcLink)
-> Lens VpcLink VpcLink (Maybe VpcLinkStatus) (Maybe VpcLinkStatus)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\VpcLink' {Maybe VpcLinkStatus
vpcLinkStatus :: Maybe VpcLinkStatus
$sel:vpcLinkStatus:VpcLink' :: VpcLink -> Maybe VpcLinkStatus
vpcLinkStatus} -> Maybe VpcLinkStatus
vpcLinkStatus) (\s :: VpcLink
s@VpcLink' {} Maybe VpcLinkStatus
a -> VpcLink
s {$sel:vpcLinkStatus:VpcLink' :: Maybe VpcLinkStatus
vpcLinkStatus = Maybe VpcLinkStatus
a} :: VpcLink)

-- | The ID of the VPC link.
vpcLink_vpcLinkId :: Lens.Lens' VpcLink Prelude.Text
vpcLink_vpcLinkId :: (Text -> f Text) -> VpcLink -> f VpcLink
vpcLink_vpcLinkId = (VpcLink -> Text)
-> (VpcLink -> Text -> VpcLink) -> Lens VpcLink VpcLink Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\VpcLink' {Text
vpcLinkId :: Text
$sel:vpcLinkId:VpcLink' :: VpcLink -> Text
vpcLinkId} -> Text
vpcLinkId) (\s :: VpcLink
s@VpcLink' {} Text
a -> VpcLink
s {$sel:vpcLinkId:VpcLink' :: Text
vpcLinkId = Text
a} :: VpcLink)

-- | A list of security group IDs for the VPC link.
vpcLink_securityGroupIds :: Lens.Lens' VpcLink [Prelude.Text]
vpcLink_securityGroupIds :: ([Text] -> f [Text]) -> VpcLink -> f VpcLink
vpcLink_securityGroupIds = (VpcLink -> [Text])
-> (VpcLink -> [Text] -> VpcLink)
-> Lens VpcLink VpcLink [Text] [Text]
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\VpcLink' {[Text]
securityGroupIds :: [Text]
$sel:securityGroupIds:VpcLink' :: VpcLink -> [Text]
securityGroupIds} -> [Text]
securityGroupIds) (\s :: VpcLink
s@VpcLink' {} [Text]
a -> VpcLink
s {$sel:securityGroupIds:VpcLink' :: [Text]
securityGroupIds = [Text]
a} :: VpcLink) (([Text] -> f [Text]) -> VpcLink -> f VpcLink)
-> (([Text] -> f [Text]) -> [Text] -> f [Text])
-> ([Text] -> f [Text])
-> VpcLink
-> f VpcLink
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. ([Text] -> f [Text]) -> [Text] -> f [Text]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | A list of subnet IDs to include in the VPC link.
vpcLink_subnetIds :: Lens.Lens' VpcLink [Prelude.Text]
vpcLink_subnetIds :: ([Text] -> f [Text]) -> VpcLink -> f VpcLink
vpcLink_subnetIds = (VpcLink -> [Text])
-> (VpcLink -> [Text] -> VpcLink)
-> Lens VpcLink VpcLink [Text] [Text]
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\VpcLink' {[Text]
subnetIds :: [Text]
$sel:subnetIds:VpcLink' :: VpcLink -> [Text]
subnetIds} -> [Text]
subnetIds) (\s :: VpcLink
s@VpcLink' {} [Text]
a -> VpcLink
s {$sel:subnetIds:VpcLink' :: [Text]
subnetIds = [Text]
a} :: VpcLink) (([Text] -> f [Text]) -> VpcLink -> f VpcLink)
-> (([Text] -> f [Text]) -> [Text] -> f [Text])
-> ([Text] -> f [Text])
-> VpcLink
-> f VpcLink
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. ([Text] -> f [Text]) -> [Text] -> f [Text]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | The name of the VPC link.
vpcLink_name :: Lens.Lens' VpcLink Prelude.Text
vpcLink_name :: (Text -> f Text) -> VpcLink -> f VpcLink
vpcLink_name = (VpcLink -> Text)
-> (VpcLink -> Text -> VpcLink) -> Lens VpcLink VpcLink Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\VpcLink' {Text
name :: Text
$sel:name:VpcLink' :: VpcLink -> Text
name} -> Text
name) (\s :: VpcLink
s@VpcLink' {} Text
a -> VpcLink
s {$sel:name:VpcLink' :: Text
name = Text
a} :: VpcLink)

instance Core.FromJSON VpcLink where
  parseJSON :: Value -> Parser VpcLink
parseJSON =
    String -> (Object -> Parser VpcLink) -> Value -> Parser VpcLink
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
      String
"VpcLink"
      ( \Object
x ->
          Maybe POSIX
-> Maybe VpcLinkVersion
-> Maybe Text
-> Maybe (HashMap Text Text)
-> Maybe VpcLinkStatus
-> Text
-> [Text]
-> [Text]
-> Text
-> VpcLink
VpcLink'
            (Maybe POSIX
 -> Maybe VpcLinkVersion
 -> Maybe Text
 -> Maybe (HashMap Text Text)
 -> Maybe VpcLinkStatus
 -> Text
 -> [Text]
 -> [Text]
 -> Text
 -> VpcLink)
-> Parser (Maybe POSIX)
-> Parser
     (Maybe VpcLinkVersion
      -> Maybe Text
      -> Maybe (HashMap Text Text)
      -> Maybe VpcLinkStatus
      -> Text
      -> [Text]
      -> [Text]
      -> Text
      -> VpcLink)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Parser (Maybe POSIX)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"createdDate")
            Parser
  (Maybe VpcLinkVersion
   -> Maybe Text
   -> Maybe (HashMap Text Text)
   -> Maybe VpcLinkStatus
   -> Text
   -> [Text]
   -> [Text]
   -> Text
   -> VpcLink)
-> Parser (Maybe VpcLinkVersion)
-> Parser
     (Maybe Text
      -> Maybe (HashMap Text Text)
      -> Maybe VpcLinkStatus
      -> Text
      -> [Text]
      -> [Text]
      -> Text
      -> VpcLink)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe VpcLinkVersion)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"vpcLinkVersion")
            Parser
  (Maybe Text
   -> Maybe (HashMap Text Text)
   -> Maybe VpcLinkStatus
   -> Text
   -> [Text]
   -> [Text]
   -> Text
   -> VpcLink)
-> Parser (Maybe Text)
-> Parser
     (Maybe (HashMap Text Text)
      -> Maybe VpcLinkStatus
      -> Text
      -> [Text]
      -> [Text]
      -> Text
      -> VpcLink)
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
"vpcLinkStatusMessage")
            Parser
  (Maybe (HashMap Text Text)
   -> Maybe VpcLinkStatus
   -> Text
   -> [Text]
   -> [Text]
   -> Text
   -> VpcLink)
-> Parser (Maybe (HashMap Text Text))
-> Parser
     (Maybe VpcLinkStatus
      -> Text -> [Text] -> [Text] -> Text -> VpcLink)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe (Maybe (HashMap Text Text)))
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"tags" Parser (Maybe (Maybe (HashMap Text Text)))
-> Maybe (HashMap Text Text) -> Parser (Maybe (HashMap Text Text))
forall a. Parser (Maybe a) -> a -> Parser a
Core..!= Maybe (HashMap Text Text)
forall a. Monoid a => a
Prelude.mempty)
            Parser
  (Maybe VpcLinkStatus
   -> Text -> [Text] -> [Text] -> Text -> VpcLink)
-> Parser (Maybe VpcLinkStatus)
-> Parser (Text -> [Text] -> [Text] -> Text -> VpcLink)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe VpcLinkStatus)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"vpcLinkStatus")
            Parser (Text -> [Text] -> [Text] -> Text -> VpcLink)
-> Parser Text -> Parser ([Text] -> [Text] -> Text -> VpcLink)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser Text
forall a. FromJSON a => Object -> Text -> Parser a
Core..: Text
"vpcLinkId")
            Parser ([Text] -> [Text] -> Text -> VpcLink)
-> Parser [Text] -> Parser ([Text] -> Text -> VpcLink)
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
"securityGroupIds"
                            Parser (Maybe [Text]) -> [Text] -> Parser [Text]
forall a. Parser (Maybe a) -> a -> Parser a
Core..!= [Text]
forall a. Monoid a => a
Prelude.mempty
                        )
            Parser ([Text] -> Text -> VpcLink)
-> Parser [Text] -> Parser (Text -> VpcLink)
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
"subnetIds" Parser (Maybe [Text]) -> [Text] -> Parser [Text]
forall a. Parser (Maybe a) -> a -> Parser a
Core..!= [Text]
forall a. Monoid a => a
Prelude.mempty)
            Parser (Text -> VpcLink) -> Parser Text -> Parser VpcLink
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser Text
forall a. FromJSON a => Object -> Text -> Parser a
Core..: Text
"name")
      )

instance Prelude.Hashable VpcLink

instance Prelude.NFData VpcLink