module Stratosphere.Lightsail.StaticIp (
        StaticIp(..), mkStaticIp
    ) where
import qualified Data.Aeson as JSON
import qualified Stratosphere.Prelude as Prelude
import Stratosphere.Property
import Stratosphere.ResourceProperties
import Stratosphere.Value
data StaticIp
  = -- | See: <http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-lightsail-staticip.html>
    StaticIp {StaticIp -> ()
haddock_workaround_ :: (),
              -- | See: <http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-lightsail-staticip.html#cfn-lightsail-staticip-attachedto>
              StaticIp -> Maybe (Value Text)
attachedTo :: (Prelude.Maybe (Value Prelude.Text)),
              -- | See: <http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-lightsail-staticip.html#cfn-lightsail-staticip-staticipname>
              StaticIp -> Value Text
staticIpName :: (Value Prelude.Text)}
  deriving stock (StaticIp -> StaticIp -> Bool
(StaticIp -> StaticIp -> Bool)
-> (StaticIp -> StaticIp -> Bool) -> Eq StaticIp
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: StaticIp -> StaticIp -> Bool
== :: StaticIp -> StaticIp -> Bool
$c/= :: StaticIp -> StaticIp -> Bool
/= :: StaticIp -> StaticIp -> Bool
Prelude.Eq, Int -> StaticIp -> ShowS
[StaticIp] -> ShowS
StaticIp -> String
(Int -> StaticIp -> ShowS)
-> (StaticIp -> String) -> ([StaticIp] -> ShowS) -> Show StaticIp
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> StaticIp -> ShowS
showsPrec :: Int -> StaticIp -> ShowS
$cshow :: StaticIp -> String
show :: StaticIp -> String
$cshowList :: [StaticIp] -> ShowS
showList :: [StaticIp] -> ShowS
Prelude.Show)
mkStaticIp :: Value Prelude.Text -> StaticIp
mkStaticIp :: Value Text -> StaticIp
mkStaticIp Value Text
staticIpName
  = StaticIp
      {haddock_workaround_ :: ()
haddock_workaround_ = (), staticIpName :: Value Text
staticIpName = Value Text
staticIpName,
       attachedTo :: Maybe (Value Text)
attachedTo = Maybe (Value Text)
forall a. Maybe a
Prelude.Nothing}
instance ToResourceProperties StaticIp where
  toResourceProperties :: StaticIp -> ResourceProperties
toResourceProperties StaticIp {Maybe (Value Text)
()
Value Text
haddock_workaround_ :: StaticIp -> ()
attachedTo :: StaticIp -> Maybe (Value Text)
staticIpName :: StaticIp -> Value Text
haddock_workaround_ :: ()
attachedTo :: Maybe (Value Text)
staticIpName :: Value Text
..}
    = ResourceProperties
        {awsType :: Text
awsType = Text
"AWS::Lightsail::StaticIp",
         supportsTags :: Bool
supportsTags = Bool
Prelude.False,
         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
"StaticIpName" 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
staticIpName]
                           ([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
"AttachedTo" (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)
attachedTo]))}
instance JSON.ToJSON StaticIp where
  toJSON :: StaticIp -> Value
toJSON StaticIp {Maybe (Value Text)
()
Value Text
haddock_workaround_ :: StaticIp -> ()
attachedTo :: StaticIp -> Maybe (Value Text)
staticIpName :: StaticIp -> Value Text
haddock_workaround_ :: ()
attachedTo :: Maybe (Value Text)
staticIpName :: Value Text
..}
    = [(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
"StaticIpName" 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
staticIpName]
              ([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
"AttachedTo" (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)
attachedTo])))
instance Property "AttachedTo" StaticIp where
  type PropertyType "AttachedTo" StaticIp = Value Prelude.Text
  set :: PropertyType "AttachedTo" StaticIp -> StaticIp -> StaticIp
set PropertyType "AttachedTo" StaticIp
newValue StaticIp {Maybe (Value Text)
()
Value Text
haddock_workaround_ :: StaticIp -> ()
attachedTo :: StaticIp -> Maybe (Value Text)
staticIpName :: StaticIp -> Value Text
haddock_workaround_ :: ()
attachedTo :: Maybe (Value Text)
staticIpName :: Value Text
..}
    = StaticIp {attachedTo :: Maybe (Value Text)
attachedTo = Value Text -> Maybe (Value Text)
forall a. a -> Maybe a
forall (f :: * -> *) a. Applicative f => a -> f a
Prelude.pure PropertyType "AttachedTo" StaticIp
Value Text
newValue, ()
Value Text
haddock_workaround_ :: ()
staticIpName :: Value Text
haddock_workaround_ :: ()
staticIpName :: Value Text
..}
instance Property "StaticIpName" StaticIp where
  type PropertyType "StaticIpName" StaticIp = Value Prelude.Text
  set :: PropertyType "StaticIpName" StaticIp -> StaticIp -> StaticIp
set PropertyType "StaticIpName" StaticIp
newValue StaticIp {Maybe (Value Text)
()
Value Text
haddock_workaround_ :: StaticIp -> ()
attachedTo :: StaticIp -> Maybe (Value Text)
staticIpName :: StaticIp -> Value Text
haddock_workaround_ :: ()
attachedTo :: Maybe (Value Text)
staticIpName :: Value Text
..} = StaticIp {staticIpName :: Value Text
staticIpName = PropertyType "StaticIpName" StaticIp
Value Text
newValue, Maybe (Value Text)
()
haddock_workaround_ :: ()
attachedTo :: Maybe (Value Text)
haddock_workaround_ :: ()
attachedTo :: Maybe (Value Text)
..}