{-# 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.NetworkManager.Types.NetworkRouteDestination
-- 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.NetworkManager.Types.NetworkRouteDestination 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

-- | Describes the destination of a network route.
--
-- /See:/ 'newNetworkRouteDestination' smart constructor.
data NetworkRouteDestination = NetworkRouteDestination'
  { -- | The ID of a core network attachment.
    NetworkRouteDestination -> Maybe Text
coreNetworkAttachmentId :: Prelude.Maybe Prelude.Text,
    -- | The edge location for the network destination.
    NetworkRouteDestination -> Maybe Text
edgeLocation :: Prelude.Maybe Prelude.Text,
    -- | The ID of the resource.
    NetworkRouteDestination -> Maybe Text
resourceId :: Prelude.Maybe Prelude.Text,
    -- | The resource type.
    NetworkRouteDestination -> Maybe Text
resourceType :: Prelude.Maybe Prelude.Text,
    -- | The name of the segment.
    NetworkRouteDestination -> Maybe Text
segmentName :: Prelude.Maybe Prelude.Text,
    -- | The ID of the transit gateway attachment.
    NetworkRouteDestination -> Maybe Text
transitGatewayAttachmentId :: Prelude.Maybe Prelude.Text
  }
  deriving (NetworkRouteDestination -> NetworkRouteDestination -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: NetworkRouteDestination -> NetworkRouteDestination -> Bool
$c/= :: NetworkRouteDestination -> NetworkRouteDestination -> Bool
== :: NetworkRouteDestination -> NetworkRouteDestination -> Bool
$c== :: NetworkRouteDestination -> NetworkRouteDestination -> Bool
Prelude.Eq, ReadPrec [NetworkRouteDestination]
ReadPrec NetworkRouteDestination
Int -> ReadS NetworkRouteDestination
ReadS [NetworkRouteDestination]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [NetworkRouteDestination]
$creadListPrec :: ReadPrec [NetworkRouteDestination]
readPrec :: ReadPrec NetworkRouteDestination
$creadPrec :: ReadPrec NetworkRouteDestination
readList :: ReadS [NetworkRouteDestination]
$creadList :: ReadS [NetworkRouteDestination]
readsPrec :: Int -> ReadS NetworkRouteDestination
$creadsPrec :: Int -> ReadS NetworkRouteDestination
Prelude.Read, Int -> NetworkRouteDestination -> ShowS
[NetworkRouteDestination] -> ShowS
NetworkRouteDestination -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [NetworkRouteDestination] -> ShowS
$cshowList :: [NetworkRouteDestination] -> ShowS
show :: NetworkRouteDestination -> String
$cshow :: NetworkRouteDestination -> String
showsPrec :: Int -> NetworkRouteDestination -> ShowS
$cshowsPrec :: Int -> NetworkRouteDestination -> ShowS
Prelude.Show, forall x. Rep NetworkRouteDestination x -> NetworkRouteDestination
forall x. NetworkRouteDestination -> Rep NetworkRouteDestination x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep NetworkRouteDestination x -> NetworkRouteDestination
$cfrom :: forall x. NetworkRouteDestination -> Rep NetworkRouteDestination x
Prelude.Generic)

-- |
-- Create a value of 'NetworkRouteDestination' 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:
--
-- 'coreNetworkAttachmentId', 'networkRouteDestination_coreNetworkAttachmentId' - The ID of a core network attachment.
--
-- 'edgeLocation', 'networkRouteDestination_edgeLocation' - The edge location for the network destination.
--
-- 'resourceId', 'networkRouteDestination_resourceId' - The ID of the resource.
--
-- 'resourceType', 'networkRouteDestination_resourceType' - The resource type.
--
-- 'segmentName', 'networkRouteDestination_segmentName' - The name of the segment.
--
-- 'transitGatewayAttachmentId', 'networkRouteDestination_transitGatewayAttachmentId' - The ID of the transit gateway attachment.
newNetworkRouteDestination ::
  NetworkRouteDestination
newNetworkRouteDestination :: NetworkRouteDestination
newNetworkRouteDestination =
  NetworkRouteDestination'
    { $sel:coreNetworkAttachmentId:NetworkRouteDestination' :: Maybe Text
coreNetworkAttachmentId =
        forall a. Maybe a
Prelude.Nothing,
      $sel:edgeLocation:NetworkRouteDestination' :: Maybe Text
edgeLocation = forall a. Maybe a
Prelude.Nothing,
      $sel:resourceId:NetworkRouteDestination' :: Maybe Text
resourceId = forall a. Maybe a
Prelude.Nothing,
      $sel:resourceType:NetworkRouteDestination' :: Maybe Text
resourceType = forall a. Maybe a
Prelude.Nothing,
      $sel:segmentName:NetworkRouteDestination' :: Maybe Text
segmentName = forall a. Maybe a
Prelude.Nothing,
      $sel:transitGatewayAttachmentId:NetworkRouteDestination' :: Maybe Text
transitGatewayAttachmentId = forall a. Maybe a
Prelude.Nothing
    }

-- | The ID of a core network attachment.
networkRouteDestination_coreNetworkAttachmentId :: Lens.Lens' NetworkRouteDestination (Prelude.Maybe Prelude.Text)
networkRouteDestination_coreNetworkAttachmentId :: Lens' NetworkRouteDestination (Maybe Text)
networkRouteDestination_coreNetworkAttachmentId = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\NetworkRouteDestination' {Maybe Text
coreNetworkAttachmentId :: Maybe Text
$sel:coreNetworkAttachmentId:NetworkRouteDestination' :: NetworkRouteDestination -> Maybe Text
coreNetworkAttachmentId} -> Maybe Text
coreNetworkAttachmentId) (\s :: NetworkRouteDestination
s@NetworkRouteDestination' {} Maybe Text
a -> NetworkRouteDestination
s {$sel:coreNetworkAttachmentId:NetworkRouteDestination' :: Maybe Text
coreNetworkAttachmentId = Maybe Text
a} :: NetworkRouteDestination)

