{-# 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 Amazonka.GroundStation.Types.ConfigCapabilityType
import Amazonka.GroundStation.Types.ConfigDetails
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
data Source = Source'
{
Source -> Maybe Text
dataflowSourceRegion :: Prelude.Maybe Prelude.Text,
Source -> Maybe Text
configId :: Prelude.Maybe Prelude.Text,
Source -> Maybe ConfigCapabilityType
configType :: Prelude.Maybe ConfigCapabilityType,
Source -> Maybe ConfigDetails
configDetails :: Prelude.Maybe ConfigDetails
}
deriving (Source -> Source -> Bool
(Source -> Source -> Bool)
-> (Source -> Source -> Bool) -> Eq Source
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]
(Int -> ReadS Source)
-> ReadS [Source]
-> ReadPrec Source
-> ReadPrec [Source]
-> Read 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
(Int -> Source -> ShowS)
-> (Source -> String) -> ([Source] -> ShowS) -> Show Source
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. Source -> Rep Source x)
-> (forall x. Rep Source x -> Source) -> Generic Source
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' :: Maybe Text
-> Maybe Text
-> Maybe ConfigCapabilityType
-> Maybe ConfigDetails
-> Source
Source'
{ $sel:dataflowSourceRegion:Source' :: Maybe Text
dataflowSourceRegion = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:configId:Source' :: Maybe Text
configId = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:configType:Source' :: Maybe ConfigCapabilityType
configType = Maybe ConfigCapabilityType
forall a. Maybe a
Prelude.Nothing,
$sel:configDetails:Source' :: Maybe ConfigDetails
configDetails = Maybe ConfigDetails
forall a. Maybe a
Prelude.Nothing
}
source_dataflowSourceRegion :: Lens.Lens' Source (Prelude.Maybe Prelude.Text)
source_dataflowSourceRegion :: (Maybe Text -> f (Maybe Text)) -> Source -> f Source
source_dataflowSourceRegion = (Source -> Maybe Text)
-> (Source -> Maybe Text -> Source)
-> Lens Source Source (Maybe Text) (Maybe Text)
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)
source_configId :: Lens.Lens' Source (Prelude.Maybe Prelude.Text)
source_configId :: (Maybe Text -> f (Maybe Text)) -> Source -> f Source
source_configId = (Source -> Maybe Text)
-> (Source -> Maybe Text -> Source)
-> Lens Source Source (Maybe Text) (Maybe Text)
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 :: (Maybe ConfigCapabilityType -> f (Maybe ConfigCapabilityType))
-> Source -> f Source
source_configType = (Source -> Maybe ConfigCapabilityType)
-> (Source -> Maybe ConfigCapabilityType -> Source)
-> Lens
Source
Source
(Maybe ConfigCapabilityType)
(Maybe ConfigCapabilityType)
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_configDetails :: Lens.Lens' Source (Prelude.Maybe ConfigDetails)
source_configDetails :: (Maybe ConfigDetails -> f (Maybe ConfigDetails))
-> Source -> f Source
source_configDetails = (Source -> Maybe ConfigDetails)
-> (Source -> Maybe ConfigDetails -> Source)
-> Lens Source Source (Maybe ConfigDetails) (Maybe 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)
instance Core.FromJSON Source where
parseJSON :: Value -> Parser Source
parseJSON =
String -> (Object -> Parser Source) -> Value -> Parser Source
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
String
"Source"
( \Object
x ->
Maybe Text
-> Maybe Text
-> Maybe ConfigCapabilityType
-> Maybe ConfigDetails
-> Source
Source'
(Maybe Text
-> Maybe Text
-> Maybe ConfigCapabilityType
-> Maybe ConfigDetails
-> Source)
-> Parser (Maybe Text)
-> Parser
(Maybe Text
-> Maybe ConfigCapabilityType -> Maybe ConfigDetails -> Source)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"dataflowSourceRegion")
Parser
(Maybe Text
-> Maybe ConfigCapabilityType -> Maybe ConfigDetails -> Source)
-> Parser (Maybe Text)
-> Parser
(Maybe ConfigCapabilityType -> Maybe ConfigDetails -> Source)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"configId")
Parser
(Maybe ConfigCapabilityType -> Maybe ConfigDetails -> Source)
-> Parser (Maybe ConfigCapabilityType)
-> Parser (Maybe ConfigDetails -> Source)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe ConfigCapabilityType)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"configType")
Parser (Maybe ConfigDetails -> Source)
-> Parser (Maybe ConfigDetails) -> Parser Source
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe ConfigDetails)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"configDetails")
)
instance Prelude.Hashable Source
instance Prelude.NFData Source