/
pagespeedonline-gen.go
1454 lines (1231 loc) · 56 KB
/
pagespeedonline-gen.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
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
// Copyright 2022 Google LLC.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
// Code generated file. DO NOT EDIT.
// Package pagespeedonline provides access to the PageSpeed Insights API.
//
// For product documentation, see: https://developers.google.com/speed/docs/insights/v5/about
//
// # Creating a client
//
// Usage example:
//
// import "google.golang.org/api/pagespeedonline/v5"
// ...
// ctx := context.Background()
// pagespeedonlineService, err := pagespeedonline.NewService(ctx)
//
// In this example, Google Application Default Credentials are used for authentication.
//
// For information on how to create and obtain Application Default Credentials, see https://developers.google.com/identity/protocols/application-default-credentials.
//
// # Other authentication options
//
// To use an API key for authentication (note: some APIs do not support API keys), use option.WithAPIKey:
//
// pagespeedonlineService, err := pagespeedonline.NewService(ctx, option.WithAPIKey("AIza..."))
//
// To use an OAuth token (e.g., a user token obtained via a three-legged OAuth flow), use option.WithTokenSource:
//
// config := &oauth2.Config{...}
// // ...
// token, err := config.Exchange(ctx, ...)
// pagespeedonlineService, err := pagespeedonline.NewService(ctx, option.WithTokenSource(config.TokenSource(ctx, token)))
//
// See https://godoc.org/google.golang.org/api/option/ for details on options.
package pagespeedonline // import "google.golang.org/api/pagespeedonline/v5"
import (
"bytes"
"context"
"encoding/json"
"errors"
"fmt"
"io"
"net/http"
"net/url"
"strconv"
"strings"
googleapi "google.golang.org/api/googleapi"
internal "google.golang.org/api/internal"
gensupport "google.golang.org/api/internal/gensupport"
option "google.golang.org/api/option"
internaloption "google.golang.org/api/option/internaloption"
htransport "google.golang.org/api/transport/http"
)
// Always reference these packages, just in case the auto-generated code
// below doesn't.
var _ = bytes.NewBuffer
var _ = strconv.Itoa
var _ = fmt.Sprintf
var _ = json.NewDecoder
var _ = io.Copy
var _ = url.Parse
var _ = gensupport.MarshalJSON
var _ = googleapi.Version
var _ = errors.New
var _ = strings.Replace
var _ = context.Canceled
var _ = internaloption.WithDefaultEndpoint
const apiId = "pagespeedonline:v5"
const apiName = "pagespeedonline"
const apiVersion = "v5"
const basePath = "https://pagespeedonline.googleapis.com/"
const mtlsBasePath = "https://pagespeedonline.mtls.googleapis.com/"
// OAuth2 scopes used by this API.
const (
// Associate you with your personal info on Google
OpenIDScope = "openid"
)
// NewService creates a new Service.
func NewService(ctx context.Context, opts ...option.ClientOption) (*Service, error) {
scopesOption := internaloption.WithDefaultScopes(
"openid",
)
// NOTE: prepend, so we don't override user-specified scopes.
opts = append([]option.ClientOption{scopesOption}, opts...)
opts = append(opts, internaloption.WithDefaultEndpoint(basePath))
opts = append(opts, internaloption.WithDefaultMTLSEndpoint(mtlsBasePath))
client, endpoint, err := htransport.NewClient(ctx, opts...)
if err != nil {
return nil, err
}
s, err := New(client)
if err != nil {
return nil, err
}
if endpoint != "" {
s.BasePath = endpoint
}
return s, nil
}
// New creates a new Service. It uses the provided http.Client for requests.
//
// Deprecated: please use NewService instead.
// To provide a custom HTTP client, use option.WithHTTPClient.
// If you are using google.golang.org/api/googleapis/transport.APIKey, use option.WithAPIKey with NewService instead.
func New(client *http.Client) (*Service, error) {
if client == nil {
return nil, errors.New("client is nil")
}
s := &Service{client: client, BasePath: basePath}
s.Pagespeedapi = NewPagespeedapiService(s)
return s, nil
}
type Service struct {
client *http.Client
BasePath string // API endpoint base URL
UserAgent string // optional additional User-Agent fragment
Pagespeedapi *PagespeedapiService
}
func (s *Service) userAgent() string {
if s.UserAgent == "" {
return googleapi.UserAgent
}
return googleapi.UserAgent + " " + s.UserAgent
}
func NewPagespeedapiService(s *Service) *PagespeedapiService {
rs := &PagespeedapiService{s: s}
return rs
}
type PagespeedapiService struct {
s *Service
}
// AuditRefs: A light reference to an audit by id, used to group and
// weight audits in a given category.
type AuditRefs struct {
// Acronym: The conventional acronym for the audit/metric.
Acronym string `json:"acronym,omitempty"`
// Group: The category group that the audit belongs to (optional).
Group string `json:"group,omitempty"`
// Id: The audit ref id.
Id string `json:"id,omitempty"`
// RelevantAudits: Any audit IDs closely relevant to this one.
RelevantAudits []string `json:"relevantAudits,omitempty"`
// Weight: The weight this audit's score has on the overall category
// score.
Weight float64 `json:"weight,omitempty"`
// ForceSendFields is a list of field names (e.g. "Acronym") to
// unconditionally include in API requests. By default, fields with
// empty or default values are omitted from API requests. However, any
// non-pointer, non-interface field appearing in ForceSendFields will be
// sent to the server regardless of whether the field is empty or not.
// This may be used to include empty fields in Patch requests.
ForceSendFields []string `json:"-"`
// NullFields is a list of field names (e.g. "Acronym") to include in
// API requests with the JSON null value. By default, fields with empty
// values are omitted from API requests. However, any field with an
// empty value appearing in NullFields will be sent to the server as
// null. It is an error if a field in this list has a non-empty value.
// This may be used to include null fields in Patch requests.
NullFields []string `json:"-"`
}
func (s *AuditRefs) MarshalJSON() ([]byte, error) {
type NoMethod AuditRefs
raw := NoMethod(*s)
return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
}
func (s *AuditRefs) UnmarshalJSON(data []byte) error {
type NoMethod AuditRefs
var s1 struct {
Weight gensupport.JSONFloat64 `json:"weight"`
*NoMethod
}
s1.NoMethod = (*NoMethod)(s)
if err := json.Unmarshal(data, &s1); err != nil {
return err
}
s.Weight = float64(s1.Weight)
return nil
}
// Bucket: A proportion of data in the total distribution, bucketed by a
// min/max percentage. Each bucket's range is bounded by min <= x < max,
// In millisecond.
type Bucket struct {
// Max: Upper bound for a bucket's range.
Max int64 `json:"max,omitempty"`
// Min: Lower bound for a bucket's range.
Min int64 `json:"min,omitempty"`
// Proportion: The proportion of data in this bucket.
Proportion float64 `json:"proportion,omitempty"`
// ForceSendFields is a list of field names (e.g. "Max") to
// unconditionally include in API requests. By default, fields with
// empty or default values are omitted from API requests. However, any
// non-pointer, non-interface field appearing in ForceSendFields will be
// sent to the server regardless of whether the field is empty or not.
// This may be used to include empty fields in Patch requests.
ForceSendFields []string `json:"-"`
// NullFields is a list of field names (e.g. "Max") to include in API
// requests with the JSON null value. By default, fields with empty
// values are omitted from API requests. However, any field with an
// empty value appearing in NullFields will be sent to the server as
// null. It is an error if a field in this list has a non-empty value.
// This may be used to include null fields in Patch requests.
NullFields []string `json:"-"`
}
func (s *Bucket) MarshalJSON() ([]byte, error) {
type NoMethod Bucket
raw := NoMethod(*s)
return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
}
func (s *Bucket) UnmarshalJSON(data []byte) error {
type NoMethod Bucket
var s1 struct {
Proportion gensupport.JSONFloat64 `json:"proportion"`
*NoMethod
}
s1.NoMethod = (*NoMethod)(s)
if err := json.Unmarshal(data, &s1); err != nil {
return err
}
s.Proportion = float64(s1.Proportion)
return nil
}
// Categories: The categories in a Lighthouse run.
type Categories struct {
// Accessibility: The accessibility category, containing all
// accessibility related audits.
Accessibility *LighthouseCategoryV5 `json:"accessibility,omitempty"`
// BestPractices: The best practices category, containing all best
// practices related audits.
BestPractices *LighthouseCategoryV5 `json:"best-practices,omitempty"`
// Performance: The performance category, containing all performance
// related audits.
Performance *LighthouseCategoryV5 `json:"performance,omitempty"`
// Pwa: The Progressive-Web-App (PWA) category, containing all pwa
// related audits.
Pwa *LighthouseCategoryV5 `json:"pwa,omitempty"`
// Seo: The Search-Engine-Optimization (SEO) category, containing all
// seo related audits.
Seo *LighthouseCategoryV5 `json:"seo,omitempty"`
// ForceSendFields is a list of field names (e.g. "Accessibility") to
// unconditionally include in API requests. By default, fields with
// empty or default values are omitted from API requests. However, any
// non-pointer, non-interface field appearing in ForceSendFields will be
// sent to the server regardless of whether the field is empty or not.
// This may be used to include empty fields in Patch requests.
ForceSendFields []string `json:"-"`
// NullFields is a list of field names (e.g. "Accessibility") to include
// in API requests with the JSON null value. By default, fields with
// empty values are omitted from API requests. However, any field with
// an empty value appearing in NullFields will be sent to the server as
// null. It is an error if a field in this list has a non-empty value.
// This may be used to include null fields in Patch requests.
NullFields []string `json:"-"`
}
func (s *Categories) MarshalJSON() ([]byte, error) {
type NoMethod Categories
raw := NoMethod(*s)
return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
}
// CategoryGroupV5: Message containing a category
type CategoryGroupV5 struct {
// Description: The description of what the category is grouping
Description string `json:"description,omitempty"`
// Title: The human readable title of the group
Title string `json:"title,omitempty"`
// ForceSendFields is a list of field names (e.g. "Description") to
// unconditionally include in API requests. By default, fields with
// empty or default values are omitted from API requests. However, any
// non-pointer, non-interface field appearing in ForceSendFields will be
// sent to the server regardless of whether the field is empty or not.
// This may be used to include empty fields in Patch requests.
ForceSendFields []string `json:"-"`
// NullFields is a list of field names (e.g. "Description") to include
// in API requests with the JSON null value. By default, fields with
// empty values are omitted from API requests. However, any field with
// an empty value appearing in NullFields will be sent to the server as
// null. It is an error if a field in this list has a non-empty value.
// This may be used to include null fields in Patch requests.
NullFields []string `json:"-"`
}
func (s *CategoryGroupV5) MarshalJSON() ([]byte, error) {
type NoMethod CategoryGroupV5
raw := NoMethod(*s)
return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
}
// ConfigSettings: Message containing the configuration settings for the
// Lighthouse run.
type ConfigSettings struct {
// Channel: How Lighthouse was run, e.g. from the Chrome extension or
// from the npm module.
Channel string `json:"channel,omitempty"`
// EmulatedFormFactor: The form factor the emulation should use. This
// field is deprecated, form_factor should be used instead.
EmulatedFormFactor string `json:"emulatedFormFactor,omitempty"`
// FormFactor: How Lighthouse should interpret this run in regards to
// scoring performance metrics and skipping mobile-only tests in
// desktop.
FormFactor string `json:"formFactor,omitempty"`
// Locale: The locale setting.
Locale string `json:"locale,omitempty"`
// OnlyCategories: List of categories of audits the run should conduct.
OnlyCategories interface{} `json:"onlyCategories,omitempty"`
// ForceSendFields is a list of field names (e.g. "Channel") to
// unconditionally include in API requests. By default, fields with
// empty or default values are omitted from API requests. However, any
// non-pointer, non-interface field appearing in ForceSendFields will be
// sent to the server regardless of whether the field is empty or not.
// This may be used to include empty fields in Patch requests.
ForceSendFields []string `json:"-"`
// NullFields is a list of field names (e.g. "Channel") to include in
// API requests with the JSON null value. By default, fields with empty
// values are omitted from API requests. However, any field with an
// empty value appearing in NullFields will be sent to the server as
// null. It is an error if a field in this list has a non-empty value.
// This may be used to include null fields in Patch requests.
NullFields []string `json:"-"`
}
func (s *ConfigSettings) MarshalJSON() ([]byte, error) {
type NoMethod ConfigSettings
raw := NoMethod(*s)
return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
}
// Environment: Message containing environment configuration for a
// Lighthouse run.
type Environment struct {
// BenchmarkIndex: The benchmark index number that indicates rough
// device class.
BenchmarkIndex float64 `json:"benchmarkIndex,omitempty"`
// HostUserAgent: The user agent string of the version of Chrome used.
HostUserAgent string `json:"hostUserAgent,omitempty"`
// NetworkUserAgent: The user agent string that was sent over the
// network.
NetworkUserAgent string `json:"networkUserAgent,omitempty"`
// ForceSendFields is a list of field names (e.g. "BenchmarkIndex") to
// unconditionally include in API requests. By default, fields with
// empty or default values are omitted from API requests. However, any
// non-pointer, non-interface field appearing in ForceSendFields will be
// sent to the server regardless of whether the field is empty or not.
// This may be used to include empty fields in Patch requests.
ForceSendFields []string `json:"-"`
// NullFields is a list of field names (e.g. "BenchmarkIndex") to
// include in API requests with the JSON null value. By default, fields
// with empty values are omitted from API requests. However, any field
// with an empty value appearing in NullFields will be sent to the
// server as null. It is an error if a field in this list has a
// non-empty value. This may be used to include null fields in Patch
// requests.
NullFields []string `json:"-"`
}
func (s *Environment) MarshalJSON() ([]byte, error) {
type NoMethod Environment
raw := NoMethod(*s)
return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
}
func (s *Environment) UnmarshalJSON(data []byte) error {
type NoMethod Environment
var s1 struct {
BenchmarkIndex gensupport.JSONFloat64 `json:"benchmarkIndex"`
*NoMethod
}
s1.NoMethod = (*NoMethod)(s)
if err := json.Unmarshal(data, &s1); err != nil {
return err
}
s.BenchmarkIndex = float64(s1.BenchmarkIndex)
return nil
}
// I18n: Message containing the i18n data for the LHR - Version 1.
type I18n struct {
// RendererFormattedStrings: Internationalized strings that are
// formatted to the locale in configSettings.
RendererFormattedStrings *RendererFormattedStrings `json:"rendererFormattedStrings,omitempty"`
// ForceSendFields is a list of field names (e.g.
// "RendererFormattedStrings") to unconditionally include in API
// requests. By default, fields with empty or default values are omitted
// from API requests. However, any non-pointer, non-interface field
// appearing in ForceSendFields will be sent to the server regardless of
// whether the field is empty or not. This may be used to include empty
// fields in Patch requests.
ForceSendFields []string `json:"-"`
// NullFields is a list of field names (e.g. "RendererFormattedStrings")
// to include in API requests with the JSON null value. By default,
// fields with empty values are omitted from API requests. However, any
// field with an empty value appearing in NullFields will be sent to the
// server as null. It is an error if a field in this list has a
// non-empty value. This may be used to include null fields in Patch
// requests.
NullFields []string `json:"-"`
}
func (s *I18n) MarshalJSON() ([]byte, error) {
type NoMethod I18n
raw := NoMethod(*s)
return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
}
// LighthouseAuditResultV5: An audit's result object in a Lighthouse
// result.
type LighthouseAuditResultV5 struct {
// Description: The description of the audit.
Description string `json:"description,omitempty"`
// Details: Freeform details section of the audit.
Details googleapi.RawMessage `json:"details,omitempty"`
// DisplayValue: The value that should be displayed on the UI for this
// audit.
DisplayValue string `json:"displayValue,omitempty"`
// ErrorMessage: An error message from a thrown error inside the audit.
ErrorMessage string `json:"errorMessage,omitempty"`
// Explanation: An explanation of the errors in the audit.
Explanation string `json:"explanation,omitempty"`
// Id: The audit's id.
Id string `json:"id,omitempty"`
// NumericUnit: The unit of the numeric_value field. Used to format the
// numeric value for display.
NumericUnit string `json:"numericUnit,omitempty"`
// NumericValue: A numeric value that has a meaning specific to the
// audit, e.g. the number of nodes in the DOM or the timestamp of a
// specific load event. More information can be found in the audit
// details, if present.
NumericValue float64 `json:"numericValue,omitempty"`
// Score: The score of the audit, can be null.
Score interface{} `json:"score,omitempty"`
// ScoreDisplayMode: The enumerated score display mode.
ScoreDisplayMode string `json:"scoreDisplayMode,omitempty"`
// Title: The human readable title.
Title string `json:"title,omitempty"`
// Warnings: Possible warnings that occurred in the audit, can be null.
Warnings interface{} `json:"warnings,omitempty"`
// ForceSendFields is a list of field names (e.g. "Description") to
// unconditionally include in API requests. By default, fields with
// empty or default values are omitted from API requests. However, any
// non-pointer, non-interface field appearing in ForceSendFields will be
// sent to the server regardless of whether the field is empty or not.
// This may be used to include empty fields in Patch requests.
ForceSendFields []string `json:"-"`
// NullFields is a list of field names (e.g. "Description") to include
// in API requests with the JSON null value. By default, fields with
// empty values are omitted from API requests. However, any field with
// an empty value appearing in NullFields will be sent to the server as
// null. It is an error if a field in this list has a non-empty value.
// This may be used to include null fields in Patch requests.
NullFields []string `json:"-"`
}
func (s *LighthouseAuditResultV5) MarshalJSON() ([]byte, error) {
type NoMethod LighthouseAuditResultV5
raw := NoMethod(*s)
return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
}
func (s *LighthouseAuditResultV5) UnmarshalJSON(data []byte) error {
type NoMethod LighthouseAuditResultV5
var s1 struct {
NumericValue gensupport.JSONFloat64 `json:"numericValue"`
*NoMethod
}
s1.NoMethod = (*NoMethod)(s)
if err := json.Unmarshal(data, &s1); err != nil {
return err
}
s.NumericValue = float64(s1.NumericValue)
return nil
}
// LighthouseCategoryV5: A Lighthouse category.
type LighthouseCategoryV5 struct {
// AuditRefs: An array of references to all the audit members of this
// category.
AuditRefs []*AuditRefs `json:"auditRefs,omitempty"`
// Description: A more detailed description of the category and its
// importance.
Description string `json:"description,omitempty"`
// Id: The string identifier of the category.
Id string `json:"id,omitempty"`
// ManualDescription: A description for the manual audits in the
// category.
ManualDescription string `json:"manualDescription,omitempty"`
// Score: The overall score of the category, the weighted average of all
// its audits. (The category's score, can be null.)
Score interface{} `json:"score,omitempty"`
// Title: The human-friendly name of the category.
Title string `json:"title,omitempty"`
// ForceSendFields is a list of field names (e.g. "AuditRefs") to
// unconditionally include in API requests. By default, fields with
// empty or default values are omitted from API requests. However, any
// non-pointer, non-interface field appearing in ForceSendFields will be
// sent to the server regardless of whether the field is empty or not.
// This may be used to include empty fields in Patch requests.
ForceSendFields []string `json:"-"`
// NullFields is a list of field names (e.g. "AuditRefs") to include in
// API requests with the JSON null value. By default, fields with empty
// values are omitted from API requests. However, any field with an
// empty value appearing in NullFields will be sent to the server as
// null. It is an error if a field in this list has a non-empty value.
// This may be used to include null fields in Patch requests.
NullFields []string `json:"-"`
}
func (s *LighthouseCategoryV5) MarshalJSON() ([]byte, error) {
type NoMethod LighthouseCategoryV5
raw := NoMethod(*s)
return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
}
// LighthouseResultV5: The Lighthouse result object.
type LighthouseResultV5 struct {
// Audits: Map of audits in the LHR.
Audits map[string]LighthouseAuditResultV5 `json:"audits,omitempty"`
// Categories: Map of categories in the LHR.
Categories *Categories `json:"categories,omitempty"`
// CategoryGroups: Map of category groups in the LHR.
CategoryGroups map[string]CategoryGroupV5 `json:"categoryGroups,omitempty"`
// ConfigSettings: The configuration settings for this LHR.
ConfigSettings *ConfigSettings `json:"configSettings,omitempty"`
// Environment: Environment settings that were used when making this
// LHR.
Environment *Environment `json:"environment,omitempty"`
// FetchTime: The time that this run was fetched.
FetchTime string `json:"fetchTime,omitempty"`
// FinalUrl: The final resolved url that was audited.
FinalUrl string `json:"finalUrl,omitempty"`
// I18n: The internationalization strings that are required to render
// the LHR.
I18n *I18n `json:"i18n,omitempty"`
// LighthouseVersion: The lighthouse version that was used to generate
// this LHR.
LighthouseVersion string `json:"lighthouseVersion,omitempty"`
// RequestedUrl: The original requested url.
RequestedUrl string `json:"requestedUrl,omitempty"`
// RunWarnings: List of all run warnings in the LHR. Will always output
// to at least `[]`.
RunWarnings []interface{} `json:"runWarnings,omitempty"`
// RuntimeError: A top-level error message that, if present, indicates a
// serious enough problem that this Lighthouse result may need to be
// discarded.
RuntimeError *RuntimeError `json:"runtimeError,omitempty"`
// StackPacks: The Stack Pack advice strings.
StackPacks []*StackPack `json:"stackPacks,omitempty"`
// Timing: Timing information for this LHR.
Timing *Timing `json:"timing,omitempty"`
// UserAgent: The user agent that was used to run this LHR.
UserAgent string `json:"userAgent,omitempty"`
// ForceSendFields is a list of field names (e.g. "Audits") to
// unconditionally include in API requests. By default, fields with
// empty or default values are omitted from API requests. However, any
// non-pointer, non-interface field appearing in ForceSendFields will be
// sent to the server regardless of whether the field is empty or not.
// This may be used to include empty fields in Patch requests.
ForceSendFields []string `json:"-"`
// NullFields is a list of field names (e.g. "Audits") to include in API
// requests with the JSON null value. By default, fields with empty
// values are omitted from API requests. However, any field with an
// empty value appearing in NullFields will be sent to the server as
// null. It is an error if a field in this list has a non-empty value.
// This may be used to include null fields in Patch requests.
NullFields []string `json:"-"`
}
func (s *LighthouseResultV5) MarshalJSON() ([]byte, error) {
type NoMethod LighthouseResultV5
raw := NoMethod(*s)
return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
}
// PagespeedApiLoadingExperienceV5: The CrUX loading experience object
// that contains CrUX data breakdowns.
type PagespeedApiLoadingExperienceV5 struct {
// Id: The url, pattern or origin which the metrics are on.
Id string `json:"id,omitempty"`
// InitialUrl: The requested URL, which may differ from the resolved
// "id".
InitialUrl string `json:"initial_url,omitempty"`
// Metrics: The map of .
Metrics map[string]UserPageLoadMetricV5 `json:"metrics,omitempty"`
// OriginFallback: True if the result is an origin fallback from a page,
// false otherwise.
OriginFallback bool `json:"origin_fallback,omitempty"`
// OverallCategory: The human readable speed "category" of the id.
OverallCategory string `json:"overall_category,omitempty"`
// ForceSendFields is a list of field names (e.g. "Id") to
// unconditionally include in API requests. By default, fields with
// empty or default values are omitted from API requests. However, any
// non-pointer, non-interface field appearing in ForceSendFields will be
// sent to the server regardless of whether the field is empty or not.
// This may be used to include empty fields in Patch requests.
ForceSendFields []string `json:"-"`
// NullFields is a list of field names (e.g. "Id") to include in API
// requests with the JSON null value. By default, fields with empty
// values are omitted from API requests. However, any field with an
// empty value appearing in NullFields will be sent to the server as
// null. It is an error if a field in this list has a non-empty value.
// This may be used to include null fields in Patch requests.
NullFields []string `json:"-"`
}
func (s *PagespeedApiLoadingExperienceV5) MarshalJSON() ([]byte, error) {
type NoMethod PagespeedApiLoadingExperienceV5
raw := NoMethod(*s)
return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
}
// PagespeedApiPagespeedResponseV5: The Pagespeed API response object.
type PagespeedApiPagespeedResponseV5 struct {
// AnalysisUTCTimestamp: The UTC timestamp of this analysis.
AnalysisUTCTimestamp string `json:"analysisUTCTimestamp,omitempty"`
// CaptchaResult: The captcha verify result
CaptchaResult string `json:"captchaResult,omitempty"`
// Id: Canonicalized and final URL for the document, after following
// page redirects (if any).
Id string `json:"id,omitempty"`
// Kind: Kind of result.
Kind string `json:"kind,omitempty"`
// LighthouseResult: Lighthouse response for the audit url as an object.
LighthouseResult *LighthouseResultV5 `json:"lighthouseResult,omitempty"`
// LoadingExperience: Metrics of end users' page loading experience.
LoadingExperience *PagespeedApiLoadingExperienceV5 `json:"loadingExperience,omitempty"`
// OriginLoadingExperience: Metrics of the aggregated page loading
// experience of the origin
OriginLoadingExperience *PagespeedApiLoadingExperienceV5 `json:"originLoadingExperience,omitempty"`
// Version: The version of PageSpeed used to generate these results.
Version *PagespeedVersion `json:"version,omitempty"`
// ServerResponse contains the HTTP response code and headers from the
// server.
googleapi.ServerResponse `json:"-"`
// ForceSendFields is a list of field names (e.g.
// "AnalysisUTCTimestamp") to unconditionally include in API requests.
// By default, fields with empty or default values are omitted from API
// requests. However, any non-pointer, non-interface field appearing in
// ForceSendFields will be sent to the server regardless of whether the
// field is empty or not. This may be used to include empty fields in
// Patch requests.
ForceSendFields []string `json:"-"`
// NullFields is a list of field names (e.g. "AnalysisUTCTimestamp") to
// include in API requests with the JSON null value. By default, fields
// with empty values are omitted from API requests. However, any field
// with an empty value appearing in NullFields will be sent to the
// server as null. It is an error if a field in this list has a
// non-empty value. This may be used to include null fields in Patch
// requests.
NullFields []string `json:"-"`
}
func (s *PagespeedApiPagespeedResponseV5) MarshalJSON() ([]byte, error) {
type NoMethod PagespeedApiPagespeedResponseV5
raw := NoMethod(*s)
return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
}
// PagespeedVersion: The Pagespeed Version object.
type PagespeedVersion struct {
// Major: The major version number of PageSpeed used to generate these
// results.
Major string `json:"major,omitempty"`
// Minor: The minor version number of PageSpeed used to generate these
// results.
Minor string `json:"minor,omitempty"`
// ForceSendFields is a list of field names (e.g. "Major") to
// unconditionally include in API requests. By default, fields with
// empty or default values are omitted from API requests. However, any
// non-pointer, non-interface field appearing in ForceSendFields will be
// sent to the server regardless of whether the field is empty or not.
// This may be used to include empty fields in Patch requests.
ForceSendFields []string `json:"-"`
// NullFields is a list of field names (e.g. "Major") to include in API
// requests with the JSON null value. By default, fields with empty
// values are omitted from API requests. However, any field with an
// empty value appearing in NullFields will be sent to the server as
// null. It is an error if a field in this list has a non-empty value.
// This may be used to include null fields in Patch requests.
NullFields []string `json:"-"`
}
func (s *PagespeedVersion) MarshalJSON() ([]byte, error) {
type NoMethod PagespeedVersion
raw := NoMethod(*s)
return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
}
// RendererFormattedStrings: Message holding the formatted strings used
// in the renderer.
type RendererFormattedStrings struct {
// AuditGroupExpandTooltip: The tooltip text on an expandable chevron
// icon.
AuditGroupExpandTooltip string `json:"auditGroupExpandTooltip,omitempty"`
// CalculatorLink: Text link pointing to the Lighthouse scoring
// calculator. This link immediately follows a sentence stating the
// performance score is calculated from the perf metrics.
CalculatorLink string `json:"calculatorLink,omitempty"`
// CrcInitialNavigation: The label for the initial request in a critical
// request chain.
CrcInitialNavigation string `json:"crcInitialNavigation,omitempty"`
// CrcLongestDurationLabel: The label for values shown in the summary of
// critical request chains.
CrcLongestDurationLabel string `json:"crcLongestDurationLabel,omitempty"`
// DropdownCopyJSON: Option in a dropdown menu that copies the
// Lighthouse JSON object to the system clipboard.
DropdownCopyJSON string `json:"dropdownCopyJSON,omitempty"`
// DropdownDarkTheme: Option in a dropdown menu that toggles the
// themeing of the report between Light(default) and Dark themes.
DropdownDarkTheme string `json:"dropdownDarkTheme,omitempty"`
// DropdownPrintExpanded: Option in a dropdown menu that opens a full
// Lighthouse report in a print dialog.
DropdownPrintExpanded string `json:"dropdownPrintExpanded,omitempty"`
// DropdownPrintSummary: Option in a dropdown menu that opens a small,
// summary report in a print dialog.
DropdownPrintSummary string `json:"dropdownPrintSummary,omitempty"`
// DropdownSaveGist: Option in a dropdown menu that saves the current
// report as a new GitHub Gist.
DropdownSaveGist string `json:"dropdownSaveGist,omitempty"`
// DropdownSaveHTML: Option in a dropdown menu that saves the Lighthouse
// report HTML locally to the system as a '.html' file.
DropdownSaveHTML string `json:"dropdownSaveHTML,omitempty"`
// DropdownSaveJSON: Option in a dropdown menu that saves the Lighthouse
// JSON object to the local system as a '.json' file.
DropdownSaveJSON string `json:"dropdownSaveJSON,omitempty"`
// DropdownViewer: Option in a dropdown menu that opens the current
// report in the Lighthouse Viewer Application.
DropdownViewer string `json:"dropdownViewer,omitempty"`
// ErrorLabel: The label shown next to an audit or metric that has had
// an error.
ErrorLabel string `json:"errorLabel,omitempty"`
// ErrorMissingAuditInfo: The error string shown next to an erroring
// audit.
ErrorMissingAuditInfo string `json:"errorMissingAuditInfo,omitempty"`
// FooterIssue: Label for button to create an issue against the
// Lighthouse GitHub project.
FooterIssue string `json:"footerIssue,omitempty"`
// LabDataTitle: The title of the lab data performance category.
LabDataTitle string `json:"labDataTitle,omitempty"`
// LsPerformanceCategoryDescription: The disclaimer shown under
// performance explaining that the network can vary.
LsPerformanceCategoryDescription string `json:"lsPerformanceCategoryDescription,omitempty"`
// ManualAuditsGroupTitle: The heading shown above a list of audits that
// were not computerd in the run.
ManualAuditsGroupTitle string `json:"manualAuditsGroupTitle,omitempty"`
// NotApplicableAuditsGroupTitle: The heading shown above a list of
// audits that do not apply to a page.
NotApplicableAuditsGroupTitle string `json:"notApplicableAuditsGroupTitle,omitempty"`
// OpportunityResourceColumnLabel: The heading for the estimated page
// load savings opportunity of an audit.
OpportunityResourceColumnLabel string `json:"opportunityResourceColumnLabel,omitempty"`
// OpportunitySavingsColumnLabel: The heading for the estimated page
// load savings of opportunity audits.
OpportunitySavingsColumnLabel string `json:"opportunitySavingsColumnLabel,omitempty"`
// PassedAuditsGroupTitle: The heading that is shown above a list of
// audits that are passing.
PassedAuditsGroupTitle string `json:"passedAuditsGroupTitle,omitempty"`
// RuntimeDesktopEmulation: Descriptive explanation for emulation
// setting when emulating a generic desktop form factor, as opposed to a
// mobile-device like form factor.
RuntimeDesktopEmulation string `json:"runtimeDesktopEmulation,omitempty"`
// RuntimeMobileEmulation: Descriptive explanation for emulation setting
// when emulating a Nexus 5X mobile device.
RuntimeMobileEmulation string `json:"runtimeMobileEmulation,omitempty"`
// RuntimeNoEmulation: Descriptive explanation for emulation setting
// when no device emulation is set.
RuntimeNoEmulation string `json:"runtimeNoEmulation,omitempty"`
// RuntimeSettingsAxeVersion: Label for a row in a table that shows the
// version of the Axe library used
RuntimeSettingsAxeVersion string `json:"runtimeSettingsAxeVersion,omitempty"`
// RuntimeSettingsBenchmark: Label for a row in a table that shows the
// estimated CPU power of the machine running Lighthouse. Example row
// values: 532, 1492, 783.
RuntimeSettingsBenchmark string `json:"runtimeSettingsBenchmark,omitempty"`
// RuntimeSettingsCPUThrottling: Label for a row in a table that
// describes the CPU throttling conditions that were used during a
// Lighthouse run, if any.
RuntimeSettingsCPUThrottling string `json:"runtimeSettingsCPUThrottling,omitempty"`
// RuntimeSettingsChannel: Label for a row in a table that shows in what
// tool Lighthouse is being run (e.g. The lighthouse CLI, Chrome
// DevTools, Lightrider, WebPageTest, etc).
RuntimeSettingsChannel string `json:"runtimeSettingsChannel,omitempty"`
// RuntimeSettingsDevice: Label for a row in a table that describes the
// kind of device that was emulated for the Lighthouse run. Example
// values for row elements: 'No Emulation', 'Emulated Desktop', etc.
RuntimeSettingsDevice string `json:"runtimeSettingsDevice,omitempty"`
// RuntimeSettingsFetchTime: Label for a row in a table that shows the
// time at which a Lighthouse run was conducted; formatted as a
// timestamp, e.g. Jan 1, 1970 12:00 AM UTC.
RuntimeSettingsFetchTime string `json:"runtimeSettingsFetchTime,omitempty"`
// RuntimeSettingsNetworkThrottling: Label for a row in a table that
// describes the network throttling conditions that were used during a
// Lighthouse run, if any.
RuntimeSettingsNetworkThrottling string `json:"runtimeSettingsNetworkThrottling,omitempty"`
// RuntimeSettingsTitle: Title of the Runtime settings table in a
// Lighthouse report. Runtime settings are the environment
// configurations that a specific report used at auditing time.
RuntimeSettingsTitle string `json:"runtimeSettingsTitle,omitempty"`
// RuntimeSettingsUA: Label for a row in a table that shows the User
// Agent that was detected on the Host machine that ran Lighthouse.
RuntimeSettingsUA string `json:"runtimeSettingsUA,omitempty"`
// RuntimeSettingsUANetwork: Label for a row in a table that shows the
// User Agent that was used to send out all network requests during the
// Lighthouse run.
RuntimeSettingsUANetwork string `json:"runtimeSettingsUANetwork,omitempty"`
// RuntimeSettingsUrl: Label for a row in a table that shows the URL
// that was audited during a Lighthouse run.
RuntimeSettingsUrl string `json:"runtimeSettingsUrl,omitempty"`
// RuntimeUnknown: Descriptive explanation for a runtime setting that is
// set to an unknown value.
RuntimeUnknown string `json:"runtimeUnknown,omitempty"`
// ScorescaleLabel: The label that explains the score gauges scale
// (0-49, 50-89, 90-100).
ScorescaleLabel string `json:"scorescaleLabel,omitempty"`
// ShowRelevantAudits: Label preceding a radio control for filtering the
// list of audits. The radio choices are various performance metrics
// (FCP, LCP, TBT), and if chosen, the audits in the report are hidden
// if they are not relevant to the selected metric.
ShowRelevantAudits string `json:"showRelevantAudits,omitempty"`
// SnippetCollapseButtonLabel: The label for the button to show only a
// few lines of a snippet
SnippetCollapseButtonLabel string `json:"snippetCollapseButtonLabel,omitempty"`
// SnippetExpandButtonLabel: The label for the button to show all lines
// of a snippet
SnippetExpandButtonLabel string `json:"snippetExpandButtonLabel,omitempty"`
// ThirdPartyResourcesLabel: This label is for a filter checkbox above a
// table of items
ThirdPartyResourcesLabel string `json:"thirdPartyResourcesLabel,omitempty"`
// ThrottlingProvided: Descriptive explanation for environment
// throttling that was provided by the runtime environment instead of
// provided by Lighthouse throttling.
ThrottlingProvided string `json:"throttlingProvided,omitempty"`
// ToplevelWarningsMessage: The label shown preceding important warnings
// that may have invalidated an entire report.
ToplevelWarningsMessage string `json:"toplevelWarningsMessage,omitempty"`
// VarianceDisclaimer: The disclaimer shown below a performance metric
// value.
VarianceDisclaimer string `json:"varianceDisclaimer,omitempty"`
// ViewTreemapLabel: Label for a button that opens the Treemap App
ViewTreemapLabel string `json:"viewTreemapLabel,omitempty"`
// WarningAuditsGroupTitle: The heading that is shown above a list of
// audits that have warnings
WarningAuditsGroupTitle string `json:"warningAuditsGroupTitle,omitempty"`
// WarningHeader: The label shown above a bulleted list of warnings.
WarningHeader string `json:"warningHeader,omitempty"`
// ForceSendFields is a list of field names (e.g.