{-# 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.AppRunner.Types.VpcDNSTarget
-- 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.AppRunner.Types.VpcDNSTarget 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

-- | DNS Target record for a custom domain of this Amazon VPC.
--
-- /See:/ 'newVpcDNSTarget' smart constructor.
data VpcDNSTarget = VpcDNSTarget'
  { -- | The domain name of your target DNS that is associated with the Amazon
    -- VPC.
    VpcDNSTarget -> Maybe Text
domainName :: Prelude.Maybe Prelude.Text,
    -- | The ID of the Amazon VPC that is associated with the custom domain name
    -- of the target DNS.
    VpcDNSTarget -> Maybe Text
vpcId :: Prelude.Maybe Prelude.Text,
    -- | The Amazon Resource Name (ARN) of the VPC Ingress Connection that is
    -- associated with your service.
    VpcDNSTarget -> Maybe Text
vpcIngressConnectionArn :: Prelude.Maybe Prelude.Text
  }
  deriving (VpcDNSTarget -> VpcDNSTarget -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: VpcDNSTarget -> VpcDNSTarget -> Bool
$c/= :: VpcDNSTarget -> VpcDNSTarget -> Bool
== :: VpcDNSTarget -> VpcDNSTarget -> Bool
$c== :: VpcDNSTarget -> VpcDNSTarget -> Bool
Prelude.Eq, ReadPrec [VpcDNSTarget]
ReadPrec VpcDNSTarget
Int -> ReadS VpcDNSTarget
ReadS [VpcDNSTarget]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [VpcDNSTarget]
$creadListPrec :: ReadPrec [VpcDNSTarget]
readPrec :: ReadPrec VpcDNSTarget
$creadPrec :: ReadPrec VpcDNSTarget
readList :: ReadS [VpcDNSTarget]
$creadList :: ReadS [VpcDNSTarget]
readsPrec :: Int -> ReadS VpcDNSTarget
$creadsPrec :: Int -> ReadS VpcDNSTarget
Prelude.Read, Int -> VpcDNSTarget -> ShowS
[VpcDNSTarget] -> ShowS
VpcDNSTarget -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [VpcDNSTarget] -> ShowS
$cshowList :: [VpcDNSTarget] -> ShowS
show :: VpcDNSTarget -> String
$cshow :: VpcDNSTarget -> String
showsPrec :: Int -> VpcDNSTarget -> ShowS
$cshowsPrec :: Int -> VpcDNSTarget -> ShowS
Prelude.Show, forall x. Rep VpcDNSTarget x -> VpcDNSTarget
forall x. VpcDNSTarget -> Rep VpcDNSTarget x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep VpcDNSTarget x -> VpcDNSTarget
$cfrom :: forall x. VpcDNSTarget -> Rep VpcDNSTarget x
Prelude.Generic)

-- |
-- Create a value of 'VpcDNSTarget' 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:
--
-- 'domainName', 'vpcDNSTarget_domainName' - The domain name of your target DNS that is associated with the Amazon
-- VPC.
--
-- 'vpcId', 'vpcDNSTarget_vpcId' - The ID of the Amazon VPC that is associated with the custom domain name
-- of the target DNS.
--
-- 'vpcIngressConnectionArn', 'vpcDNSTarget_vpcIngressConnectionArn' - The Amazon Resource Name (ARN) of the VPC Ingress Connection that is
-- associated with your service.
newVpcDNSTarget ::
  VpcDNSTarget
newVpcDNSTarget :: VpcDNSTarget
newVpcDNSTarget =
  VpcDNSTarget'
    { $sel:domainName:VpcDNSTarget' :: Maybe Text
domainName = forall a. Maybe a
Prelude.Nothing,
      $sel:vpcId:VpcDNSTarget' :: Maybe Text
vpcId = forall a. Maybe a
Prelude.Nothing,
      $sel:vpcIngressConnectionArn:VpcDNSTarget' :: Maybe Text
vpcIngressConnectionArn = forall a. Maybe a
Prelude.Nothing
    }

-- | The domain name of your target DNS that is associated with the Amazon
-- VPC.
vpcDNSTarget_domainName :: Lens.Lens' VpcDNSTarget (Prelude.Maybe Prelude.Text)
vpcDNSTarget_domainName :: Lens' VpcDNSTarget (Maybe Text)
vpcDNSTarget_domainName = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\VpcDNSTarget' {Maybe Text
domainName :: Maybe Text
$sel:domainName:VpcDNSTarget' :: VpcDNSTarget -> Maybe Text
domainName} -> Maybe Text
domainName) (\s :: VpcDNSTarget
s@VpcDNSTarget' {} Maybe Text
a -> VpcDNSTarget
s {$sel:domainName:VpcDNSTarget' :: Maybe Text
domainName = Maybe Text
a} :: VpcDNSTarget)

