1// Copyright 2020 Google LLC. 2// Use of this source code is governed by a BSD-style 3// license that can be found in the LICENSE file. 4 5// Code generated file. DO NOT EDIT. 6 7// Package pagespeedonline provides access to the PageSpeed Insights API. 8// 9// For product documentation, see: https://developers.google.com/speed/docs/insights/v4/getting-started 10// 11// Creating a client 12// 13// Usage example: 14// 15// import "google.golang.org/api/pagespeedonline/v4" 16// ... 17// ctx := context.Background() 18// pagespeedonlineService, err := pagespeedonline.NewService(ctx) 19// 20// In this example, Google Application Default Credentials are used for authentication. 21// 22// For information on how to create and obtain Application Default Credentials, see https://developers.google.com/identity/protocols/application-default-credentials. 23// 24// Other authentication options 25// 26// To use an API key for authentication (note: some APIs do not support API keys), use option.WithAPIKey: 27// 28// pagespeedonlineService, err := pagespeedonline.NewService(ctx, option.WithAPIKey("AIza...")) 29// 30// To use an OAuth token (e.g., a user token obtained via a three-legged OAuth flow), use option.WithTokenSource: 31// 32// config := &oauth2.Config{...} 33// // ... 34// token, err := config.Exchange(ctx, ...) 35// pagespeedonlineService, err := pagespeedonline.NewService(ctx, option.WithTokenSource(config.TokenSource(ctx, token))) 36// 37// See https://godoc.org/google.golang.org/api/option/ for details on options. 38package pagespeedonline // import "google.golang.org/api/pagespeedonline/v4" 39 40import ( 41 "bytes" 42 "context" 43 "encoding/json" 44 "errors" 45 "fmt" 46 "io" 47 "net/http" 48 "net/url" 49 "strconv" 50 "strings" 51 52 googleapi "google.golang.org/api/googleapi" 53 gensupport "google.golang.org/api/internal/gensupport" 54 option "google.golang.org/api/option" 55 internaloption "google.golang.org/api/option/internaloption" 56 htransport "google.golang.org/api/transport/http" 57) 58 59// Always reference these packages, just in case the auto-generated code 60// below doesn't. 61var _ = bytes.NewBuffer 62var _ = strconv.Itoa 63var _ = fmt.Sprintf 64var _ = json.NewDecoder 65var _ = io.Copy 66var _ = url.Parse 67var _ = gensupport.MarshalJSON 68var _ = googleapi.Version 69var _ = errors.New 70var _ = strings.Replace 71var _ = context.Canceled 72var _ = internaloption.WithDefaultEndpoint 73 74const apiId = "pagespeedonline:v4" 75const apiName = "pagespeedonline" 76const apiVersion = "v4" 77const basePath = "https://www.googleapis.com/pagespeedonline/v4/" 78 79// NewService creates a new Service. 80func NewService(ctx context.Context, opts ...option.ClientOption) (*Service, error) { 81 opts = append(opts, internaloption.WithDefaultEndpoint(basePath)) 82 client, endpoint, err := htransport.NewClient(ctx, opts...) 83 if err != nil { 84 return nil, err 85 } 86 s, err := New(client) 87 if err != nil { 88 return nil, err 89 } 90 if endpoint != "" { 91 s.BasePath = endpoint 92 } 93 return s, nil 94} 95 96// New creates a new Service. It uses the provided http.Client for requests. 97// 98// Deprecated: please use NewService instead. 99// To provide a custom HTTP client, use option.WithHTTPClient. 100// If you are using google.golang.org/api/googleapis/transport.APIKey, use option.WithAPIKey with NewService instead. 101func New(client *http.Client) (*Service, error) { 102 if client == nil { 103 return nil, errors.New("client is nil") 104 } 105 s := &Service{client: client, BasePath: basePath} 106 s.Pagespeedapi = NewPagespeedapiService(s) 107 return s, nil 108} 109 110type Service struct { 111 client *http.Client 112 BasePath string // API endpoint base URL 113 UserAgent string // optional additional User-Agent fragment 114 115 Pagespeedapi *PagespeedapiService 116} 117 118func (s *Service) userAgent() string { 119 if s.UserAgent == "" { 120 return googleapi.UserAgent 121 } 122 return googleapi.UserAgent + " " + s.UserAgent 123} 124 125func NewPagespeedapiService(s *Service) *PagespeedapiService { 126 rs := &PagespeedapiService{s: s} 127 return rs 128} 129 130type PagespeedapiService struct { 131 s *Service 132} 133 134type PagespeedApiFormatStringV4 struct { 135 // Args: List of arguments for the format string. 136 Args []*PagespeedApiFormatStringV4Args `json:"args,omitempty"` 137 138 // Format: A localized format string with {{FOO}} placeholders, where 139 // 'FOO' is the key of the argument whose value should be substituted. 140 // For HYPERLINK arguments, the format string will instead contain 141 // {{BEGIN_FOO}} and {{END_FOO}} for the argument with key 'FOO'. 142 Format string `json:"format,omitempty"` 143 144 // ForceSendFields is a list of field names (e.g. "Args") to 145 // unconditionally include in API requests. By default, fields with 146 // empty values are omitted from API requests. However, any non-pointer, 147 // non-interface field appearing in ForceSendFields will be sent to the 148 // server regardless of whether the field is empty or not. This may be 149 // used to include empty fields in Patch requests. 150 ForceSendFields []string `json:"-"` 151 152 // NullFields is a list of field names (e.g. "Args") to include in API 153 // requests with the JSON null value. By default, fields with empty 154 // values are omitted from API requests. However, any field with an 155 // empty value appearing in NullFields will be sent to the server as 156 // null. It is an error if a field in this list has a non-empty value. 157 // This may be used to include null fields in Patch requests. 158 NullFields []string `json:"-"` 159} 160 161func (s *PagespeedApiFormatStringV4) MarshalJSON() ([]byte, error) { 162 type NoMethod PagespeedApiFormatStringV4 163 raw := NoMethod(*s) 164 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 165} 166 167type PagespeedApiFormatStringV4Args struct { 168 // Key: The placeholder key for this arg, as a string. 169 Key string `json:"key,omitempty"` 170 171 // Rects: The screen rectangles being referred to, with dimensions 172 // measured in CSS pixels. This is only ever used for SNAPSHOT_RECT 173 // arguments. If this is absent for a SNAPSHOT_RECT argument, it means 174 // that that argument refers to the entire snapshot. 175 Rects []*PagespeedApiFormatStringV4ArgsRects `json:"rects,omitempty"` 176 177 // SecondaryRects: Secondary screen rectangles being referred to, with 178 // dimensions measured in CSS pixels. This is only ever used for 179 // SNAPSHOT_RECT arguments. 180 SecondaryRects []*PagespeedApiFormatStringV4ArgsSecondaryRects `json:"secondary_rects,omitempty"` 181 182 // Type: Type of argument. One of URL, STRING_LITERAL, INT_LITERAL, 183 // BYTES, DURATION, VERBATIM_STRING, PERCENTAGE, HYPERLINK, or 184 // SNAPSHOT_RECT. 185 Type string `json:"type,omitempty"` 186 187 // Value: Argument value, as a localized string. 188 Value string `json:"value,omitempty"` 189 190 // ForceSendFields is a list of field names (e.g. "Key") to 191 // unconditionally include in API requests. By default, fields with 192 // empty values are omitted from API requests. However, any non-pointer, 193 // non-interface field appearing in ForceSendFields will be sent to the 194 // server regardless of whether the field is empty or not. This may be 195 // used to include empty fields in Patch requests. 196 ForceSendFields []string `json:"-"` 197 198 // NullFields is a list of field names (e.g. "Key") to include in API 199 // requests with the JSON null value. By default, fields with empty 200 // values are omitted from API requests. However, any field with an 201 // empty value appearing in NullFields will be sent to the server as 202 // null. It is an error if a field in this list has a non-empty value. 203 // This may be used to include null fields in Patch requests. 204 NullFields []string `json:"-"` 205} 206 207func (s *PagespeedApiFormatStringV4Args) MarshalJSON() ([]byte, error) { 208 type NoMethod PagespeedApiFormatStringV4Args 209 raw := NoMethod(*s) 210 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 211} 212 213type PagespeedApiFormatStringV4ArgsRects struct { 214 Height int64 `json:"height,omitempty"` 215 216 Left int64 `json:"left,omitempty"` 217 218 Top int64 `json:"top,omitempty"` 219 220 Width int64 `json:"width,omitempty"` 221 222 // ForceSendFields is a list of field names (e.g. "Height") to 223 // unconditionally include in API requests. By default, fields with 224 // empty values are omitted from API requests. However, any non-pointer, 225 // non-interface field appearing in ForceSendFields will be sent to the 226 // server regardless of whether the field is empty or not. This may be 227 // used to include empty fields in Patch requests. 228 ForceSendFields []string `json:"-"` 229 230 // NullFields is a list of field names (e.g. "Height") to include in API 231 // requests with the JSON null value. By default, fields with empty 232 // values are omitted from API requests. However, any field with an 233 // empty value appearing in NullFields will be sent to the server as 234 // null. It is an error if a field in this list has a non-empty value. 235 // This may be used to include null fields in Patch requests. 236 NullFields []string `json:"-"` 237} 238 239func (s *PagespeedApiFormatStringV4ArgsRects) MarshalJSON() ([]byte, error) { 240 type NoMethod PagespeedApiFormatStringV4ArgsRects 241 raw := NoMethod(*s) 242 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 243} 244 245type PagespeedApiFormatStringV4ArgsSecondaryRects struct { 246 Height int64 `json:"height,omitempty"` 247 248 Left int64 `json:"left,omitempty"` 249 250 Top int64 `json:"top,omitempty"` 251 252 Width int64 `json:"width,omitempty"` 253 254 // ForceSendFields is a list of field names (e.g. "Height") to 255 // unconditionally include in API requests. By default, fields with 256 // empty values are omitted from API requests. However, any non-pointer, 257 // non-interface field appearing in ForceSendFields will be sent to the 258 // server regardless of whether the field is empty or not. This may be 259 // used to include empty fields in Patch requests. 260 ForceSendFields []string `json:"-"` 261 262 // NullFields is a list of field names (e.g. "Height") to include in API 263 // requests with the JSON null value. By default, fields with empty 264 // values are omitted from API requests. However, any field with an 265 // empty value appearing in NullFields will be sent to the server as 266 // null. It is an error if a field in this list has a non-empty value. 267 // This may be used to include null fields in Patch requests. 268 NullFields []string `json:"-"` 269} 270 271func (s *PagespeedApiFormatStringV4ArgsSecondaryRects) MarshalJSON() ([]byte, error) { 272 type NoMethod PagespeedApiFormatStringV4ArgsSecondaryRects 273 raw := NoMethod(*s) 274 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 275} 276 277type PagespeedApiImageV4 struct { 278 // Data: Image data base64 encoded. 279 Data string `json:"data,omitempty"` 280 281 // Height: Height of screenshot in pixels. 282 Height int64 `json:"height,omitempty"` 283 284 // Key: Unique string key, if any, identifying this image. 285 Key string `json:"key,omitempty"` 286 287 // MimeType: Mime type of image data (e.g. "image/jpeg"). 288 MimeType string `json:"mime_type,omitempty"` 289 290 PageRect *PagespeedApiImageV4PageRect `json:"page_rect,omitempty"` 291 292 // Width: Width of screenshot in pixels. 293 Width int64 `json:"width,omitempty"` 294 295 // ForceSendFields is a list of field names (e.g. "Data") to 296 // unconditionally include in API requests. By default, fields with 297 // empty values are omitted from API requests. However, any non-pointer, 298 // non-interface field appearing in ForceSendFields will be sent to the 299 // server regardless of whether the field is empty or not. This may be 300 // used to include empty fields in Patch requests. 301 ForceSendFields []string `json:"-"` 302 303 // NullFields is a list of field names (e.g. "Data") to include in API 304 // requests with the JSON null value. By default, fields with empty 305 // values are omitted from API requests. However, any field with an 306 // empty value appearing in NullFields will be sent to the server as 307 // null. It is an error if a field in this list has a non-empty value. 308 // This may be used to include null fields in Patch requests. 309 NullFields []string `json:"-"` 310} 311 312func (s *PagespeedApiImageV4) MarshalJSON() ([]byte, error) { 313 type NoMethod PagespeedApiImageV4 314 raw := NoMethod(*s) 315 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 316} 317 318type PagespeedApiImageV4PageRect struct { 319 Height int64 `json:"height,omitempty"` 320 321 Left int64 `json:"left,omitempty"` 322 323 Top int64 `json:"top,omitempty"` 324 325 Width int64 `json:"width,omitempty"` 326 327 // ForceSendFields is a list of field names (e.g. "Height") to 328 // unconditionally include in API requests. By default, fields with 329 // empty values are omitted from API requests. However, any non-pointer, 330 // non-interface field appearing in ForceSendFields will be sent to the 331 // server regardless of whether the field is empty or not. This may be 332 // used to include empty fields in Patch requests. 333 ForceSendFields []string `json:"-"` 334 335 // NullFields is a list of field names (e.g. "Height") to include in API 336 // requests with the JSON null value. By default, fields with empty 337 // values are omitted from API requests. However, any field with an 338 // empty value appearing in NullFields will be sent to the server as 339 // null. It is an error if a field in this list has a non-empty value. 340 // This may be used to include null fields in Patch requests. 341 NullFields []string `json:"-"` 342} 343 344func (s *PagespeedApiImageV4PageRect) MarshalJSON() ([]byte, error) { 345 type NoMethod PagespeedApiImageV4PageRect 346 raw := NoMethod(*s) 347 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 348} 349 350type PagespeedApiPagespeedResponseV4 struct { 351 // CaptchaResult: The captcha verify result 352 CaptchaResult string `json:"captchaResult,omitempty"` 353 354 // FormattedResults: Localized PageSpeed results. Contains a ruleResults 355 // entry for each PageSpeed rule instantiated and run by the server. 356 FormattedResults *PagespeedApiPagespeedResponseV4FormattedResults `json:"formattedResults,omitempty"` 357 358 // Id: Canonicalized and final URL for the document, after following 359 // page redirects (if any). 360 Id string `json:"id,omitempty"` 361 362 // InvalidRules: List of rules that were specified in the request, but 363 // which the server did not know how to instantiate. 364 InvalidRules []string `json:"invalidRules,omitempty"` 365 366 // Kind: Kind of result. 367 Kind string `json:"kind,omitempty"` 368 369 // LoadingExperience: Metrics of end users' page loading experience. 370 LoadingExperience *PagespeedApiPagespeedResponseV4LoadingExperience `json:"loadingExperience,omitempty"` 371 372 // PageStats: Summary statistics for the page, such as number of 373 // JavaScript bytes, number of HTML bytes, etc. 374 PageStats *PagespeedApiPagespeedResponseV4PageStats `json:"pageStats,omitempty"` 375 376 // ResponseCode: Response code for the document. 200 indicates a normal 377 // page load. 4xx/5xx indicates an error. 378 ResponseCode int64 `json:"responseCode,omitempty"` 379 380 // RuleGroups: A map with one entry for each rule group in these 381 // results. 382 RuleGroups map[string]PagespeedApiPagespeedResponseV4RuleGroups `json:"ruleGroups,omitempty"` 383 384 // Screenshot: Base64-encoded screenshot of the page that was analyzed. 385 Screenshot *PagespeedApiImageV4 `json:"screenshot,omitempty"` 386 387 // Snapshots: Additional base64-encoded screenshots of the page, in 388 // various partial render states. 389 Snapshots []*PagespeedApiImageV4 `json:"snapshots,omitempty"` 390 391 // Title: Title of the page, as displayed in the browser's title bar. 392 Title string `json:"title,omitempty"` 393 394 // Version: The version of PageSpeed used to generate these results. 395 Version *PagespeedApiPagespeedResponseV4Version `json:"version,omitempty"` 396 397 // ServerResponse contains the HTTP response code and headers from the 398 // server. 399 googleapi.ServerResponse `json:"-"` 400 401 // ForceSendFields is a list of field names (e.g. "CaptchaResult") to 402 // unconditionally include in API requests. By default, fields with 403 // empty values are omitted from API requests. However, any non-pointer, 404 // non-interface field appearing in ForceSendFields will be sent to the 405 // server regardless of whether the field is empty or not. This may be 406 // used to include empty fields in Patch requests. 407 ForceSendFields []string `json:"-"` 408 409 // NullFields is a list of field names (e.g. "CaptchaResult") to include 410 // in API requests with the JSON null value. By default, fields with 411 // empty values are omitted from API requests. However, any field with 412 // an empty value appearing in NullFields will be sent to the server as 413 // null. It is an error if a field in this list has a non-empty value. 414 // This may be used to include null fields in Patch requests. 415 NullFields []string `json:"-"` 416} 417 418func (s *PagespeedApiPagespeedResponseV4) MarshalJSON() ([]byte, error) { 419 type NoMethod PagespeedApiPagespeedResponseV4 420 raw := NoMethod(*s) 421 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 422} 423 424// PagespeedApiPagespeedResponseV4FormattedResults: Localized PageSpeed 425// results. Contains a ruleResults entry for each PageSpeed rule 426// instantiated and run by the server. 427type PagespeedApiPagespeedResponseV4FormattedResults struct { 428 // Locale: The locale of the formattedResults, e.g. "en_US". 429 Locale string `json:"locale,omitempty"` 430 431 // RuleResults: Dictionary of formatted rule results, with one entry for 432 // each PageSpeed rule instantiated and run by the server. 433 RuleResults map[string]PagespeedApiPagespeedResponseV4FormattedResultsRuleResults `json:"ruleResults,omitempty"` 434 435 // ForceSendFields is a list of field names (e.g. "Locale") to 436 // unconditionally include in API requests. By default, fields with 437 // empty values are omitted from API requests. However, any non-pointer, 438 // non-interface field appearing in ForceSendFields will be sent to the 439 // server regardless of whether the field is empty or not. This may be 440 // used to include empty fields in Patch requests. 441 ForceSendFields []string `json:"-"` 442 443 // NullFields is a list of field names (e.g. "Locale") to include in API 444 // requests with the JSON null value. By default, fields with empty 445 // values are omitted from API requests. However, any field with an 446 // empty value appearing in NullFields will be sent to the server as 447 // null. It is an error if a field in this list has a non-empty value. 448 // This may be used to include null fields in Patch requests. 449 NullFields []string `json:"-"` 450} 451 452func (s *PagespeedApiPagespeedResponseV4FormattedResults) MarshalJSON() ([]byte, error) { 453 type NoMethod PagespeedApiPagespeedResponseV4FormattedResults 454 raw := NoMethod(*s) 455 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 456} 457 458// PagespeedApiPagespeedResponseV4FormattedResultsRuleResults: The 459// enum-like identifier for this rule. For instance "EnableKeepAlive" or 460// "AvoidCssImport". Not localized. 461type PagespeedApiPagespeedResponseV4FormattedResultsRuleResults struct { 462 // Beta: Whether this rule is in 'beta'. Rules in beta are new rules 463 // that are being tested, which do not impact the overall score. 464 Beta bool `json:"beta,omitempty"` 465 466 // Groups: List of rule groups that this rule belongs to. Each entry in 467 // the list is one of "SPEED", "USABILITY", or "SECURITY". 468 Groups []string `json:"groups,omitempty"` 469 470 // LocalizedRuleName: Localized name of the rule, intended for 471 // presentation to a user. 472 LocalizedRuleName string `json:"localizedRuleName,omitempty"` 473 474 // RuleImpact: The impact (unbounded floating point value) that 475 // implementing the suggestions for this rule would have on making the 476 // page faster. Impact is comparable between rules to determine which 477 // rule's suggestions would have a higher or lower impact on making a 478 // page faster. For instance, if enabling compression would save 1MB, 479 // while optimizing images would save 500kB, the enable compression rule 480 // would have 2x the impact of the image optimization rule, all other 481 // things being equal. 482 RuleImpact float64 `json:"ruleImpact,omitempty"` 483 484 // Summary: A brief summary description for the rule, indicating at a 485 // high level what should be done to follow the rule and what benefit 486 // can be gained by doing so. 487 Summary *PagespeedApiFormatStringV4 `json:"summary,omitempty"` 488 489 // UrlBlocks: List of blocks of URLs. Each block may contain a heading 490 // and a list of URLs. Each URL may optionally include additional 491 // details. 492 UrlBlocks []*PagespeedApiPagespeedResponseV4FormattedResultsRuleResultsUrlBlocks `json:"urlBlocks,omitempty"` 493 494 // ForceSendFields is a list of field names (e.g. "Beta") to 495 // unconditionally include in API requests. By default, fields with 496 // empty values are omitted from API requests. However, any non-pointer, 497 // non-interface field appearing in ForceSendFields will be sent to the 498 // server regardless of whether the field is empty or not. This may be 499 // used to include empty fields in Patch requests. 500 ForceSendFields []string `json:"-"` 501 502 // NullFields is a list of field names (e.g. "Beta") to include in API 503 // requests with the JSON null value. By default, fields with empty 504 // values are omitted from API requests. However, any field with an 505 // empty value appearing in NullFields will be sent to the server as 506 // null. It is an error if a field in this list has a non-empty value. 507 // This may be used to include null fields in Patch requests. 508 NullFields []string `json:"-"` 509} 510 511func (s *PagespeedApiPagespeedResponseV4FormattedResultsRuleResults) MarshalJSON() ([]byte, error) { 512 type NoMethod PagespeedApiPagespeedResponseV4FormattedResultsRuleResults 513 raw := NoMethod(*s) 514 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 515} 516 517func (s *PagespeedApiPagespeedResponseV4FormattedResultsRuleResults) UnmarshalJSON(data []byte) error { 518 type NoMethod PagespeedApiPagespeedResponseV4FormattedResultsRuleResults 519 var s1 struct { 520 RuleImpact gensupport.JSONFloat64 `json:"ruleImpact"` 521 *NoMethod 522 } 523 s1.NoMethod = (*NoMethod)(s) 524 if err := json.Unmarshal(data, &s1); err != nil { 525 return err 526 } 527 s.RuleImpact = float64(s1.RuleImpact) 528 return nil 529} 530 531type PagespeedApiPagespeedResponseV4FormattedResultsRuleResultsUrlBlocks struct { 532 // Header: Heading to be displayed with the list of URLs. 533 Header *PagespeedApiFormatStringV4 `json:"header,omitempty"` 534 535 // Urls: List of entries that provide information about URLs in the url 536 // block. Optional. 537 Urls []*PagespeedApiPagespeedResponseV4FormattedResultsRuleResultsUrlBlocksUrls `json:"urls,omitempty"` 538 539 // ForceSendFields is a list of field names (e.g. "Header") to 540 // unconditionally include in API requests. By default, fields with 541 // empty values are omitted from API requests. However, any non-pointer, 542 // non-interface field appearing in ForceSendFields will be sent to the 543 // server regardless of whether the field is empty or not. This may be 544 // used to include empty fields in Patch requests. 545 ForceSendFields []string `json:"-"` 546 547 // NullFields is a list of field names (e.g. "Header") to include in API 548 // requests with the JSON null value. By default, fields with empty 549 // values are omitted from API requests. However, any field with an 550 // empty value appearing in NullFields will be sent to the server as 551 // null. It is an error if a field in this list has a non-empty value. 552 // This may be used to include null fields in Patch requests. 553 NullFields []string `json:"-"` 554} 555 556func (s *PagespeedApiPagespeedResponseV4FormattedResultsRuleResultsUrlBlocks) MarshalJSON() ([]byte, error) { 557 type NoMethod PagespeedApiPagespeedResponseV4FormattedResultsRuleResultsUrlBlocks 558 raw := NoMethod(*s) 559 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 560} 561 562type PagespeedApiPagespeedResponseV4FormattedResultsRuleResultsUrlBlocksUrls struct { 563 // Details: List of entries that provide additional details about a 564 // single URL. Optional. 565 Details []*PagespeedApiFormatStringV4 `json:"details,omitempty"` 566 567 // Result: A format string that gives information about the URL, and a 568 // list of arguments for that format string. 569 Result *PagespeedApiFormatStringV4 `json:"result,omitempty"` 570 571 // ForceSendFields is a list of field names (e.g. "Details") to 572 // unconditionally include in API requests. By default, fields with 573 // empty values are omitted from API requests. However, any non-pointer, 574 // non-interface field appearing in ForceSendFields will be sent to the 575 // server regardless of whether the field is empty or not. This may be 576 // used to include empty fields in Patch requests. 577 ForceSendFields []string `json:"-"` 578 579 // NullFields is a list of field names (e.g. "Details") to include in 580 // API requests with the JSON null value. By default, fields with empty 581 // values are omitted from API requests. However, any field with an 582 // empty value appearing in NullFields will be sent to the server as 583 // null. It is an error if a field in this list has a non-empty value. 584 // This may be used to include null fields in Patch requests. 585 NullFields []string `json:"-"` 586} 587 588func (s *PagespeedApiPagespeedResponseV4FormattedResultsRuleResultsUrlBlocksUrls) MarshalJSON() ([]byte, error) { 589 type NoMethod PagespeedApiPagespeedResponseV4FormattedResultsRuleResultsUrlBlocksUrls 590 raw := NoMethod(*s) 591 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 592} 593 594// PagespeedApiPagespeedResponseV4LoadingExperience: Metrics of end 595// users' page loading experience. 596type PagespeedApiPagespeedResponseV4LoadingExperience struct { 597 // Id: The url, pattern or origin which the metrics are on. 598 Id string `json:"id,omitempty"` 599 600 InitialUrl string `json:"initial_url,omitempty"` 601 602 Metrics map[string]PagespeedApiPagespeedResponseV4LoadingExperienceMetrics `json:"metrics,omitempty"` 603 604 OverallCategory string `json:"overall_category,omitempty"` 605 606 // ForceSendFields is a list of field names (e.g. "Id") to 607 // unconditionally include in API requests. By default, fields with 608 // empty values are omitted from API requests. However, any non-pointer, 609 // non-interface field appearing in ForceSendFields will be sent to the 610 // server regardless of whether the field is empty or not. This may be 611 // used to include empty fields in Patch requests. 612 ForceSendFields []string `json:"-"` 613 614 // NullFields is a list of field names (e.g. "Id") to include in API 615 // requests with the JSON null value. By default, fields with empty 616 // values are omitted from API requests. However, any field with an 617 // empty value appearing in NullFields will be sent to the server as 618 // null. It is an error if a field in this list has a non-empty value. 619 // This may be used to include null fields in Patch requests. 620 NullFields []string `json:"-"` 621} 622 623func (s *PagespeedApiPagespeedResponseV4LoadingExperience) MarshalJSON() ([]byte, error) { 624 type NoMethod PagespeedApiPagespeedResponseV4LoadingExperience 625 raw := NoMethod(*s) 626 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 627} 628 629// PagespeedApiPagespeedResponseV4LoadingExperienceMetrics: The type of 630// the metric. 631type PagespeedApiPagespeedResponseV4LoadingExperienceMetrics struct { 632 Category string `json:"category,omitempty"` 633 634 Distributions []*PagespeedApiPagespeedResponseV4LoadingExperienceMetricsDistributions `json:"distributions,omitempty"` 635 636 Median int64 `json:"median,omitempty"` 637 638 // ForceSendFields is a list of field names (e.g. "Category") to 639 // unconditionally include in API requests. By default, fields with 640 // empty values are omitted from API requests. However, any non-pointer, 641 // non-interface field appearing in ForceSendFields will be sent to the 642 // server regardless of whether the field is empty or not. This may be 643 // used to include empty fields in Patch requests. 644 ForceSendFields []string `json:"-"` 645 646 // NullFields is a list of field names (e.g. "Category") to include in 647 // API requests with the JSON null value. By default, fields with empty 648 // values are omitted from API requests. However, any field with an 649 // empty value appearing in NullFields will be sent to the server as 650 // null. It is an error if a field in this list has a non-empty value. 651 // This may be used to include null fields in Patch requests. 652 NullFields []string `json:"-"` 653} 654 655func (s *PagespeedApiPagespeedResponseV4LoadingExperienceMetrics) MarshalJSON() ([]byte, error) { 656 type NoMethod PagespeedApiPagespeedResponseV4LoadingExperienceMetrics 657 raw := NoMethod(*s) 658 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 659} 660 661type PagespeedApiPagespeedResponseV4LoadingExperienceMetricsDistributions struct { 662 Max int64 `json:"max,omitempty"` 663 664 Min int64 `json:"min,omitempty"` 665 666 Proportion float64 `json:"proportion,omitempty"` 667 668 // ForceSendFields is a list of field names (e.g. "Max") to 669 // unconditionally include in API requests. By default, fields with 670 // empty values are omitted from API requests. However, any non-pointer, 671 // non-interface field appearing in ForceSendFields will be sent to the 672 // server regardless of whether the field is empty or not. This may be 673 // used to include empty fields in Patch requests. 674 ForceSendFields []string `json:"-"` 675 676 // NullFields is a list of field names (e.g. "Max") to include in API 677 // requests with the JSON null value. By default, fields with empty 678 // values are omitted from API requests. However, any field with an 679 // empty value appearing in NullFields will be sent to the server as 680 // null. It is an error if a field in this list has a non-empty value. 681 // This may be used to include null fields in Patch requests. 682 NullFields []string `json:"-"` 683} 684 685func (s *PagespeedApiPagespeedResponseV4LoadingExperienceMetricsDistributions) MarshalJSON() ([]byte, error) { 686 type NoMethod PagespeedApiPagespeedResponseV4LoadingExperienceMetricsDistributions 687 raw := NoMethod(*s) 688 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 689} 690 691func (s *PagespeedApiPagespeedResponseV4LoadingExperienceMetricsDistributions) UnmarshalJSON(data []byte) error { 692 type NoMethod PagespeedApiPagespeedResponseV4LoadingExperienceMetricsDistributions 693 var s1 struct { 694 Proportion gensupport.JSONFloat64 `json:"proportion"` 695 *NoMethod 696 } 697 s1.NoMethod = (*NoMethod)(s) 698 if err := json.Unmarshal(data, &s1); err != nil { 699 return err 700 } 701 s.Proportion = float64(s1.Proportion) 702 return nil 703} 704 705// PagespeedApiPagespeedResponseV4PageStats: Summary statistics for the 706// page, such as number of JavaScript bytes, number of HTML bytes, etc. 707type PagespeedApiPagespeedResponseV4PageStats struct { 708 // Cms: Content management system (CMS) used for the page. 709 Cms string `json:"cms,omitempty"` 710 711 // CssResponseBytes: Number of uncompressed response bytes for CSS 712 // resources on the page. 713 CssResponseBytes int64 `json:"cssResponseBytes,omitempty,string"` 714 715 // FlashResponseBytes: Number of response bytes for flash resources on 716 // the page. 717 FlashResponseBytes int64 `json:"flashResponseBytes,omitempty,string"` 718 719 // HtmlResponseBytes: Number of uncompressed response bytes for the main 720 // HTML document and all iframes on the page. 721 HtmlResponseBytes int64 `json:"htmlResponseBytes,omitempty,string"` 722 723 // ImageResponseBytes: Number of response bytes for image resources on 724 // the page. 725 ImageResponseBytes int64 `json:"imageResponseBytes,omitempty,string"` 726 727 // JavascriptResponseBytes: Number of uncompressed response bytes for JS 728 // resources on the page. 729 JavascriptResponseBytes int64 `json:"javascriptResponseBytes,omitempty,string"` 730 731 // NumRenderBlockingRoundTrips: The needed round trips to load render 732 // blocking resources 733 NumRenderBlockingRoundTrips int64 `json:"numRenderBlockingRoundTrips,omitempty"` 734 735 // NumTotalRoundTrips: The needed round trips to load the full page 736 NumTotalRoundTrips int64 `json:"numTotalRoundTrips,omitempty"` 737 738 // NumberCssResources: Number of CSS resources referenced by the page. 739 NumberCssResources int64 `json:"numberCssResources,omitempty"` 740 741 // NumberHosts: Number of unique hosts referenced by the page. 742 NumberHosts int64 `json:"numberHosts,omitempty"` 743 744 // NumberJsResources: Number of JavaScript resources referenced by the 745 // page. 746 NumberJsResources int64 `json:"numberJsResources,omitempty"` 747 748 // NumberResources: Number of HTTP resources loaded by the page. 749 NumberResources int64 `json:"numberResources,omitempty"` 750 751 // NumberRobotedResources: Number of roboted resources. 752 NumberRobotedResources int64 `json:"numberRobotedResources,omitempty"` 753 754 // NumberStaticResources: Number of static (i.e. cacheable) resources on 755 // the page. 756 NumberStaticResources int64 `json:"numberStaticResources,omitempty"` 757 758 // NumberTransientFetchFailureResources: Number of transient-failed 759 // resources. 760 NumberTransientFetchFailureResources int64 `json:"numberTransientFetchFailureResources,omitempty"` 761 762 // OtherResponseBytes: Number of response bytes for other resources on 763 // the page. 764 OtherResponseBytes int64 `json:"otherResponseBytes,omitempty,string"` 765 766 // OverTheWireResponseBytes: Number of over-the-wire bytes, uses the 767 // default gzip compression strategy as an estimation. 768 OverTheWireResponseBytes int64 `json:"overTheWireResponseBytes,omitempty,string"` 769 770 // RobotedUrls: List of roboted urls. 771 RobotedUrls []string `json:"robotedUrls,omitempty"` 772 773 // TextResponseBytes: Number of uncompressed response bytes for text 774 // resources not covered by other statistics (i.e non-HTML, non-script, 775 // non-CSS resources) on the page. 776 TextResponseBytes int64 `json:"textResponseBytes,omitempty,string"` 777 778 // TotalRequestBytes: Total size of all request bytes sent by the page. 779 TotalRequestBytes int64 `json:"totalRequestBytes,omitempty,string"` 780 781 // TransientFetchFailureUrls: List of transient fetch failure urls. 782 TransientFetchFailureUrls []string `json:"transientFetchFailureUrls,omitempty"` 783 784 // ForceSendFields is a list of field names (e.g. "Cms") to 785 // unconditionally include in API requests. By default, fields with 786 // empty values are omitted from API requests. However, any non-pointer, 787 // non-interface field appearing in ForceSendFields will be sent to the 788 // server regardless of whether the field is empty or not. This may be 789 // used to include empty fields in Patch requests. 790 ForceSendFields []string `json:"-"` 791 792 // NullFields is a list of field names (e.g. "Cms") to include in API 793 // requests with the JSON null value. By default, fields with empty 794 // values are omitted from API requests. However, any field with an 795 // empty value appearing in NullFields will be sent to the server as 796 // null. It is an error if a field in this list has a non-empty value. 797 // This may be used to include null fields in Patch requests. 798 NullFields []string `json:"-"` 799} 800 801func (s *PagespeedApiPagespeedResponseV4PageStats) MarshalJSON() ([]byte, error) { 802 type NoMethod PagespeedApiPagespeedResponseV4PageStats 803 raw := NoMethod(*s) 804 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 805} 806 807// PagespeedApiPagespeedResponseV4RuleGroups: The name of this rule 808// group: one of "SPEED", "USABILITY", or "SECURITY". 809type PagespeedApiPagespeedResponseV4RuleGroups struct { 810 Pass bool `json:"pass,omitempty"` 811 812 // Score: The score (0-100) for this rule group, which indicates how 813 // much better a page could be in that category (e.g. how much faster, 814 // or how much more usable, or how much more secure). A high score 815 // indicates little room for improvement, while a lower score indicates 816 // more room for improvement. 817 Score int64 `json:"score,omitempty"` 818 819 // ForceSendFields is a list of field names (e.g. "Pass") to 820 // unconditionally include in API requests. By default, fields with 821 // empty values are omitted from API requests. However, any non-pointer, 822 // non-interface field appearing in ForceSendFields will be sent to the 823 // server regardless of whether the field is empty or not. This may be 824 // used to include empty fields in Patch requests. 825 ForceSendFields []string `json:"-"` 826 827 // NullFields is a list of field names (e.g. "Pass") to include in API 828 // requests with the JSON null value. By default, fields with empty 829 // values are omitted from API requests. However, any field with an 830 // empty value appearing in NullFields will be sent to the server as 831 // null. It is an error if a field in this list has a non-empty value. 832 // This may be used to include null fields in Patch requests. 833 NullFields []string `json:"-"` 834} 835 836func (s *PagespeedApiPagespeedResponseV4RuleGroups) MarshalJSON() ([]byte, error) { 837 type NoMethod PagespeedApiPagespeedResponseV4RuleGroups 838 raw := NoMethod(*s) 839 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 840} 841 842// PagespeedApiPagespeedResponseV4Version: The version of PageSpeed used 843// to generate these results. 844type PagespeedApiPagespeedResponseV4Version struct { 845 // Major: The major version number of PageSpeed used to generate these 846 // results. 847 Major int64 `json:"major,omitempty"` 848 849 // Minor: The minor version number of PageSpeed used to generate these 850 // results. 851 Minor int64 `json:"minor,omitempty"` 852 853 // ForceSendFields is a list of field names (e.g. "Major") to 854 // unconditionally include in API requests. By default, fields with 855 // empty values are omitted from API requests. However, any non-pointer, 856 // non-interface field appearing in ForceSendFields will be sent to the 857 // server regardless of whether the field is empty or not. This may be 858 // used to include empty fields in Patch requests. 859 ForceSendFields []string `json:"-"` 860 861 // NullFields is a list of field names (e.g. "Major") to include in API 862 // requests with the JSON null value. By default, fields with empty 863 // values are omitted from API requests. However, any field with an 864 // empty value appearing in NullFields will be sent to the server as 865 // null. It is an error if a field in this list has a non-empty value. 866 // This may be used to include null fields in Patch requests. 867 NullFields []string `json:"-"` 868} 869 870func (s *PagespeedApiPagespeedResponseV4Version) MarshalJSON() ([]byte, error) { 871 type NoMethod PagespeedApiPagespeedResponseV4Version 872 raw := NoMethod(*s) 873 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 874} 875 876// method id "pagespeedonline.pagespeedapi.runpagespeed": 877 878type PagespeedapiRunpagespeedCall struct { 879 s *Service 880 urlParams_ gensupport.URLParams 881 ifNoneMatch_ string 882 ctx_ context.Context 883 header_ http.Header 884} 885 886// Runpagespeed: Runs PageSpeed analysis on the page at the specified 887// URL, and returns PageSpeed scores, a list of suggestions to make that 888// page faster, and other information. 889func (r *PagespeedapiService) Runpagespeed(url string) *PagespeedapiRunpagespeedCall { 890 c := &PagespeedapiRunpagespeedCall{s: r.s, urlParams_: make(gensupport.URLParams)} 891 c.urlParams_.Set("url", url) 892 return c 893} 894 895// FilterThirdPartyResources sets the optional parameter 896// "filter_third_party_resources": Indicates if third party resources 897// should be filtered out before PageSpeed analysis. 898func (c *PagespeedapiRunpagespeedCall) FilterThirdPartyResources(filterThirdPartyResources bool) *PagespeedapiRunpagespeedCall { 899 c.urlParams_.Set("filter_third_party_resources", fmt.Sprint(filterThirdPartyResources)) 900 return c 901} 902 903// Locale sets the optional parameter "locale": The locale used to 904// localize formatted results 905func (c *PagespeedapiRunpagespeedCall) Locale(locale string) *PagespeedapiRunpagespeedCall { 906 c.urlParams_.Set("locale", locale) 907 return c 908} 909 910// Rule sets the optional parameter "rule": A PageSpeed rule to run; if 911// none are given, all rules are run 912func (c *PagespeedapiRunpagespeedCall) Rule(rule ...string) *PagespeedapiRunpagespeedCall { 913 c.urlParams_.SetMulti("rule", append([]string{}, rule...)) 914 return c 915} 916 917// Screenshot sets the optional parameter "screenshot": Indicates if 918// binary data containing a screenshot should be included 919func (c *PagespeedapiRunpagespeedCall) Screenshot(screenshot bool) *PagespeedapiRunpagespeedCall { 920 c.urlParams_.Set("screenshot", fmt.Sprint(screenshot)) 921 return c 922} 923 924// Snapshots sets the optional parameter "snapshots": Indicates if 925// binary data containing snapshot images should be included 926func (c *PagespeedapiRunpagespeedCall) Snapshots(snapshots bool) *PagespeedapiRunpagespeedCall { 927 c.urlParams_.Set("snapshots", fmt.Sprint(snapshots)) 928 return c 929} 930 931// Strategy sets the optional parameter "strategy": The analysis 932// strategy (desktop or mobile) to use, and desktop is the default 933// 934// Possible values: 935// "desktop" - Fetch and analyze the URL for desktop browsers 936// "mobile" - Fetch and analyze the URL for mobile devices 937func (c *PagespeedapiRunpagespeedCall) Strategy(strategy string) *PagespeedapiRunpagespeedCall { 938 c.urlParams_.Set("strategy", strategy) 939 return c 940} 941 942// UtmCampaign sets the optional parameter "utm_campaign": Campaign name 943// for analytics. 944func (c *PagespeedapiRunpagespeedCall) UtmCampaign(utmCampaign string) *PagespeedapiRunpagespeedCall { 945 c.urlParams_.Set("utm_campaign", utmCampaign) 946 return c 947} 948 949// UtmSource sets the optional parameter "utm_source": Campaign source 950// for analytics. 951func (c *PagespeedapiRunpagespeedCall) UtmSource(utmSource string) *PagespeedapiRunpagespeedCall { 952 c.urlParams_.Set("utm_source", utmSource) 953 return c 954} 955 956// Fields allows partial responses to be retrieved. See 957// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 958// for more information. 959func (c *PagespeedapiRunpagespeedCall) Fields(s ...googleapi.Field) *PagespeedapiRunpagespeedCall { 960 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 961 return c 962} 963 964// IfNoneMatch sets the optional parameter which makes the operation 965// fail if the object's ETag matches the given value. This is useful for 966// getting updates only after the object has changed since the last 967// request. Use googleapi.IsNotModified to check whether the response 968// error from Do is the result of In-None-Match. 969func (c *PagespeedapiRunpagespeedCall) IfNoneMatch(entityTag string) *PagespeedapiRunpagespeedCall { 970 c.ifNoneMatch_ = entityTag 971 return c 972} 973 974// Context sets the context to be used in this call's Do method. Any 975// pending HTTP request will be aborted if the provided context is 976// canceled. 977func (c *PagespeedapiRunpagespeedCall) Context(ctx context.Context) *PagespeedapiRunpagespeedCall { 978 c.ctx_ = ctx 979 return c 980} 981 982// Header returns an http.Header that can be modified by the caller to 983// add HTTP headers to the request. 984func (c *PagespeedapiRunpagespeedCall) Header() http.Header { 985 if c.header_ == nil { 986 c.header_ = make(http.Header) 987 } 988 return c.header_ 989} 990 991func (c *PagespeedapiRunpagespeedCall) doRequest(alt string) (*http.Response, error) { 992 reqHeaders := make(http.Header) 993 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20200514") 994 for k, v := range c.header_ { 995 reqHeaders[k] = v 996 } 997 reqHeaders.Set("User-Agent", c.s.userAgent()) 998 if c.ifNoneMatch_ != "" { 999 reqHeaders.Set("If-None-Match", c.ifNoneMatch_) 1000 } 1001 var body io.Reader = nil 1002 c.urlParams_.Set("alt", alt) 1003 c.urlParams_.Set("prettyPrint", "false") 1004 urls := googleapi.ResolveRelative(c.s.BasePath, "runPagespeed") 1005 urls += "?" + c.urlParams_.Encode() 1006 req, err := http.NewRequest("GET", urls, body) 1007 if err != nil { 1008 return nil, err 1009 } 1010 req.Header = reqHeaders 1011 return gensupport.SendRequest(c.ctx_, c.s.client, req) 1012} 1013 1014// Do executes the "pagespeedonline.pagespeedapi.runpagespeed" call. 1015// Exactly one of *PagespeedApiPagespeedResponseV4 or error will be 1016// non-nil. Any non-2xx status code is an error. Response headers are in 1017// either *PagespeedApiPagespeedResponseV4.ServerResponse.Header or (if 1018// a response was returned at all) in error.(*googleapi.Error).Header. 1019// Use googleapi.IsNotModified to check whether the returned error was 1020// because http.StatusNotModified was returned. 1021func (c *PagespeedapiRunpagespeedCall) Do(opts ...googleapi.CallOption) (*PagespeedApiPagespeedResponseV4, error) { 1022 gensupport.SetOptions(c.urlParams_, opts...) 1023 res, err := c.doRequest("json") 1024 if res != nil && res.StatusCode == http.StatusNotModified { 1025 if res.Body != nil { 1026 res.Body.Close() 1027 } 1028 return nil, &googleapi.Error{ 1029 Code: res.StatusCode, 1030 Header: res.Header, 1031 } 1032 } 1033 if err != nil { 1034 return nil, err 1035 } 1036 defer googleapi.CloseBody(res) 1037 if err := googleapi.CheckResponse(res); err != nil { 1038 return nil, err 1039 } 1040 ret := &PagespeedApiPagespeedResponseV4{ 1041 ServerResponse: googleapi.ServerResponse{ 1042 Header: res.Header, 1043 HTTPStatusCode: res.StatusCode, 1044 }, 1045 } 1046 target := &ret 1047 if err := gensupport.DecodeResponse(target, res); err != nil { 1048 return nil, err 1049 } 1050 return ret, nil 1051 // { 1052 // "description": "Runs PageSpeed analysis on the page at the specified URL, and returns PageSpeed scores, a list of suggestions to make that page faster, and other information.", 1053 // "httpMethod": "GET", 1054 // "id": "pagespeedonline.pagespeedapi.runpagespeed", 1055 // "parameterOrder": [ 1056 // "url" 1057 // ], 1058 // "parameters": { 1059 // "filter_third_party_resources": { 1060 // "default": "false", 1061 // "description": "Indicates if third party resources should be filtered out before PageSpeed analysis.", 1062 // "location": "query", 1063 // "type": "boolean" 1064 // }, 1065 // "locale": { 1066 // "description": "The locale used to localize formatted results", 1067 // "location": "query", 1068 // "pattern": "[a-zA-Z]+(_[a-zA-Z]+)?", 1069 // "type": "string" 1070 // }, 1071 // "rule": { 1072 // "description": "A PageSpeed rule to run; if none are given, all rules are run", 1073 // "location": "query", 1074 // "pattern": "[a-zA-Z]+", 1075 // "repeated": true, 1076 // "type": "string" 1077 // }, 1078 // "screenshot": { 1079 // "default": "false", 1080 // "description": "Indicates if binary data containing a screenshot should be included", 1081 // "location": "query", 1082 // "type": "boolean" 1083 // }, 1084 // "snapshots": { 1085 // "default": "false", 1086 // "description": "Indicates if binary data containing snapshot images should be included", 1087 // "location": "query", 1088 // "type": "boolean" 1089 // }, 1090 // "strategy": { 1091 // "description": "The analysis strategy (desktop or mobile) to use, and desktop is the default", 1092 // "enum": [ 1093 // "desktop", 1094 // "mobile" 1095 // ], 1096 // "enumDescriptions": [ 1097 // "Fetch and analyze the URL for desktop browsers", 1098 // "Fetch and analyze the URL for mobile devices" 1099 // ], 1100 // "location": "query", 1101 // "type": "string" 1102 // }, 1103 // "url": { 1104 // "description": "The URL to fetch and analyze", 1105 // "location": "query", 1106 // "pattern": "(?i)(site:|origin:)?http(s)?://.*", 1107 // "required": true, 1108 // "type": "string" 1109 // }, 1110 // "utm_campaign": { 1111 // "description": "Campaign name for analytics.", 1112 // "location": "query", 1113 // "type": "string" 1114 // }, 1115 // "utm_source": { 1116 // "description": "Campaign source for analytics.", 1117 // "location": "query", 1118 // "type": "string" 1119 // } 1120 // }, 1121 // "path": "runPagespeed", 1122 // "response": { 1123 // "$ref": "PagespeedApiPagespeedResponseV4" 1124 // } 1125 // } 1126 1127} 1128