module Stratosphere.Lightsail.InstanceSnapshot (
InstanceSnapshot(..), mkInstanceSnapshot
) where
import qualified Data.Aeson as JSON
import qualified Stratosphere.Prelude as Prelude
import Stratosphere.Property
import Stratosphere.ResourceProperties
import Stratosphere.Tag
import Stratosphere.Value
data InstanceSnapshot
=
InstanceSnapshot {InstanceSnapshot -> ()
haddock_workaround_ :: (),
InstanceSnapshot -> Value Text
instanceName :: (Value Prelude.Text),
InstanceSnapshot -> Value Text
instanceSnapshotName :: (Value Prelude.Text),
InstanceSnapshot -> Maybe [Tag]
tags :: (Prelude.Maybe [Tag])}
deriving stock (InstanceSnapshot -> InstanceSnapshot -> Bool
(InstanceSnapshot -> InstanceSnapshot -> Bool)
-> (InstanceSnapshot -> InstanceSnapshot -> Bool)
-> Eq InstanceSnapshot
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: InstanceSnapshot -> InstanceSnapshot -> Bool
== :: InstanceSnapshot -> InstanceSnapshot -> Bool
$c/= :: InstanceSnapshot -> InstanceSnapshot -> Bool
/= :: InstanceSnapshot -> InstanceSnapshot -> Bool
Prelude.Eq, Int -> InstanceSnapshot -> ShowS
[InstanceSnapshot] -> ShowS
InstanceSnapshot -> String
(Int -> InstanceSnapshot -> ShowS)
-> (InstanceSnapshot -> String)
-> ([InstanceSnapshot] -> ShowS)
-> Show InstanceSnapshot
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> InstanceSnapshot -> ShowS
showsPrec :: Int -> InstanceSnapshot -> ShowS
$cshow :: InstanceSnapshot -> String
show :: InstanceSnapshot -> String
$cshowList :: [InstanceSnapshot] -> ShowS
showList :: [InstanceSnapshot] -> ShowS
Prelude.Show)
mkInstanceSnapshot ::
Value Prelude.Text -> Value Prelude.Text -> InstanceSnapshot
mkInstanceSnapshot :: Value Text -> Value Text -> InstanceSnapshot
mkInstanceSnapshot Value Text
instanceName Value Text
instanceSnapshotName
= InstanceSnapshot
{haddock_workaround_ :: ()
haddock_workaround_ = (), instanceName :: Value Text
instanceName = Value Text
instanceName,
instanceSnapshotName :: Value Text
instanceSnapshotName = Value Text
instanceSnapshotName,
tags :: Maybe [Tag]
tags = Maybe [Tag]
forall a. Maybe a
Prelude.Nothing}
instance ToResourceProperties InstanceSnapshot where
toResourceProperties :: InstanceSnapshot -> ResourceProperties
toResourceProperties InstanceSnapshot {Maybe [Tag]
()
Value Text
haddock_workaround_ :: InstanceSnapshot -> ()
instanceName :: InstanceSnapshot -> Value Text
instanceSnapshotName :: InstanceSnapshot -> Value Text
tags :: InstanceSnapshot -> Maybe [Tag]
haddock_workaround_ :: ()
instanceName :: Value Text
instanceSnapshotName :: Value Text
tags :: Maybe [Tag]
..}
= ResourceProperties
{awsType :: Text
awsType = Text
"AWS::Lightsail::InstanceSnapshot",
supportsTags :: Bool
supportsTags = Bool
Prelude.True,
properties :: Object
properties = [Item Object] -> Object
forall l. IsList l => [Item l] -> l
Prelude.fromList
([(Key, Value)] -> [(Key, Value)] -> [(Key, Value)]
forall a. Semigroup a => a -> a -> a
(Prelude.<>)
[Key
"InstanceName" 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..= Value Text
instanceName,
Key
"InstanceSnapshotName" 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..= Value Text
instanceSnapshotName]
([Maybe (Key, Value)] -> [(Key, Value)]
forall a. [Maybe a] -> [a]
Prelude.catMaybes [Key -> [Tag] -> (Key, Value)
forall v. ToJSON v => Key -> v -> (Key, Value)
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
(JSON..=) Key
"Tags" ([Tag] -> (Key, Value)) -> Maybe [Tag] -> Maybe (Key, Value)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe [Tag]
tags]))}
instance JSON.ToJSON InstanceSnapshot where
toJSON :: InstanceSnapshot -> Value
toJSON InstanceSnapshot {Maybe [Tag]
()
Value Text
haddock_workaround_ :: InstanceSnapshot -> ()
instanceName :: InstanceSnapshot -> Value Text
instanceSnapshotName :: InstanceSnapshot -> Value Text
tags :: InstanceSnapshot -> Maybe [Tag]
haddock_workaround_ :: ()
instanceName :: Value Text
instanceSnapshotName :: Value Text
tags :: Maybe [Tag]
..}
= [(Key, Value)] -> Value
JSON.object
([Item [(Key, Value)]] -> [(Key, Value)]
forall l. IsList l => [Item l] -> l
Prelude.fromList
([(Key, Value)] -> [(Key, Value)] -> [(Key, Value)]
forall a. Semigroup a => a -> a -> a
(Prelude.<>)
[Key
"InstanceName" 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..= Value Text
instanceName,
Key
"InstanceSnapshotName" 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..= Value Text
instanceSnapshotName]
([Maybe (Key, Value)] -> [(Key, Value)]
forall a. [Maybe a] -> [a]
Prelude.catMaybes [Key -> [Tag] -> (Key, Value)
forall v. ToJSON v => Key -> v -> (Key, Value)
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
(JSON..=) Key
"Tags" ([Tag] -> (Key, Value)) -> Maybe [Tag] -> Maybe (Key, Value)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe [Tag]
tags])))
instance Property "InstanceName" InstanceSnapshot where
type PropertyType "InstanceName" InstanceSnapshot = Value Prelude.Text
set :: PropertyType "InstanceName" InstanceSnapshot
-> InstanceSnapshot -> InstanceSnapshot
set PropertyType "InstanceName" InstanceSnapshot
newValue InstanceSnapshot {Maybe [Tag]
()
Value Text
haddock_workaround_ :: InstanceSnapshot -> ()
instanceName :: InstanceSnapshot -> Value Text
instanceSnapshotName :: InstanceSnapshot -> Value Text
tags :: InstanceSnapshot -> Maybe [Tag]
haddock_workaround_ :: ()
instanceName :: Value Text
instanceSnapshotName :: Value Text
tags :: Maybe [Tag]
..}
= InstanceSnapshot {instanceName :: Value Text
instanceName = PropertyType "InstanceName" InstanceSnapshot
Value Text
newValue, Maybe [Tag]
()
Value Text
haddock_workaround_ :: ()
instanceSnapshotName :: Value Text
tags :: Maybe [Tag]
haddock_workaround_ :: ()
instanceSnapshotName :: Value Text
tags :: Maybe [Tag]
..}
instance Property "InstanceSnapshotName" InstanceSnapshot where
type PropertyType "InstanceSnapshotName" InstanceSnapshot = Value Prelude.Text
set :: PropertyType "InstanceSnapshotName" InstanceSnapshot
-> InstanceSnapshot -> InstanceSnapshot
set PropertyType "InstanceSnapshotName" InstanceSnapshot
newValue InstanceSnapshot {Maybe [Tag]
()
Value Text
haddock_workaround_ :: InstanceSnapshot -> ()
instanceName :: InstanceSnapshot -> Value Text
instanceSnapshotName :: InstanceSnapshot -> Value Text
tags :: InstanceSnapshot -> Maybe [Tag]
haddock_workaround_ :: ()
instanceName :: Value Text
instanceSnapshotName :: Value Text
tags :: Maybe [Tag]
..}
= InstanceSnapshot {instanceSnapshotName :: Value Text
instanceSnapshotName = PropertyType "InstanceSnapshotName" InstanceSnapshot
Value Text
newValue, Maybe [Tag]
()
Value Text
haddock_workaround_ :: ()
instanceName :: Value Text
tags :: Maybe [Tag]
haddock_workaround_ :: ()
instanceName :: Value Text
tags :: Maybe [Tag]
..}
instance Property "Tags" InstanceSnapshot where
type PropertyType "Tags" InstanceSnapshot = [Tag]
set :: PropertyType "Tags" InstanceSnapshot
-> InstanceSnapshot -> InstanceSnapshot
set PropertyType "Tags" InstanceSnapshot
newValue InstanceSnapshot {Maybe [Tag]
()
Value Text
haddock_workaround_ :: InstanceSnapshot -> ()
instanceName :: InstanceSnapshot -> Value Text
instanceSnapshotName :: InstanceSnapshot -> Value Text
tags :: InstanceSnapshot -> Maybe [Tag]
haddock_workaround_ :: ()
instanceName :: Value Text
instanceSnapshotName :: Value Text
tags :: Maybe [Tag]
..}
= InstanceSnapshot {tags :: Maybe [Tag]
tags = [Tag] -> Maybe [Tag]
forall a. a -> Maybe a
forall (f :: * -> *) a. Applicative f => a -> f a
Prelude.pure [Tag]
PropertyType "Tags" InstanceSnapshot
newValue, ()
Value Text
haddock_workaround_ :: ()
instanceName :: Value Text
instanceSnapshotName :: Value Text
haddock_workaround_ :: ()
instanceName :: Value Text
instanceSnapshotName :: Value Text
..}