-- | The edge location for the network destination.
networkRouteDestination_edgeLocation :: Lens.Lens' NetworkRouteDestination (Prelude.Maybe Prelude.Text)
networkRouteDestination_edgeLocation :: Lens' NetworkRouteDestination (Maybe Text)
networkRouteDestination_edgeLocation = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\NetworkRouteDestination' {Maybe Text
edgeLocation :: Maybe Text
$sel:edgeLocation:NetworkRouteDestination' :: NetworkRouteDestination -> Maybe Text
edgeLocation} -> Maybe Text
edgeLocation) (\s :: NetworkRouteDestination
s@NetworkRouteDestination' {} Maybe Text
a -> NetworkRouteDestination
s {$sel:edgeLocation:NetworkRouteDestination' :: Maybe Text
edgeLocation = Maybe Text
a} :: NetworkRouteDestination)

-- | The ID of the resource.
networkRouteDestination_resourceId :: Lens.Lens' NetworkRouteDestination (Prelude.Maybe Prelude.Text)
networkRouteDestination_resourceId :: Lens' NetworkRouteDestination (Maybe Text)
networkRouteDestination_resourceId = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\NetworkRouteDestination' {Maybe Text
resourceId :: Maybe Text
$sel:resourceId:NetworkRouteDestination' :: NetworkRouteDestination -> Maybe Text
resourceId} -> Maybe Text
resourceId) (\s :: NetworkRouteDestination
s@NetworkRouteDestination' {} Maybe Text
a -> NetworkRouteDestination
s {$sel:resourceId:NetworkRouteDestination' :: Maybe Text
resourceId = Maybe Text
a} :: NetworkRouteDestination)

-- | The resource type.
networkRouteDestination_resourceType :: Lens.Lens' NetworkRouteDestination (Prelude.Maybe Prelude.Text)
networkRouteDestination_resourceType :: Lens' NetworkRouteDestination (Maybe Text)
networkRouteDestination_resourceType = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\NetworkRouteDestination' {Maybe Text
resourceType :: Maybe Text
$sel:resourceType:NetworkRouteDestination' :: NetworkRouteDestination -> Maybe Text
resourceType} -> Maybe Text
resourceType) (\s :: NetworkRouteDestination
s@NetworkRouteDestination' {} Maybe Text
a -> NetworkRouteDestination
s {$sel:resourceType:NetworkRouteDestination' :: Maybe Text
resourceType = Maybe Text
a} :: NetworkRouteDestination)

