{-# 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.QuickSight.Types.VpcConnectionProperties
-- 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.QuickSight.Types.VpcConnectionProperties 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

-- | VPC connection properties.
--
-- /See:/ 'newVpcConnectionProperties' smart constructor.
data VpcConnectionProperties = VpcConnectionProperties'
  { -- | The Amazon Resource Name (ARN) for the VPC connection.
    VpcConnectionProperties -> Text
vpcConnectionArn :: Prelude.Text
  }
  deriving (VpcConnectionProperties -> VpcConnectionProperties -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: VpcConnectionProperties -> VpcConnectionProperties -> Bool
$c/= :: VpcConnectionProperties -> VpcConnectionProperties -> Bool
== :: VpcConnectionProperties -> VpcConnectionProperties -> Bool
$c== :: VpcConnectionProperties -> VpcConnectionProperties -> Bool
Prelude.Eq, ReadPrec [VpcConnectionProperties]
ReadPrec VpcConnectionProperties
Int -> ReadS VpcConnectionProperties
ReadS [VpcConnectionProperties]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [VpcConnectionProperties]
$creadListPrec :: ReadPrec [VpcConnectionProperties]
readPrec :: ReadPrec VpcConnectionProperties
$creadPrec :: ReadPrec VpcConnectionProperties
readList :: ReadS [VpcConnectionProperties]
$creadList :: ReadS [VpcConnectionProperties]
readsPrec :: Int -> ReadS VpcConnectionProperties
$creadsPrec :: Int -> ReadS VpcConnectionProperties
Prelude.Read, Int -> VpcConnectionProperties -> ShowS
[VpcConnectionProperties] -> ShowS
VpcConnectionProperties -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [VpcConnectionProperties] -> ShowS
$cshowList :: [VpcConnectionProperties] -> ShowS
show :: VpcConnectionProperties -> String
$cshow :: VpcConnectionProperties -> String
showsPrec :: Int -> VpcConnectionProperties -> ShowS
$cshowsPrec :: Int -> VpcConnectionProperties -> ShowS
Prelude.Show, forall x. Rep VpcConnectionProperties x -> VpcConnectionProperties
forall x. VpcConnectionProperties -> Rep VpcConnectionProperties x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep VpcConnectionProperties x -> VpcConnectionProperties
$cfrom :: forall x. VpcConnectionProperties -> Rep VpcConnectionProperties x
Prelude.Generic)

-- |
-- Create a value of 'VpcConnectionProperties' 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:
--
-- 'vpcConnectionArn', 'vpcConnectionProperties_vpcConnectionArn' - The Amazon Resource Name (ARN) for the VPC connection.
newVpcConnectionProperties ::
  -- | 'vpcConnectionArn'
  Prelude.Text ->
  VpcConnectionProperties
newVpcConnectionProperties :: Text -> VpcConnectionProperties
newVpcConnectionProperties Text
pVpcConnectionArn_ =
  VpcConnectionProperties'
    { $sel:vpcConnectionArn:VpcConnectionProperties' :: Text
vpcConnectionArn =
        Text
pVpcConnectionArn_
    }

-- | The Amazon Resource Name (ARN) for the VPC connection.
vpcConnectionProperties_vpcConnectionArn :: Lens.Lens' VpcConnectionProperties Prelude.Text
vpcConnectionProperties_vpcConnectionArn :: Lens' VpcConnectionProperties Text
vpcConnectionProperties_vpcConnectionArn = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\VpcConnectionProperties' {Text
vpcConnectionArn :: Text
$sel:vpcConnectionArn:VpcConnectionProperties' :: VpcConnectionProperties -> Text
vpcConnectionArn} -> Text
vpcConnectionArn) (\s :: VpcConnectionProperties
s@VpcConnectionProperties' {} Text
a -> VpcConnectionProperties
s {$sel:vpcConnectionArn:VpcConnectionProperties' :: Text
vpcConnectionArn = Text
a} :: VpcConnectionProperties)

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

instance Prelude.Hashable VpcConnectionProperties where
  hashWithSalt :: Int -> VpcConnectionProperties -> Int
hashWithSalt Int
_salt VpcConnectionProperties' {Text
vpcConnectionArn :: Text
$sel:vpcConnectionArn:VpcConnectionProperties' :: VpcConnectionProperties -> Text
..} =
    Int
_salt forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
vpcConnectionArn

instance Prelude.NFData VpcConnectionProperties where
  rnf :: VpcConnectionProperties -> ()
rnf VpcConnectionProperties' {Text
vpcConnectionArn :: Text
$sel:vpcConnectionArn:VpcConnectionProperties' :: VpcConnectionProperties -> Text
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Text
vpcConnectionArn

instance Data.ToJSON VpcConnectionProperties where
  toJSON :: VpcConnectionProperties -> Value
toJSON VpcConnectionProperties' {Text
vpcConnectionArn :: Text
$sel:vpcConnectionArn:VpcConnectionProperties' :: VpcConnectionProperties -> Text
..} =
    [Pair] -> Value
Data.object
      ( forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ forall a. a -> Maybe a
Prelude.Just
              (Key
"VpcConnectionArn" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= Text
vpcConnectionArn)
          ]
      )