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

import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
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
(VpcConnectionProperties -> VpcConnectionProperties -> Bool)
-> (VpcConnectionProperties -> VpcConnectionProperties -> Bool)
-> Eq VpcConnectionProperties
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]
(Int -> ReadS VpcConnectionProperties)
-> ReadS [VpcConnectionProperties]
-> ReadPrec VpcConnectionProperties
-> ReadPrec [VpcConnectionProperties]
-> Read 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
(Int -> VpcConnectionProperties -> ShowS)
-> (VpcConnectionProperties -> String)
-> ([VpcConnectionProperties] -> ShowS)
-> Show VpcConnectionProperties
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.
 VpcConnectionProperties -> Rep VpcConnectionProperties x)
-> (forall x.
    Rep VpcConnectionProperties x -> VpcConnectionProperties)
-> Generic VpcConnectionProperties
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' :: Text -> VpcConnectionProperties
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 :: (Text -> f Text)
-> VpcConnectionProperties -> f VpcConnectionProperties
vpcConnectionProperties_vpcConnectionArn = (VpcConnectionProperties -> Text)
-> (VpcConnectionProperties -> Text -> VpcConnectionProperties)
-> Lens VpcConnectionProperties VpcConnectionProperties Text Text
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 Core.FromJSON VpcConnectionProperties where
  parseJSON :: Value -> Parser VpcConnectionProperties
parseJSON =
    String
-> (Object -> Parser VpcConnectionProperties)
-> Value
-> Parser VpcConnectionProperties
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
      String
"VpcConnectionProperties"
      ( \Object
x ->
          Text -> VpcConnectionProperties
VpcConnectionProperties'
            (Text -> VpcConnectionProperties)
-> Parser Text -> Parser VpcConnectionProperties
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Parser Text
forall a. FromJSON a => Object -> Text -> Parser a
Core..: Text
"VpcConnectionArn")
      )

instance Prelude.Hashable VpcConnectionProperties

instance Prelude.NFData VpcConnectionProperties

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