{-# 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.TimeStreamQuery.Types.TargetDestination
-- 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.TimeStreamQuery.Types.TargetDestination 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
import Amazonka.TimeStreamQuery.Types.TimestreamDestination

-- | Destination details to write data for a target data source. Current
-- supported data source is Timestream.
--
-- /See:/ 'newTargetDestination' smart constructor.
data TargetDestination = TargetDestination'
  { -- | Query result destination details for Timestream data source.
    TargetDestination -> Maybe TimestreamDestination
timestreamDestination :: Prelude.Maybe TimestreamDestination
  }
  deriving (TargetDestination -> TargetDestination -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: TargetDestination -> TargetDestination -> Bool
$c/= :: TargetDestination -> TargetDestination -> Bool
== :: TargetDestination -> TargetDestination -> Bool
$c== :: TargetDestination -> TargetDestination -> Bool
Prelude.Eq, ReadPrec [TargetDestination]
ReadPrec TargetDestination
Int -> ReadS TargetDestination
ReadS [TargetDestination]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [TargetDestination]
$creadListPrec :: ReadPrec [TargetDestination]
readPrec :: ReadPrec TargetDestination
$creadPrec :: ReadPrec TargetDestination
readList :: ReadS [TargetDestination]
$creadList :: ReadS [TargetDestination]
readsPrec :: Int -> ReadS TargetDestination
$creadsPrec :: Int -> ReadS TargetDestination
Prelude.Read, Int -> TargetDestination -> ShowS
[TargetDestination] -> ShowS
TargetDestination -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [TargetDestination] -> ShowS
$cshowList :: [TargetDestination] -> ShowS
show :: TargetDestination -> String
$cshow :: TargetDestination -> String
showsPrec :: Int -> TargetDestination -> ShowS
$cshowsPrec :: Int -> TargetDestination -> ShowS
Prelude.Show, forall x. Rep TargetDestination x -> TargetDestination
forall x. TargetDestination -> Rep TargetDestination x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep TargetDestination x -> TargetDestination
$cfrom :: forall x. TargetDestination -> Rep TargetDestination x
Prelude.Generic)

-- |
-- Create a value of 'TargetDestination' 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:
--
-- 'timestreamDestination', 'targetDestination_timestreamDestination' - Query result destination details for Timestream data source.
newTargetDestination ::
  TargetDestination
newTargetDestination :: TargetDestination
newTargetDestination =
  TargetDestination'
    { $sel:timestreamDestination:TargetDestination' :: Maybe TimestreamDestination
timestreamDestination =
        forall a. Maybe a
Prelude.Nothing
    }

-- | Query result destination details for Timestream data source.
targetDestination_timestreamDestination :: Lens.Lens' TargetDestination (Prelude.Maybe TimestreamDestination)
targetDestination_timestreamDestination :: Lens' TargetDestination (Maybe TimestreamDestination)
targetDestination_timestreamDestination = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\TargetDestination' {Maybe TimestreamDestination
timestreamDestination :: Maybe TimestreamDestination
$sel:timestreamDestination:TargetDestination' :: TargetDestination -> Maybe TimestreamDestination
timestreamDestination} -> Maybe TimestreamDestination
timestreamDestination) (\s :: TargetDestination
s@TargetDestination' {} Maybe TimestreamDestination
a -> TargetDestination
s {$sel:timestreamDestination:TargetDestination' :: Maybe TimestreamDestination
timestreamDestination = Maybe TimestreamDestination
a} :: TargetDestination)

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

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

instance Prelude.NFData TargetDestination where
  rnf :: TargetDestination -> ()
rnf TargetDestination' {Maybe TimestreamDestination
timestreamDestination :: Maybe TimestreamDestination
$sel:timestreamDestination:TargetDestination' :: TargetDestination -> Maybe TimestreamDestination
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe TimestreamDestination
timestreamDestination