{-# 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.XRay.Types.InsightImpactGraphEdge
-- 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.XRay.Types.InsightImpactGraphEdge 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

-- | The connection between two service in an insight impact graph.
--
-- /See:/ 'newInsightImpactGraphEdge' smart constructor.
data InsightImpactGraphEdge = InsightImpactGraphEdge'
  { -- | Identifier of the edge. Unique within a service map.
    InsightImpactGraphEdge -> Maybe Int
referenceId :: Prelude.Maybe Prelude.Int
  }
  deriving (InsightImpactGraphEdge -> InsightImpactGraphEdge -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: InsightImpactGraphEdge -> InsightImpactGraphEdge -> Bool
$c/= :: InsightImpactGraphEdge -> InsightImpactGraphEdge -> Bool
== :: InsightImpactGraphEdge -> InsightImpactGraphEdge -> Bool
$c== :: InsightImpactGraphEdge -> InsightImpactGraphEdge -> Bool
Prelude.Eq, ReadPrec [InsightImpactGraphEdge]
ReadPrec InsightImpactGraphEdge
Int -> ReadS InsightImpactGraphEdge
ReadS [InsightImpactGraphEdge]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [InsightImpactGraphEdge]
$creadListPrec :: ReadPrec [InsightImpactGraphEdge]
readPrec :: ReadPrec InsightImpactGraphEdge
$creadPrec :: ReadPrec InsightImpactGraphEdge
readList :: ReadS [InsightImpactGraphEdge]
$creadList :: ReadS [InsightImpactGraphEdge]
readsPrec :: Int -> ReadS InsightImpactGraphEdge
$creadsPrec :: Int -> ReadS InsightImpactGraphEdge
Prelude.Read, Int -> InsightImpactGraphEdge -> ShowS
[InsightImpactGraphEdge] -> ShowS
InsightImpactGraphEdge -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [InsightImpactGraphEdge] -> ShowS
$cshowList :: [InsightImpactGraphEdge] -> ShowS
show :: InsightImpactGraphEdge -> String
$cshow :: InsightImpactGraphEdge -> String
showsPrec :: Int -> InsightImpactGraphEdge -> ShowS
$cshowsPrec :: Int -> InsightImpactGraphEdge -> ShowS
Prelude.Show, forall x. Rep InsightImpactGraphEdge x -> InsightImpactGraphEdge
forall x. InsightImpactGraphEdge -> Rep InsightImpactGraphEdge x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep InsightImpactGraphEdge x -> InsightImpactGraphEdge
$cfrom :: forall x. InsightImpactGraphEdge -> Rep InsightImpactGraphEdge x
Prelude.Generic)

-- |
-- Create a value of 'InsightImpactGraphEdge' 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:
--
-- 'referenceId', 'insightImpactGraphEdge_referenceId' - Identifier of the edge. Unique within a service map.
newInsightImpactGraphEdge ::
  InsightImpactGraphEdge
newInsightImpactGraphEdge :: InsightImpactGraphEdge
newInsightImpactGraphEdge =
  InsightImpactGraphEdge'
    { $sel:referenceId:InsightImpactGraphEdge' :: Maybe Int
referenceId =
        forall a. Maybe a
Prelude.Nothing
    }

-- | Identifier of the edge. Unique within a service map.
insightImpactGraphEdge_referenceId :: Lens.Lens' InsightImpactGraphEdge (Prelude.Maybe Prelude.Int)
insightImpactGraphEdge_referenceId :: Lens' InsightImpactGraphEdge (Maybe Int)
insightImpactGraphEdge_referenceId = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\InsightImpactGraphEdge' {Maybe Int
referenceId :: Maybe Int
$sel:referenceId:InsightImpactGraphEdge' :: InsightImpactGraphEdge -> Maybe Int
referenceId} -> Maybe Int
referenceId) (\s :: InsightImpactGraphEdge
s@InsightImpactGraphEdge' {} Maybe Int
a -> InsightImpactGraphEdge
s {$sel:referenceId:InsightImpactGraphEdge' :: Maybe Int
referenceId = Maybe Int
a} :: InsightImpactGraphEdge)

instance Data.FromJSON InsightImpactGraphEdge where
  parseJSON :: Value -> Parser InsightImpactGraphEdge
parseJSON =
    forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
      String
"InsightImpactGraphEdge"
      ( \Object
x ->
          Maybe Int -> InsightImpactGraphEdge
InsightImpactGraphEdge'
            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
"ReferenceId")
      )

instance Prelude.Hashable InsightImpactGraphEdge where
  hashWithSalt :: Int -> InsightImpactGraphEdge -> Int
hashWithSalt Int
_salt InsightImpactGraphEdge' {Maybe Int
referenceId :: Maybe Int
$sel:referenceId:InsightImpactGraphEdge' :: InsightImpactGraphEdge -> Maybe Int
..} =
    Int
_salt forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Int
referenceId

instance Prelude.NFData InsightImpactGraphEdge where
  rnf :: InsightImpactGraphEdge -> ()
rnf InsightImpactGraphEdge' {Maybe Int
referenceId :: Maybe Int
$sel:referenceId:InsightImpactGraphEdge' :: InsightImpactGraphEdge -> Maybe Int
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe Int
referenceId