{-# 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.DeviceFarm.Types.VPCEConfiguration
-- 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.DeviceFarm.Types.VPCEConfiguration 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

-- | Represents an Amazon Virtual Private Cloud (VPC) endpoint configuration.
--
-- /See:/ 'newVPCEConfiguration' smart constructor.
data VPCEConfiguration = VPCEConfiguration'
  { -- | The Amazon Resource Name (ARN) of the VPC endpoint configuration.
    VPCEConfiguration -> Maybe Text
arn :: Prelude.Maybe Prelude.Text,
    -- | The DNS name that maps to the private IP address of the service you want
    -- to access.
    VPCEConfiguration -> Maybe Text
serviceDnsName :: Prelude.Maybe Prelude.Text,
    -- | An optional description that provides details about your VPC endpoint
    -- configuration.
    VPCEConfiguration -> Maybe Text
vpceConfigurationDescription :: Prelude.Maybe Prelude.Text,
    -- | The friendly name you give to your VPC endpoint configuration to manage
    -- your configurations more easily.
    VPCEConfiguration -> Maybe Text
vpceConfigurationName :: Prelude.Maybe Prelude.Text,
    -- | The name of the VPC endpoint service running in your AWS account that
    -- you want Device Farm to test.
    VPCEConfiguration -> Maybe Text
vpceServiceName :: Prelude.Maybe Prelude.Text
  }
  deriving (VPCEConfiguration -> VPCEConfiguration -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: VPCEConfiguration -> VPCEConfiguration -> Bool
$c/= :: VPCEConfiguration -> VPCEConfiguration -> Bool
== :: VPCEConfiguration -> VPCEConfiguration -> Bool
$c== :: VPCEConfiguration -> VPCEConfiguration -> Bool
Prelude.Eq, ReadPrec [VPCEConfiguration]
ReadPrec VPCEConfiguration
Int -> ReadS VPCEConfiguration
ReadS [VPCEConfiguration]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [VPCEConfiguration]
$creadListPrec :: ReadPrec [VPCEConfiguration]
readPrec :: ReadPrec VPCEConfiguration
$creadPrec :: ReadPrec VPCEConfiguration
readList :: ReadS [VPCEConfiguration]
$creadList :: ReadS [VPCEConfiguration]
readsPrec :: Int -> ReadS VPCEConfiguration
$creadsPrec :: Int -> ReadS VPCEConfiguration
Prelude.Read, Int -> VPCEConfiguration -> ShowS
[VPCEConfiguration] -> ShowS
VPCEConfiguration -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [VPCEConfiguration] -> ShowS
$cshowList :: [VPCEConfiguration] -> ShowS
show :: VPCEConfiguration -> String
$cshow :: VPCEConfiguration -> String
showsPrec :: Int -> VPCEConfiguration -> ShowS
$cshowsPrec :: Int -> VPCEConfiguration -> ShowS
Prelude.Show, forall x. Rep VPCEConfiguration x -> VPCEConfiguration
forall x. VPCEConfiguration -> Rep VPCEConfiguration x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep VPCEConfiguration x -> VPCEConfiguration
$cfrom :: forall x. VPCEConfiguration -> Rep VPCEConfiguration x
Prelude.Generic)

-- |
-- Create a value of 'VPCEConfiguration' 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:
--
-- 'arn', 'vPCEConfiguration_arn' - The Amazon Resource Name (ARN) of the VPC endpoint configuration.
--
-- 'serviceDnsName', 'vPCEConfiguration_serviceDnsName' - The DNS name that maps to the private IP address of the service you want
-- to access.
--
-- 'vpceConfigurationDescription', 'vPCEConfiguration_vpceConfigurationDescription' - An optional description that provides details about your VPC endpoint
-- configuration.
--
-- 'vpceConfigurationName', 'vPCEConfiguration_vpceConfigurationName' - The friendly name you give to your VPC endpoint configuration to manage
-- your configurations more easily.
--
-- 'vpceServiceName', 'vPCEConfiguration_vpceServiceName' - The name of the VPC endpoint service running in your AWS account that
-- you want Device Farm to test.
newVPCEConfiguration ::
  VPCEConfiguration
newVPCEConfiguration :: VPCEConfiguration
newVPCEConfiguration =
  VPCEConfiguration'
    { $sel:arn:VPCEConfiguration' :: Maybe Text
arn = forall a. Maybe a
Prelude.Nothing,
      $sel:serviceDnsName:VPCEConfiguration' :: Maybe Text
serviceDnsName = forall a. Maybe a
Prelude.Nothing,
      $sel:vpceConfigurationDescription:VPCEConfiguration' :: Maybe Text
vpceConfigurationDescription = forall a. Maybe a
Prelude.Nothing,
      $sel:vpceConfigurationName:VPCEConfiguration' :: Maybe Text
vpceConfigurationName = forall a. Maybe a
Prelude.Nothing,
      $sel:vpceServiceName:VPCEConfiguration' :: Maybe Text
vpceServiceName = forall a. Maybe a
Prelude.Nothing
    }

-- | The Amazon Resource Name (ARN) of the VPC endpoint configuration.
vPCEConfiguration_arn :: Lens.Lens' VPCEConfiguration (Prelude.Maybe Prelude.Text)
vPCEConfiguration_arn :: Lens' VPCEConfiguration (Maybe Text)
vPCEConfiguration_arn = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\VPCEConfiguration' {Maybe Text
arn :: Maybe Text
$sel:arn:VPCEConfiguration' :: VPCEConfiguration -> Maybe Text
arn} -> Maybe Text
arn) (\s :: VPCEConfiguration
s@VPCEConfiguration' {} Maybe Text
a -> VPCEConfiguration
s {$sel:arn:VPCEConfiguration' :: Maybe Text
arn = Maybe Text
a} :: VPCEConfiguration)

