{-# 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.DirectConnect.Types.VirtualGateway
-- Copyright   : (c) 2013-2023 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay
-- Stability   : auto-generated
-- Portability : non-portable (GHC extensions)
module Amazonka.DirectConnect.Types.VirtualGateway where

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

-- | Information about a virtual private gateway for a private virtual
-- interface.
--
-- /See:/ 'newVirtualGateway' smart constructor.
data VirtualGateway = VirtualGateway'
  { -- | The ID of the virtual private gateway.
    VirtualGateway -> Maybe Text
virtualGatewayId :: Prelude.Maybe Prelude.Text,
    -- | The state of the virtual private gateway. The following are the possible
    -- values:
    --
    -- -   @pending@: Initial state after creating the virtual private gateway.
    --
    -- -   @available@: Ready for use by a private virtual interface.
    --
    -- -   @deleting@: Initial state after deleting the virtual private
    --     gateway.
    --
    -- -   @deleted@: The virtual private gateway is deleted. The private
    --     virtual interface is unable to send traffic over this gateway.
    VirtualGateway -> Maybe Text
virtualGatewayState :: Prelude.Maybe Prelude.Text
  }
  deriving (VirtualGateway -> VirtualGateway -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: VirtualGateway -> VirtualGateway -> Bool
$c/= :: VirtualGateway -> VirtualGateway -> Bool
== :: VirtualGateway -> VirtualGateway -> Bool
$c== :: VirtualGateway -> VirtualGateway -> Bool
Prelude.Eq, ReadPrec [VirtualGateway]
ReadPrec VirtualGateway
Int -> ReadS VirtualGateway
ReadS [VirtualGateway]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [VirtualGateway]
$creadListPrec :: ReadPrec [VirtualGateway]
readPrec :: ReadPrec VirtualGateway
$creadPrec :: ReadPrec VirtualGateway
readList :: ReadS [VirtualGateway]
$creadList :: ReadS [VirtualGateway]
readsPrec :: Int -> ReadS VirtualGateway
$creadsPrec :: Int -> ReadS VirtualGateway
Prelude.Read, Int -> VirtualGateway -> ShowS
[VirtualGateway] -> ShowS
VirtualGateway -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [VirtualGateway] -> ShowS
$cshowList :: [VirtualGateway] -> ShowS
show :: VirtualGateway -> String
$cshow :: VirtualGateway -> String
showsPrec :: Int -> VirtualGateway -> ShowS
$cshowsPrec :: Int -> VirtualGateway -> ShowS
Prelude.Show, forall x. Rep VirtualGateway x -> VirtualGateway
forall x. VirtualGateway -> Rep VirtualGateway x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep VirtualGateway x -> VirtualGateway
$cfrom :: forall x. VirtualGateway -> Rep VirtualGateway x
Prelude.Generic)

-- |
-- Create a value of 'VirtualGateway' 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:
--
-- 'virtualGatewayId', 'virtualGateway_virtualGatewayId' - The ID of the virtual private gateway.
--
-- 'virtualGatewayState', 'virtualGateway_virtualGatewayState' - The state of the virtual private gateway. The following are the possible
-- values:
--
-- -   @pending@: Initial state after creating the virtual private gateway.
--
-- -   @available@: Ready for use by a private virtual interface.
--
-- -   @deleting@: Initial state after deleting the virtual private
--     gateway.
--
-- -   @deleted@: The virtual private gateway is deleted. The private
--     virtual interface is unable to send traffic over this gateway.
newVirtualGateway ::
  VirtualGateway
newVirtualGateway :: VirtualGateway
newVirtualGateway =
  VirtualGateway'
    { $sel:virtualGatewayId:VirtualGateway' :: Maybe Text
virtualGatewayId = forall a. Maybe a
Prelude.Nothing,
      $sel:virtualGatewayState:VirtualGateway' :: Maybe Text
virtualGatewayState = forall a. Maybe a
Prelude.Nothing
    }

-- | The ID of the virtual private gateway.
virtualGateway_virtualGatewayId :: Lens.Lens' VirtualGateway (Prelude.Maybe Prelude.Text)
virtualGateway_virtualGatewayId :: Lens' VirtualGateway (Maybe Text)
virtualGateway_virtualGatewayId = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\VirtualGateway' {Maybe Text
virtualGatewayId :: Maybe Text
$sel:virtualGatewayId:VirtualGateway' :: VirtualGateway -> Maybe Text
virtualGatewayId} -> Maybe Text
virtualGatewayId) (\s :: VirtualGateway
s@VirtualGateway' {} Maybe Text
a -> VirtualGateway
s {$sel:virtualGatewayId:VirtualGateway' :: Maybe Text
virtualGatewayId = Maybe Text
a} :: VirtualGateway)

-- | The state of the virtual private gateway. The following are the possible
-- values:
--
-- -   @pending@: Initial state after creating the virtual private gateway.
--
-- -   @available@: Ready for use by a private virtual interface.
--
-- -   @deleting@: Initial state after deleting the virtual private
--     gateway.
--
-- -   @deleted@: The virtual private gateway is deleted. The private
--     virtual interface is unable to send traffic over this gateway.
virtualGateway_virtualGatewayState :: Lens.Lens' VirtualGateway (Prelude.Maybe Prelude.Text)
virtualGateway_virtualGatewayState :: Lens' VirtualGateway (Maybe Text)
virtualGateway_virtualGatewayState = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\VirtualGateway' {Maybe Text
virtualGatewayState :: Maybe Text
$sel:virtualGatewayState:VirtualGateway' :: VirtualGateway -> Maybe Text
virtualGatewayState} -> Maybe Text
virtualGatewayState) (\s :: VirtualGateway
s@VirtualGateway' {} Maybe Text
a -> VirtualGateway
s {$sel:virtualGatewayState:VirtualGateway' :: Maybe Text
virtualGatewayState = Maybe Text
a} :: VirtualGateway)

instance Data.FromJSON VirtualGateway where
  parseJSON :: Value -> Parser VirtualGateway
parseJSON =
    forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
      String
"VirtualGateway"
      ( \Object
x ->
          Maybe Text -> Maybe Text -> VirtualGateway
VirtualGateway'
            forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"virtualGatewayId")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"virtualGatewayState")
      )

instance Prelude.Hashable VirtualGateway where
  hashWithSalt :: Int -> VirtualGateway -> Int
hashWithSalt Int
_salt VirtualGateway' {Maybe Text
virtualGatewayState :: Maybe Text
virtualGatewayId :: Maybe Text
$sel:virtualGatewayState:VirtualGateway' :: VirtualGateway -> Maybe Text
$sel:virtualGatewayId:VirtualGateway' :: VirtualGateway -> Maybe Text
..} =
    Int
_salt
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
virtualGatewayId
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
virtualGatewayState

instance Prelude.NFData VirtualGateway where
  rnf :: VirtualGateway -> ()
rnf VirtualGateway' {Maybe Text
virtualGatewayState :: Maybe Text
virtualGatewayId :: Maybe Text
$sel:virtualGatewayState:VirtualGateway' :: VirtualGateway -> Maybe Text
$sel:virtualGatewayId:VirtualGateway' :: VirtualGateway -> Maybe Text
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
virtualGatewayId
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
virtualGatewayState