module Stratosphere.IoTTwinMaker.ComponentType.StatusProperty (
        module Exports, StatusProperty(..), mkStatusProperty
    ) where
import qualified Data.Aeson as JSON
import qualified Stratosphere.Prelude as Prelude
import Stratosphere.Property
import {-# SOURCE #-} Stratosphere.IoTTwinMaker.ComponentType.ErrorProperty as Exports
import Stratosphere.ResourceProperties
import Stratosphere.Value
data StatusProperty
  = -- | See: <http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-iottwinmaker-componenttype-status.html>
    StatusProperty {StatusProperty -> ()
haddock_workaround_ :: (),
                    -- | See: <http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-iottwinmaker-componenttype-status.html#cfn-iottwinmaker-componenttype-status-error>
                    StatusProperty -> Maybe ErrorProperty
error :: (Prelude.Maybe ErrorProperty),
                    -- | See: <http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-iottwinmaker-componenttype-status.html#cfn-iottwinmaker-componenttype-status-state>
                    StatusProperty -> Maybe (Value Text)
state :: (Prelude.Maybe (Value Prelude.Text))}
  deriving stock (StatusProperty -> StatusProperty -> Bool
(StatusProperty -> StatusProperty -> Bool)
-> (StatusProperty -> StatusProperty -> Bool) -> Eq StatusProperty
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: StatusProperty -> StatusProperty -> Bool
== :: StatusProperty -> StatusProperty -> Bool
$c/= :: StatusProperty -> StatusProperty -> Bool
/= :: StatusProperty -> StatusProperty -> Bool
Prelude.Eq, Int -> StatusProperty -> ShowS
[StatusProperty] -> ShowS
StatusProperty -> String
(Int -> StatusProperty -> ShowS)
-> (StatusProperty -> String)
-> ([StatusProperty] -> ShowS)
-> Show StatusProperty
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> StatusProperty -> ShowS
showsPrec :: Int -> StatusProperty -> ShowS
$cshow :: StatusProperty -> String
show :: StatusProperty -> String
$cshowList :: [StatusProperty] -> ShowS
showList :: [StatusProperty] -> ShowS
Prelude.Show)
mkStatusProperty :: StatusProperty
mkStatusProperty :: StatusProperty
mkStatusProperty
  = StatusProperty
      {haddock_workaround_ :: ()
haddock_workaround_ = (), error :: Maybe ErrorProperty
error = Maybe ErrorProperty
forall a. Maybe a
Prelude.Nothing,
       state :: Maybe (Value Text)
state = Maybe (Value Text)
forall a. Maybe a
Prelude.Nothing}
instance ToResourceProperties StatusProperty where
  toResourceProperties :: StatusProperty -> ResourceProperties
toResourceProperties StatusProperty {Maybe (Value Text)
Maybe ErrorProperty
()
haddock_workaround_ :: StatusProperty -> ()
error :: StatusProperty -> Maybe ErrorProperty
state :: StatusProperty -> Maybe (Value Text)
haddock_workaround_ :: ()
error :: Maybe ErrorProperty
state :: Maybe (Value Text)
..}
    = ResourceProperties
        {awsType :: Text
awsType = Text
"AWS::IoTTwinMaker::ComponentType.Status",
         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 -> ErrorProperty -> (Key, Value)
forall v. ToJSON v => Key -> v -> (Key, Value)
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
(JSON..=) Key
"Error" (ErrorProperty -> (Key, Value))
-> Maybe ErrorProperty -> Maybe (Key, Value)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe ErrorProperty
error,
                            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
"State" (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)
state])}
instance JSON.ToJSON StatusProperty where
  toJSON :: StatusProperty -> Value
toJSON StatusProperty {Maybe (Value Text)
Maybe ErrorProperty
()
haddock_workaround_ :: StatusProperty -> ()
error :: StatusProperty -> Maybe ErrorProperty
state :: StatusProperty -> Maybe (Value Text)
haddock_workaround_ :: ()
error :: Maybe ErrorProperty
state :: 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 -> ErrorProperty -> (Key, Value)
forall v. ToJSON v => Key -> v -> (Key, Value)
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
(JSON..=) Key
"Error" (ErrorProperty -> (Key, Value))
-> Maybe ErrorProperty -> Maybe (Key, Value)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe ErrorProperty
error,
               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
"State" (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)
state]))
instance Property "Error" StatusProperty where
  type PropertyType "Error" StatusProperty = ErrorProperty
  set :: PropertyType "Error" StatusProperty
-> StatusProperty -> StatusProperty
set PropertyType "Error" StatusProperty
newValue StatusProperty {Maybe (Value Text)
Maybe ErrorProperty
()
haddock_workaround_ :: StatusProperty -> ()
error :: StatusProperty -> Maybe ErrorProperty
state :: StatusProperty -> Maybe (Value Text)
haddock_workaround_ :: ()
error :: Maybe ErrorProperty
state :: Maybe (Value Text)
..}
    = StatusProperty {error :: Maybe ErrorProperty
error = ErrorProperty -> Maybe ErrorProperty
forall a. a -> Maybe a
forall (f :: * -> *) a. Applicative f => a -> f a
Prelude.pure PropertyType "Error" StatusProperty
ErrorProperty
newValue, Maybe (Value Text)
()
haddock_workaround_ :: ()
state :: Maybe (Value Text)
haddock_workaround_ :: ()
state :: Maybe (Value Text)
..}
instance Property "State" StatusProperty where
  type PropertyType "State" StatusProperty = Value Prelude.Text
  set :: PropertyType "State" StatusProperty
-> StatusProperty -> StatusProperty
set PropertyType "State" StatusProperty
newValue StatusProperty {Maybe (Value Text)
Maybe ErrorProperty
()
haddock_workaround_ :: StatusProperty -> ()
error :: StatusProperty -> Maybe ErrorProperty
state :: StatusProperty -> Maybe (Value Text)
haddock_workaround_ :: ()
error :: Maybe ErrorProperty
state :: Maybe (Value Text)
..}
    = StatusProperty {state :: Maybe (Value Text)
state = Value Text -> Maybe (Value Text)
forall a. a -> Maybe a
forall (f :: * -> *) a. Applicative f => a -> f a
Prelude.pure PropertyType "State" StatusProperty
Value Text
newValue, Maybe ErrorProperty
()
haddock_workaround_ :: ()
error :: Maybe ErrorProperty
haddock_workaround_ :: ()
error :: Maybe ErrorProperty
..}