{-# 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.IoTEvents.Types.InputIdentifier where
import qualified Amazonka.Core as Core
import Amazonka.IoTEvents.Types.IotEventsInputIdentifier
import Amazonka.IoTEvents.Types.IotSiteWiseInputIdentifier
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
data InputIdentifier = InputIdentifier'
{
InputIdentifier -> Maybe IotSiteWiseInputIdentifier
iotSiteWiseInputIdentifier :: Prelude.Maybe IotSiteWiseInputIdentifier,
InputIdentifier -> Maybe IotEventsInputIdentifier
iotEventsInputIdentifier :: Prelude.Maybe IotEventsInputIdentifier
}
deriving (InputIdentifier -> InputIdentifier -> Bool
(InputIdentifier -> InputIdentifier -> Bool)
-> (InputIdentifier -> InputIdentifier -> Bool)
-> Eq InputIdentifier
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: InputIdentifier -> InputIdentifier -> Bool
$c/= :: InputIdentifier -> InputIdentifier -> Bool
== :: InputIdentifier -> InputIdentifier -> Bool
$c== :: InputIdentifier -> InputIdentifier -> Bool
Prelude.Eq, ReadPrec [InputIdentifier]
ReadPrec InputIdentifier
Int -> ReadS InputIdentifier
ReadS [InputIdentifier]
(Int -> ReadS InputIdentifier)
-> ReadS [InputIdentifier]
-> ReadPrec InputIdentifier
-> ReadPrec [InputIdentifier]
-> Read InputIdentifier
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [InputIdentifier]
$creadListPrec :: ReadPrec [InputIdentifier]
readPrec :: ReadPrec InputIdentifier
$creadPrec :: ReadPrec InputIdentifier
readList :: ReadS [InputIdentifier]
$creadList :: ReadS [InputIdentifier]
readsPrec :: Int -> ReadS InputIdentifier
$creadsPrec :: Int -> ReadS InputIdentifier
Prelude.Read, Int -> InputIdentifier -> ShowS
[InputIdentifier] -> ShowS
InputIdentifier -> String
(Int -> InputIdentifier -> ShowS)
-> (InputIdentifier -> String)
-> ([InputIdentifier] -> ShowS)
-> Show InputIdentifier
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [InputIdentifier] -> ShowS
$cshowList :: [InputIdentifier] -> ShowS
show :: InputIdentifier -> String
$cshow :: InputIdentifier -> String
showsPrec :: Int -> InputIdentifier -> ShowS
$cshowsPrec :: Int -> InputIdentifier -> ShowS
Prelude.Show, (forall x. InputIdentifier -> Rep InputIdentifier x)
-> (forall x. Rep InputIdentifier x -> InputIdentifier)
-> Generic InputIdentifier
forall x. Rep InputIdentifier x -> InputIdentifier
forall x. InputIdentifier -> Rep InputIdentifier x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep InputIdentifier x -> InputIdentifier
$cfrom :: forall x. InputIdentifier -> Rep InputIdentifier x
Prelude.Generic)
newInputIdentifier ::
InputIdentifier
newInputIdentifier :: InputIdentifier
newInputIdentifier =
InputIdentifier' :: Maybe IotSiteWiseInputIdentifier
-> Maybe IotEventsInputIdentifier -> InputIdentifier
InputIdentifier'
{ $sel:iotSiteWiseInputIdentifier:InputIdentifier' :: Maybe IotSiteWiseInputIdentifier
iotSiteWiseInputIdentifier =
Maybe IotSiteWiseInputIdentifier
forall a. Maybe a
Prelude.Nothing,
$sel:iotEventsInputIdentifier:InputIdentifier' :: Maybe IotEventsInputIdentifier
iotEventsInputIdentifier = Maybe IotEventsInputIdentifier
forall a. Maybe a
Prelude.Nothing
}
inputIdentifier_iotSiteWiseInputIdentifier :: Lens.Lens' InputIdentifier (Prelude.Maybe IotSiteWiseInputIdentifier)
inputIdentifier_iotSiteWiseInputIdentifier :: (Maybe IotSiteWiseInputIdentifier
-> f (Maybe IotSiteWiseInputIdentifier))
-> InputIdentifier -> f InputIdentifier
inputIdentifier_iotSiteWiseInputIdentifier = (InputIdentifier -> Maybe IotSiteWiseInputIdentifier)
-> (InputIdentifier
-> Maybe IotSiteWiseInputIdentifier -> InputIdentifier)
-> Lens
InputIdentifier
InputIdentifier
(Maybe IotSiteWiseInputIdentifier)
(Maybe IotSiteWiseInputIdentifier)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\InputIdentifier' {Maybe IotSiteWiseInputIdentifier
iotSiteWiseInputIdentifier :: Maybe IotSiteWiseInputIdentifier
$sel:iotSiteWiseInputIdentifier:InputIdentifier' :: InputIdentifier -> Maybe IotSiteWiseInputIdentifier
iotSiteWiseInputIdentifier} -> Maybe IotSiteWiseInputIdentifier
iotSiteWiseInputIdentifier) (\s :: InputIdentifier
s@InputIdentifier' {} Maybe IotSiteWiseInputIdentifier
a -> InputIdentifier
s {$sel:iotSiteWiseInputIdentifier:InputIdentifier' :: Maybe IotSiteWiseInputIdentifier
iotSiteWiseInputIdentifier = Maybe IotSiteWiseInputIdentifier
a} :: InputIdentifier)
inputIdentifier_iotEventsInputIdentifier :: Lens.Lens' InputIdentifier (Prelude.Maybe IotEventsInputIdentifier)
inputIdentifier_iotEventsInputIdentifier :: (Maybe IotEventsInputIdentifier
-> f (Maybe IotEventsInputIdentifier))
-> InputIdentifier -> f InputIdentifier
inputIdentifier_iotEventsInputIdentifier = (InputIdentifier -> Maybe IotEventsInputIdentifier)
-> (InputIdentifier
-> Maybe IotEventsInputIdentifier -> InputIdentifier)
-> Lens
InputIdentifier
InputIdentifier
(Maybe IotEventsInputIdentifier)
(Maybe IotEventsInputIdentifier)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\InputIdentifier' {Maybe IotEventsInputIdentifier
iotEventsInputIdentifier :: Maybe IotEventsInputIdentifier
$sel:iotEventsInputIdentifier:InputIdentifier' :: InputIdentifier -> Maybe IotEventsInputIdentifier
iotEventsInputIdentifier} -> Maybe IotEventsInputIdentifier
iotEventsInputIdentifier) (\s :: InputIdentifier
s@InputIdentifier' {} Maybe IotEventsInputIdentifier
a -> InputIdentifier
s {$sel:iotEventsInputIdentifier:InputIdentifier' :: Maybe IotEventsInputIdentifier
iotEventsInputIdentifier = Maybe IotEventsInputIdentifier
a} :: InputIdentifier)
instance Prelude.Hashable InputIdentifier
instance Prelude.NFData InputIdentifier
instance Core.ToJSON InputIdentifier where
toJSON :: InputIdentifier -> Value
toJSON InputIdentifier' {Maybe IotEventsInputIdentifier
Maybe IotSiteWiseInputIdentifier
iotEventsInputIdentifier :: Maybe IotEventsInputIdentifier
iotSiteWiseInputIdentifier :: Maybe IotSiteWiseInputIdentifier
$sel:iotEventsInputIdentifier:InputIdentifier' :: InputIdentifier -> Maybe IotEventsInputIdentifier
$sel:iotSiteWiseInputIdentifier:InputIdentifier' :: InputIdentifier -> Maybe IotSiteWiseInputIdentifier
..} =
[Pair] -> Value
Core.object
( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ (Text
"iotSiteWiseInputIdentifier" Text -> IotSiteWiseInputIdentifier -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
(IotSiteWiseInputIdentifier -> Pair)
-> Maybe IotSiteWiseInputIdentifier -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe IotSiteWiseInputIdentifier
iotSiteWiseInputIdentifier,
(Text
"iotEventsInputIdentifier" Text -> IotEventsInputIdentifier -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
(IotEventsInputIdentifier -> Pair)
-> Maybe IotEventsInputIdentifier -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe IotEventsInputIdentifier
iotEventsInputIdentifier
]
)