-- | The ID of the Amazon VPC that is associated with the custom domain name
-- of the target DNS.
vpcDNSTarget_vpcId :: Lens.Lens' VpcDNSTarget (Prelude.Maybe Prelude.Text)
vpcDNSTarget_vpcId :: Lens' VpcDNSTarget (Maybe Text)
vpcDNSTarget_vpcId = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\VpcDNSTarget' {Maybe Text
vpcId :: Maybe Text
$sel:vpcId:VpcDNSTarget' :: VpcDNSTarget -> Maybe Text
vpcId} -> Maybe Text
vpcId) (\s :: VpcDNSTarget
s@VpcDNSTarget' {} Maybe Text
a -> VpcDNSTarget
s {$sel:vpcId:VpcDNSTarget' :: Maybe Text
vpcId = Maybe Text
a} :: VpcDNSTarget)

-- | The Amazon Resource Name (ARN) of the VPC Ingress Connection that is
-- associated with your service.
vpcDNSTarget_vpcIngressConnectionArn :: Lens.Lens' VpcDNSTarget (Prelude.Maybe Prelude.Text)
vpcDNSTarget_vpcIngressConnectionArn :: Lens' VpcDNSTarget (Maybe Text)
vpcDNSTarget_vpcIngressConnectionArn = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\VpcDNSTarget' {Maybe Text
vpcIngressConnectionArn :: Maybe Text
$sel:vpcIngressConnectionArn:VpcDNSTarget' :: VpcDNSTarget -> Maybe Text
vpcIngressConnectionArn} -> Maybe Text
vpcIngressConnectionArn) (\s :: VpcDNSTarget
s@VpcDNSTarget' {} Maybe Text
a -> VpcDNSTarget
s {$sel:vpcIngressConnectionArn:VpcDNSTarget' :: Maybe Text
vpcIngressConnectionArn = Maybe Text
a} :: VpcDNSTarget)

instance Data.FromJSON VpcDNSTarget where
  parseJSON :: Value -> Parser VpcDNSTarget
parseJSON =
    forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
      String
"VpcDNSTarget"
      ( \Object
x ->
          Maybe Text -> Maybe Text -> Maybe Text -> VpcDNSTarget
VpcDNSTarget'
            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
"DomainName")
            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
"VpcId")
            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
"VpcIngressConnectionArn")
      )

instance Prelude.Hashable VpcDNSTarget where
  hashWithSalt :: Int -> VpcDNSTarget -> Int
hashWithSalt Int
_salt VpcDNSTarget' {Maybe Text
vpcIngressConnectionArn :: Maybe Text
vpcId :: Maybe Text
domainName :: Maybe Text
$sel:vpcIngressConnectionArn:VpcDNSTarget' :: VpcDNSTarget -> Maybe Text
$sel:vpcId:VpcDNSTarget' :: VpcDNSTarget -> Maybe Text
$sel:domainName:VpcDNSTarget' :: VpcDNSTarget -> Maybe Text
..} =
    Int
_salt
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
domainName
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
vpcId
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
vpcIngressConnectionArn

instance Prelude.NFData VpcDNSTarget where
  rnf :: VpcDNSTarget -> ()
rnf VpcDNSTarget' {Maybe Text
vpcIngressConnectionArn :: Maybe Text
vpcId :: Maybe Text
domainName :: Maybe Text
$sel:vpcIngressConnectionArn:VpcDNSTarget' :: VpcDNSTarget -> Maybe Text
$sel:vpcId:VpcDNSTarget' :: VpcDNSTarget -> Maybe Text
$sel:domainName:VpcDNSTarget' :: VpcDNSTarget -> Maybe Text
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
domainName
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
vpcId
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
vpcIngressConnectionArn