module Stratosphere.EC2.Instance.StateProperty (
        StateProperty(..), mkStateProperty
    ) where
import qualified Data.Aeson as JSON
import qualified Stratosphere.Prelude as Prelude
import Stratosphere.Property
import Stratosphere.ResourceProperties
import Stratosphere.Value
data StateProperty
  = -- | See: <http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ec2-instance-state.html>
    StateProperty {StateProperty -> ()
haddock_workaround_ :: (),
                   -- | See: <http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ec2-instance-state.html#cfn-ec2-instance-state-code>
                   StateProperty -> Maybe (Value Text)
code :: (Prelude.Maybe (Value Prelude.Text)),
                   -- | See: <http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ec2-instance-state.html#cfn-ec2-instance-state-name>
                   StateProperty -> Maybe (Value Text)
name :: (Prelude.Maybe (Value Prelude.Text))}
  deriving stock (StateProperty -> StateProperty -> Bool
(StateProperty -> StateProperty -> Bool)
-> (StateProperty -> StateProperty -> Bool) -> Eq StateProperty
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: StateProperty -> StateProperty -> Bool
== :: StateProperty -> StateProperty -> Bool
$c/= :: StateProperty -> StateProperty -> Bool
/= :: StateProperty -> StateProperty -> Bool
Prelude.Eq, Int -> StateProperty -> ShowS
[StateProperty] -> ShowS
StateProperty -> String
(Int -> StateProperty -> ShowS)
-> (StateProperty -> String)
-> ([StateProperty] -> ShowS)
-> Show StateProperty
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> StateProperty -> ShowS
showsPrec :: Int -> StateProperty -> ShowS
$cshow :: StateProperty -> String
show :: StateProperty -> String
$cshowList :: [StateProperty] -> ShowS
showList :: [StateProperty] -> ShowS
Prelude.Show)
mkStateProperty :: StateProperty
mkStateProperty :: StateProperty
mkStateProperty
  = StateProperty
      {haddock_workaround_ :: ()
haddock_workaround_ = (), code :: Maybe (Value Text)
code = Maybe (Value Text)
forall a. Maybe a
Prelude.Nothing,
       name :: Maybe (Value Text)
name = Maybe (Value Text)
forall a. Maybe a
Prelude.Nothing}
instance ToResourceProperties StateProperty where
  toResourceProperties :: StateProperty -> ResourceProperties
toResourceProperties StateProperty {Maybe (Value Text)
()
haddock_workaround_ :: StateProperty -> ()
code :: StateProperty -> Maybe (Value Text)
name :: StateProperty -> Maybe (Value Text)
haddock_workaround_ :: ()
code :: Maybe (Value Text)
name :: Maybe (Value Text)
..}
    = ResourceProperties
        {awsType :: Text
awsType = Text
"AWS::EC2::Instance.State",
         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
"Name" (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)
name])}
instance JSON.ToJSON StateProperty where
  toJSON :: StateProperty -> Value
toJSON StateProperty {Maybe (Value Text)
()
haddock_workaround_ :: StateProperty -> ()
code :: StateProperty -> Maybe (Value Text)
name :: StateProperty -> Maybe (Value Text)
haddock_workaround_ :: ()
code :: Maybe (Value Text)
name :: 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
"Name" (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)
name]))
instance Property "Code" StateProperty where
  type PropertyType "Code" StateProperty = Value Prelude.Text
  set :: PropertyType "Code" StateProperty -> StateProperty -> StateProperty
set PropertyType "Code" StateProperty
newValue StateProperty {Maybe (Value Text)
()
haddock_workaround_ :: StateProperty -> ()
code :: StateProperty -> Maybe (Value Text)
name :: StateProperty -> Maybe (Value Text)
haddock_workaround_ :: ()
code :: Maybe (Value Text)
name :: Maybe (Value Text)
..}
    = StateProperty {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" StateProperty
Value Text
newValue, Maybe (Value Text)
()
haddock_workaround_ :: ()
name :: Maybe (Value Text)
haddock_workaround_ :: ()
name :: Maybe (Value Text)
..}
instance Property "Name" StateProperty where
  type PropertyType "Name" StateProperty = Value Prelude.Text
  set :: PropertyType "Name" StateProperty -> StateProperty -> StateProperty
set PropertyType "Name" StateProperty
newValue StateProperty {Maybe (Value Text)
()
haddock_workaround_ :: StateProperty -> ()
code :: StateProperty -> Maybe (Value Text)
name :: StateProperty -> Maybe (Value Text)
haddock_workaround_ :: ()
code :: Maybe (Value Text)
name :: Maybe (Value Text)
..}
    = StateProperty {name :: Maybe (Value Text)
name = Value Text -> Maybe (Value Text)
forall a. a -> Maybe a
forall (f :: * -> *) a. Applicative f => a -> f a
Prelude.pure PropertyType "Name" StateProperty
Value Text
newValue, Maybe (Value Text)
()
haddock_workaround_ :: ()
code :: Maybe (Value Text)
haddock_workaround_ :: ()
code :: Maybe (Value Text)
..}