func (c *DOM) ScrollIntoViewIfNeeded(nodeId int, backendNodeId int, objectId string, rect *DOMRect) (*gcdmessage.ChromeResponse, error) {
	var v DOMScrollIntoViewIfNeededParams
	v.NodeId = nodeId
	v.BackendNodeId = backendNodeId
	v.ObjectId = objectId
	v.Rect = rect
	return c.ScrollIntoViewIfNeededWithParams(&v)
}
ScrollIntoViewIfNeeded - Scrolls the specified rect of the given node into view if not already visible. Note: exactly one between nodeId, backendNodeId and objectId should be passed to identify the node.
nodeId - Identifier of the node.
backendNodeId - Identifier of the backend node.
objectId - JavaScript object id of the node wrapper.
rect - The rect to be scrolled into view, relative to the node's border box, in CSS pixels. When omitted, center of the node will be used, similar to Element.scrollIntoView.
package gcdapi
import (
	"github.com/wirepair/gcd/gcdmessage"
)
type DOMBackendNode struct {
	NodeType      int    `json:"nodeType"`       
	NodeName      string `json:"nodeName"`       
	BackendNodeId int    `json:"backendNodeId"`  
}
type DOMNode struct {
	NodeId           int               `json:"nodeId"`                      
	ParentId         int               `json:"parentId,omitempty"`          
	BackendNodeId    int               `json:"backendNodeId"`               
	NodeType         int               `json:"nodeType"`                    
	NodeName         string            `json:"nodeName"`                    
	LocalName        string            `json:"localName"`                   
	NodeValue        string            `json:"nodeValue"`                   
	ChildNodeCount   int               `json:"childNodeCount,omitempty"`    
	Children         []*DOMNode        `json:"children,omitempty"`          
	Attributes       []string          `json:"attributes,omitempty"`        
	DocumentURL      string            `json:"documentURL,omitempty"`       
	BaseURL          string            `json:"baseURL,omitempty"`           
	PublicId         string            `json:"publicId,omitempty"`          
	SystemId         string            `json:"systemId,omitempty"`          
	InternalSubset   string            `json:"internalSubset,omitempty"`    
	XmlVersion       string            `json:"xmlVersion,omitempty"`        
	Name             string            `json:"name,omitempty"`              
	Value            string            `json:"value,omitempty"`             
	PseudoType       string            `json:"pseudoType,omitempty"`        
	ShadowRootType   string            `json:"shadowRootType,omitempty"`    
	FrameId          string            `json:"frameId,omitempty"`           
	ContentDocument  *DOMNode          `json:"contentDocument,omitempty"`   
	ShadowRoots      []*DOMNode        `json:"shadowRoots,omitempty"`       
	TemplateContent  *DOMNode          `json:"templateContent,omitempty"`   
	PseudoElements   []*DOMNode        `json:"pseudoElements,omitempty"`    
	ImportedDocument *DOMNode          `json:"importedDocument,omitempty"`  
	DistributedNodes []*DOMBackendNode `json:"distributedNodes,omitempty"`  
	IsSVG            bool              `json:"isSVG,omitempty"`             
}
type DOMRGBA struct {
	R int     `json:"r"`            
	G int     `json:"g"`            
	B int     `json:"b"`            
	A float64 `json:"a,omitempty"`  
}
type DOMBoxModel struct {
	Content      []float64            `json:"content"`                 
	Padding      []float64            `json:"padding"`                 
	Border       []float64            `json:"border"`                  
	Margin       []float64            `json:"margin"`                  
	Width        int                  `json:"width"`                   
	Height       int                  `json:"height"`                  
	ShapeOutside *DOMShapeOutsideInfo `json:"shapeOutside,omitempty"`  
}
type DOMShapeOutsideInfo struct {
	Bounds      []float64     `json:"bounds"`       
	Shape       []interface{} `json:"shape"`        
	MarginShape []interface{} `json:"marginShape"`  
}
type DOMRect struct {
	X      float64 `json:"x"`       
	Y      float64 `json:"y"`       
	Width  float64 `json:"width"`   
	Height float64 `json:"height"`  
}
type DOMAttributeModifiedEvent struct {
	Method string `json:"method"`
	Params struct {
		NodeId int    `json:"nodeId"`  
		Name   string `json:"name"`    
		Value  string `json:"value"`   
	} `json:"Params,omitempty"`
}
type DOMAttributeRemovedEvent struct {
	Method string `json:"method"`
	Params struct {
		NodeId int    `json:"nodeId"`  
		Name   string `json:"name"`    
	} `json:"Params,omitempty"`
}
type DOMCharacterDataModifiedEvent struct {
	Method string `json:"method"`
	Params struct {
		NodeId        int    `json:"nodeId"`         
		CharacterData string `json:"characterData"`  
	} `json:"Params,omitempty"`
}
type DOMChildNodeCountUpdatedEvent struct {
	Method string `json:"method"`
	Params struct {
		NodeId         int `json:"nodeId"`          
		ChildNodeCount int `json:"childNodeCount"`  
	} `json:"Params,omitempty"`
}
type DOMChildNodeInsertedEvent struct {
	Method string `json:"method"`
	Params struct {
		ParentNodeId   int      `json:"parentNodeId"`    
		PreviousNodeId int      `json:"previousNodeId"`  
		Node           *DOMNode `json:"node"`            
	} `json:"Params,omitempty"`
}
type DOMChildNodeRemovedEvent struct {
	Method string `json:"method"`
	Params struct {
		ParentNodeId int `json:"parentNodeId"`  
		NodeId       int `json:"nodeId"`        
	} `json:"Params,omitempty"`
}
type DOMDistributedNodesUpdatedEvent struct {
	Method string `json:"method"`
	Params struct {
		InsertionPointId int               `json:"insertionPointId"`  
		DistributedNodes []*DOMBackendNode `json:"distributedNodes"`  
	} `json:"Params,omitempty"`
}
type DOMInlineStyleInvalidatedEvent struct {
	Method string `json:"method"`
	Params struct {
		NodeIds []int `json:"nodeIds"`  
	} `json:"Params,omitempty"`
}
type DOMPseudoElementAddedEvent struct {
	Method string `json:"method"`
	Params struct {
		ParentId      int      `json:"parentId"`       
		PseudoElement *DOMNode `json:"pseudoElement"`  
	} `json:"Params,omitempty"`
}
type DOMPseudoElementRemovedEvent struct {
	Method string `json:"method"`
	Params struct {
		ParentId        int `json:"parentId"`         
		PseudoElementId int `json:"pseudoElementId"`  
	} `json:"Params,omitempty"`
}
type DOMSetChildNodesEvent struct {
	Method string `json:"method"`
	Params struct {
		ParentId int        `json:"parentId"`  
		Nodes    []*DOMNode `json:"nodes"`     
	} `json:"Params,omitempty"`
}
type DOMShadowRootPoppedEvent struct {
	Method string `json:"method"`
	Params struct {
		HostId int `json:"hostId"`  
		RootId int `json:"rootId"`  
	} `json:"Params,omitempty"`
}
type DOMShadowRootPushedEvent struct {
	Method string `json:"method"`
	Params struct {
		HostId int      `json:"hostId"`  
		Root   *DOMNode `json:"root"`    
	} `json:"Params,omitempty"`
}
type DOM struct {
	target gcdmessage.ChromeTargeter
}
func NewDOM(target gcdmessage.ChromeTargeter) *DOM {
	c := &DOM{target: target}
	return c
}
type DOMCollectClassNamesFromSubtreeParams struct {
	NodeId int `json:"nodeId"`
}
func (c *DOM) CollectClassNamesFromSubtreeWithParams(v *DOMCollectClassNamesFromSubtreeParams) ([]string, error) {
	resp, err := gcdmessage.SendCustomReturn(c.target, c.target.GetSendCh(), &gcdmessage.ParamRequest{Id: c.target.GetId(), Method: "DOM.collectClassNamesFromSubtree", Params: v})
	if err != nil {
		return nil, err
	}
	var chromeData struct {
		Result struct {
			ClassNames []string
		}
	}
	if resp == nil {
		return nil, &gcdmessage.ChromeEmptyResponseErr{}
	}
	cerr := &gcdmessage.ChromeErrorResponse{}
	json.Unmarshal(resp.Data, cerr)
	if cerr != nil && cerr.Error != nil {
		return nil, &gcdmessage.ChromeRequestErr{Resp: cerr}
	}
	if err := json.Unmarshal(resp.Data, &chromeData); err != nil {
		return nil, err
	}
	return chromeData.Result.ClassNames, nil
}
func (c *DOM) CollectClassNamesFromSubtree(nodeId int) ([]string, error) {
	var v DOMCollectClassNamesFromSubtreeParams
	v.NodeId = nodeId
	return c.CollectClassNamesFromSubtreeWithParams(&v)
}
type DOMCopyToParams struct {
	NodeId int `json:"nodeId"`
	TargetNodeId int `json:"targetNodeId"`
	InsertBeforeNodeId int `json:"insertBeforeNodeId,omitempty"`
}
func (c *DOM) CopyToWithParams(v *DOMCopyToParams) (int, error) {
	resp, err := gcdmessage.SendCustomReturn(c.target, c.target.GetSendCh(), &gcdmessage.ParamRequest{Id: c.target.GetId(), Method: "DOM.copyTo", Params: v})
	if err != nil {
		return 0, err
	}
	var chromeData struct {
		Result struct {
			NodeId int
		}
	}
	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.NodeId, nil
}
func (c *DOM) CopyTo(nodeId int, targetNodeId int, insertBeforeNodeId int) (int, error) {
	var v DOMCopyToParams
	v.NodeId = nodeId
	v.TargetNodeId = targetNodeId
	v.InsertBeforeNodeId = insertBeforeNodeId
	return c.CopyToWithParams(&v)
}
type DOMDescribeNodeParams struct {
	NodeId int `json:"nodeId,omitempty"`
	BackendNodeId int `json:"backendNodeId,omitempty"`
	ObjectId string `json:"objectId,omitempty"`
	Depth int `json:"depth,omitempty"`
	Pierce bool `json:"pierce,omitempty"`
}
func (c *DOM) DescribeNodeWithParams(v *DOMDescribeNodeParams) (*DOMNode, error) {
	resp, err := gcdmessage.SendCustomReturn(c.target, c.target.GetSendCh(), &gcdmessage.ParamRequest{Id: c.target.GetId(), Method: "DOM.describeNode", Params: v})
	if err != nil {
		return nil, err
	}
	var chromeData struct {
		Result struct {
			Node *DOMNode
		}
	}
	if resp == nil {
		return nil, &gcdmessage.ChromeEmptyResponseErr{}
	}
	cerr := &gcdmessage.ChromeErrorResponse{}
	json.Unmarshal(resp.Data, cerr)
	if cerr != nil && cerr.Error != nil {
		return nil, &gcdmessage.ChromeRequestErr{Resp: cerr}
	}
	if err := json.Unmarshal(resp.Data, &chromeData); err != nil {
		return nil, err
	}
	return chromeData.Result.Node, nil
}
func (c *DOM) DescribeNode(nodeId int, backendNodeId int, objectId string, depth int, pierce bool) (*DOMNode, error) {
	var v DOMDescribeNodeParams
	v.NodeId = nodeId
	v.BackendNodeId = backendNodeId
	v.ObjectId = objectId
	v.Depth = depth
	v.Pierce = pierce
	return c.DescribeNodeWithParams(&v)
}
type DOMScrollIntoViewIfNeededParams struct {
	NodeId int `json:"nodeId,omitempty"`
	BackendNodeId int `json:"backendNodeId,omitempty"`
	ObjectId string `json:"objectId,omitempty"`
	Rect *DOMRect `json:"rect,omitempty"`
}
func (c *DOM) ScrollIntoViewIfNeededWithParams(v *DOMScrollIntoViewIfNeededParams) (*gcdmessage.ChromeResponse, error) {
	return gcdmessage.SendDefaultRequest(c.target, c.target.GetSendCh(), &gcdmessage.ParamRequest{Id: c.target.GetId(), Method: "DOM.scrollIntoViewIfNeeded", Params: v})
}