spotInstanceLaunchSpecificationConv :: (MonadThrow m, Applicative m)
    => Text -> XmlElement -> m SpotInstanceLaunchSpecification
spotInstanceLaunchSpecificationConv label = element label conv
  where
    conv e = SpotInstanceLaunchSpecification
        <$> e .< "imageId"
        <*> e .< "keyName"
        <*> groupSetConv e
        <*> e .< "instanceType"
        <*> element "placement" plConv e
        <*> e .< "kernelId"
        <*> e .< "ramdiskId"
        <*> spotInstanceBlockDeviceMappingsConv e
        <*> element "monitoring" monConv e
        <*> e .< "subnetId"
        <*> spotInstanceNetworkInterfaceConv e
        <*> elementM "iamInstanceProfile" profConv e
        <*> e .< "ebsOptimized"
    plConv e = Placement
        <$> e .< "availabilityZone"
        <*> e .< "groupName"
        <*> e .< "tenancy"
    profConv e = IamInstanceProfile
        <$> e .< "arn"
        <*> e .< "id"
    monConv e = SpotInstanceMonitoringState
        <$> e .< "enabled"
spotInstanceLaunchSpecificationConv :: (MonadThrow m, Applicative m)
    => Text -> XmlElement -> m SpotInstanceLaunchSpecification
spotInstanceLaunchSpecificationConv label = element label conv
  where
    conv e = SpotInstanceLaunchSpecification
        <$> e .< "imageId"
        <*> e .< "keyName"
        <*> groupSetConv e
        <*> e .< "instanceType"
        <*> element "placement" plConv e
        <*> e .< "kernelId"
        <*> e .< "ramdiskId"
        <*> spotInstanceBlockDeviceMappingsConv e
        <*> element "monitoring" monConv e
        <*> e .< "subnetId"
        <*> spotInstanceNetworkInterfaceConv e
        <*> elementM "iamInstanceProfile" profConv e
        <*> e .< "ebsOptimized"
    plConv e = Placement
        <$> e .< "availabilityZone"
        <*> e .< "groupName"
        <*> e .< "tenancy"
    profConv e = IamInstanceProfile
        <$> e .< "arn"
        <*> e .< "id"
    monConv e = SpotInstanceMonitoringState
        <$> e .< "enabled"
spotInstanceLaunchSpecificationConv label = element label conv
  where
    conv e = SpotInstanceLaunchSpecification
        <$> e .< "imageId"
        <*> e .< "keyName"
        <*> groupSetConv e
        <*> e .< "instanceType"
        <*> element "placement" plConv e
        <*> e .< "kernelId"
        <*> e .< "ramdiskId"
        <*> spotInstanceBlockDeviceMappingsConv e
        <*> element "monitoring" monConv e
        <*> e .< "subnetId"
        <*> spotInstanceNetworkInterfaceConv e
        <*> elementM "iamInstanceProfile" profConv e
        <*> e .< "ebsOptimized"
    plConv e = Placement
        <$> e .< "availabilityZone"
        <*> e .< "groupName"
        <*> e .< "tenancy"
    profConv e = IamInstanceProfile
        <$> e .< "arn"
        <*> e .< "id"
    monConv e = SpotInstanceMonitoringState
        <$> e .< "enabled"