{-# 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 #-}
module Amazonka.GroundStation.Types.Source 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
data Source = Source'
{
Source -> Maybe ConfigDetails
configDetails :: Prelude.Maybe ConfigDetails,
Source -> Maybe Text
configId :: Prelude.Maybe Prelude.Text,
Source -> Maybe ConfigCapabilityType
configType :: Prelude.Maybe ConfigCapabilityType,
Source -> Maybe Text
dataflowSourceRegion :: Prelude.Maybe Prelude.Text
}
deriving (Source -> Source -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: Source -> Source -> Bool
$c/= :: Source -> Source -> Bool
== :: Source -> Source -> Bool
$c== :: Source -> Source -> Bool
Prelude.Eq, ReadPrec [Source]
ReadPrec Source
Int -> ReadS Source
ReadS [Source]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [Source]
$creadListPrec :: ReadPrec [Source]
readPrec :: ReadPrec Source
$creadPrec :: ReadPrec Source
readList :: ReadS [Source]
$creadList :: ReadS [Source]
readsPrec :: Int -> ReadS Source
$creadsPrec :: Int -> ReadS Source
Prelude.Read, Int -> Source -> ShowS
[Source] -> ShowS
Source -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [Source] -> ShowS
$cshowList :: [Source] -> ShowS
show :: Source -> String
$cshow :: Source -> String
showsPrec :: Int -> Source -> ShowS
$cshowsPrec :: Int -> Source -> ShowS
Prelude.Show, forall x. Rep Source x -> Source
forall x. Source -> Rep Source x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep Source x -> Source
$cfrom :: forall x. Source -> Rep Source x
Prelude.Generic)
newSource ::
Source
newSource :: Source
newSource =
Source'
{ $sel:configDetails:Source' :: Maybe ConfigDetails
configDetails = forall a. Maybe a
Prelude.Nothing,
$sel:configId:Source' :: Maybe Text
configId = forall a. Maybe a
Prelude.Nothing,
$sel:configType:Source' :: Maybe ConfigCapabilityType
configType = forall a. Maybe a
Prelude.Nothing,
$sel:dataflowSourceRegion:Source' :: Maybe Text
dataflowSourceRegion = forall a. Maybe a
Prelude.Nothing
}
source_configDetails :: Lens.Lens' Source (Prelude.Maybe ConfigDetails)
source_configDetails :: Lens' Source (Maybe ConfigDetails)
source_configDetails = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Source' {Maybe ConfigDetails
configDetails :: Maybe ConfigDetails
$sel:configDetails:Source' :: Source -> Maybe ConfigDetails
configDetails} -> Maybe ConfigDetails
configDetails) (\s :: Source
s@Source' {} Maybe ConfigDetails
a -> Source
s {$sel:configDetails:Source' :: Maybe ConfigDetails
configDetails = Maybe ConfigDetails
a} :: Source)
source_configId :: Lens.Lens' Source (Prelude.Maybe Prelude.Text)
source_configId :: Lens' Source (Maybe Text)
source_configId = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Source' {Maybe Text
configId :: Maybe Text
$sel:configId:Source' :: Source -> Maybe Text
configId} -> Maybe Text
configId) (\s :: Source
s@Source' {} Maybe Text
a -> Source
s {$sel:configId:Source' :: Maybe Text
configId = Maybe Text
a} :: Source)
source_configType :: Lens.Lens' Source (Prelude.Maybe ConfigCapabilityType)
source_configType :: Lens' Source (Maybe ConfigCapabilityType)
source_configType = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Source' {Maybe ConfigCapabilityType
configType :: Maybe ConfigCapabilityType
$sel:configType:Source' :: Source -> Maybe ConfigCapabilityType
configType} -> Maybe ConfigCapabilityType
configType) (\s :: Source
s@Source' {} Maybe ConfigCapabilityType
a -> Source
s {$sel:configType:Source' :: Maybe ConfigCapabilityType
configType = Maybe ConfigCapabilityType
a} :: Source)
source_dataflowSourceRegion :: Lens.Lens' Source (Prelude.Maybe Prelude.Text)
source_dataflowSourceRegion :: Lens' Source (Maybe Text)
source_dataflowSourceRegion = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Source' {Maybe Text
dataflowSourceRegion :: Maybe Text
$sel:dataflowSourceRegion:Source' :: Source -> Maybe Text
dataflowSourceRegion} -> Maybe Text
dataflowSourceRegion) (\s :: Source
s@Source' {} Maybe Text
a -> Source
s {$sel:dataflowSourceRegion:Source' :: Maybe Text
dataflowSourceRegion = Maybe Text
a} :: Source)
instance Data.FromJSON Source where
parseJSON :: Value -> Parser Source
parseJSON =
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
String
"Source"
( \Object
x ->
Maybe ConfigDetails
-> Maybe Text -> Maybe ConfigCapabilityType -> Maybe Text -> Source
Source'
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
"dataflowSourceRegion")
)
instance Prelude.Hashable Source where
hashWithSalt :: Int -> Source -> Int
hashWithSalt Int
_salt Source' {Maybe Text
Maybe ConfigCapabilityType
Maybe ConfigDetails
dataflowSourceRegion :: Maybe Text
configType :: Maybe ConfigCapabilityType
configId :: Maybe Text
configDetails :: Maybe ConfigDetails
$sel:dataflowSourceRegion:Source' :: Source -> Maybe Text
$sel:configType:Source' :: Source -> Maybe ConfigCapabilityType
$sel:configId:Source' :: Source -> Maybe Text
$sel:configDetails:Source' :: Source -> 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
dataflowSourceRegion
instance Prelude.NFData Source where
rnf :: Source -> ()
rnf Source' {Maybe Text
Maybe ConfigCapabilityType
Maybe ConfigDetails
dataflowSourceRegion :: Maybe Text
configType :: Maybe ConfigCapabilityType
configId :: Maybe Text
configDetails :: Maybe ConfigDetails
$sel:dataflowSourceRegion:Source' :: Source -> Maybe Text
$sel:configType:Source' :: Source -> Maybe ConfigCapabilityType
$sel:configId:Source' :: Source -> Maybe Text
$sel:configDetails:Source' :: Source -> 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
dataflowSourceRegion