// Package crashreportcontext provides the Chrome DevTools Protocol
// commands, types, and events for the CrashReportContext domain.
//
// This domain exposes the current state of the CrashReportContext API.
//
// Generated by the cdproto-gen command.
package crashreportcontext

// Code generated by cdproto-gen. DO NOT EDIT.

import (
	"context"

	"github.com/chromedp/cdproto/cdp"
)

// GetEntriesParams returns all entries in the CrashReportContext across all
// frames in the page.
type GetEntriesParams struct{}

// GetEntries returns all entries in the CrashReportContext across all frames
// in the page.
//
// See: https://chromedevtools.github.io/devtools-protocol/tot/CrashReportContext#method-getEntries
func GetEntries() *GetEntriesParams {
	return &GetEntriesParams{}
}

// GetEntriesReturns return values.
type GetEntriesReturns struct {
	Entries []*Entry `json:"entries,omitempty,omitzero"`
}

// Do executes CrashReportContext.getEntries against the provided context.
//
// returns:
//
//	entries
func (p *GetEntriesParams) Do(ctx context.Context) (entries []*Entry, err error) {
	// execute
	var res GetEntriesReturns
	err = cdp.Execute(ctx, CommandGetEntries, nil, &res)
	if err != nil {
		return nil, err
	}

	return res.Entries, nil
}

// Command names.
const (
	CommandGetEntries = "CrashReportContext.getEntries"
)
