forked from chromedp/chromedp
/
types.go
56 lines (45 loc) · 1.57 KB
/
types.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
package audits
// Code generated by cdproto-gen. DO NOT EDIT.
import (
"errors"
"github.com/mailru/easyjson"
"github.com/mailru/easyjson/jlexer"
"github.com/mailru/easyjson/jwriter"
)
// GetEncodedResponseEncoding the encoding to use.
type GetEncodedResponseEncoding string
// String returns the GetEncodedResponseEncoding as string value.
func (t GetEncodedResponseEncoding) String() string {
return string(t)
}
// GetEncodedResponseEncoding values.
const (
GetEncodedResponseEncodingWebp GetEncodedResponseEncoding = "webp"
GetEncodedResponseEncodingJpeg GetEncodedResponseEncoding = "jpeg"
GetEncodedResponseEncodingPng GetEncodedResponseEncoding = "png"
)
// MarshalEasyJSON satisfies easyjson.Marshaler.
func (t GetEncodedResponseEncoding) MarshalEasyJSON(out *jwriter.Writer) {
out.String(string(t))
}
// MarshalJSON satisfies json.Marshaler.
func (t GetEncodedResponseEncoding) MarshalJSON() ([]byte, error) {
return easyjson.Marshal(t)
}
// UnmarshalEasyJSON satisfies easyjson.Unmarshaler.
func (t *GetEncodedResponseEncoding) UnmarshalEasyJSON(in *jlexer.Lexer) {
switch GetEncodedResponseEncoding(in.String()) {
case GetEncodedResponseEncodingWebp:
*t = GetEncodedResponseEncodingWebp
case GetEncodedResponseEncodingJpeg:
*t = GetEncodedResponseEncodingJpeg
case GetEncodedResponseEncodingPng:
*t = GetEncodedResponseEncodingPng
default:
in.AddError(errors.New("unknown GetEncodedResponseEncoding value"))
}
}
// UnmarshalJSON satisfies json.Unmarshaler.
func (t *GetEncodedResponseEncoding) UnmarshalJSON(buf []byte) error {
return easyjson.Unmarshal(buf, t)
}