module Stratosphere.ServiceDiscovery.Instance (
        Instance(..), mkInstance
    ) where
import qualified Data.Aeson as JSON
import qualified Stratosphere.Prelude as Prelude
import Stratosphere.Property
import Stratosphere.ResourceProperties
import Stratosphere.Value
data Instance
  = -- | See: <http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-servicediscovery-instance.html>
    Instance {Instance -> ()
haddock_workaround_ :: (),
              -- | See: <http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-servicediscovery-instance.html#cfn-servicediscovery-instance-instanceattributes>
              Instance -> Object
instanceAttributes :: JSON.Object,
              -- | See: <http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-servicediscovery-instance.html#cfn-servicediscovery-instance-instanceid>
              Instance -> Maybe (Value Text)
instanceId :: (Prelude.Maybe (Value Prelude.Text)),
              -- | See: <http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-servicediscovery-instance.html#cfn-servicediscovery-instance-serviceid>
              Instance -> Value Text
serviceId :: (Value Prelude.Text)}
  deriving stock (Instance -> Instance -> Bool
(Instance -> Instance -> Bool)
-> (Instance -> Instance -> Bool) -> Eq Instance
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: Instance -> Instance -> Bool
== :: Instance -> Instance -> Bool
$c/= :: Instance -> Instance -> Bool
/= :: Instance -> Instance -> Bool
Prelude.Eq, Int -> Instance -> ShowS
[Instance] -> ShowS
Instance -> String
(Int -> Instance -> ShowS)
-> (Instance -> String) -> ([Instance] -> ShowS) -> Show Instance
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> Instance -> ShowS
showsPrec :: Int -> Instance -> ShowS
$cshow :: Instance -> String
show :: Instance -> String
$cshowList :: [Instance] -> ShowS
showList :: [Instance] -> ShowS
Prelude.Show)
mkInstance :: JSON.Object -> Value Prelude.Text -> Instance
mkInstance :: Object -> Value Text -> Instance
mkInstance Object
instanceAttributes Value Text
serviceId
  = Instance
      {haddock_workaround_ :: ()
haddock_workaround_ = (), instanceAttributes :: Object
instanceAttributes = Object
instanceAttributes,
       serviceId :: Value Text
serviceId = Value Text
serviceId, instanceId :: Maybe (Value Text)
instanceId = Maybe (Value Text)
forall a. Maybe a
Prelude.Nothing}
instance ToResourceProperties Instance where
  toResourceProperties :: Instance -> ResourceProperties
toResourceProperties Instance {Maybe (Value Text)
()
Object
Value Text
haddock_workaround_ :: Instance -> ()
instanceAttributes :: Instance -> Object
instanceId :: Instance -> Maybe (Value Text)
serviceId :: Instance -> Value Text
haddock_workaround_ :: ()
instanceAttributes :: Object
instanceId :: Maybe (Value Text)
serviceId :: Value Text
..}
    = ResourceProperties
        {awsType :: Text
awsType = Text
"AWS::ServiceDiscovery::Instance",
         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
"InstanceAttributes" Key -> Object -> (Key, Value)
forall v. ToJSON v => Key -> v -> (Key, Value)
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
JSON..= Object
instanceAttributes,
                            Key
"ServiceId" 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
serviceId]
                           ([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
"InstanceId" (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)
instanceId]))}
instance JSON.ToJSON Instance where
  toJSON :: Instance -> Value
toJSON Instance {Maybe (Value Text)
()
Object
Value Text
haddock_workaround_ :: Instance -> ()
instanceAttributes :: Instance -> Object
instanceId :: Instance -> Maybe (Value Text)
serviceId :: Instance -> Value Text
haddock_workaround_ :: ()
instanceAttributes :: Object
instanceId :: Maybe (Value Text)
serviceId :: 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
"InstanceAttributes" Key -> Object -> (Key, Value)
forall v. ToJSON v => Key -> v -> (Key, Value)
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
JSON..= Object
instanceAttributes,
               Key
"ServiceId" 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
serviceId]
              ([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
"InstanceId" (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)
instanceId])))
instance Property "InstanceAttributes" Instance where
  type PropertyType "InstanceAttributes" Instance = JSON.Object
  set :: PropertyType "InstanceAttributes" Instance -> Instance -> Instance
set PropertyType "InstanceAttributes" Instance
newValue Instance {Maybe (Value Text)
()
Object
Value Text
haddock_workaround_ :: Instance -> ()
instanceAttributes :: Instance -> Object
instanceId :: Instance -> Maybe (Value Text)
serviceId :: Instance -> Value Text
haddock_workaround_ :: ()
instanceAttributes :: Object
instanceId :: Maybe (Value Text)
serviceId :: Value Text
..}
    = Instance {instanceAttributes :: Object
instanceAttributes = Object
PropertyType "InstanceAttributes" Instance
newValue, Maybe (Value Text)
()
Value Text
haddock_workaround_ :: ()
instanceId :: Maybe (Value Text)
serviceId :: Value Text
haddock_workaround_ :: ()
instanceId :: Maybe (Value Text)
serviceId :: Value Text
..}
instance Property "InstanceId" Instance where
  type PropertyType "InstanceId" Instance = Value Prelude.Text
  set :: PropertyType "InstanceId" Instance -> Instance -> Instance
set PropertyType "InstanceId" Instance
newValue Instance {Maybe (Value Text)
()
Object
Value Text
haddock_workaround_ :: Instance -> ()
instanceAttributes :: Instance -> Object
instanceId :: Instance -> Maybe (Value Text)
serviceId :: Instance -> Value Text
haddock_workaround_ :: ()
instanceAttributes :: Object
instanceId :: Maybe (Value Text)
serviceId :: Value Text
..}
    = Instance {instanceId :: Maybe (Value Text)
instanceId = Value Text -> Maybe (Value Text)
forall a. a -> Maybe a
forall (f :: * -> *) a. Applicative f => a -> f a
Prelude.pure PropertyType "InstanceId" Instance
Value Text
newValue, ()
Object
Value Text
haddock_workaround_ :: ()
instanceAttributes :: Object
serviceId :: Value Text
haddock_workaround_ :: ()
instanceAttributes :: Object
serviceId :: Value Text
..}
instance Property "ServiceId" Instance where
  type PropertyType "ServiceId" Instance = Value Prelude.Text
  set :: PropertyType "ServiceId" Instance -> Instance -> Instance
set PropertyType "ServiceId" Instance
newValue Instance {Maybe (Value Text)
()
Object
Value Text
haddock_workaround_ :: Instance -> ()
instanceAttributes :: Instance -> Object
instanceId :: Instance -> Maybe (Value Text)
serviceId :: Instance -> Value Text
haddock_workaround_ :: ()
instanceAttributes :: Object
instanceId :: Maybe (Value Text)
serviceId :: Value Text
..} = Instance {serviceId :: Value Text
serviceId = PropertyType "ServiceId" Instance
Value Text
newValue, Maybe (Value Text)
()
Object
haddock_workaround_ :: ()
instanceAttributes :: Object
instanceId :: Maybe (Value Text)
haddock_workaround_ :: ()
instanceAttributes :: Object
instanceId :: Maybe (Value Text)
..}