{-# 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.IotTwinMaker.Types.FunctionResponse where
import qualified Amazonka.Core as Core
import qualified Amazonka.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
import Amazonka.IotTwinMaker.Types.DataConnector
import Amazonka.IotTwinMaker.Types.Scope
import qualified Amazonka.Prelude as Prelude
data FunctionResponse = FunctionResponse'
{
FunctionResponse -> Maybe DataConnector
implementedBy :: Prelude.Maybe DataConnector,
FunctionResponse -> Maybe Bool
isInherited :: Prelude.Maybe Prelude.Bool,
FunctionResponse -> Maybe [Text]
requiredProperties :: Prelude.Maybe [Prelude.Text],
FunctionResponse -> Maybe Scope
scope :: Prelude.Maybe Scope
}
deriving (FunctionResponse -> FunctionResponse -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: FunctionResponse -> FunctionResponse -> Bool
$c/= :: FunctionResponse -> FunctionResponse -> Bool
== :: FunctionResponse -> FunctionResponse -> Bool
$c== :: FunctionResponse -> FunctionResponse -> Bool
Prelude.Eq, ReadPrec [FunctionResponse]
ReadPrec FunctionResponse
Int -> ReadS FunctionResponse
ReadS [FunctionResponse]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [FunctionResponse]
$creadListPrec :: ReadPrec [FunctionResponse]
readPrec :: ReadPrec FunctionResponse
$creadPrec :: ReadPrec FunctionResponse
readList :: ReadS [FunctionResponse]
$creadList :: ReadS [FunctionResponse]
readsPrec :: Int -> ReadS FunctionResponse
$creadsPrec :: Int -> ReadS FunctionResponse
Prelude.Read, Int -> FunctionResponse -> ShowS
[FunctionResponse] -> ShowS
FunctionResponse -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [FunctionResponse] -> ShowS
$cshowList :: [FunctionResponse] -> ShowS
show :: FunctionResponse -> String
$cshow :: FunctionResponse -> String
showsPrec :: Int -> FunctionResponse -> ShowS
$cshowsPrec :: Int -> FunctionResponse -> ShowS
Prelude.Show, forall x. Rep FunctionResponse x -> FunctionResponse
forall x. FunctionResponse -> Rep FunctionResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep FunctionResponse x -> FunctionResponse
$cfrom :: forall x. FunctionResponse -> Rep FunctionResponse x
Prelude.Generic)
newFunctionResponse ::
FunctionResponse
newFunctionResponse :: FunctionResponse
newFunctionResponse =
FunctionResponse'
{ $sel:implementedBy:FunctionResponse' :: Maybe DataConnector
implementedBy = forall a. Maybe a
Prelude.Nothing,
$sel:isInherited:FunctionResponse' :: Maybe Bool
isInherited = forall a. Maybe a
Prelude.Nothing,
$sel:requiredProperties:FunctionResponse' :: Maybe [Text]
requiredProperties = forall a. Maybe a
Prelude.Nothing,
$sel:scope:FunctionResponse' :: Maybe Scope
scope = forall a. Maybe a
Prelude.Nothing
}
functionResponse_implementedBy :: Lens.Lens' FunctionResponse (Prelude.Maybe DataConnector)
functionResponse_implementedBy :: Lens' FunctionResponse (Maybe DataConnector)
functionResponse_implementedBy = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\FunctionResponse' {Maybe DataConnector
implementedBy :: Maybe DataConnector
$sel:implementedBy:FunctionResponse' :: FunctionResponse -> Maybe DataConnector
implementedBy} -> Maybe DataConnector
implementedBy) (\s :: FunctionResponse
s@FunctionResponse' {} Maybe DataConnector
a -> FunctionResponse
s {$sel:implementedBy:FunctionResponse' :: Maybe DataConnector
implementedBy = Maybe DataConnector
a} :: FunctionResponse)
functionResponse_isInherited :: Lens.Lens' FunctionResponse (Prelude.Maybe Prelude.Bool)
functionResponse_isInherited :: Lens' FunctionResponse (Maybe Bool)
functionResponse_isInherited = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\FunctionResponse' {Maybe Bool
isInherited :: Maybe Bool
$sel:isInherited:FunctionResponse' :: FunctionResponse -> Maybe Bool
isInherited} -> Maybe Bool
isInherited) (\s :: FunctionResponse
s@FunctionResponse' {} Maybe Bool
a -> FunctionResponse
s {$sel:isInherited:FunctionResponse' :: Maybe Bool
isInherited = Maybe Bool
a} :: FunctionResponse)
functionResponse_requiredProperties :: Lens.Lens' FunctionResponse (Prelude.Maybe [Prelude.Text])
functionResponse_requiredProperties :: Lens' FunctionResponse (Maybe [Text])
functionResponse_requiredProperties = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\FunctionResponse' {Maybe [Text]
requiredProperties :: Maybe [Text]
$sel:requiredProperties:FunctionResponse' :: FunctionResponse -> Maybe [Text]
requiredProperties} -> Maybe [Text]
requiredProperties) (\s :: FunctionResponse
s@FunctionResponse' {} Maybe [Text]
a -> FunctionResponse
s {$sel:requiredProperties:FunctionResponse' :: Maybe [Text]
requiredProperties = Maybe [Text]
a} :: FunctionResponse) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. forall (f :: * -> *) (g :: * -> *) s t a b.
(Functor f, Functor g) =>
AnIso s t a b -> Iso (f s) (g t) (f a) (g b)
Lens.mapping forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced
functionResponse_scope :: Lens.Lens' FunctionResponse (Prelude.Maybe Scope)
functionResponse_scope :: Lens' FunctionResponse (Maybe Scope)
functionResponse_scope = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\FunctionResponse' {Maybe Scope
scope :: Maybe Scope
$sel:scope:FunctionResponse' :: FunctionResponse -> Maybe Scope
scope} -> Maybe Scope
scope) (\s :: FunctionResponse
s@FunctionResponse' {} Maybe Scope
a -> FunctionResponse
s {$sel:scope:FunctionResponse' :: Maybe Scope
scope = Maybe Scope
a} :: FunctionResponse)
instance Data.FromJSON FunctionResponse where
parseJSON :: Value -> Parser FunctionResponse
parseJSON =
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
String
"FunctionResponse"
( \Object
x ->
Maybe DataConnector
-> Maybe Bool -> Maybe [Text] -> Maybe Scope -> FunctionResponse
FunctionResponse'
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
"implementedBy")
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
"isInherited")
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
"requiredProperties"
forall a. Parser (Maybe a) -> a -> Parser a
Data..!= forall a. Monoid a => a
Prelude.mempty
)
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
"scope")
)
instance Prelude.Hashable FunctionResponse where
hashWithSalt :: Int -> FunctionResponse -> Int
hashWithSalt Int
_salt FunctionResponse' {Maybe Bool
Maybe [Text]
Maybe DataConnector
Maybe Scope
scope :: Maybe Scope
requiredProperties :: Maybe [Text]
isInherited :: Maybe Bool
implementedBy :: Maybe DataConnector
$sel:scope:FunctionResponse' :: FunctionResponse -> Maybe Scope
$sel:requiredProperties:FunctionResponse' :: FunctionResponse -> Maybe [Text]
$sel:isInherited:FunctionResponse' :: FunctionResponse -> Maybe Bool
$sel:implementedBy:FunctionResponse' :: FunctionResponse -> Maybe DataConnector
..} =
Int
_salt
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe DataConnector
implementedBy
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Bool
isInherited
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe [Text]
requiredProperties
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Scope
scope
instance Prelude.NFData FunctionResponse where
rnf :: FunctionResponse -> ()
rnf FunctionResponse' {Maybe Bool
Maybe [Text]
Maybe DataConnector
Maybe Scope
scope :: Maybe Scope
requiredProperties :: Maybe [Text]
isInherited :: Maybe Bool
implementedBy :: Maybe DataConnector
$sel:scope:FunctionResponse' :: FunctionResponse -> Maybe Scope
$sel:requiredProperties:FunctionResponse' :: FunctionResponse -> Maybe [Text]
$sel:isInherited:FunctionResponse' :: FunctionResponse -> Maybe Bool
$sel:implementedBy:FunctionResponse' :: FunctionResponse -> Maybe DataConnector
..} =
forall a. NFData a => a -> ()
Prelude.rnf Maybe DataConnector
implementedBy
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Bool
isInherited
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe [Text]
requiredProperties
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Scope
scope