package headlessexperimental

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

import (
	

	
	
	
)

// ScreenshotParams encoding options for a screenshot.
//
// See: https://chromedevtools.github.io/devtools-protocol/tot/HeadlessExperimental#type-ScreenshotParams
type ScreenshotParams struct {
	Format           ScreenshotParamsFormat `json:"format,omitempty"`           // Image compression format (defaults to png).
	Quality          int64                  `json:"quality,omitempty"`          // Compression quality from range [0..100] (jpeg and webp only).
	OptimizeForSpeed bool                   `json:"optimizeForSpeed,omitempty"` // Optimize image encoding for speed, not for resulting size (defaults to false)
}

// ScreenshotParamsFormat image compression format (defaults to png).
//
// See: https://chromedevtools.github.io/devtools-protocol/tot/HeadlessExperimental#type-ScreenshotParams
type ScreenshotParamsFormat string

// String returns the ScreenshotParamsFormat as string value.
func ( ScreenshotParamsFormat) () string {
	return string()
}

// ScreenshotParamsFormat values.
const (
	ScreenshotParamsFormatJpeg ScreenshotParamsFormat = "jpeg"
	ScreenshotParamsFormatPng  ScreenshotParamsFormat = "png"
	ScreenshotParamsFormatWebp ScreenshotParamsFormat = "webp"
)

// MarshalEasyJSON satisfies easyjson.Marshaler.
func ( ScreenshotParamsFormat) ( *jwriter.Writer) {
	.String(string())
}

// MarshalJSON satisfies json.Marshaler.
func ( ScreenshotParamsFormat) () ([]byte, error) {
	return easyjson.Marshal()
}

// UnmarshalEasyJSON satisfies easyjson.Unmarshaler.
func ( *ScreenshotParamsFormat) ( *jlexer.Lexer) {
	 := .String()
	switch ScreenshotParamsFormat() {
	case ScreenshotParamsFormatJpeg:
		* = ScreenshotParamsFormatJpeg
	case ScreenshotParamsFormatPng:
		* = ScreenshotParamsFormatPng
	case ScreenshotParamsFormatWebp:
		* = ScreenshotParamsFormatWebp

	default:
		.AddError(fmt.Errorf("unknown ScreenshotParamsFormat value: %v", ))
	}
}

// UnmarshalJSON satisfies json.Unmarshaler.
func ( *ScreenshotParamsFormat) ( []byte) error {
	return easyjson.Unmarshal(, )
}