// Package ads provides the Chrome DevTools Protocol
// commands, types, and events for the Ads domain.
//
// A domain for ad-related metrics and data.
//
// Generated by the cdproto-gen command.
package ads

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

import (
	"context"

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

// GetAdMetricsParams retrieves ad metrics for the current page.
type GetAdMetricsParams struct{}

// GetAdMetrics retrieves ad metrics for the current page.
//
// See: https://chromedevtools.github.io/devtools-protocol/tot/Ads#method-getAdMetrics
func GetAdMetrics() *GetAdMetricsParams {
	return &GetAdMetricsParams{}
}

// GetAdMetricsReturns return values.
type GetAdMetricsReturns struct {
	Metrics *AdMetrics `json:"metrics,omitempty,omitzero"`
}

// Do executes Ads.getAdMetrics against the provided context.
//
// returns:
//
//	metrics
func (p *GetAdMetricsParams) Do(ctx context.Context) (metrics *AdMetrics, err error) {
	// execute
	var res GetAdMetricsReturns
	err = cdp.Execute(ctx, CommandGetAdMetrics, nil, &res)
	if err != nil {
		return nil, err
	}

	return res.Metrics, nil
}

// Command names.
const (
	CommandGetAdMetrics = "Ads.getAdMetrics"
)