-- | The DNS name that maps to the private IP address of the service you want
-- to access.
vPCEConfiguration_serviceDnsName :: Lens.Lens' VPCEConfiguration (Prelude.Maybe Prelude.Text)
vPCEConfiguration_serviceDnsName :: Lens' VPCEConfiguration (Maybe Text)
vPCEConfiguration_serviceDnsName = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\VPCEConfiguration' {Maybe Text
serviceDnsName :: Maybe Text
$sel:serviceDnsName:VPCEConfiguration' :: VPCEConfiguration -> Maybe Text
serviceDnsName} -> Maybe Text
serviceDnsName) (\s :: VPCEConfiguration
s@VPCEConfiguration' {} Maybe Text
a -> VPCEConfiguration
s {$sel:serviceDnsName:VPCEConfiguration' :: Maybe Text
serviceDnsName = Maybe Text
a} :: VPCEConfiguration)

-- | An optional description that provides details about your VPC endpoint
-- configuration.
vPCEConfiguration_vpceConfigurationDescription :: Lens.Lens' VPCEConfiguration (Prelude.Maybe Prelude.Text)
vPCEConfiguration_vpceConfigurationDescription :: Lens' VPCEConfiguration (Maybe Text)
vPCEConfiguration_vpceConfigurationDescription = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\VPCEConfiguration' {Maybe Text
vpceConfigurationDescription :: Maybe Text
$sel:vpceConfigurationDescription:VPCEConfiguration' :: VPCEConfiguration -> Maybe Text
vpceConfigurationDescription} -> Maybe Text
vpceConfigurationDescription) (\s :: VPCEConfiguration
s@VPCEConfiguration' {} Maybe Text
a -> VPCEConfiguration
s {$sel:vpceConfigurationDescription:VPCEConfiguration' :: Maybe Text
vpceConfigurationDescription = Maybe Text
a} :: VPCEConfiguration)

