{-# 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.GroundStation.Types.DataflowDetail
-- 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.GroundStation.Types.DataflowDetail where

import qualified Amazonka.Core as Core
import qualified Amazonka.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
import Amazonka.GroundStation.Types.Destination
import Amazonka.GroundStation.Types.Source
import qualified Amazonka.Prelude as Prelude

-- | Information about a dataflow edge used in a contact.
--
-- /See:/ 'newDataflowDetail' smart constructor.
data DataflowDetail = DataflowDetail'
  { DataflowDetail -> Maybe Destination
destination :: Prelude.Maybe Destination,
    -- | Error message for a dataflow.
    DataflowDetail -> Maybe Text
errorMessage :: Prelude.Maybe Prelude.Text,
    DataflowDetail -> Maybe Source
source :: Prelude.Maybe Source
  }
  deriving (DataflowDetail -> DataflowDetail -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DataflowDetail -> DataflowDetail -> Bool
$c/= :: DataflowDetail -> DataflowDetail -> Bool
== :: DataflowDetail -> DataflowDetail -> Bool
$c== :: DataflowDetail -> DataflowDetail -> Bool
Prelude.Eq, ReadPrec [DataflowDetail]
ReadPrec DataflowDetail
Int -> ReadS DataflowDetail
ReadS [DataflowDetail]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DataflowDetail]
$creadListPrec :: ReadPrec [DataflowDetail]
readPrec :: ReadPrec DataflowDetail
$creadPrec :: ReadPrec DataflowDetail
readList :: ReadS [DataflowDetail]
$creadList :: ReadS [DataflowDetail]
readsPrec :: Int -> ReadS DataflowDetail
$creadsPrec :: Int -> ReadS DataflowDetail
Prelude.Read, Int -> DataflowDetail -> ShowS
[DataflowDetail] -> ShowS
DataflowDetail -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DataflowDetail] -> ShowS
$cshowList :: [DataflowDetail] -> ShowS
show :: DataflowDetail -> String
$cshow :: DataflowDetail -> String
showsPrec :: Int -> DataflowDetail -> ShowS
$cshowsPrec :: Int -> DataflowDetail -> ShowS
Prelude.Show, forall x. Rep DataflowDetail x -> DataflowDetail
forall x. DataflowDetail -> Rep DataflowDetail x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep DataflowDetail x -> DataflowDetail
$cfrom :: forall x. DataflowDetail -> Rep DataflowDetail x
Prelude.Generic)

-- |
-- Create a value of 'DataflowDetail' 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:
--
-- 'destination', 'dataflowDetail_destination' - Undocumented member.
--
-- 'errorMessage', 'dataflowDetail_errorMessage' - Error message for a dataflow.
--
-- 'source', 'dataflowDetail_source' - Undocumented member.
newDataflowDetail ::
  DataflowDetail
newDataflowDetail :: DataflowDetail
newDataflowDetail =
  DataflowDetail'
    { $sel:destination:DataflowDetail' :: Maybe Destination
destination = forall a. Maybe a
Prelude.Nothing,
      $sel:errorMessage:DataflowDetail' :: Maybe Text
errorMessage = forall a. Maybe a
Prelude.Nothing,
      $sel:source:DataflowDetail' :: Maybe Source
source = forall a. Maybe a
Prelude.Nothing
    }

-- | Undocumented member.
dataflowDetail_destination :: Lens.Lens' DataflowDetail (Prelude.Maybe Destination)
dataflowDetail_destination :: Lens' DataflowDetail (Maybe Destination)
dataflowDetail_destination = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DataflowDetail' {Maybe Destination
destination :: Maybe Destination
$sel:destination:DataflowDetail' :: DataflowDetail -> Maybe Destination
destination} -> Maybe Destination
destination) (\s :: DataflowDetail
s@DataflowDetail' {} Maybe Destination
a -> DataflowDetail
s {$sel:destination:DataflowDetail' :: Maybe Destination
destination = Maybe Destination
a} :: DataflowDetail)

-- | Error message for a dataflow.
dataflowDetail_errorMessage :: Lens.Lens' DataflowDetail (Prelude.Maybe Prelude.Text)
dataflowDetail_errorMessage :: Lens' DataflowDetail (Maybe Text)
dataflowDetail_errorMessage = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DataflowDetail' {Maybe Text
errorMessage :: Maybe Text
$sel:errorMessage:DataflowDetail' :: DataflowDetail -> Maybe Text
errorMessage} -> Maybe Text
errorMessage) (\s :: DataflowDetail
s@DataflowDetail' {} Maybe Text
a -> DataflowDetail
s {$sel:errorMessage:DataflowDetail' :: Maybe Text
errorMessage = Maybe Text
a} :: DataflowDetail)

-- | Undocumented member.
dataflowDetail_source :: Lens.Lens' DataflowDetail (Prelude.Maybe Source)
dataflowDetail_source :: Lens' DataflowDetail (Maybe Source)
dataflowDetail_source = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DataflowDetail' {Maybe Source
source :: Maybe Source
$sel:source:DataflowDetail' :: DataflowDetail -> Maybe Source
source} -> Maybe Source
source) (\s :: DataflowDetail
s@DataflowDetail' {} Maybe Source
a -> DataflowDetail
s {$sel:source:DataflowDetail' :: Maybe Source
source = Maybe Source
a} :: DataflowDetail)

instance Data.FromJSON DataflowDetail where
  parseJSON :: Value -> Parser DataflowDetail
parseJSON =
    forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
      String
"DataflowDetail"
      ( \Object
x ->
          Maybe Destination -> Maybe Text -> Maybe Source -> DataflowDetail
DataflowDetail'
            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
"destination")
            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
"errorMessage")
            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
"source")
      )

instance Prelude.Hashable DataflowDetail where
  hashWithSalt :: Int -> DataflowDetail -> Int
hashWithSalt Int
_salt DataflowDetail' {Maybe Text
Maybe Destination
Maybe Source
source :: Maybe Source
errorMessage :: Maybe Text
destination :: Maybe Destination
$sel:source:DataflowDetail' :: DataflowDetail -> Maybe Source
$sel:errorMessage:DataflowDetail' :: DataflowDetail -> Maybe Text
$sel:destination:DataflowDetail' :: DataflowDetail -> Maybe Destination
..} =
    Int
_salt
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Destination
destination
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
errorMessage
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Source
source

instance Prelude.NFData DataflowDetail where
  rnf :: DataflowDetail -> ()
rnf DataflowDetail' {Maybe Text
Maybe Destination
Maybe Source
source :: Maybe Source
errorMessage :: Maybe Text
destination :: Maybe Destination
$sel:source:DataflowDetail' :: DataflowDetail -> Maybe Source
$sel:errorMessage:DataflowDetail' :: DataflowDetail -> Maybe Text
$sel:destination:DataflowDetail' :: DataflowDetail -> Maybe Destination
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe Destination
destination
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
errorMessage
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Source
source