-- | The name of the segment.
networkRouteDestination_segmentName :: Lens.Lens' NetworkRouteDestination (Prelude.Maybe Prelude.Text)
networkRouteDestination_segmentName :: Lens' NetworkRouteDestination (Maybe Text)
networkRouteDestination_segmentName = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\NetworkRouteDestination' {Maybe Text
segmentName :: Maybe Text
$sel:segmentName:NetworkRouteDestination' :: NetworkRouteDestination -> Maybe Text
segmentName} -> Maybe Text
segmentName) (\s :: NetworkRouteDestination
s@NetworkRouteDestination' {} Maybe Text
a -> NetworkRouteDestination
s {$sel:segmentName:NetworkRouteDestination' :: Maybe Text
segmentName = Maybe Text
a} :: NetworkRouteDestination)

-- | The ID of the transit gateway attachment.
networkRouteDestination_transitGatewayAttachmentId :: Lens.Lens' NetworkRouteDestination (Prelude.Maybe Prelude.Text)
networkRouteDestination_transitGatewayAttachmentId :: Lens' NetworkRouteDestination (Maybe Text)
networkRouteDestination_transitGatewayAttachmentId = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\NetworkRouteDestination' {Maybe Text
transitGatewayAttachmentId :: Maybe Text
$sel:transitGatewayAttachmentId:NetworkRouteDestination' :: NetworkRouteDestination -> Maybe Text
transitGatewayAttachmentId} -> Maybe Text
transitGatewayAttachmentId) (\s :: NetworkRouteDestination
s@NetworkRouteDestination' {} Maybe Text
a -> NetworkRouteDestination
s {$sel:transitGatewayAttachmentId:NetworkRouteDestination' :: Maybe Text
transitGatewayAttachmentId = Maybe Text
a} :: NetworkRouteDestination)

instance Data.FromJSON NetworkRouteDestination where
  parseJSON :: Value -> Parser NetworkRouteDestination
parseJSON =
    forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
      String
"NetworkRouteDestination"
      ( \Object
x ->
          Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> NetworkRouteDestination
NetworkRouteDestination'
            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
"CoreNetworkAttachmentId")
            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
"EdgeLocation")
            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
"ResourceId")
            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
"ResourceType")
            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
"SegmentName")
            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
"TransitGatewayAttachmentId")
      )

instance Prelude.Hashable NetworkRouteDestination where
  hashWithSalt :: Int -> NetworkRouteDestination -> Int
hashWithSalt Int
_salt NetworkRouteDestination' {Maybe Text
transitGatewayAttachmentId :: Maybe Text
segmentName :: Maybe Text
resourceType :: Maybe Text
resourceId :: Maybe Text
edgeLocation :: Maybe Text
coreNetworkAttachmentId :: Maybe Text
$sel:transitGatewayAttachmentId:NetworkRouteDestination' :: NetworkRouteDestination -> Maybe Text
$sel:segmentName:NetworkRouteDestination' :: NetworkRouteDestination -> Maybe Text
$sel:resourceType:NetworkRouteDestination' :: NetworkRouteDestination -> Maybe Text
$sel:resourceId:NetworkRouteDestination' :: NetworkRouteDestination -> Maybe Text
$sel:edgeLocation:NetworkRouteDestination' :: NetworkRouteDestination -> Maybe Text
$sel:coreNetworkAttachmentId:NetworkRouteDestination' :: NetworkRouteDestination -> Maybe Text
..} =
    Int
_salt
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
coreNetworkAttachmentId
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
edgeLocation
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
resourceId
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
resourceType
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
segmentName
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
transitGatewayAttachmentId

instance Prelude.NFData NetworkRouteDestination where
  rnf :: NetworkRouteDestination -> ()
rnf NetworkRouteDestination' {Maybe Text
transitGatewayAttachmentId :: Maybe Text
segmentName :: Maybe Text
resourceType :: Maybe Text
resourceId :: Maybe Text
edgeLocation :: Maybe Text
coreNetworkAttachmentId :: Maybe Text
$sel:transitGatewayAttachmentId:NetworkRouteDestination' :: NetworkRouteDestination -> Maybe Text
$sel:segmentName:NetworkRouteDestination' :: NetworkRouteDestination -> Maybe Text
$sel:resourceType:NetworkRouteDestination' :: NetworkRouteDestination -> Maybe Text
$sel:resourceId:NetworkRouteDestination' :: NetworkRouteDestination -> Maybe Text
$sel:edgeLocation:NetworkRouteDestination' :: NetworkRouteDestination -> Maybe Text
$sel:coreNetworkAttachmentId:NetworkRouteDestination' :: NetworkRouteDestination -> Maybe Text
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
coreNetworkAttachmentId
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
edgeLocation
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
resourceId
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
resourceType
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
segmentName
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
transitGatewayAttachmentId