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

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

-- | Represents an Amazon Virtual Private Cloud (VPC) endpoint configuration.
--
-- /See:/ 'newVPCEConfiguration' smart constructor.
data VPCEConfiguration = VPCEConfiguration'
  { -- | 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,
    -- | The Amazon Resource Name (ARN) of the VPC endpoint configuration.
    VPCEConfiguration -> Maybe Text
arn :: 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 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
  }
  deriving (VPCEConfiguration -> VPCEConfiguration -> Bool
(VPCEConfiguration -> VPCEConfiguration -> Bool)
-> (VPCEConfiguration -> VPCEConfiguration -> Bool)
-> Eq VPCEConfiguration
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]
(Int -> ReadS VPCEConfiguration)
-> ReadS [VPCEConfiguration]
-> ReadPrec VPCEConfiguration
-> ReadPrec [VPCEConfiguration]
-> Read 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
(Int -> VPCEConfiguration -> ShowS)
-> (VPCEConfiguration -> String)
-> ([VPCEConfiguration] -> ShowS)
-> Show VPCEConfiguration
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. VPCEConfiguration -> Rep VPCEConfiguration x)
-> (forall x. Rep VPCEConfiguration x -> VPCEConfiguration)
-> Generic VPCEConfiguration
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:
--
-- 'vpceServiceName', 'vPCEConfiguration_vpceServiceName' - The name of the VPC endpoint service running in your AWS account that
-- you want Device Farm to test.
--
-- 'arn', 'vPCEConfiguration_arn' - The Amazon Resource Name (ARN) of the VPC endpoint configuration.
--
-- 'vpceConfigurationName', 'vPCEConfiguration_vpceConfigurationName' - The friendly name you give to your VPC endpoint configuration to manage
-- your configurations more easily.
--
-- '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.
newVPCEConfiguration ::
  VPCEConfiguration
newVPCEConfiguration :: VPCEConfiguration
newVPCEConfiguration =
  VPCEConfiguration' :: Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> VPCEConfiguration
VPCEConfiguration'
    { $sel:vpceServiceName:VPCEConfiguration' :: Maybe Text
vpceServiceName =
        Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:arn:VPCEConfiguration' :: Maybe Text
arn = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:vpceConfigurationName:VPCEConfiguration' :: Maybe Text
vpceConfigurationName = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:serviceDnsName:VPCEConfiguration' :: Maybe Text
serviceDnsName = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:vpceConfigurationDescription:VPCEConfiguration' :: Maybe Text
vpceConfigurationDescription = Maybe Text
forall a. Maybe a
Prelude.Nothing
    }

-- | 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 :: (Maybe Text -> f (Maybe Text))
-> VPCEConfiguration -> f VPCEConfiguration
vPCEConfiguration_vpceServiceName = (VPCEConfiguration -> Maybe Text)
-> (VPCEConfiguration -> Maybe Text -> VPCEConfiguration)
-> Lens
     VPCEConfiguration VPCEConfiguration (Maybe Text) (Maybe Text)
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)

-- | The Amazon Resource Name (ARN) of the VPC endpoint configuration.
vPCEConfiguration_arn :: Lens.Lens' VPCEConfiguration (Prelude.Maybe Prelude.Text)
vPCEConfiguration_arn :: (Maybe Text -> f (Maybe Text))
-> VPCEConfiguration -> f VPCEConfiguration
vPCEConfiguration_arn = (VPCEConfiguration -> Maybe Text)
-> (VPCEConfiguration -> Maybe Text -> VPCEConfiguration)
-> Lens
     VPCEConfiguration VPCEConfiguration (Maybe Text) (Maybe Text)
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 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 :: (Maybe Text -> f (Maybe Text))
-> VPCEConfiguration -> f VPCEConfiguration
vPCEConfiguration_vpceConfigurationName = (VPCEConfiguration -> Maybe Text)
-> (VPCEConfiguration -> Maybe Text -> VPCEConfiguration)
-> Lens
     VPCEConfiguration VPCEConfiguration (Maybe Text) (Maybe Text)
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 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 :: (Maybe Text -> f (Maybe Text))
-> VPCEConfiguration -> f VPCEConfiguration
vPCEConfiguration_serviceDnsName = (VPCEConfiguration -> Maybe Text)
-> (VPCEConfiguration -> Maybe Text -> VPCEConfiguration)
-> Lens
     VPCEConfiguration VPCEConfiguration (Maybe Text) (Maybe Text)
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 :: (Maybe Text -> f (Maybe Text))
-> VPCEConfiguration -> f VPCEConfiguration
vPCEConfiguration_vpceConfigurationDescription = (VPCEConfiguration -> Maybe Text)
-> (VPCEConfiguration -> Maybe Text -> VPCEConfiguration)
-> Lens
     VPCEConfiguration VPCEConfiguration (Maybe Text) (Maybe Text)
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)

instance Core.FromJSON VPCEConfiguration where
  parseJSON :: Value -> Parser VPCEConfiguration
parseJSON =
    String
-> (Object -> Parser VPCEConfiguration)
-> Value
-> Parser VPCEConfiguration
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
      String
"VPCEConfiguration"
      ( \Object
x ->
          Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> VPCEConfiguration
VPCEConfiguration'
            (Maybe Text
 -> Maybe Text
 -> Maybe Text
 -> Maybe Text
 -> Maybe Text
 -> VPCEConfiguration)
-> Parser (Maybe Text)
-> Parser
     (Maybe Text
      -> Maybe Text -> Maybe Text -> Maybe Text -> VPCEConfiguration)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"vpceServiceName")
            Parser
  (Maybe Text
   -> Maybe Text -> Maybe Text -> Maybe Text -> VPCEConfiguration)
-> Parser (Maybe Text)
-> Parser
     (Maybe Text -> Maybe Text -> Maybe Text -> VPCEConfiguration)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"arn")
            Parser
  (Maybe Text -> Maybe Text -> Maybe Text -> VPCEConfiguration)
-> Parser (Maybe Text)
-> Parser (Maybe Text -> Maybe Text -> VPCEConfiguration)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"vpceConfigurationName")
            Parser (Maybe Text -> Maybe Text -> VPCEConfiguration)
-> Parser (Maybe Text) -> Parser (Maybe Text -> VPCEConfiguration)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"serviceDnsName")
            Parser (Maybe Text -> VPCEConfiguration)
-> Parser (Maybe Text) -> Parser VPCEConfiguration
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"vpceConfigurationDescription")
      )

instance Prelude.Hashable VPCEConfiguration

instance Prelude.NFData VPCEConfiguration