{-# 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.NetworkManager.Types.VpcOptions
-- 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.NetworkManager.Types.VpcOptions 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

-- | Describes the VPC options.
--
-- /See:/ 'newVpcOptions' smart constructor.
data VpcOptions = VpcOptions'
  { -- | Indicates whether appliance mode is supported. If enabled, traffic flow
    -- between a source and destination use the same Availability Zone for the
    -- VPC attachment for the lifetime of that flow. The default value is
    -- @false@.
    VpcOptions -> Maybe Bool
applianceModeSupport :: Prelude.Maybe Prelude.Bool,
    -- | Indicates whether IPv6 is supported.
    VpcOptions -> Maybe Bool
ipv6Support :: Prelude.Maybe Prelude.Bool
  }
  deriving (VpcOptions -> VpcOptions -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: VpcOptions -> VpcOptions -> Bool
$c/= :: VpcOptions -> VpcOptions -> Bool
== :: VpcOptions -> VpcOptions -> Bool
$c== :: VpcOptions -> VpcOptions -> Bool
Prelude.Eq, ReadPrec [VpcOptions]
ReadPrec VpcOptions
Int -> ReadS VpcOptions
ReadS [VpcOptions]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [VpcOptions]
$creadListPrec :: ReadPrec [VpcOptions]
readPrec :: ReadPrec VpcOptions
$creadPrec :: ReadPrec VpcOptions
readList :: ReadS [VpcOptions]
$creadList :: ReadS [VpcOptions]
readsPrec :: Int -> ReadS VpcOptions
$creadsPrec :: Int -> ReadS VpcOptions
Prelude.Read, Int -> VpcOptions -> ShowS
[VpcOptions] -> ShowS
VpcOptions -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [VpcOptions] -> ShowS
$cshowList :: [VpcOptions] -> ShowS
show :: VpcOptions -> String
$cshow :: VpcOptions -> String
showsPrec :: Int -> VpcOptions -> ShowS
$cshowsPrec :: Int -> VpcOptions -> ShowS
Prelude.Show, forall x. Rep VpcOptions x -> VpcOptions
forall x. VpcOptions -> Rep VpcOptions x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep VpcOptions x -> VpcOptions
$cfrom :: forall x. VpcOptions -> Rep VpcOptions x
Prelude.Generic)

-- |
-- Create a value of 'VpcOptions' 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:
--
-- 'applianceModeSupport', 'vpcOptions_applianceModeSupport' - Indicates whether appliance mode is supported. If enabled, traffic flow
-- between a source and destination use the same Availability Zone for the
-- VPC attachment for the lifetime of that flow. The default value is
-- @false@.
--
-- 'ipv6Support', 'vpcOptions_ipv6Support' - Indicates whether IPv6 is supported.
newVpcOptions ::
  VpcOptions
newVpcOptions :: VpcOptions
newVpcOptions =
  VpcOptions'
    { $sel:applianceModeSupport:VpcOptions' :: Maybe Bool
applianceModeSupport = forall a. Maybe a
Prelude.Nothing,
      $sel:ipv6Support:VpcOptions' :: Maybe Bool
ipv6Support = forall a. Maybe a
Prelude.Nothing
    }

-- | Indicates whether appliance mode is supported. If enabled, traffic flow
-- between a source and destination use the same Availability Zone for the
-- VPC attachment for the lifetime of that flow. The default value is
-- @false@.
vpcOptions_applianceModeSupport :: Lens.Lens' VpcOptions (Prelude.Maybe Prelude.Bool)
vpcOptions_applianceModeSupport :: Lens' VpcOptions (Maybe Bool)
vpcOptions_applianceModeSupport = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\VpcOptions' {Maybe Bool
applianceModeSupport :: Maybe Bool
$sel:applianceModeSupport:VpcOptions' :: VpcOptions -> Maybe Bool
applianceModeSupport} -> Maybe Bool
applianceModeSupport) (\s :: VpcOptions
s@VpcOptions' {} Maybe Bool
a -> VpcOptions
s {$sel:applianceModeSupport:VpcOptions' :: Maybe Bool
applianceModeSupport = Maybe Bool
a} :: VpcOptions)

-- | Indicates whether IPv6 is supported.
vpcOptions_ipv6Support :: Lens.Lens' VpcOptions (Prelude.Maybe Prelude.Bool)
vpcOptions_ipv6Support :: Lens' VpcOptions (Maybe Bool)
vpcOptions_ipv6Support = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\VpcOptions' {Maybe Bool
ipv6Support :: Maybe Bool
$sel:ipv6Support:VpcOptions' :: VpcOptions -> Maybe Bool
ipv6Support} -> Maybe Bool
ipv6Support) (\s :: VpcOptions
s@VpcOptions' {} Maybe Bool
a -> VpcOptions
s {$sel:ipv6Support:VpcOptions' :: Maybe Bool
ipv6Support = Maybe Bool
a} :: VpcOptions)

instance Data.FromJSON VpcOptions where
  parseJSON :: Value -> Parser VpcOptions
parseJSON =
    forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
      String
"VpcOptions"
      ( \Object
x ->
          Maybe Bool -> Maybe Bool -> VpcOptions
VpcOptions'
            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
"ApplianceModeSupport")
            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
"Ipv6Support")
      )

instance Prelude.Hashable VpcOptions where
  hashWithSalt :: Int -> VpcOptions -> Int
hashWithSalt Int
_salt VpcOptions' {Maybe Bool
ipv6Support :: Maybe Bool
applianceModeSupport :: Maybe Bool
$sel:ipv6Support:VpcOptions' :: VpcOptions -> Maybe Bool
$sel:applianceModeSupport:VpcOptions' :: VpcOptions -> Maybe Bool
..} =
    Int
_salt
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Bool
applianceModeSupport
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Bool
ipv6Support

instance Prelude.NFData VpcOptions where
  rnf :: VpcOptions -> ()
rnf VpcOptions' {Maybe Bool
ipv6Support :: Maybe Bool
applianceModeSupport :: Maybe Bool
$sel:ipv6Support:VpcOptions' :: VpcOptions -> Maybe Bool
$sel:applianceModeSupport:VpcOptions' :: VpcOptions -> Maybe Bool
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe Bool
applianceModeSupport
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Bool
ipv6Support

instance Data.ToJSON VpcOptions where
  toJSON :: VpcOptions -> Value
toJSON VpcOptions' {Maybe Bool
ipv6Support :: Maybe Bool
applianceModeSupport :: Maybe Bool
$sel:ipv6Support:VpcOptions' :: VpcOptions -> Maybe Bool
$sel:applianceModeSupport:VpcOptions' :: VpcOptions -> Maybe Bool
..} =
    [Pair] -> Value
Data.object
      ( forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ (Key
"ApplianceModeSupport" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=)
              forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Bool
applianceModeSupport,
            (Key
"Ipv6Support" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=) forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Bool
ipv6Support
          ]
      )