func (c *Emulation) SetVirtualTimePolicyWithParams(v *EmulationSetVirtualTimePolicyParams) (float64, error) {
	resp, err := gcdmessage.SendCustomReturn(c.target, c.target.GetSendCh(), &gcdmessage.ParamRequest{Id: c.target.GetId(), Method: "Emulation.setVirtualTimePolicy", Params: v})
	if err != nil {
		return 0, err
	}
	var chromeData struct {
		Result struct {
			VirtualTimeTicksBase float64
		}
	}
	if resp == nil {
		return 0, &gcdmessage.ChromeEmptyResponseErr{}
	}
	cerr := &gcdmessage.ChromeErrorResponse{}
	json.Unmarshal(resp.Data, cerr)
	if cerr != nil && cerr.Error != nil {
		return 0, &gcdmessage.ChromeRequestErr{Resp: cerr}
	}
	if err := json.Unmarshal(resp.Data, &chromeData); err != nil {
		return 0, err
	}
	return chromeData.Result.VirtualTimeTicksBase, nil
}
SetVirtualTimePolicyWithParams - Turns on virtual time for all frames (replacing real-time with a synthetic time source) and sets the current virtual time policy.  Note this supersedes any previous time budget.
Returns -  virtualTimeTicksBase - Absolute timestamp at which virtual time was first enabled (up time in milliseconds).
package gcdapi
import (
	"encoding/json"
	"github.com/wirepair/gcd/gcdmessage"
)
type EmulationScreenOrientation struct {
	Type  string `json:"type"`   
	Angle int    `json:"angle"`  
}
type EmulationVirtualTimeAdvancedEvent struct {
	Method string `json:"method"`
	Params struct {
		VirtualTimeElapsed float64 `json:"virtualTimeElapsed"`  
	} `json:"Params,omitempty"`
}
type EmulationVirtualTimePausedEvent struct {
	Method string `json:"method"`
	Params struct {
		VirtualTimeElapsed float64 `json:"virtualTimeElapsed"`  
	} `json:"Params,omitempty"`
}
type Emulation struct {
	target gcdmessage.ChromeTargeter
}
func NewEmulation(target gcdmessage.ChromeTargeter) *Emulation {
	c := &Emulation{target: target}
	return c
}
func (c *Emulation) CanEmulate() (bool, error) {
	resp, err := gcdmessage.SendCustomReturn(c.target, c.target.GetSendCh(), &gcdmessage.ParamRequest{Id: c.target.GetId(), Method: "Emulation.canEmulate"})
	if err != nil {
		return false, err
	}
	var chromeData struct {
		Result struct {
			Result bool
		}
	}
	if resp == nil {
		return false, &gcdmessage.ChromeEmptyResponseErr{}
	}
	cerr := &gcdmessage.ChromeErrorResponse{}
	json.Unmarshal(resp.Data, cerr)
	if cerr != nil && cerr.Error != nil {
		return false, &gcdmessage.ChromeRequestErr{Resp: cerr}
	}
	if err := json.Unmarshal(resp.Data, &chromeData); err != nil {
		return false, err
	}
	return chromeData.Result.Result, nil
}
func (c *Emulation) ClearDeviceMetricsOverride() (*gcdmessage.ChromeResponse, error) {
	return gcdmessage.SendDefaultRequest(c.target, c.target.GetSendCh(), &gcdmessage.ParamRequest{Id: c.target.GetId(), Method: "Emulation.clearDeviceMetricsOverride"})
}
func (c *Emulation) ClearGeolocationOverride() (*gcdmessage.ChromeResponse, error) {
	return gcdmessage.SendDefaultRequest(c.target, c.target.GetSendCh(), &gcdmessage.ParamRequest{Id: c.target.GetId(), Method: "Emulation.clearGeolocationOverride"})
}
func (c *Emulation) ResetPageScaleFactor() (*gcdmessage.ChromeResponse, error) {
	return gcdmessage.SendDefaultRequest(c.target, c.target.GetSendCh(), &gcdmessage.ParamRequest{Id: c.target.GetId(), Method: "Emulation.resetPageScaleFactor"})
}
type EmulationSetFocusEmulationEnabledParams struct {
	Enabled bool `json:"enabled"`
}
func (c *Emulation) SetFocusEmulationEnabledWithParams(v *EmulationSetFocusEmulationEnabledParams) (*gcdmessage.ChromeResponse, error) {
	return gcdmessage.SendDefaultRequest(c.target, c.target.GetSendCh(), &gcdmessage.ParamRequest{Id: c.target.GetId(), Method: "Emulation.setFocusEmulationEnabled", Params: v})
}
func (c *Emulation) SetFocusEmulationEnabled(enabled bool) (*gcdmessage.ChromeResponse, error) {
	var v EmulationSetFocusEmulationEnabledParams
	v.Enabled = enabled
	return c.SetFocusEmulationEnabledWithParams(&v)
}
type EmulationSetCPUThrottlingRateParams struct {
	Rate float64 `json:"rate"`
}
func (c *Emulation) SetCPUThrottlingRateWithParams(v *EmulationSetCPUThrottlingRateParams) (*gcdmessage.ChromeResponse, error) {
	return gcdmessage.SendDefaultRequest(c.target, c.target.GetSendCh(), &gcdmessage.ParamRequest{Id: c.target.GetId(), Method: "Emulation.setCPUThrottlingRate", Params: v})
}
func (c *Emulation) SetCPUThrottlingRate(rate float64) (*gcdmessage.ChromeResponse, error) {
	var v EmulationSetCPUThrottlingRateParams
	v.Rate = rate
	return c.SetCPUThrottlingRateWithParams(&v)
}
type EmulationSetDefaultBackgroundColorOverrideParams struct {
	Color *DOMRGBA `json:"color,omitempty"`
}
func (c *Emulation) SetDefaultBackgroundColorOverrideWithParams(v *EmulationSetDefaultBackgroundColorOverrideParams) (*gcdmessage.ChromeResponse, error) {
	return gcdmessage.SendDefaultRequest(c.target, c.target.GetSendCh(), &gcdmessage.ParamRequest{Id: c.target.GetId(), Method: "Emulation.setDefaultBackgroundColorOverride", Params: v})
}
func (c *Emulation) SetDefaultBackgroundColorOverride(color *DOMRGBA) (*gcdmessage.ChromeResponse, error) {
	var v EmulationSetDefaultBackgroundColorOverrideParams
	v.Color = color
	return c.SetDefaultBackgroundColorOverrideWithParams(&v)
}
type EmulationSetDeviceMetricsOverrideParams struct {
	Width int `json:"width"`
	Height int `json:"height"`
	DeviceScaleFactor float64 `json:"deviceScaleFactor"`
	Mobile bool `json:"mobile"`
	Scale float64 `json:"scale,omitempty"`
	ScreenWidth int `json:"screenWidth,omitempty"`
	ScreenHeight int `json:"screenHeight,omitempty"`
	PositionX int `json:"positionX,omitempty"`
	PositionY int `json:"positionY,omitempty"`
	DontSetVisibleSize bool `json:"dontSetVisibleSize,omitempty"`
	ScreenOrientation *EmulationScreenOrientation `json:"screenOrientation,omitempty"`
	Viewport *PageViewport `json:"viewport,omitempty"`
}
func (c *Emulation) SetDeviceMetricsOverrideWithParams(v *EmulationSetDeviceMetricsOverrideParams) (*gcdmessage.ChromeResponse, error) {
	return gcdmessage.SendDefaultRequest(c.target, c.target.GetSendCh(), &gcdmessage.ParamRequest{Id: c.target.GetId(), Method: "Emulation.setDeviceMetricsOverride", Params: v})
}
func (c *Emulation) SetDeviceMetricsOverride(width int, height int, deviceScaleFactor float64, mobile bool, scale float64, screenWidth int, screenHeight int, positionX int, positionY int, dontSetVisibleSize bool, screenOrientation *EmulationScreenOrientation, viewport *PageViewport) (*gcdmessage.ChromeResponse, error) {
	var v EmulationSetDeviceMetricsOverrideParams
	v.Width = width
	v.Height = height
	v.DeviceScaleFactor = deviceScaleFactor
	v.Mobile = mobile
	v.Scale = scale
	v.ScreenWidth = screenWidth
	v.ScreenHeight = screenHeight
	v.PositionX = positionX
	v.PositionY = positionY
	v.DontSetVisibleSize = dontSetVisibleSize
	v.ScreenOrientation = screenOrientation
	v.Viewport = viewport
	return c.SetDeviceMetricsOverrideWithParams(&v)
}
type EmulationSetScrollbarsHiddenParams struct {
	Hidden bool `json:"hidden"`
}
func (c *Emulation) SetScrollbarsHiddenWithParams(v *EmulationSetScrollbarsHiddenParams) (*gcdmessage.ChromeResponse, error) {
	return gcdmessage.SendDefaultRequest(c.target, c.target.GetSendCh(), &gcdmessage.ParamRequest{Id: c.target.GetId(), Method: "Emulation.setScrollbarsHidden", Params: v})
}
func (c *Emulation) SetScrollbarsHidden(hidden bool) (*gcdmessage.ChromeResponse, error) {
	var v EmulationSetScrollbarsHiddenParams
	v.Hidden = hidden
	return c.SetScrollbarsHiddenWithParams(&v)
}
type EmulationSetDocumentCookieDisabledParams struct {
	Disabled bool `json:"disabled"`
}
func (c *Emulation) SetDocumentCookieDisabledWithParams(v *EmulationSetDocumentCookieDisabledParams) (*gcdmessage.ChromeResponse, error) {
	return gcdmessage.SendDefaultRequest(c.target, c.target.GetSendCh(), &gcdmessage.ParamRequest{Id: c.target.GetId(), Method: "Emulation.setDocumentCookieDisabled", Params: v})
}
func (c *Emulation) SetDocumentCookieDisabled(disabled bool) (*gcdmessage.ChromeResponse, error) {
	var v EmulationSetDocumentCookieDisabledParams
	v.Disabled = disabled
	return c.SetDocumentCookieDisabledWithParams(&v)
}
type EmulationSetEmitTouchEventsForMouseParams struct {
	Enabled bool `json:"enabled"`
	Configuration string `json:"configuration,omitempty"`
}
func (c *Emulation) SetEmitTouchEventsForMouseWithParams(v *EmulationSetEmitTouchEventsForMouseParams) (*gcdmessage.ChromeResponse, error) {
	return gcdmessage.SendDefaultRequest(c.target, c.target.GetSendCh(), &gcdmessage.ParamRequest{Id: c.target.GetId(), Method: "Emulation.setEmitTouchEventsForMouse", Params: v})
}
func (c *Emulation) SetEmitTouchEventsForMouse(enabled bool, configuration string) (*gcdmessage.ChromeResponse, error) {
	var v EmulationSetEmitTouchEventsForMouseParams
	v.Enabled = enabled
	v.Configuration = configuration
	return c.SetEmitTouchEventsForMouseWithParams(&v)
}
type EmulationSetEmulatedMediaParams struct {
	Media string `json:"media"`
}
func (c *Emulation) SetEmulatedMediaWithParams(v *EmulationSetEmulatedMediaParams) (*gcdmessage.ChromeResponse, error) {
	return gcdmessage.SendDefaultRequest(c.target, c.target.GetSendCh(), &gcdmessage.ParamRequest{Id: c.target.GetId(), Method: "Emulation.setEmulatedMedia", Params: v})
}
func (c *Emulation) SetEmulatedMedia(media string) (*gcdmessage.ChromeResponse, error) {
	var v EmulationSetEmulatedMediaParams
	v.Media = media
	return c.SetEmulatedMediaWithParams(&v)
}
type EmulationSetGeolocationOverrideParams struct {
	Latitude float64 `json:"latitude,omitempty"`
	Longitude float64 `json:"longitude,omitempty"`
	Accuracy float64 `json:"accuracy,omitempty"`
}
func (c *Emulation) SetGeolocationOverrideWithParams(v *EmulationSetGeolocationOverrideParams) (*gcdmessage.ChromeResponse, error) {
	return gcdmessage.SendDefaultRequest(c.target, c.target.GetSendCh(), &gcdmessage.ParamRequest{Id: c.target.GetId(), Method: "Emulation.setGeolocationOverride", Params: v})
}
func (c *Emulation) SetGeolocationOverride(latitude float64, longitude float64, accuracy float64) (*gcdmessage.ChromeResponse, error) {
	var v EmulationSetGeolocationOverrideParams
	v.Latitude = latitude
	v.Longitude = longitude
	v.Accuracy = accuracy
	return c.SetGeolocationOverrideWithParams(&v)
}
type EmulationSetNavigatorOverridesParams struct {
	Platform string `json:"platform"`
}
func (c *Emulation) SetNavigatorOverridesWithParams(v *EmulationSetNavigatorOverridesParams) (*gcdmessage.ChromeResponse, error) {
	return gcdmessage.SendDefaultRequest(c.target, c.target.GetSendCh(), &gcdmessage.ParamRequest{Id: c.target.GetId(), Method: "Emulation.setNavigatorOverrides", Params: v})
}
func (c *Emulation) SetNavigatorOverrides(platform string) (*gcdmessage.ChromeResponse, error) {
	var v EmulationSetNavigatorOverridesParams
	v.Platform = platform
	return c.SetNavigatorOverridesWithParams(&v)
}
type EmulationSetPageScaleFactorParams struct {
	PageScaleFactor float64 `json:"pageScaleFactor"`
}
func (c *Emulation) SetPageScaleFactorWithParams(v *EmulationSetPageScaleFactorParams) (*gcdmessage.ChromeResponse, error) {
	return gcdmessage.SendDefaultRequest(c.target, c.target.GetSendCh(), &gcdmessage.ParamRequest{Id: c.target.GetId(), Method: "Emulation.setPageScaleFactor", Params: v})
}
func (c *Emulation) SetPageScaleFactor(pageScaleFactor float64) (*gcdmessage.ChromeResponse, error) {
	var v EmulationSetPageScaleFactorParams
	v.PageScaleFactor = pageScaleFactor
	return c.SetPageScaleFactorWithParams(&v)
}
type EmulationSetScriptExecutionDisabledParams struct {
	Value bool `json:"value"`
}
func (c *Emulation) SetScriptExecutionDisabledWithParams(v *EmulationSetScriptExecutionDisabledParams) (*gcdmessage.ChromeResponse, error) {
	return gcdmessage.SendDefaultRequest(c.target, c.target.GetSendCh(), &gcdmessage.ParamRequest{Id: c.target.GetId(), Method: "Emulation.setScriptExecutionDisabled", Params: v})
}
func (c *Emulation) SetScriptExecutionDisabled(value bool) (*gcdmessage.ChromeResponse, error) {
	var v EmulationSetScriptExecutionDisabledParams
	v.Value = value
	return c.SetScriptExecutionDisabledWithParams(&v)
}
type EmulationSetTouchEmulationEnabledParams struct {
	Enabled bool `json:"enabled"`
	MaxTouchPoints int `json:"maxTouchPoints,omitempty"`
}
func (c *Emulation) SetTouchEmulationEnabledWithParams(v *EmulationSetTouchEmulationEnabledParams) (*gcdmessage.ChromeResponse, error) {
	return gcdmessage.SendDefaultRequest(c.target, c.target.GetSendCh(), &gcdmessage.ParamRequest{Id: c.target.GetId(), Method: "Emulation.setTouchEmulationEnabled", Params: v})
}
func (c *Emulation) SetTouchEmulationEnabled(enabled bool, maxTouchPoints int) (*gcdmessage.ChromeResponse, error) {
	var v EmulationSetTouchEmulationEnabledParams
	v.Enabled = enabled
	v.MaxTouchPoints = maxTouchPoints
	return c.SetTouchEmulationEnabledWithParams(&v)
}
type EmulationSetVirtualTimePolicyParams struct {
	Policy string `json:"policy"`
	Budget float64 `json:"budget,omitempty"`
	MaxVirtualTimeTaskStarvationCount int `json:"maxVirtualTimeTaskStarvationCount,omitempty"`
	WaitForNavigation bool `json:"waitForNavigation,omitempty"`
	InitialVirtualTime float64 `json:"initialVirtualTime,omitempty"`
}