| OLD | NEW |
| 1 // This is a generated file (see the discoveryapis_generator project). | 1 // This is a generated file (see the discoveryapis_generator project). |
| 2 | 2 |
| 3 library googleapis.pagespeedonline.v2; | 3 library googleapis.pagespeedonline.v2; |
| 4 | 4 |
| 5 import 'dart:core' as core; | 5 import 'dart:core' as core; |
| 6 import 'dart:async' as async; | 6 import 'dart:async' as async; |
| 7 import 'dart:convert' as convert; | 7 import 'dart:convert' as convert; |
| 8 | 8 |
| 9 import 'package:_discoveryapis_commons/_discoveryapis_commons.dart' as commons; | 9 import 'package:_discoveryapis_commons/_discoveryapis_commons.dart' as commons; |
| 10 import 'package:http/http.dart' as http; | 10 import 'package:http/http.dart' as http; |
| 11 | 11 |
| 12 export 'package:_discoveryapis_commons/_discoveryapis_commons.dart' show | 12 export 'package:_discoveryapis_commons/_discoveryapis_commons.dart' |
| 13 ApiRequestError, DetailedApiRequestError; | 13 show ApiRequestError, DetailedApiRequestError; |
| 14 | 14 |
| 15 const core.String USER_AGENT = 'dart-api-client pagespeedonline/v2'; | 15 const core.String USER_AGENT = 'dart-api-client pagespeedonline/v2'; |
| 16 | 16 |
| 17 /** | 17 /// Analyzes the performance of a web page and provides tailored suggestions to |
| 18 * Analyzes the performance of a web page and provides tailored suggestions to | 18 /// make that page faster. |
| 19 * make that page faster. | |
| 20 */ | |
| 21 class PagespeedonlineApi { | 19 class PagespeedonlineApi { |
| 22 | |
| 23 final commons.ApiRequester _requester; | 20 final commons.ApiRequester _requester; |
| 24 | 21 |
| 25 PagespeedapiResourceApi get pagespeedapi => new PagespeedapiResourceApi(_reque
ster); | 22 PagespeedapiResourceApi get pagespeedapi => |
| 23 new PagespeedapiResourceApi(_requester); |
| 26 | 24 |
| 27 PagespeedonlineApi(http.Client client, {core.String rootUrl: "https://www.goog
leapis.com/", core.String servicePath: "pagespeedonline/v2/"}) : | 25 PagespeedonlineApi(http.Client client, |
| 28 _requester = new commons.ApiRequester(client, rootUrl, servicePath, USER_A
GENT); | 26 {core.String rootUrl: "https://www.googleapis.com/", |
| 27 core.String servicePath: "pagespeedonline/v2/"}) |
| 28 : _requester = |
| 29 new commons.ApiRequester(client, rootUrl, servicePath, USER_AGENT); |
| 29 } | 30 } |
| 30 | 31 |
| 31 | |
| 32 class PagespeedapiResourceApi { | 32 class PagespeedapiResourceApi { |
| 33 final commons.ApiRequester _requester; | 33 final commons.ApiRequester _requester; |
| 34 | 34 |
| 35 PagespeedapiResourceApi(commons.ApiRequester client) : | 35 PagespeedapiResourceApi(commons.ApiRequester client) : _requester = client; |
| 36 _requester = client; | |
| 37 | 36 |
| 38 /** | 37 /// Runs PageSpeed analysis on the page at the specified URL, and returns |
| 39 * Runs PageSpeed analysis on the page at the specified URL, and returns | 38 /// PageSpeed scores, a list of suggestions to make that page faster, and |
| 40 * PageSpeed scores, a list of suggestions to make that page faster, and other | 39 /// other information. |
| 41 * information. | 40 /// |
| 42 * | 41 /// Request parameters: |
| 43 * Request parameters: | 42 /// |
| 44 * | 43 /// [url] - The URL to fetch and analyze |
| 45 * [url] - The URL to fetch and analyze | 44 /// Value must have pattern "(?i)http(s)?://.*". |
| 46 * Value must have pattern "(?i)http(s)?://.*". | 45 /// |
| 47 * | 46 /// [filterThirdPartyResources] - Indicates if third party resources should |
| 48 * [filterThirdPartyResources] - Indicates if third party resources should be | 47 /// be filtered out before PageSpeed analysis. |
| 49 * filtered out before PageSpeed analysis. | 48 /// |
| 50 * | 49 /// [locale] - The locale used to localize formatted results |
| 51 * [locale] - The locale used to localize formatted results | 50 /// Value must have pattern "[a-zA-Z]+(_[a-zA-Z]+)?". |
| 52 * Value must have pattern "[a-zA-Z]+(_[a-zA-Z]+)?". | 51 /// |
| 53 * | 52 /// [rule] - A PageSpeed rule to run; if none are given, all rules are run |
| 54 * [rule] - A PageSpeed rule to run; if none are given, all rules are run | 53 /// Value must have pattern "[a-zA-Z]+". |
| 55 * Value must have pattern "[a-zA-Z]+". | 54 /// |
| 56 * | 55 /// [screenshot] - Indicates if binary data containing a screenshot should be |
| 57 * [screenshot] - Indicates if binary data containing a screenshot should be | 56 /// included |
| 58 * included | 57 /// |
| 59 * | 58 /// [strategy] - The analysis strategy to use |
| 60 * [strategy] - The analysis strategy to use | 59 /// Possible string values are: |
| 61 * Possible string values are: | 60 /// - "desktop" : Fetch and analyze the URL for desktop browsers |
| 62 * - "desktop" : Fetch and analyze the URL for desktop browsers | 61 /// - "mobile" : Fetch and analyze the URL for mobile devices |
| 63 * - "mobile" : Fetch and analyze the URL for mobile devices | 62 /// |
| 64 * | 63 /// Completes with a [Result]. |
| 65 * Completes with a [Result]. | 64 /// |
| 66 * | 65 /// Completes with a [commons.ApiRequestError] if the API endpoint returned |
| 67 * Completes with a [commons.ApiRequestError] if the API endpoint returned an | 66 /// an error. |
| 68 * error. | 67 /// |
| 69 * | 68 /// If the used [http.Client] completes with an error when making a REST |
| 70 * If the used [http.Client] completes with an error when making a REST call, | 69 /// call, this method will complete with the same error. |
| 71 * this method will complete with the same error. | 70 async.Future<Result> runpagespeed(core.String url, |
| 72 */ | 71 {core.bool filterThirdPartyResources, |
| 73 async.Future<Result> runpagespeed(core.String url, {core.bool filterThirdParty
Resources, core.String locale, core.List<core.String> rule, core.bool screenshot
, core.String strategy}) { | 72 core.String locale, |
| 73 core.List<core.String> rule, |
| 74 core.bool screenshot, |
| 75 core.String strategy}) { |
| 74 var _url = null; | 76 var _url = null; |
| 75 var _queryParams = new core.Map(); | 77 var _queryParams = new core.Map(); |
| 76 var _uploadMedia = null; | 78 var _uploadMedia = null; |
| 77 var _uploadOptions = null; | 79 var _uploadOptions = null; |
| 78 var _downloadOptions = commons.DownloadOptions.Metadata; | 80 var _downloadOptions = commons.DownloadOptions.Metadata; |
| 79 var _body = null; | 81 var _body = null; |
| 80 | 82 |
| 81 if (url == null) { | 83 if (url == null) { |
| 82 throw new core.ArgumentError("Parameter url is required."); | 84 throw new core.ArgumentError("Parameter url is required."); |
| 83 } | 85 } |
| 84 _queryParams["url"] = [url]; | 86 _queryParams["url"] = [url]; |
| 85 if (filterThirdPartyResources != null) { | 87 if (filterThirdPartyResources != null) { |
| 86 _queryParams["filter_third_party_resources"] = ["${filterThirdPartyResourc
es}"]; | 88 _queryParams["filter_third_party_resources"] = [ |
| 89 "${filterThirdPartyResources}" |
| 90 ]; |
| 87 } | 91 } |
| 88 if (locale != null) { | 92 if (locale != null) { |
| 89 _queryParams["locale"] = [locale]; | 93 _queryParams["locale"] = [locale]; |
| 90 } | 94 } |
| 91 if (rule != null) { | 95 if (rule != null) { |
| 92 _queryParams["rule"] = rule; | 96 _queryParams["rule"] = rule; |
| 93 } | 97 } |
| 94 if (screenshot != null) { | 98 if (screenshot != null) { |
| 95 _queryParams["screenshot"] = ["${screenshot}"]; | 99 _queryParams["screenshot"] = ["${screenshot}"]; |
| 96 } | 100 } |
| 97 if (strategy != null) { | 101 if (strategy != null) { |
| 98 _queryParams["strategy"] = [strategy]; | 102 _queryParams["strategy"] = [strategy]; |
| 99 } | 103 } |
| 100 | 104 |
| 101 _url = 'runPagespeed'; | 105 _url = 'runPagespeed'; |
| 102 | 106 |
| 103 var _response = _requester.request(_url, | 107 var _response = _requester.request(_url, "GET", |
| 104 "GET", | 108 body: _body, |
| 105 body: _body, | 109 queryParams: _queryParams, |
| 106 queryParams: _queryParams, | 110 uploadOptions: _uploadOptions, |
| 107 uploadOptions: _uploadOptions, | 111 uploadMedia: _uploadMedia, |
| 108 uploadMedia: _uploadMedia, | 112 downloadOptions: _downloadOptions); |
| 109 downloadOptions: _downloadOptions); | |
| 110 return _response.then((data) => new Result.fromJson(data)); | 113 return _response.then((data) => new Result.fromJson(data)); |
| 111 } | 114 } |
| 112 | |
| 113 } | 115 } |
| 114 | 116 |
| 117 class PagespeedApiFormatStringV2ArgsRects { |
| 118 /// The height of the rect. |
| 119 core.int height; |
| 115 | 120 |
| 121 /// The left coordinate of the rect, in page coordinates. |
| 122 core.int left; |
| 116 | 123 |
| 117 class PagespeedApiFormatStringV2ArgsRects { | 124 /// The top coordinate of the rect, in page coordinates. |
| 118 /** The height of the rect. */ | |
| 119 core.int height; | |
| 120 /** The left coordinate of the rect, in page coordinates. */ | |
| 121 core.int left; | |
| 122 /** The top coordinate of the rect, in page coordinates. */ | |
| 123 core.int top; | 125 core.int top; |
| 124 /** The width of the rect. */ | 126 |
| 127 /// The width of the rect. |
| 125 core.int width; | 128 core.int width; |
| 126 | 129 |
| 127 PagespeedApiFormatStringV2ArgsRects(); | 130 PagespeedApiFormatStringV2ArgsRects(); |
| 128 | 131 |
| 129 PagespeedApiFormatStringV2ArgsRects.fromJson(core.Map _json) { | 132 PagespeedApiFormatStringV2ArgsRects.fromJson(core.Map _json) { |
| 130 if (_json.containsKey("height")) { | 133 if (_json.containsKey("height")) { |
| 131 height = _json["height"]; | 134 height = _json["height"]; |
| 132 } | 135 } |
| 133 if (_json.containsKey("left")) { | 136 if (_json.containsKey("left")) { |
| 134 left = _json["left"]; | 137 left = _json["left"]; |
| 135 } | 138 } |
| 136 if (_json.containsKey("top")) { | 139 if (_json.containsKey("top")) { |
| 137 top = _json["top"]; | 140 top = _json["top"]; |
| 138 } | 141 } |
| 139 if (_json.containsKey("width")) { | 142 if (_json.containsKey("width")) { |
| 140 width = _json["width"]; | 143 width = _json["width"]; |
| 141 } | 144 } |
| 142 } | 145 } |
| 143 | 146 |
| 144 core.Map<core.String, core.Object> toJson() { | 147 core.Map<core.String, core.Object> toJson() { |
| 145 final core.Map<core.String, core.Object> _json = new core.Map<core.String, c
ore.Object>(); | 148 final core.Map<core.String, core.Object> _json = |
| 149 new core.Map<core.String, core.Object>(); |
| 146 if (height != null) { | 150 if (height != null) { |
| 147 _json["height"] = height; | 151 _json["height"] = height; |
| 148 } | 152 } |
| 149 if (left != null) { | 153 if (left != null) { |
| 150 _json["left"] = left; | 154 _json["left"] = left; |
| 151 } | 155 } |
| 152 if (top != null) { | 156 if (top != null) { |
| 153 _json["top"] = top; | 157 _json["top"] = top; |
| 154 } | 158 } |
| 155 if (width != null) { | 159 if (width != null) { |
| 156 _json["width"] = width; | 160 _json["width"] = width; |
| 157 } | 161 } |
| 158 return _json; | 162 return _json; |
| 159 } | 163 } |
| 160 } | 164 } |
| 161 | 165 |
| 162 class PagespeedApiFormatStringV2ArgsSecondaryRects { | 166 class PagespeedApiFormatStringV2ArgsSecondaryRects { |
| 163 /** The height of the rect. */ | 167 /// The height of the rect. |
| 164 core.int height; | 168 core.int height; |
| 165 /** The left coordinate of the rect, in page coordinates. */ | 169 |
| 170 /// The left coordinate of the rect, in page coordinates. |
| 166 core.int left; | 171 core.int left; |
| 167 /** The top coordinate of the rect, in page coordinates. */ | 172 |
| 173 /// The top coordinate of the rect, in page coordinates. |
| 168 core.int top; | 174 core.int top; |
| 169 /** The width of the rect. */ | 175 |
| 176 /// The width of the rect. |
| 170 core.int width; | 177 core.int width; |
| 171 | 178 |
| 172 PagespeedApiFormatStringV2ArgsSecondaryRects(); | 179 PagespeedApiFormatStringV2ArgsSecondaryRects(); |
| 173 | 180 |
| 174 PagespeedApiFormatStringV2ArgsSecondaryRects.fromJson(core.Map _json) { | 181 PagespeedApiFormatStringV2ArgsSecondaryRects.fromJson(core.Map _json) { |
| 175 if (_json.containsKey("height")) { | 182 if (_json.containsKey("height")) { |
| 176 height = _json["height"]; | 183 height = _json["height"]; |
| 177 } | 184 } |
| 178 if (_json.containsKey("left")) { | 185 if (_json.containsKey("left")) { |
| 179 left = _json["left"]; | 186 left = _json["left"]; |
| 180 } | 187 } |
| 181 if (_json.containsKey("top")) { | 188 if (_json.containsKey("top")) { |
| 182 top = _json["top"]; | 189 top = _json["top"]; |
| 183 } | 190 } |
| 184 if (_json.containsKey("width")) { | 191 if (_json.containsKey("width")) { |
| 185 width = _json["width"]; | 192 width = _json["width"]; |
| 186 } | 193 } |
| 187 } | 194 } |
| 188 | 195 |
| 189 core.Map<core.String, core.Object> toJson() { | 196 core.Map<core.String, core.Object> toJson() { |
| 190 final core.Map<core.String, core.Object> _json = new core.Map<core.String, c
ore.Object>(); | 197 final core.Map<core.String, core.Object> _json = |
| 198 new core.Map<core.String, core.Object>(); |
| 191 if (height != null) { | 199 if (height != null) { |
| 192 _json["height"] = height; | 200 _json["height"] = height; |
| 193 } | 201 } |
| 194 if (left != null) { | 202 if (left != null) { |
| 195 _json["left"] = left; | 203 _json["left"] = left; |
| 196 } | 204 } |
| 197 if (top != null) { | 205 if (top != null) { |
| 198 _json["top"] = top; | 206 _json["top"] = top; |
| 199 } | 207 } |
| 200 if (width != null) { | 208 if (width != null) { |
| 201 _json["width"] = width; | 209 _json["width"] = width; |
| 202 } | 210 } |
| 203 return _json; | 211 return _json; |
| 204 } | 212 } |
| 205 } | 213 } |
| 206 | 214 |
| 207 class PagespeedApiFormatStringV2Args { | 215 class PagespeedApiFormatStringV2Args { |
| 208 /** The placeholder key for this arg, as a string. */ | 216 /// The placeholder key for this arg, as a string. |
| 209 core.String key; | 217 core.String key; |
| 210 /** | 218 |
| 211 * The screen rectangles being referred to, with dimensions measured in CSS | 219 /// The screen rectangles being referred to, with dimensions measured in CSS |
| 212 * pixels. This is only ever used for SNAPSHOT_RECT arguments. If this is | 220 /// pixels. This is only ever used for SNAPSHOT_RECT arguments. If this is |
| 213 * absent for a SNAPSHOT_RECT argument, it means that that argument refers to | 221 /// absent for a SNAPSHOT_RECT argument, it means that that argument refers |
| 214 * the entire snapshot. | 222 /// to the entire snapshot. |
| 215 */ | |
| 216 core.List<PagespeedApiFormatStringV2ArgsRects> rects; | 223 core.List<PagespeedApiFormatStringV2ArgsRects> rects; |
| 217 /** | 224 |
| 218 * Secondary screen rectangles being referred to, with dimensions measured in | 225 /// Secondary screen rectangles being referred to, with dimensions measured |
| 219 * CSS pixels. This is only ever used for SNAPSHOT_RECT arguments. | 226 /// in CSS pixels. This is only ever used for SNAPSHOT_RECT arguments. |
| 220 */ | |
| 221 core.List<PagespeedApiFormatStringV2ArgsSecondaryRects> secondaryRects; | 227 core.List<PagespeedApiFormatStringV2ArgsSecondaryRects> secondaryRects; |
| 222 /** | 228 |
| 223 * Type of argument. One of URL, STRING_LITERAL, INT_LITERAL, BYTES, DURATION, | 229 /// Type of argument. One of URL, STRING_LITERAL, INT_LITERAL, BYTES, |
| 224 * VERBATIM_STRING, PERCENTAGE, HYPERLINK, or SNAPSHOT_RECT. | 230 /// DURATION, VERBATIM_STRING, PERCENTAGE, HYPERLINK, or SNAPSHOT_RECT. |
| 225 */ | |
| 226 core.String type; | 231 core.String type; |
| 227 /** Argument value, as a localized string. */ | 232 |
| 233 /// Argument value, as a localized string. |
| 228 core.String value; | 234 core.String value; |
| 229 | 235 |
| 230 PagespeedApiFormatStringV2Args(); | 236 PagespeedApiFormatStringV2Args(); |
| 231 | 237 |
| 232 PagespeedApiFormatStringV2Args.fromJson(core.Map _json) { | 238 PagespeedApiFormatStringV2Args.fromJson(core.Map _json) { |
| 233 if (_json.containsKey("key")) { | 239 if (_json.containsKey("key")) { |
| 234 key = _json["key"]; | 240 key = _json["key"]; |
| 235 } | 241 } |
| 236 if (_json.containsKey("rects")) { | 242 if (_json.containsKey("rects")) { |
| 237 rects = _json["rects"].map((value) => new PagespeedApiFormatStringV2ArgsRe
cts.fromJson(value)).toList(); | 243 rects = _json["rects"] |
| 244 .map((value) => |
| 245 new PagespeedApiFormatStringV2ArgsRects.fromJson(value)) |
| 246 .toList(); |
| 238 } | 247 } |
| 239 if (_json.containsKey("secondary_rects")) { | 248 if (_json.containsKey("secondary_rects")) { |
| 240 secondaryRects = _json["secondary_rects"].map((value) => new PagespeedApiF
ormatStringV2ArgsSecondaryRects.fromJson(value)).toList(); | 249 secondaryRects = _json["secondary_rects"] |
| 250 .map((value) => |
| 251 new PagespeedApiFormatStringV2ArgsSecondaryRects.fromJson(value)) |
| 252 .toList(); |
| 241 } | 253 } |
| 242 if (_json.containsKey("type")) { | 254 if (_json.containsKey("type")) { |
| 243 type = _json["type"]; | 255 type = _json["type"]; |
| 244 } | 256 } |
| 245 if (_json.containsKey("value")) { | 257 if (_json.containsKey("value")) { |
| 246 value = _json["value"]; | 258 value = _json["value"]; |
| 247 } | 259 } |
| 248 } | 260 } |
| 249 | 261 |
| 250 core.Map<core.String, core.Object> toJson() { | 262 core.Map<core.String, core.Object> toJson() { |
| 251 final core.Map<core.String, core.Object> _json = new core.Map<core.String, c
ore.Object>(); | 263 final core.Map<core.String, core.Object> _json = |
| 264 new core.Map<core.String, core.Object>(); |
| 252 if (key != null) { | 265 if (key != null) { |
| 253 _json["key"] = key; | 266 _json["key"] = key; |
| 254 } | 267 } |
| 255 if (rects != null) { | 268 if (rects != null) { |
| 256 _json["rects"] = rects.map((value) => (value).toJson()).toList(); | 269 _json["rects"] = rects.map((value) => (value).toJson()).toList(); |
| 257 } | 270 } |
| 258 if (secondaryRects != null) { | 271 if (secondaryRects != null) { |
| 259 _json["secondary_rects"] = secondaryRects.map((value) => (value).toJson())
.toList(); | 272 _json["secondary_rects"] = |
| 273 secondaryRects.map((value) => (value).toJson()).toList(); |
| 260 } | 274 } |
| 261 if (type != null) { | 275 if (type != null) { |
| 262 _json["type"] = type; | 276 _json["type"] = type; |
| 263 } | 277 } |
| 264 if (value != null) { | 278 if (value != null) { |
| 265 _json["value"] = value; | 279 _json["value"] = value; |
| 266 } | 280 } |
| 267 return _json; | 281 return _json; |
| 268 } | 282 } |
| 269 } | 283 } |
| 270 | 284 |
| 271 class PagespeedApiFormatStringV2 { | 285 class PagespeedApiFormatStringV2 { |
| 272 /** List of arguments for the format string. */ | 286 /// List of arguments for the format string. |
| 273 core.List<PagespeedApiFormatStringV2Args> args; | 287 core.List<PagespeedApiFormatStringV2Args> args; |
| 274 /** | 288 |
| 275 * A localized format string with {{FOO}} placeholders, where 'FOO' is the key | 289 /// A localized format string with {{FOO}} placeholders, where 'FOO' is the |
| 276 * of the argument whose value should be substituted. For HYPERLINK arguments, | 290 /// key of the argument whose value should be substituted. For HYPERLINK |
| 277 * the format string will instead contain {{BEGIN_FOO}} and {{END_FOO}} for | 291 /// arguments, the format string will instead contain {{BEGIN_FOO}} and |
| 278 * the argument with key 'FOO'. | 292 /// {{END_FOO}} for the argument with key 'FOO'. |
| 279 */ | |
| 280 core.String format; | 293 core.String format; |
| 281 | 294 |
| 282 PagespeedApiFormatStringV2(); | 295 PagespeedApiFormatStringV2(); |
| 283 | 296 |
| 284 PagespeedApiFormatStringV2.fromJson(core.Map _json) { | 297 PagespeedApiFormatStringV2.fromJson(core.Map _json) { |
| 285 if (_json.containsKey("args")) { | 298 if (_json.containsKey("args")) { |
| 286 args = _json["args"].map((value) => new PagespeedApiFormatStringV2Args.fro
mJson(value)).toList(); | 299 args = _json["args"] |
| 300 .map((value) => new PagespeedApiFormatStringV2Args.fromJson(value)) |
| 301 .toList(); |
| 287 } | 302 } |
| 288 if (_json.containsKey("format")) { | 303 if (_json.containsKey("format")) { |
| 289 format = _json["format"]; | 304 format = _json["format"]; |
| 290 } | 305 } |
| 291 } | 306 } |
| 292 | 307 |
| 293 core.Map<core.String, core.Object> toJson() { | 308 core.Map<core.String, core.Object> toJson() { |
| 294 final core.Map<core.String, core.Object> _json = new core.Map<core.String, c
ore.Object>(); | 309 final core.Map<core.String, core.Object> _json = |
| 310 new core.Map<core.String, core.Object>(); |
| 295 if (args != null) { | 311 if (args != null) { |
| 296 _json["args"] = args.map((value) => (value).toJson()).toList(); | 312 _json["args"] = args.map((value) => (value).toJson()).toList(); |
| 297 } | 313 } |
| 298 if (format != null) { | 314 if (format != null) { |
| 299 _json["format"] = format; | 315 _json["format"] = format; |
| 300 } | 316 } |
| 301 return _json; | 317 return _json; |
| 302 } | 318 } |
| 303 } | 319 } |
| 304 | 320 |
| 305 /** | 321 /// The region of the page that is captured by this image, with dimensions |
| 306 * The region of the page that is captured by this image, with dimensions | 322 /// measured in CSS pixels. |
| 307 * measured in CSS pixels. | |
| 308 */ | |
| 309 class PagespeedApiImageV2PageRect { | 323 class PagespeedApiImageV2PageRect { |
| 310 /** The height of the rect. */ | 324 /// The height of the rect. |
| 311 core.int height; | 325 core.int height; |
| 312 /** The left coordinate of the rect, in page coordinates. */ | 326 |
| 327 /// The left coordinate of the rect, in page coordinates. |
| 313 core.int left; | 328 core.int left; |
| 314 /** The top coordinate of the rect, in page coordinates. */ | 329 |
| 330 /// The top coordinate of the rect, in page coordinates. |
| 315 core.int top; | 331 core.int top; |
| 316 /** The width of the rect. */ | 332 |
| 333 /// The width of the rect. |
| 317 core.int width; | 334 core.int width; |
| 318 | 335 |
| 319 PagespeedApiImageV2PageRect(); | 336 PagespeedApiImageV2PageRect(); |
| 320 | 337 |
| 321 PagespeedApiImageV2PageRect.fromJson(core.Map _json) { | 338 PagespeedApiImageV2PageRect.fromJson(core.Map _json) { |
| 322 if (_json.containsKey("height")) { | 339 if (_json.containsKey("height")) { |
| 323 height = _json["height"]; | 340 height = _json["height"]; |
| 324 } | 341 } |
| 325 if (_json.containsKey("left")) { | 342 if (_json.containsKey("left")) { |
| 326 left = _json["left"]; | 343 left = _json["left"]; |
| 327 } | 344 } |
| 328 if (_json.containsKey("top")) { | 345 if (_json.containsKey("top")) { |
| 329 top = _json["top"]; | 346 top = _json["top"]; |
| 330 } | 347 } |
| 331 if (_json.containsKey("width")) { | 348 if (_json.containsKey("width")) { |
| 332 width = _json["width"]; | 349 width = _json["width"]; |
| 333 } | 350 } |
| 334 } | 351 } |
| 335 | 352 |
| 336 core.Map<core.String, core.Object> toJson() { | 353 core.Map<core.String, core.Object> toJson() { |
| 337 final core.Map<core.String, core.Object> _json = new core.Map<core.String, c
ore.Object>(); | 354 final core.Map<core.String, core.Object> _json = |
| 355 new core.Map<core.String, core.Object>(); |
| 338 if (height != null) { | 356 if (height != null) { |
| 339 _json["height"] = height; | 357 _json["height"] = height; |
| 340 } | 358 } |
| 341 if (left != null) { | 359 if (left != null) { |
| 342 _json["left"] = left; | 360 _json["left"] = left; |
| 343 } | 361 } |
| 344 if (top != null) { | 362 if (top != null) { |
| 345 _json["top"] = top; | 363 _json["top"] = top; |
| 346 } | 364 } |
| 347 if (width != null) { | 365 if (width != null) { |
| 348 _json["width"] = width; | 366 _json["width"] = width; |
| 349 } | 367 } |
| 350 return _json; | 368 return _json; |
| 351 } | 369 } |
| 352 } | 370 } |
| 353 | 371 |
| 354 class PagespeedApiImageV2 { | 372 class PagespeedApiImageV2 { |
| 355 /** Image data base64 encoded. */ | 373 /// Image data base64 encoded. |
| 356 core.String data; | 374 core.String data; |
| 357 core.List<core.int> get dataAsBytes { | 375 core.List<core.int> get dataAsBytes { |
| 358 return convert.BASE64.decode(data); | 376 return convert.BASE64.decode(data); |
| 359 } | 377 } |
| 360 | 378 |
| 361 void set dataAsBytes(core.List<core.int> _bytes) { | 379 void set dataAsBytes(core.List<core.int> _bytes) { |
| 362 data = convert.BASE64.encode(_bytes).replaceAll("/", "_").replaceAll("+", "-
"); | 380 data = |
| 381 convert.BASE64.encode(_bytes).replaceAll("/", "_").replaceAll("+", "-"); |
| 363 } | 382 } |
| 364 /** Height of screenshot in pixels. */ | 383 |
| 384 /// Height of screenshot in pixels. |
| 365 core.int height; | 385 core.int height; |
| 366 /** Unique string key, if any, identifying this image. */ | 386 |
| 387 /// Unique string key, if any, identifying this image. |
| 367 core.String key; | 388 core.String key; |
| 368 /** Mime type of image data (e.g. "image/jpeg"). */ | 389 |
| 390 /// Mime type of image data (e.g. "image/jpeg"). |
| 369 core.String mimeType; | 391 core.String mimeType; |
| 370 /** | 392 |
| 371 * The region of the page that is captured by this image, with dimensions | 393 /// The region of the page that is captured by this image, with dimensions |
| 372 * measured in CSS pixels. | 394 /// measured in CSS pixels. |
| 373 */ | |
| 374 PagespeedApiImageV2PageRect pageRect; | 395 PagespeedApiImageV2PageRect pageRect; |
| 375 /** Width of screenshot in pixels. */ | 396 |
| 397 /// Width of screenshot in pixels. |
| 376 core.int width; | 398 core.int width; |
| 377 | 399 |
| 378 PagespeedApiImageV2(); | 400 PagespeedApiImageV2(); |
| 379 | 401 |
| 380 PagespeedApiImageV2.fromJson(core.Map _json) { | 402 PagespeedApiImageV2.fromJson(core.Map _json) { |
| 381 if (_json.containsKey("data")) { | 403 if (_json.containsKey("data")) { |
| 382 data = _json["data"]; | 404 data = _json["data"]; |
| 383 } | 405 } |
| 384 if (_json.containsKey("height")) { | 406 if (_json.containsKey("height")) { |
| 385 height = _json["height"]; | 407 height = _json["height"]; |
| 386 } | 408 } |
| 387 if (_json.containsKey("key")) { | 409 if (_json.containsKey("key")) { |
| 388 key = _json["key"]; | 410 key = _json["key"]; |
| 389 } | 411 } |
| 390 if (_json.containsKey("mime_type")) { | 412 if (_json.containsKey("mime_type")) { |
| 391 mimeType = _json["mime_type"]; | 413 mimeType = _json["mime_type"]; |
| 392 } | 414 } |
| 393 if (_json.containsKey("page_rect")) { | 415 if (_json.containsKey("page_rect")) { |
| 394 pageRect = new PagespeedApiImageV2PageRect.fromJson(_json["page_rect"]); | 416 pageRect = new PagespeedApiImageV2PageRect.fromJson(_json["page_rect"]); |
| 395 } | 417 } |
| 396 if (_json.containsKey("width")) { | 418 if (_json.containsKey("width")) { |
| 397 width = _json["width"]; | 419 width = _json["width"]; |
| 398 } | 420 } |
| 399 } | 421 } |
| 400 | 422 |
| 401 core.Map<core.String, core.Object> toJson() { | 423 core.Map<core.String, core.Object> toJson() { |
| 402 final core.Map<core.String, core.Object> _json = new core.Map<core.String, c
ore.Object>(); | 424 final core.Map<core.String, core.Object> _json = |
| 425 new core.Map<core.String, core.Object>(); |
| 403 if (data != null) { | 426 if (data != null) { |
| 404 _json["data"] = data; | 427 _json["data"] = data; |
| 405 } | 428 } |
| 406 if (height != null) { | 429 if (height != null) { |
| 407 _json["height"] = height; | 430 _json["height"] = height; |
| 408 } | 431 } |
| 409 if (key != null) { | 432 if (key != null) { |
| 410 _json["key"] = key; | 433 _json["key"] = key; |
| 411 } | 434 } |
| 412 if (mimeType != null) { | 435 if (mimeType != null) { |
| 413 _json["mime_type"] = mimeType; | 436 _json["mime_type"] = mimeType; |
| 414 } | 437 } |
| 415 if (pageRect != null) { | 438 if (pageRect != null) { |
| 416 _json["page_rect"] = (pageRect).toJson(); | 439 _json["page_rect"] = (pageRect).toJson(); |
| 417 } | 440 } |
| 418 if (width != null) { | 441 if (width != null) { |
| 419 _json["width"] = width; | 442 _json["width"] = width; |
| 420 } | 443 } |
| 421 return _json; | 444 return _json; |
| 422 } | 445 } |
| 423 } | 446 } |
| 424 | 447 |
| 425 class ResultFormattedResultsRuleResultsValueUrlBlocksUrls { | 448 class ResultFormattedResultsRuleResultsValueUrlBlocksUrls { |
| 426 /** | 449 /// List of entries that provide additional details about a single URL. |
| 427 * List of entries that provide additional details about a single URL. | 450 /// Optional. |
| 428 * Optional. | |
| 429 */ | |
| 430 core.List<PagespeedApiFormatStringV2> details; | 451 core.List<PagespeedApiFormatStringV2> details; |
| 431 /** | 452 |
| 432 * A format string that gives information about the URL, and a list of | 453 /// A format string that gives information about the URL, and a list of |
| 433 * arguments for that format string. | 454 /// arguments for that format string. |
| 434 */ | |
| 435 PagespeedApiFormatStringV2 result; | 455 PagespeedApiFormatStringV2 result; |
| 436 | 456 |
| 437 ResultFormattedResultsRuleResultsValueUrlBlocksUrls(); | 457 ResultFormattedResultsRuleResultsValueUrlBlocksUrls(); |
| 438 | 458 |
| 439 ResultFormattedResultsRuleResultsValueUrlBlocksUrls.fromJson(core.Map _json) { | 459 ResultFormattedResultsRuleResultsValueUrlBlocksUrls.fromJson(core.Map _json) { |
| 440 if (_json.containsKey("details")) { | 460 if (_json.containsKey("details")) { |
| 441 details = _json["details"].map((value) => new PagespeedApiFormatStringV2.f
romJson(value)).toList(); | 461 details = _json["details"] |
| 462 .map((value) => new PagespeedApiFormatStringV2.fromJson(value)) |
| 463 .toList(); |
| 442 } | 464 } |
| 443 if (_json.containsKey("result")) { | 465 if (_json.containsKey("result")) { |
| 444 result = new PagespeedApiFormatStringV2.fromJson(_json["result"]); | 466 result = new PagespeedApiFormatStringV2.fromJson(_json["result"]); |
| 445 } | 467 } |
| 446 } | 468 } |
| 447 | 469 |
| 448 core.Map<core.String, core.Object> toJson() { | 470 core.Map<core.String, core.Object> toJson() { |
| 449 final core.Map<core.String, core.Object> _json = new core.Map<core.String, c
ore.Object>(); | 471 final core.Map<core.String, core.Object> _json = |
| 472 new core.Map<core.String, core.Object>(); |
| 450 if (details != null) { | 473 if (details != null) { |
| 451 _json["details"] = details.map((value) => (value).toJson()).toList(); | 474 _json["details"] = details.map((value) => (value).toJson()).toList(); |
| 452 } | 475 } |
| 453 if (result != null) { | 476 if (result != null) { |
| 454 _json["result"] = (result).toJson(); | 477 _json["result"] = (result).toJson(); |
| 455 } | 478 } |
| 456 return _json; | 479 return _json; |
| 457 } | 480 } |
| 458 } | 481 } |
| 459 | 482 |
| 460 class ResultFormattedResultsRuleResultsValueUrlBlocks { | 483 class ResultFormattedResultsRuleResultsValueUrlBlocks { |
| 461 /** Heading to be displayed with the list of URLs. */ | 484 /// Heading to be displayed with the list of URLs. |
| 462 PagespeedApiFormatStringV2 header; | 485 PagespeedApiFormatStringV2 header; |
| 463 /** | 486 |
| 464 * List of entries that provide information about URLs in the url block. | 487 /// List of entries that provide information about URLs in the url block. |
| 465 * Optional. | 488 /// Optional. |
| 466 */ | |
| 467 core.List<ResultFormattedResultsRuleResultsValueUrlBlocksUrls> urls; | 489 core.List<ResultFormattedResultsRuleResultsValueUrlBlocksUrls> urls; |
| 468 | 490 |
| 469 ResultFormattedResultsRuleResultsValueUrlBlocks(); | 491 ResultFormattedResultsRuleResultsValueUrlBlocks(); |
| 470 | 492 |
| 471 ResultFormattedResultsRuleResultsValueUrlBlocks.fromJson(core.Map _json) { | 493 ResultFormattedResultsRuleResultsValueUrlBlocks.fromJson(core.Map _json) { |
| 472 if (_json.containsKey("header")) { | 494 if (_json.containsKey("header")) { |
| 473 header = new PagespeedApiFormatStringV2.fromJson(_json["header"]); | 495 header = new PagespeedApiFormatStringV2.fromJson(_json["header"]); |
| 474 } | 496 } |
| 475 if (_json.containsKey("urls")) { | 497 if (_json.containsKey("urls")) { |
| 476 urls = _json["urls"].map((value) => new ResultFormattedResultsRuleResultsV
alueUrlBlocksUrls.fromJson(value)).toList(); | 498 urls = _json["urls"] |
| 499 .map((value) => |
| 500 new ResultFormattedResultsRuleResultsValueUrlBlocksUrls.fromJson( |
| 501 value)) |
| 502 .toList(); |
| 477 } | 503 } |
| 478 } | 504 } |
| 479 | 505 |
| 480 core.Map<core.String, core.Object> toJson() { | 506 core.Map<core.String, core.Object> toJson() { |
| 481 final core.Map<core.String, core.Object> _json = new core.Map<core.String, c
ore.Object>(); | 507 final core.Map<core.String, core.Object> _json = |
| 508 new core.Map<core.String, core.Object>(); |
| 482 if (header != null) { | 509 if (header != null) { |
| 483 _json["header"] = (header).toJson(); | 510 _json["header"] = (header).toJson(); |
| 484 } | 511 } |
| 485 if (urls != null) { | 512 if (urls != null) { |
| 486 _json["urls"] = urls.map((value) => (value).toJson()).toList(); | 513 _json["urls"] = urls.map((value) => (value).toJson()).toList(); |
| 487 } | 514 } |
| 488 return _json; | 515 return _json; |
| 489 } | 516 } |
| 490 } | 517 } |
| 491 | 518 |
| 492 /** | 519 /// The enum-like identifier for this rule. For instance "EnableKeepAlive" or |
| 493 * The enum-like identifier for this rule. For instance "EnableKeepAlive" or | 520 /// "AvoidCssImport". Not localized. |
| 494 * "AvoidCssImport". Not localized. | |
| 495 */ | |
| 496 class ResultFormattedResultsRuleResultsValue { | 521 class ResultFormattedResultsRuleResultsValue { |
| 497 /** | 522 /// List of rule groups that this rule belongs to. Each entry in the list is |
| 498 * List of rule groups that this rule belongs to. Each entry in the list is | 523 /// one of "SPEED" or "USABILITY". |
| 499 * one of "SPEED" or "USABILITY". | |
| 500 */ | |
| 501 core.List<core.String> groups; | 524 core.List<core.String> groups; |
| 502 /** Localized name of the rule, intended for presentation to a user. */ | 525 |
| 526 /// Localized name of the rule, intended for presentation to a user. |
| 503 core.String localizedRuleName; | 527 core.String localizedRuleName; |
| 504 /** | 528 |
| 505 * The impact (unbounded floating point value) that implementing the | 529 /// The impact (unbounded floating point value) that implementing the |
| 506 * suggestions for this rule would have on making the page faster. Impact is | 530 /// suggestions for this rule would have on making the page faster. Impact is |
| 507 * comparable between rules to determine which rule's suggestions would have a | 531 /// comparable between rules to determine which rule's suggestions would have |
| 508 * higher or lower impact on making a page faster. For instance, if enabling | 532 /// a higher or lower impact on making a page faster. For instance, if |
| 509 * compression would save 1MB, while optimizing images would save 500kB, the | 533 /// enabling compression would save 1MB, while optimizing images would save |
| 510 * enable compression rule would have 2x the impact of the image optimization | 534 /// 500kB, the enable compression rule would have 2x the impact of the image |
| 511 * rule, all other things being equal. | 535 /// optimization rule, all other things being equal. |
| 512 */ | |
| 513 core.double ruleImpact; | 536 core.double ruleImpact; |
| 514 /** | 537 |
| 515 * A brief summary description for the rule, indicating at a high level what | 538 /// A brief summary description for the rule, indicating at a high level what |
| 516 * should be done to follow the rule and what benefit can be gained by doing | 539 /// should be done to follow the rule and what benefit can be gained by doing |
| 517 * so. | 540 /// so. |
| 518 */ | |
| 519 PagespeedApiFormatStringV2 summary; | 541 PagespeedApiFormatStringV2 summary; |
| 520 /** | 542 |
| 521 * List of blocks of URLs. Each block may contain a heading and a list of | 543 /// List of blocks of URLs. Each block may contain a heading and a list of |
| 522 * URLs. Each URL may optionally include additional details. | 544 /// URLs. Each URL may optionally include additional details. |
| 523 */ | |
| 524 core.List<ResultFormattedResultsRuleResultsValueUrlBlocks> urlBlocks; | 545 core.List<ResultFormattedResultsRuleResultsValueUrlBlocks> urlBlocks; |
| 525 | 546 |
| 526 ResultFormattedResultsRuleResultsValue(); | 547 ResultFormattedResultsRuleResultsValue(); |
| 527 | 548 |
| 528 ResultFormattedResultsRuleResultsValue.fromJson(core.Map _json) { | 549 ResultFormattedResultsRuleResultsValue.fromJson(core.Map _json) { |
| 529 if (_json.containsKey("groups")) { | 550 if (_json.containsKey("groups")) { |
| 530 groups = _json["groups"]; | 551 groups = _json["groups"]; |
| 531 } | 552 } |
| 532 if (_json.containsKey("localizedRuleName")) { | 553 if (_json.containsKey("localizedRuleName")) { |
| 533 localizedRuleName = _json["localizedRuleName"]; | 554 localizedRuleName = _json["localizedRuleName"]; |
| 534 } | 555 } |
| 535 if (_json.containsKey("ruleImpact")) { | 556 if (_json.containsKey("ruleImpact")) { |
| 536 ruleImpact = _json["ruleImpact"]; | 557 ruleImpact = _json["ruleImpact"]; |
| 537 } | 558 } |
| 538 if (_json.containsKey("summary")) { | 559 if (_json.containsKey("summary")) { |
| 539 summary = new PagespeedApiFormatStringV2.fromJson(_json["summary"]); | 560 summary = new PagespeedApiFormatStringV2.fromJson(_json["summary"]); |
| 540 } | 561 } |
| 541 if (_json.containsKey("urlBlocks")) { | 562 if (_json.containsKey("urlBlocks")) { |
| 542 urlBlocks = _json["urlBlocks"].map((value) => new ResultFormattedResultsRu
leResultsValueUrlBlocks.fromJson(value)).toList(); | 563 urlBlocks = _json["urlBlocks"] |
| 564 .map((value) => |
| 565 new ResultFormattedResultsRuleResultsValueUrlBlocks.fromJson( |
| 566 value)) |
| 567 .toList(); |
| 543 } | 568 } |
| 544 } | 569 } |
| 545 | 570 |
| 546 core.Map<core.String, core.Object> toJson() { | 571 core.Map<core.String, core.Object> toJson() { |
| 547 final core.Map<core.String, core.Object> _json = new core.Map<core.String, c
ore.Object>(); | 572 final core.Map<core.String, core.Object> _json = |
| 573 new core.Map<core.String, core.Object>(); |
| 548 if (groups != null) { | 574 if (groups != null) { |
| 549 _json["groups"] = groups; | 575 _json["groups"] = groups; |
| 550 } | 576 } |
| 551 if (localizedRuleName != null) { | 577 if (localizedRuleName != null) { |
| 552 _json["localizedRuleName"] = localizedRuleName; | 578 _json["localizedRuleName"] = localizedRuleName; |
| 553 } | 579 } |
| 554 if (ruleImpact != null) { | 580 if (ruleImpact != null) { |
| 555 _json["ruleImpact"] = ruleImpact; | 581 _json["ruleImpact"] = ruleImpact; |
| 556 } | 582 } |
| 557 if (summary != null) { | 583 if (summary != null) { |
| 558 _json["summary"] = (summary).toJson(); | 584 _json["summary"] = (summary).toJson(); |
| 559 } | 585 } |
| 560 if (urlBlocks != null) { | 586 if (urlBlocks != null) { |
| 561 _json["urlBlocks"] = urlBlocks.map((value) => (value).toJson()).toList(); | 587 _json["urlBlocks"] = urlBlocks.map((value) => (value).toJson()).toList(); |
| 562 } | 588 } |
| 563 return _json; | 589 return _json; |
| 564 } | 590 } |
| 565 } | 591 } |
| 566 | 592 |
| 567 /** | 593 /// Localized PageSpeed results. Contains a ruleResults entry for each |
| 568 * Localized PageSpeed results. Contains a ruleResults entry for each PageSpeed | 594 /// PageSpeed rule instantiated and run by the server. |
| 569 * rule instantiated and run by the server. | |
| 570 */ | |
| 571 class ResultFormattedResults { | 595 class ResultFormattedResults { |
| 572 /** The locale of the formattedResults, e.g. "en_US". */ | 596 /// The locale of the formattedResults, e.g. "en_US". |
| 573 core.String locale; | 597 core.String locale; |
| 574 /** | 598 |
| 575 * Dictionary of formatted rule results, with one entry for each PageSpeed | 599 /// Dictionary of formatted rule results, with one entry for each PageSpeed |
| 576 * rule instantiated and run by the server. | 600 /// rule instantiated and run by the server. |
| 577 */ | |
| 578 core.Map<core.String, ResultFormattedResultsRuleResultsValue> ruleResults; | 601 core.Map<core.String, ResultFormattedResultsRuleResultsValue> ruleResults; |
| 579 | 602 |
| 580 ResultFormattedResults(); | 603 ResultFormattedResults(); |
| 581 | 604 |
| 582 ResultFormattedResults.fromJson(core.Map _json) { | 605 ResultFormattedResults.fromJson(core.Map _json) { |
| 583 if (_json.containsKey("locale")) { | 606 if (_json.containsKey("locale")) { |
| 584 locale = _json["locale"]; | 607 locale = _json["locale"]; |
| 585 } | 608 } |
| 586 if (_json.containsKey("ruleResults")) { | 609 if (_json.containsKey("ruleResults")) { |
| 587 ruleResults = commons.mapMap<core.Map<core.String, core.Object>, ResultFor
mattedResultsRuleResultsValue>(_json["ruleResults"], (core.Map<core.String, core
.Object> item) => new ResultFormattedResultsRuleResultsValue.fromJson(item)); | 610 ruleResults = commons.mapMap<core.Map<core.String, core.Object>, |
| 611 ResultFormattedResultsRuleResultsValue>( |
| 612 _json["ruleResults"], |
| 613 (core.Map<core.String, core.Object> item) => |
| 614 new ResultFormattedResultsRuleResultsValue.fromJson(item)); |
| 588 } | 615 } |
| 589 } | 616 } |
| 590 | 617 |
| 591 core.Map<core.String, core.Object> toJson() { | 618 core.Map<core.String, core.Object> toJson() { |
| 592 final core.Map<core.String, core.Object> _json = new core.Map<core.String, c
ore.Object>(); | 619 final core.Map<core.String, core.Object> _json = |
| 620 new core.Map<core.String, core.Object>(); |
| 593 if (locale != null) { | 621 if (locale != null) { |
| 594 _json["locale"] = locale; | 622 _json["locale"] = locale; |
| 595 } | 623 } |
| 596 if (ruleResults != null) { | 624 if (ruleResults != null) { |
| 597 _json["ruleResults"] = commons.mapMap<ResultFormattedResultsRuleResultsVal
ue, core.Map<core.String, core.Object>>(ruleResults, (ResultFormattedResultsRule
ResultsValue item) => (item).toJson()); | 625 _json["ruleResults"] = commons.mapMap< |
| 626 ResultFormattedResultsRuleResultsValue, |
| 627 core.Map<core.String, core.Object>>(ruleResults, |
| 628 (ResultFormattedResultsRuleResultsValue item) => (item).toJson()); |
| 598 } | 629 } |
| 599 return _json; | 630 return _json; |
| 600 } | 631 } |
| 601 } | 632 } |
| 602 | 633 |
| 603 /** | 634 /// Summary statistics for the page, such as number of JavaScript bytes, number |
| 604 * Summary statistics for the page, such as number of JavaScript bytes, number | 635 /// of HTML bytes, etc. |
| 605 * of HTML bytes, etc. | |
| 606 */ | |
| 607 class ResultPageStats { | 636 class ResultPageStats { |
| 608 /** Number of uncompressed response bytes for CSS resources on the page. */ | 637 /// Number of uncompressed response bytes for CSS resources on the page. |
| 609 core.String cssResponseBytes; | 638 core.String cssResponseBytes; |
| 610 /** Number of response bytes for flash resources on the page. */ | 639 |
| 640 /// Number of response bytes for flash resources on the page. |
| 611 core.String flashResponseBytes; | 641 core.String flashResponseBytes; |
| 612 /** | 642 |
| 613 * Number of uncompressed response bytes for the main HTML document and all | 643 /// Number of uncompressed response bytes for the main HTML document and all |
| 614 * iframes on the page. | 644 /// iframes on the page. |
| 615 */ | |
| 616 core.String htmlResponseBytes; | 645 core.String htmlResponseBytes; |
| 617 /** Number of response bytes for image resources on the page. */ | 646 |
| 647 /// Number of response bytes for image resources on the page. |
| 618 core.String imageResponseBytes; | 648 core.String imageResponseBytes; |
| 619 /** Number of uncompressed response bytes for JS resources on the page. */ | 649 |
| 650 /// Number of uncompressed response bytes for JS resources on the page. |
| 620 core.String javascriptResponseBytes; | 651 core.String javascriptResponseBytes; |
| 621 /** Number of CSS resources referenced by the page. */ | 652 |
| 653 /// Number of CSS resources referenced by the page. |
| 622 core.int numberCssResources; | 654 core.int numberCssResources; |
| 623 /** Number of unique hosts referenced by the page. */ | 655 |
| 656 /// Number of unique hosts referenced by the page. |
| 624 core.int numberHosts; | 657 core.int numberHosts; |
| 625 /** Number of JavaScript resources referenced by the page. */ | 658 |
| 659 /// Number of JavaScript resources referenced by the page. |
| 626 core.int numberJsResources; | 660 core.int numberJsResources; |
| 627 /** Number of HTTP resources loaded by the page. */ | 661 |
| 662 /// Number of HTTP resources loaded by the page. |
| 628 core.int numberResources; | 663 core.int numberResources; |
| 629 /** Number of static (i.e. cacheable) resources on the page. */ | 664 |
| 665 /// Number of static (i.e. cacheable) resources on the page. |
| 630 core.int numberStaticResources; | 666 core.int numberStaticResources; |
| 631 /** Number of response bytes for other resources on the page. */ | 667 |
| 668 /// Number of response bytes for other resources on the page. |
| 632 core.String otherResponseBytes; | 669 core.String otherResponseBytes; |
| 633 /** | 670 |
| 634 * Number of uncompressed response bytes for text resources not covered by | 671 /// Number of uncompressed response bytes for text resources not covered by |
| 635 * other statistics (i.e non-HTML, non-script, non-CSS resources) on the page. | 672 /// other statistics (i.e non-HTML, non-script, non-CSS resources) on the |
| 636 */ | 673 /// page. |
| 637 core.String textResponseBytes; | 674 core.String textResponseBytes; |
| 638 /** Total size of all request bytes sent by the page. */ | 675 |
| 676 /// Total size of all request bytes sent by the page. |
| 639 core.String totalRequestBytes; | 677 core.String totalRequestBytes; |
| 640 | 678 |
| 641 ResultPageStats(); | 679 ResultPageStats(); |
| 642 | 680 |
| 643 ResultPageStats.fromJson(core.Map _json) { | 681 ResultPageStats.fromJson(core.Map _json) { |
| 644 if (_json.containsKey("cssResponseBytes")) { | 682 if (_json.containsKey("cssResponseBytes")) { |
| 645 cssResponseBytes = _json["cssResponseBytes"]; | 683 cssResponseBytes = _json["cssResponseBytes"]; |
| 646 } | 684 } |
| 647 if (_json.containsKey("flashResponseBytes")) { | 685 if (_json.containsKey("flashResponseBytes")) { |
| 648 flashResponseBytes = _json["flashResponseBytes"]; | 686 flashResponseBytes = _json["flashResponseBytes"]; |
| (...skipping 27 matching lines...) Expand all Loading... |
| 676 } | 714 } |
| 677 if (_json.containsKey("textResponseBytes")) { | 715 if (_json.containsKey("textResponseBytes")) { |
| 678 textResponseBytes = _json["textResponseBytes"]; | 716 textResponseBytes = _json["textResponseBytes"]; |
| 679 } | 717 } |
| 680 if (_json.containsKey("totalRequestBytes")) { | 718 if (_json.containsKey("totalRequestBytes")) { |
| 681 totalRequestBytes = _json["totalRequestBytes"]; | 719 totalRequestBytes = _json["totalRequestBytes"]; |
| 682 } | 720 } |
| 683 } | 721 } |
| 684 | 722 |
| 685 core.Map<core.String, core.Object> toJson() { | 723 core.Map<core.String, core.Object> toJson() { |
| 686 final core.Map<core.String, core.Object> _json = new core.Map<core.String, c
ore.Object>(); | 724 final core.Map<core.String, core.Object> _json = |
| 725 new core.Map<core.String, core.Object>(); |
| 687 if (cssResponseBytes != null) { | 726 if (cssResponseBytes != null) { |
| 688 _json["cssResponseBytes"] = cssResponseBytes; | 727 _json["cssResponseBytes"] = cssResponseBytes; |
| 689 } | 728 } |
| 690 if (flashResponseBytes != null) { | 729 if (flashResponseBytes != null) { |
| 691 _json["flashResponseBytes"] = flashResponseBytes; | 730 _json["flashResponseBytes"] = flashResponseBytes; |
| 692 } | 731 } |
| 693 if (htmlResponseBytes != null) { | 732 if (htmlResponseBytes != null) { |
| 694 _json["htmlResponseBytes"] = htmlResponseBytes; | 733 _json["htmlResponseBytes"] = htmlResponseBytes; |
| 695 } | 734 } |
| 696 if (imageResponseBytes != null) { | 735 if (imageResponseBytes != null) { |
| (...skipping 23 matching lines...) Expand all Loading... |
| 720 if (textResponseBytes != null) { | 759 if (textResponseBytes != null) { |
| 721 _json["textResponseBytes"] = textResponseBytes; | 760 _json["textResponseBytes"] = textResponseBytes; |
| 722 } | 761 } |
| 723 if (totalRequestBytes != null) { | 762 if (totalRequestBytes != null) { |
| 724 _json["totalRequestBytes"] = totalRequestBytes; | 763 _json["totalRequestBytes"] = totalRequestBytes; |
| 725 } | 764 } |
| 726 return _json; | 765 return _json; |
| 727 } | 766 } |
| 728 } | 767 } |
| 729 | 768 |
| 730 /** The name of this rule group: one of "SPEED" or "USABILITY". */ | 769 /// The name of this rule group: one of "SPEED" or "USABILITY". |
| 731 class ResultRuleGroupsValue { | 770 class ResultRuleGroupsValue { |
| 732 /** | 771 /// The score (0-100) for this rule group, which indicates how much better a |
| 733 * The score (0-100) for this rule group, which indicates how much better a | 772 /// page could be in that category (e.g. how much faster, or how much more |
| 734 * page could be in that category (e.g. how much faster, or how much more | 773 /// usable). A high score indicates little room for improvement, while a |
| 735 * usable). A high score indicates little room for improvement, while a lower | 774 /// lower score indicates more room for improvement. |
| 736 * score indicates more room for improvement. | |
| 737 */ | |
| 738 core.int score; | 775 core.int score; |
| 739 | 776 |
| 740 ResultRuleGroupsValue(); | 777 ResultRuleGroupsValue(); |
| 741 | 778 |
| 742 ResultRuleGroupsValue.fromJson(core.Map _json) { | 779 ResultRuleGroupsValue.fromJson(core.Map _json) { |
| 743 if (_json.containsKey("score")) { | 780 if (_json.containsKey("score")) { |
| 744 score = _json["score"]; | 781 score = _json["score"]; |
| 745 } | 782 } |
| 746 } | 783 } |
| 747 | 784 |
| 748 core.Map<core.String, core.Object> toJson() { | 785 core.Map<core.String, core.Object> toJson() { |
| 749 final core.Map<core.String, core.Object> _json = new core.Map<core.String, c
ore.Object>(); | 786 final core.Map<core.String, core.Object> _json = |
| 787 new core.Map<core.String, core.Object>(); |
| 750 if (score != null) { | 788 if (score != null) { |
| 751 _json["score"] = score; | 789 _json["score"] = score; |
| 752 } | 790 } |
| 753 return _json; | 791 return _json; |
| 754 } | 792 } |
| 755 } | 793 } |
| 756 | 794 |
| 757 /** The version of PageSpeed used to generate these results. */ | 795 /// The version of PageSpeed used to generate these results. |
| 758 class ResultVersion { | 796 class ResultVersion { |
| 759 /** The major version number of PageSpeed used to generate these results. */ | 797 /// The major version number of PageSpeed used to generate these results. |
| 760 core.int major; | 798 core.int major; |
| 761 /** The minor version number of PageSpeed used to generate these results. */ | 799 |
| 800 /// The minor version number of PageSpeed used to generate these results. |
| 762 core.int minor; | 801 core.int minor; |
| 763 | 802 |
| 764 ResultVersion(); | 803 ResultVersion(); |
| 765 | 804 |
| 766 ResultVersion.fromJson(core.Map _json) { | 805 ResultVersion.fromJson(core.Map _json) { |
| 767 if (_json.containsKey("major")) { | 806 if (_json.containsKey("major")) { |
| 768 major = _json["major"]; | 807 major = _json["major"]; |
| 769 } | 808 } |
| 770 if (_json.containsKey("minor")) { | 809 if (_json.containsKey("minor")) { |
| 771 minor = _json["minor"]; | 810 minor = _json["minor"]; |
| 772 } | 811 } |
| 773 } | 812 } |
| 774 | 813 |
| 775 core.Map<core.String, core.Object> toJson() { | 814 core.Map<core.String, core.Object> toJson() { |
| 776 final core.Map<core.String, core.Object> _json = new core.Map<core.String, c
ore.Object>(); | 815 final core.Map<core.String, core.Object> _json = |
| 816 new core.Map<core.String, core.Object>(); |
| 777 if (major != null) { | 817 if (major != null) { |
| 778 _json["major"] = major; | 818 _json["major"] = major; |
| 779 } | 819 } |
| 780 if (minor != null) { | 820 if (minor != null) { |
| 781 _json["minor"] = minor; | 821 _json["minor"] = minor; |
| 782 } | 822 } |
| 783 return _json; | 823 return _json; |
| 784 } | 824 } |
| 785 } | 825 } |
| 786 | 826 |
| 787 class Result { | 827 class Result { |
| 788 /** | 828 /// Localized PageSpeed results. Contains a ruleResults entry for each |
| 789 * Localized PageSpeed results. Contains a ruleResults entry for each | 829 /// PageSpeed rule instantiated and run by the server. |
| 790 * PageSpeed rule instantiated and run by the server. | |
| 791 */ | |
| 792 ResultFormattedResults formattedResults; | 830 ResultFormattedResults formattedResults; |
| 793 /** | 831 |
| 794 * Canonicalized and final URL for the document, after following page | 832 /// Canonicalized and final URL for the document, after following page |
| 795 * redirects (if any). | 833 /// redirects (if any). |
| 796 */ | |
| 797 core.String id; | 834 core.String id; |
| 798 /** | 835 |
| 799 * List of rules that were specified in the request, but which the server did | 836 /// List of rules that were specified in the request, but which the server |
| 800 * not know how to instantiate. | 837 /// did not know how to instantiate. |
| 801 */ | |
| 802 core.List<core.String> invalidRules; | 838 core.List<core.String> invalidRules; |
| 803 /** Kind of result. */ | 839 |
| 840 /// Kind of result. |
| 804 core.String kind; | 841 core.String kind; |
| 805 /** | 842 |
| 806 * Summary statistics for the page, such as number of JavaScript bytes, number | 843 /// Summary statistics for the page, such as number of JavaScript bytes, |
| 807 * of HTML bytes, etc. | 844 /// number of HTML bytes, etc. |
| 808 */ | |
| 809 ResultPageStats pageStats; | 845 ResultPageStats pageStats; |
| 810 /** | 846 |
| 811 * Response code for the document. 200 indicates a normal page load. 4xx/5xx | 847 /// Response code for the document. 200 indicates a normal page load. 4xx/5xx |
| 812 * indicates an error. | 848 /// indicates an error. |
| 813 */ | |
| 814 core.int responseCode; | 849 core.int responseCode; |
| 815 /** A map with one entry for each rule group in these results. */ | 850 |
| 851 /// A map with one entry for each rule group in these results. |
| 816 core.Map<core.String, ResultRuleGroupsValue> ruleGroups; | 852 core.Map<core.String, ResultRuleGroupsValue> ruleGroups; |
| 817 /** Base64-encoded screenshot of the page that was analyzed. */ | 853 |
| 854 /// Base64-encoded screenshot of the page that was analyzed. |
| 818 PagespeedApiImageV2 screenshot; | 855 PagespeedApiImageV2 screenshot; |
| 819 /** Title of the page, as displayed in the browser's title bar. */ | 856 |
| 857 /// Title of the page, as displayed in the browser's title bar. |
| 820 core.String title; | 858 core.String title; |
| 821 /** The version of PageSpeed used to generate these results. */ | 859 |
| 860 /// The version of PageSpeed used to generate these results. |
| 822 ResultVersion version; | 861 ResultVersion version; |
| 823 | 862 |
| 824 Result(); | 863 Result(); |
| 825 | 864 |
| 826 Result.fromJson(core.Map _json) { | 865 Result.fromJson(core.Map _json) { |
| 827 if (_json.containsKey("formattedResults")) { | 866 if (_json.containsKey("formattedResults")) { |
| 828 formattedResults = new ResultFormattedResults.fromJson(_json["formattedRes
ults"]); | 867 formattedResults = |
| 868 new ResultFormattedResults.fromJson(_json["formattedResults"]); |
| 829 } | 869 } |
| 830 if (_json.containsKey("id")) { | 870 if (_json.containsKey("id")) { |
| 831 id = _json["id"]; | 871 id = _json["id"]; |
| 832 } | 872 } |
| 833 if (_json.containsKey("invalidRules")) { | 873 if (_json.containsKey("invalidRules")) { |
| 834 invalidRules = _json["invalidRules"]; | 874 invalidRules = _json["invalidRules"]; |
| 835 } | 875 } |
| 836 if (_json.containsKey("kind")) { | 876 if (_json.containsKey("kind")) { |
| 837 kind = _json["kind"]; | 877 kind = _json["kind"]; |
| 838 } | 878 } |
| 839 if (_json.containsKey("pageStats")) { | 879 if (_json.containsKey("pageStats")) { |
| 840 pageStats = new ResultPageStats.fromJson(_json["pageStats"]); | 880 pageStats = new ResultPageStats.fromJson(_json["pageStats"]); |
| 841 } | 881 } |
| 842 if (_json.containsKey("responseCode")) { | 882 if (_json.containsKey("responseCode")) { |
| 843 responseCode = _json["responseCode"]; | 883 responseCode = _json["responseCode"]; |
| 844 } | 884 } |
| 845 if (_json.containsKey("ruleGroups")) { | 885 if (_json.containsKey("ruleGroups")) { |
| 846 ruleGroups = commons.mapMap<core.Map<core.String, core.Object>, ResultRule
GroupsValue>(_json["ruleGroups"], (core.Map<core.String, core.Object> item) => n
ew ResultRuleGroupsValue.fromJson(item)); | 886 ruleGroups = commons |
| 887 .mapMap<core.Map<core.String, core.Object>, ResultRuleGroupsValue>( |
| 888 _json["ruleGroups"], |
| 889 (core.Map<core.String, core.Object> item) => |
| 890 new ResultRuleGroupsValue.fromJson(item)); |
| 847 } | 891 } |
| 848 if (_json.containsKey("screenshot")) { | 892 if (_json.containsKey("screenshot")) { |
| 849 screenshot = new PagespeedApiImageV2.fromJson(_json["screenshot"]); | 893 screenshot = new PagespeedApiImageV2.fromJson(_json["screenshot"]); |
| 850 } | 894 } |
| 851 if (_json.containsKey("title")) { | 895 if (_json.containsKey("title")) { |
| 852 title = _json["title"]; | 896 title = _json["title"]; |
| 853 } | 897 } |
| 854 if (_json.containsKey("version")) { | 898 if (_json.containsKey("version")) { |
| 855 version = new ResultVersion.fromJson(_json["version"]); | 899 version = new ResultVersion.fromJson(_json["version"]); |
| 856 } | 900 } |
| 857 } | 901 } |
| 858 | 902 |
| 859 core.Map<core.String, core.Object> toJson() { | 903 core.Map<core.String, core.Object> toJson() { |
| 860 final core.Map<core.String, core.Object> _json = new core.Map<core.String, c
ore.Object>(); | 904 final core.Map<core.String, core.Object> _json = |
| 905 new core.Map<core.String, core.Object>(); |
| 861 if (formattedResults != null) { | 906 if (formattedResults != null) { |
| 862 _json["formattedResults"] = (formattedResults).toJson(); | 907 _json["formattedResults"] = (formattedResults).toJson(); |
| 863 } | 908 } |
| 864 if (id != null) { | 909 if (id != null) { |
| 865 _json["id"] = id; | 910 _json["id"] = id; |
| 866 } | 911 } |
| 867 if (invalidRules != null) { | 912 if (invalidRules != null) { |
| 868 _json["invalidRules"] = invalidRules; | 913 _json["invalidRules"] = invalidRules; |
| 869 } | 914 } |
| 870 if (kind != null) { | 915 if (kind != null) { |
| 871 _json["kind"] = kind; | 916 _json["kind"] = kind; |
| 872 } | 917 } |
| 873 if (pageStats != null) { | 918 if (pageStats != null) { |
| 874 _json["pageStats"] = (pageStats).toJson(); | 919 _json["pageStats"] = (pageStats).toJson(); |
| 875 } | 920 } |
| 876 if (responseCode != null) { | 921 if (responseCode != null) { |
| 877 _json["responseCode"] = responseCode; | 922 _json["responseCode"] = responseCode; |
| 878 } | 923 } |
| 879 if (ruleGroups != null) { | 924 if (ruleGroups != null) { |
| 880 _json["ruleGroups"] = commons.mapMap<ResultRuleGroupsValue, core.Map<core.
String, core.Object>>(ruleGroups, (ResultRuleGroupsValue item) => (item).toJson(
)); | 925 _json["ruleGroups"] = commons |
| 926 .mapMap<ResultRuleGroupsValue, core.Map<core.String, core.Object>>( |
| 927 ruleGroups, (ResultRuleGroupsValue item) => (item).toJson()); |
| 881 } | 928 } |
| 882 if (screenshot != null) { | 929 if (screenshot != null) { |
| 883 _json["screenshot"] = (screenshot).toJson(); | 930 _json["screenshot"] = (screenshot).toJson(); |
| 884 } | 931 } |
| 885 if (title != null) { | 932 if (title != null) { |
| 886 _json["title"] = title; | 933 _json["title"] = title; |
| 887 } | 934 } |
| 888 if (version != null) { | 935 if (version != null) { |
| 889 _json["version"] = (version).toJson(); | 936 _json["version"] = (version).toJson(); |
| 890 } | 937 } |
| 891 return _json; | 938 return _json; |
| 892 } | 939 } |
| 893 } | 940 } |
| OLD | NEW |