-- | The friendly name you give to your VPC endpoint configuration to manage
-- your configurations more easily.
vPCEConfiguration_vpceConfigurationName :: Lens.Lens' VPCEConfiguration (Prelude.Maybe Prelude.Text)
vPCEConfiguration_vpceConfigurationName :: Lens' VPCEConfiguration (Maybe Text)
vPCEConfiguration_vpceConfigurationName = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\VPCEConfiguration' {Maybe Text
vpceConfigurationName :: Maybe Text
$sel:vpceConfigurationName:VPCEConfiguration' :: VPCEConfiguration -> Maybe Text
vpceConfigurationName} -> Maybe Text
vpceConfigurationName) (\s :: VPCEConfiguration
s@VPCEConfiguration' {} Maybe Text
a -> VPCEConfiguration
s {$sel:vpceConfigurationName:VPCEConfiguration' :: Maybe Text
vpceConfigurationName = Maybe Text
a} :: VPCEConfiguration)

-- | The name of the VPC endpoint service running in your AWS account that
-- you want Device Farm to test.
vPCEConfiguration_vpceServiceName :: Lens.Lens' VPCEConfiguration (Prelude.Maybe Prelude.Text)
vPCEConfiguration_vpceServiceName :: Lens' VPCEConfiguration (Maybe Text)
vPCEConfiguration_vpceServiceName = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\VPCEConfiguration' {Maybe Text
vpceServiceName :: Maybe Text
$sel:vpceServiceName:VPCEConfiguration' :: VPCEConfiguration -> Maybe Text
vpceServiceName} -> Maybe Text
vpceServiceName) (\s :: VPCEConfiguration
s@VPCEConfiguration' {} Maybe Text
a -> VPCEConfiguration
s {$sel:vpceServiceName:VPCEConfiguration' :: Maybe Text
vpceServiceName = Maybe Text
a} :: VPCEConfiguration)

instance Data.FromJSON VPCEConfiguration where
  parseJSON :: Value -> Parser VPCEConfiguration
parseJSON =
    forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
      String
"VPCEConfiguration"
      ( \Object
x ->
          Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> VPCEConfiguration
VPCEConfiguration'
            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
"arn")
            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
"serviceDnsName")
            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
"vpceConfigurationDescription")
            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
"vpceConfigurationName")
            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
"vpceServiceName")
      )

instance Prelude.Hashable VPCEConfiguration where
  hashWithSalt :: Int -> VPCEConfiguration -> Int
hashWithSalt Int
_salt VPCEConfiguration' {Maybe Text
vpceServiceName :: Maybe Text
vpceConfigurationName :: Maybe Text
vpceConfigurationDescription :: Maybe Text
serviceDnsName :: Maybe Text
arn :: Maybe Text
$sel:vpceServiceName:VPCEConfiguration' :: VPCEConfiguration -> Maybe Text
$sel:vpceConfigurationName:VPCEConfiguration' :: VPCEConfiguration -> Maybe Text
$sel:vpceConfigurationDescription:VPCEConfiguration' :: VPCEConfiguration -> Maybe Text
$sel:serviceDnsName:VPCEConfiguration' :: VPCEConfiguration -> Maybe Text
$sel:arn:VPCEConfiguration' :: VPCEConfiguration -> Maybe Text
..} =
    Int
_salt
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
arn
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
serviceDnsName
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
vpceConfigurationDescription
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
vpceConfigurationName
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
vpceServiceName

instance Prelude.NFData VPCEConfiguration where
  rnf :: VPCEConfiguration -> ()
rnf VPCEConfiguration' {Maybe Text
vpceServiceName :: Maybe Text
vpceConfigurationName :: Maybe Text
vpceConfigurationDescription :: Maybe Text
serviceDnsName :: Maybe Text
arn :: Maybe Text
$sel:vpceServiceName:VPCEConfiguration' :: VPCEConfiguration -> Maybe Text
$sel:vpceConfigurationName:VPCEConfiguration' :: VPCEConfiguration -> Maybe Text
$sel:vpceConfigurationDescription:VPCEConfiguration' :: VPCEConfiguration -> Maybe Text
$sel:serviceDnsName:VPCEConfiguration' :: VPCEConfiguration -> Maybe Text
$sel:arn:VPCEConfiguration' :: VPCEConfiguration -> Maybe Text
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
arn
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
serviceDnsName
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
vpceConfigurationDescription
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
vpceConfigurationName
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
vpceServiceName