{-# 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.Destination
-- 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.Destination 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.ConfigCapabilityType
import Amazonka.GroundStation.Types.ConfigDetails
import qualified Amazonka.Prelude as Prelude

-- | Dataflow details for the destination side.
--
-- /See:/ 'newDestination' smart constructor.
data Destination = Destination'
  { -- | Additional details for a @Config@, if type is dataflow endpoint or
    -- antenna demod decode.
    Destination -> Maybe ConfigDetails
configDetails :: Prelude.Maybe ConfigDetails,
    -- | UUID of a @Config@.
    Destination -> Maybe Text
configId :: Prelude.Maybe Prelude.Text,
    -- | Type of a @Config@.
    Destination -> Maybe ConfigCapabilityType
configType :: Prelude.Maybe ConfigCapabilityType,
    -- | Region of a dataflow destination.
    Destination -> Maybe Text
dataflowDestinationRegion :: Prelude.Maybe Prelude.Text
  }
  deriving (Destination -> Destination -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: Destination -> Destination -> Bool
$c/= :: Destination -> Destination -> Bool
== :: Destination -> Destination -> Bool
$c== :: Destination -> Destination -> Bool
Prelude.Eq, ReadPrec [Destination]
ReadPrec Destination
Int -> ReadS Destination
ReadS [Destination]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [Destination]
$creadListPrec :: ReadPrec [Destination]
readPrec :: ReadPrec Destination
$creadPrec :: ReadPrec Destination
readList :: ReadS [Destination]
$creadList :: ReadS [Destination]
readsPrec :: Int -> ReadS Destination
$creadsPrec :: Int -> ReadS Destination
Prelude.Read, Int -> Destination -> ShowS
[Destination] -> ShowS
Destination -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [Destination] -> ShowS
$cshowList :: [Destination] -> ShowS
show :: Destination -> String
$cshow :: Destination -> String
showsPrec :: Int -> Destination -> ShowS
$cshowsPrec :: Int -> Destination -> ShowS
Prelude.Show, forall x. Rep Destination x -> Destination
forall x. Destination -> Rep Destination x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep Destination x -> Destination
$cfrom :: forall x. Destination -> Rep Destination x
Prelude.Generic)

-- |
-- Create a value of 'Destination' 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:
--
-- 'configDetails', 'destination_configDetails' - Additional details for a @Config@, if type is dataflow endpoint or
-- antenna demod decode.
--
-- 'configId', 'destination_configId' - UUID of a @Config@.
--
-- 'configType', 'destination_configType' - Type of a @Config@.
--
-- 'dataflowDestinationRegion', 'destination_dataflowDestinationRegion' - Region of a dataflow destination.
newDestination ::
  Destination
newDestination :: Destination
newDestination =
  Destination'
    { $sel:configDetails:Destination' :: Maybe ConfigDetails
configDetails = forall a. Maybe a
Prelude.Nothing,
      $sel:configId:Destination' :: Maybe Text
configId = forall a. Maybe a
Prelude.Nothing,
      $sel:configType:Destination' :: Maybe ConfigCapabilityType
configType = forall a. Maybe a
Prelude.Nothing,
      $sel:dataflowDestinationRegion:Destination' :: Maybe Text
dataflowDestinationRegion = forall a. Maybe a
Prelude.Nothing
    }

-- | Additional details for a @Config@, if type is dataflow endpoint or
-- antenna demod decode.
destination_configDetails :: Lens.Lens' Destination (Prelude.Maybe ConfigDetails)
destination_configDetails :: Lens' Destination (Maybe ConfigDetails)
destination_configDetails = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Destination' {Maybe ConfigDetails
configDetails :: Maybe ConfigDetails
$sel:configDetails:Destination' :: Destination -> Maybe ConfigDetails
configDetails} -> Maybe ConfigDetails
configDetails) (\s :: Destination
s@Destination' {} Maybe ConfigDetails
a -> Destination
s {$sel:configDetails:Destination' :: Maybe ConfigDetails
configDetails = Maybe ConfigDetails
a} :: Destination)

