You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

1124 lines
45 KiB

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