easyjson.go 4.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158
  1. // Code generated by easyjson for marshaling/unmarshaling. DO NOT EDIT.
  2. package deviceorientation
  3. import (
  4. json "encoding/json"
  5. easyjson "github.com/mailru/easyjson"
  6. jlexer "github.com/mailru/easyjson/jlexer"
  7. jwriter "github.com/mailru/easyjson/jwriter"
  8. )
  9. // suppress unused package warning
  10. var (
  11. _ *json.RawMessage
  12. _ *jlexer.Lexer
  13. _ *jwriter.Writer
  14. _ easyjson.Marshaler
  15. )
  16. func easyjsonC5a4559bDecodeGithubComChromedpCdprotoDeviceorientation(in *jlexer.Lexer, out *SetDeviceOrientationOverrideParams) {
  17. isTopLevel := in.IsStart()
  18. if in.IsNull() {
  19. if isTopLevel {
  20. in.Consumed()
  21. }
  22. in.Skip()
  23. return
  24. }
  25. in.Delim('{')
  26. for !in.IsDelim('}') {
  27. key := in.UnsafeFieldName(false)
  28. in.WantColon()
  29. if in.IsNull() {
  30. in.Skip()
  31. in.WantComma()
  32. continue
  33. }
  34. switch key {
  35. case "alpha":
  36. out.Alpha = float64(in.Float64())
  37. case "beta":
  38. out.Beta = float64(in.Float64())
  39. case "gamma":
  40. out.Gamma = float64(in.Float64())
  41. default:
  42. in.SkipRecursive()
  43. }
  44. in.WantComma()
  45. }
  46. in.Delim('}')
  47. if isTopLevel {
  48. in.Consumed()
  49. }
  50. }
  51. func easyjsonC5a4559bEncodeGithubComChromedpCdprotoDeviceorientation(out *jwriter.Writer, in SetDeviceOrientationOverrideParams) {
  52. out.RawByte('{')
  53. first := true
  54. _ = first
  55. {
  56. const prefix string = ",\"alpha\":"
  57. out.RawString(prefix[1:])
  58. out.Float64(float64(in.Alpha))
  59. }
  60. {
  61. const prefix string = ",\"beta\":"
  62. out.RawString(prefix)
  63. out.Float64(float64(in.Beta))
  64. }
  65. {
  66. const prefix string = ",\"gamma\":"
  67. out.RawString(prefix)
  68. out.Float64(float64(in.Gamma))
  69. }
  70. out.RawByte('}')
  71. }
  72. // MarshalJSON supports json.Marshaler interface
  73. func (v SetDeviceOrientationOverrideParams) MarshalJSON() ([]byte, error) {
  74. w := jwriter.Writer{}
  75. easyjsonC5a4559bEncodeGithubComChromedpCdprotoDeviceorientation(&w, v)
  76. return w.Buffer.BuildBytes(), w.Error
  77. }
  78. // MarshalEasyJSON supports easyjson.Marshaler interface
  79. func (v SetDeviceOrientationOverrideParams) MarshalEasyJSON(w *jwriter.Writer) {
  80. easyjsonC5a4559bEncodeGithubComChromedpCdprotoDeviceorientation(w, v)
  81. }
  82. // UnmarshalJSON supports json.Unmarshaler interface
  83. func (v *SetDeviceOrientationOverrideParams) UnmarshalJSON(data []byte) error {
  84. r := jlexer.Lexer{Data: data}
  85. easyjsonC5a4559bDecodeGithubComChromedpCdprotoDeviceorientation(&r, v)
  86. return r.Error()
  87. }
  88. // UnmarshalEasyJSON supports easyjson.Unmarshaler interface
  89. func (v *SetDeviceOrientationOverrideParams) UnmarshalEasyJSON(l *jlexer.Lexer) {
  90. easyjsonC5a4559bDecodeGithubComChromedpCdprotoDeviceorientation(l, v)
  91. }
  92. func easyjsonC5a4559bDecodeGithubComChromedpCdprotoDeviceorientation1(in *jlexer.Lexer, out *ClearDeviceOrientationOverrideParams) {
  93. isTopLevel := in.IsStart()
  94. if in.IsNull() {
  95. if isTopLevel {
  96. in.Consumed()
  97. }
  98. in.Skip()
  99. return
  100. }
  101. in.Delim('{')
  102. for !in.IsDelim('}') {
  103. key := in.UnsafeFieldName(false)
  104. in.WantColon()
  105. if in.IsNull() {
  106. in.Skip()
  107. in.WantComma()
  108. continue
  109. }
  110. switch key {
  111. default:
  112. in.SkipRecursive()
  113. }
  114. in.WantComma()
  115. }
  116. in.Delim('}')
  117. if isTopLevel {
  118. in.Consumed()
  119. }
  120. }
  121. func easyjsonC5a4559bEncodeGithubComChromedpCdprotoDeviceorientation1(out *jwriter.Writer, in ClearDeviceOrientationOverrideParams) {
  122. out.RawByte('{')
  123. first := true
  124. _ = first
  125. out.RawByte('}')
  126. }
  127. // MarshalJSON supports json.Marshaler interface
  128. func (v ClearDeviceOrientationOverrideParams) MarshalJSON() ([]byte, error) {
  129. w := jwriter.Writer{}
  130. easyjsonC5a4559bEncodeGithubComChromedpCdprotoDeviceorientation1(&w, v)
  131. return w.Buffer.BuildBytes(), w.Error
  132. }
  133. // MarshalEasyJSON supports easyjson.Marshaler interface
  134. func (v ClearDeviceOrientationOverrideParams) MarshalEasyJSON(w *jwriter.Writer) {
  135. easyjsonC5a4559bEncodeGithubComChromedpCdprotoDeviceorientation1(w, v)
  136. }
  137. // UnmarshalJSON supports json.Unmarshaler interface
  138. func (v *ClearDeviceOrientationOverrideParams) UnmarshalJSON(data []byte) error {
  139. r := jlexer.Lexer{Data: data}
  140. easyjsonC5a4559bDecodeGithubComChromedpCdprotoDeviceorientation1(&r, v)
  141. return r.Error()
  142. }
  143. // UnmarshalEasyJSON supports easyjson.Unmarshaler interface
  144. func (v *ClearDeviceOrientationOverrideParams) UnmarshalEasyJSON(l *jlexer.Lexer) {
  145. easyjsonC5a4559bDecodeGithubComChromedpCdprotoDeviceorientation1(l, v)
  146. }