module Stratosphere.IoTTwinMaker.Entity.ErrorProperty (
ErrorProperty(..), mkErrorProperty
) where
import qualified Data.Aeson as JSON
import qualified Stratosphere.Prelude as Prelude
import Stratosphere.Property
import Stratosphere.ResourceProperties
import Stratosphere.Value
data ErrorProperty
=
ErrorProperty {ErrorProperty -> ()
haddock_workaround_ :: (),
ErrorProperty -> Maybe (Value Text)
code :: (Prelude.Maybe (Value Prelude.Text)),
ErrorProperty -> Maybe (Value Text)
message :: (Prelude.Maybe (Value Prelude.Text))}
deriving stock (ErrorProperty -> ErrorProperty -> Bool
(ErrorProperty -> ErrorProperty -> Bool)
-> (ErrorProperty -> ErrorProperty -> Bool) -> Eq ErrorProperty
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: ErrorProperty -> ErrorProperty -> Bool
== :: ErrorProperty -> ErrorProperty -> Bool
$c/= :: ErrorProperty -> ErrorProperty -> Bool
/= :: ErrorProperty -> ErrorProperty -> Bool
Prelude.Eq, Int -> ErrorProperty -> ShowS
[ErrorProperty] -> ShowS
ErrorProperty -> String
(Int -> ErrorProperty -> ShowS)
-> (ErrorProperty -> String)
-> ([ErrorProperty] -> ShowS)
-> Show ErrorProperty
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> ErrorProperty -> ShowS
showsPrec :: Int -> ErrorProperty -> ShowS
$cshow :: ErrorProperty -> String
show :: ErrorProperty -> String
$cshowList :: [ErrorProperty] -> ShowS
showList :: [ErrorProperty] -> ShowS
Prelude.Show)
mkErrorProperty :: ErrorProperty
mkErrorProperty :: ErrorProperty
mkErrorProperty
= ErrorProperty
{haddock_workaround_ :: ()
haddock_workaround_ = (), code :: Maybe (Value Text)
code = Maybe (Value Text)
forall a. Maybe a
Prelude.Nothing,
message :: Maybe (Value Text)
message = Maybe (Value Text)
forall a. Maybe a
Prelude.Nothing}
instance ToResourceProperties ErrorProperty where
toResourceProperties :: ErrorProperty -> ResourceProperties
toResourceProperties ErrorProperty {Maybe (Value Text)
()
haddock_workaround_ :: ErrorProperty -> ()
code :: ErrorProperty -> Maybe (Value Text)
message :: ErrorProperty -> Maybe (Value Text)
haddock_workaround_ :: ()
code :: Maybe (Value Text)
message :: Maybe (Value Text)
..}
= ResourceProperties
{awsType :: Text
awsType = Text
"AWS::IoTTwinMaker::Entity.Error",
supportsTags :: Bool
supportsTags = Bool
Prelude.False,
properties :: Object
properties = [Item Object] -> Object
forall l. IsList l => [Item l] -> l
Prelude.fromList
([Maybe (Key, Value)] -> [(Key, Value)]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
[Key -> Value Text -> (Key, Value)
forall v. ToJSON v => Key -> v -> (Key, Value)
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
(JSON..=) Key
"Code" (Value Text -> (Key, Value))
-> Maybe (Value Text) -> Maybe (Key, Value)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe (Value Text)
code,
Key -> Value Text -> (Key, Value)
forall v. ToJSON v => Key -> v -> (Key, Value)
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
(JSON..=) Key
"Message" (Value Text -> (Key, Value))
-> Maybe (Value Text) -> Maybe (Key, Value)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe (Value Text)
message])}
instance JSON.ToJSON ErrorProperty where
toJSON :: ErrorProperty -> Value
toJSON ErrorProperty {Maybe (Value Text)
()
haddock_workaround_ :: ErrorProperty -> ()
code :: ErrorProperty -> Maybe (Value Text)
message :: ErrorProperty -> Maybe (Value Text)
haddock_workaround_ :: ()
code :: Maybe (Value Text)
message :: Maybe (Value Text)
..}
= [(Key, Value)] -> Value
JSON.object
([Item [(Key, Value)]] -> [(Key, Value)]
forall l. IsList l => [Item l] -> l
Prelude.fromList
([Maybe (Key, Value)] -> [(Key, Value)]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
[Key -> Value Text -> (Key, Value)
forall v. ToJSON v => Key -> v -> (Key, Value)
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
(JSON..=) Key
"Code" (Value Text -> (Key, Value))
-> Maybe (Value Text) -> Maybe (Key, Value)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe (Value Text)
code,
Key -> Value Text -> (Key, Value)
forall v. ToJSON v => Key -> v -> (Key, Value)
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
(JSON..=) Key
"Message" (Value Text -> (Key, Value))
-> Maybe (Value Text) -> Maybe (Key, Value)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe (Value Text)
message]))
instance Property "Code" ErrorProperty where
type PropertyType "Code" ErrorProperty = Value Prelude.Text
set :: PropertyType "Code" ErrorProperty -> ErrorProperty -> ErrorProperty
set PropertyType "Code" ErrorProperty
newValue ErrorProperty {Maybe (Value Text)
()
haddock_workaround_ :: ErrorProperty -> ()
code :: ErrorProperty -> Maybe (Value Text)
message :: ErrorProperty -> Maybe (Value Text)
haddock_workaround_ :: ()
code :: Maybe (Value Text)
message :: Maybe (Value Text)
..}
= ErrorProperty {code :: Maybe (Value Text)
code = Value Text -> Maybe (Value Text)
forall a. a -> Maybe a
forall (f :: * -> *) a. Applicative f => a -> f a
Prelude.pure PropertyType "Code" ErrorProperty
Value Text
newValue, Maybe (Value Text)
()
haddock_workaround_ :: ()
message :: Maybe (Value Text)
haddock_workaround_ :: ()
message :: Maybe (Value Text)
..}
instance Property "Message" ErrorProperty where
type PropertyType "Message" ErrorProperty = Value Prelude.Text
set :: PropertyType "Message" ErrorProperty
-> ErrorProperty -> ErrorProperty
set PropertyType "Message" ErrorProperty
newValue ErrorProperty {Maybe (Value Text)
()
haddock_workaround_ :: ErrorProperty -> ()
code :: ErrorProperty -> Maybe (Value Text)
message :: ErrorProperty -> Maybe (Value Text)
haddock_workaround_ :: ()
code :: Maybe (Value Text)
message :: Maybe (Value Text)
..}
= ErrorProperty {message :: Maybe (Value Text)
message = Value Text -> Maybe (Value Text)
forall a. a -> Maybe a
forall (f :: * -> *) a. Applicative f => a -> f a
Prelude.pure PropertyType "Message" ErrorProperty
Value Text
newValue, Maybe (Value Text)
()
haddock_workaround_ :: ()
code :: Maybe (Value Text)
haddock_workaround_ :: ()
code :: Maybe (Value Text)
..}