-- | UUID of a @Config@.
destination_configId :: Lens.Lens' Destination (Prelude.Maybe Prelude.Text)
destination_configId :: Lens' Destination (Maybe Text)
destination_configId = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Destination' {Maybe Text
configId :: Maybe Text
$sel:configId:Destination' :: Destination -> Maybe Text
configId} -> Maybe Text
configId) (\s :: Destination
s@Destination' {} Maybe Text
a -> Destination
s {$sel:configId:Destination' :: Maybe Text
configId = Maybe Text
a} :: Destination)

-- | Type of a @Config@.
destination_configType :: Lens.Lens' Destination (Prelude.Maybe ConfigCapabilityType)
destination_configType :: Lens' Destination (Maybe ConfigCapabilityType)
destination_configType = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Destination' {Maybe ConfigCapabilityType
configType :: Maybe ConfigCapabilityType
$sel:configType:Destination' :: Destination -> Maybe ConfigCapabilityType
configType} -> Maybe ConfigCapabilityType
configType) (\s :: Destination
s@Destination' {} Maybe ConfigCapabilityType
a -> Destination
s {$sel:configType:Destination' :: Maybe ConfigCapabilityType
configType = Maybe ConfigCapabilityType
a} :: Destination)

-- | Region of a dataflow destination.
destination_dataflowDestinationRegion :: Lens.Lens' Destination (Prelude.Maybe Prelude.Text)
destination_dataflowDestinationRegion :: Lens' Destination (Maybe Text)
destination_dataflowDestinationRegion = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Destination' {Maybe Text
dataflowDestinationRegion :: Maybe Text
$sel:dataflowDestinationRegion:Destination' :: Destination -> Maybe Text
dataflowDestinationRegion} -> Maybe Text
dataflowDestinationRegion) (\s :: Destination
s@Destination' {} Maybe Text
a -> Destination
s {$sel:dataflowDestinationRegion:Destination' :: Maybe Text
dataflowDestinationRegion = Maybe Text
a} :: Destination)

instance Data.FromJSON Destination where
  parseJSON :: Value -> Parser Destination
parseJSON =
    forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
      String
"Destination"
      ( \Object
x ->
          Maybe ConfigDetails
-> Maybe Text
-> Maybe ConfigCapabilityType
-> Maybe Text
-> Destination
Destination'
            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
"configDetails")
            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
"configId")
            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
"configType")
            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
"dataflowDestinationRegion")
      )

instance Prelude.Hashable Destination where
  hashWithSalt :: Int -> Destination -> Int
hashWithSalt Int
_salt Destination' {Maybe Text
Maybe ConfigCapabilityType
Maybe ConfigDetails
dataflowDestinationRegion :: Maybe Text
configType :: Maybe ConfigCapabilityType
configId :: Maybe Text
configDetails :: Maybe ConfigDetails
$sel:dataflowDestinationRegion:Destination' :: Destination -> Maybe Text
$sel:configType:Destination' :: Destination -> Maybe ConfigCapabilityType
$sel:configId:Destination' :: Destination -> Maybe Text
$sel:configDetails:Destination' :: Destination -> Maybe ConfigDetails
..} =
    Int
_salt
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe ConfigDetails
configDetails
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
configId
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe ConfigCapabilityType
configType
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
dataflowDestinationRegion

instance Prelude.NFData Destination where
  rnf :: Destination -> ()
rnf Destination' {Maybe Text
Maybe ConfigCapabilityType
Maybe ConfigDetails
dataflowDestinationRegion :: Maybe Text
configType :: Maybe ConfigCapabilityType
configId :: Maybe Text
configDetails :: Maybe ConfigDetails
$sel:dataflowDestinationRegion:Destination' :: Destination -> Maybe Text
$sel:configType:Destination' :: Destination -> Maybe ConfigCapabilityType
$sel:configId:Destination' :: Destination -> Maybe Text
$sel:configDetails:Destination' :: Destination -> Maybe ConfigDetails
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe ConfigDetails
configDetails
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
configId
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe ConfigCapabilityType
configType
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
dataflowDestinationRegion