| 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.v1; | 3 library googleapis.pagespeedonline.v1; |
| 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/v1'; | 15 const core.String USER_AGENT = 'dart-api-client pagespeedonline/v1'; |
| 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/v1/"}) : | 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/v1/"}) |
| 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 a |
| 39 * Runs PageSpeed analysis on the page at the specified URL, and returns a | 38 /// PageSpeed score, a list of suggestions to make that page faster, and |
| 40 * PageSpeed score, 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 ResultFormattedResultsRuleResultsValueUrlBlocksHeaderArgs { |
| 118 /// Type of argument. One of URL, STRING_LITERAL, INT_LITERAL, BYTES, or |
| 119 /// DURATION. |
| 120 core.String type; |
| 115 | 121 |
| 116 | 122 /// Argument value, as a localized string. |
| 117 class ResultFormattedResultsRuleResultsValueUrlBlocksHeaderArgs { | |
| 118 /** | |
| 119 * Type of argument. One of URL, STRING_LITERAL, INT_LITERAL, BYTES, or | |
| 120 * DURATION. | |
| 121 */ | |
| 122 core.String type; | |
| 123 /** Argument value, as a localized string. */ | |
| 124 core.String value; | 123 core.String value; |
| 125 | 124 |
| 126 ResultFormattedResultsRuleResultsValueUrlBlocksHeaderArgs(); | 125 ResultFormattedResultsRuleResultsValueUrlBlocksHeaderArgs(); |
| 127 | 126 |
| 128 ResultFormattedResultsRuleResultsValueUrlBlocksHeaderArgs.fromJson(core.Map _j
son) { | 127 ResultFormattedResultsRuleResultsValueUrlBlocksHeaderArgs.fromJson( |
| 128 core.Map _json) { |
| 129 if (_json.containsKey("type")) { | 129 if (_json.containsKey("type")) { |
| 130 type = _json["type"]; | 130 type = _json["type"]; |
| 131 } | 131 } |
| 132 if (_json.containsKey("value")) { | 132 if (_json.containsKey("value")) { |
| 133 value = _json["value"]; | 133 value = _json["value"]; |
| 134 } | 134 } |
| 135 } | 135 } |
| 136 | 136 |
| 137 core.Map<core.String, core.Object> toJson() { | 137 core.Map<core.String, core.Object> toJson() { |
| 138 final core.Map<core.String, core.Object> _json = new core.Map<core.String, c
ore.Object>(); | 138 final core.Map<core.String, core.Object> _json = |
| 139 new core.Map<core.String, core.Object>(); |
| 139 if (type != null) { | 140 if (type != null) { |
| 140 _json["type"] = type; | 141 _json["type"] = type; |
| 141 } | 142 } |
| 142 if (value != null) { | 143 if (value != null) { |
| 143 _json["value"] = value; | 144 _json["value"] = value; |
| 144 } | 145 } |
| 145 return _json; | 146 return _json; |
| 146 } | 147 } |
| 147 } | 148 } |
| 148 | 149 |
| 149 /** Heading to be displayed with the list of URLs. */ | 150 /// Heading to be displayed with the list of URLs. |
| 150 class ResultFormattedResultsRuleResultsValueUrlBlocksHeader { | 151 class ResultFormattedResultsRuleResultsValueUrlBlocksHeader { |
| 151 /** List of arguments for the format string. */ | 152 /// List of arguments for the format string. |
| 152 core.List<ResultFormattedResultsRuleResultsValueUrlBlocksHeaderArgs> args; | 153 core.List<ResultFormattedResultsRuleResultsValueUrlBlocksHeaderArgs> args; |
| 153 /** | 154 |
| 154 * A localized format string with $N placeholders, where N is the 1-indexed | 155 /// A localized format string with $N placeholders, where N is the 1-indexed |
| 155 * argument number, e.g. 'Minifying the following $1 resources would save a | 156 /// argument number, e.g. 'Minifying the following $1 resources would save a |
| 156 * total of $2 bytes'. | 157 /// total of $2 bytes'. |
| 157 */ | |
| 158 core.String format; | 158 core.String format; |
| 159 | 159 |
| 160 ResultFormattedResultsRuleResultsValueUrlBlocksHeader(); | 160 ResultFormattedResultsRuleResultsValueUrlBlocksHeader(); |
| 161 | 161 |
| 162 ResultFormattedResultsRuleResultsValueUrlBlocksHeader.fromJson(core.Map _json)
{ | 162 ResultFormattedResultsRuleResultsValueUrlBlocksHeader.fromJson( |
| 163 core.Map _json) { |
| 163 if (_json.containsKey("args")) { | 164 if (_json.containsKey("args")) { |
| 164 args = _json["args"].map((value) => new ResultFormattedResultsRuleResultsV
alueUrlBlocksHeaderArgs.fromJson(value)).toList(); | 165 args = _json["args"] |
| 166 .map((value) => |
| 167 new ResultFormattedResultsRuleResultsValueUrlBlocksHeaderArgs |
| 168 .fromJson(value)) |
| 169 .toList(); |
| 165 } | 170 } |
| 166 if (_json.containsKey("format")) { | 171 if (_json.containsKey("format")) { |
| 167 format = _json["format"]; | 172 format = _json["format"]; |
| 168 } | 173 } |
| 169 } | 174 } |
| 170 | 175 |
| 171 core.Map<core.String, core.Object> toJson() { | 176 core.Map<core.String, core.Object> toJson() { |
| 172 final core.Map<core.String, core.Object> _json = new core.Map<core.String, c
ore.Object>(); | 177 final core.Map<core.String, core.Object> _json = |
| 178 new core.Map<core.String, core.Object>(); |
| 173 if (args != null) { | 179 if (args != null) { |
| 174 _json["args"] = args.map((value) => (value).toJson()).toList(); | 180 _json["args"] = args.map((value) => (value).toJson()).toList(); |
| 175 } | 181 } |
| 176 if (format != null) { | 182 if (format != null) { |
| 177 _json["format"] = format; | 183 _json["format"] = format; |
| 178 } | 184 } |
| 179 return _json; | 185 return _json; |
| 180 } | 186 } |
| 181 } | 187 } |
| 182 | 188 |
| 183 class ResultFormattedResultsRuleResultsValueUrlBlocksUrlsDetailsArgs { | 189 class ResultFormattedResultsRuleResultsValueUrlBlocksUrlsDetailsArgs { |
| 184 /** | 190 /// Type of argument. One of URL, STRING_LITERAL, INT_LITERAL, BYTES, or |
| 185 * Type of argument. One of URL, STRING_LITERAL, INT_LITERAL, BYTES, or | 191 /// DURATION. |
| 186 * DURATION. | |
| 187 */ | |
| 188 core.String type; | 192 core.String type; |
| 189 /** Argument value, as a localized string. */ | 193 |
| 194 /// Argument value, as a localized string. |
| 190 core.String value; | 195 core.String value; |
| 191 | 196 |
| 192 ResultFormattedResultsRuleResultsValueUrlBlocksUrlsDetailsArgs(); | 197 ResultFormattedResultsRuleResultsValueUrlBlocksUrlsDetailsArgs(); |
| 193 | 198 |
| 194 ResultFormattedResultsRuleResultsValueUrlBlocksUrlsDetailsArgs.fromJson(core.M
ap _json) { | 199 ResultFormattedResultsRuleResultsValueUrlBlocksUrlsDetailsArgs.fromJson( |
| 200 core.Map _json) { |
| 195 if (_json.containsKey("type")) { | 201 if (_json.containsKey("type")) { |
| 196 type = _json["type"]; | 202 type = _json["type"]; |
| 197 } | 203 } |
| 198 if (_json.containsKey("value")) { | 204 if (_json.containsKey("value")) { |
| 199 value = _json["value"]; | 205 value = _json["value"]; |
| 200 } | 206 } |
| 201 } | 207 } |
| 202 | 208 |
| 203 core.Map<core.String, core.Object> toJson() { | 209 core.Map<core.String, core.Object> toJson() { |
| 204 final core.Map<core.String, core.Object> _json = new core.Map<core.String, c
ore.Object>(); | 210 final core.Map<core.String, core.Object> _json = |
| 211 new core.Map<core.String, core.Object>(); |
| 205 if (type != null) { | 212 if (type != null) { |
| 206 _json["type"] = type; | 213 _json["type"] = type; |
| 207 } | 214 } |
| 208 if (value != null) { | 215 if (value != null) { |
| 209 _json["value"] = value; | 216 _json["value"] = value; |
| 210 } | 217 } |
| 211 return _json; | 218 return _json; |
| 212 } | 219 } |
| 213 } | 220 } |
| 214 | 221 |
| 215 class ResultFormattedResultsRuleResultsValueUrlBlocksUrlsDetails { | 222 class ResultFormattedResultsRuleResultsValueUrlBlocksUrlsDetails { |
| 216 /** List of arguments for the format string. */ | 223 /// List of arguments for the format string. |
| 217 core.List<ResultFormattedResultsRuleResultsValueUrlBlocksUrlsDetailsArgs> args
; | 224 core.List<ResultFormattedResultsRuleResultsValueUrlBlocksUrlsDetailsArgs> |
| 218 /** | 225 args; |
| 219 * A localized format string with $N placeholders, where N is the 1-indexed | 226 |
| 220 * argument number, e.g. 'Unnecessary metadata for this resource adds an | 227 /// A localized format string with $N placeholders, where N is the 1-indexed |
| 221 * additional $1 bytes to its download size'. | 228 /// argument number, e.g. 'Unnecessary metadata for this resource adds an |
| 222 */ | 229 /// additional $1 bytes to its download size'. |
| 223 core.String format; | 230 core.String format; |
| 224 | 231 |
| 225 ResultFormattedResultsRuleResultsValueUrlBlocksUrlsDetails(); | 232 ResultFormattedResultsRuleResultsValueUrlBlocksUrlsDetails(); |
| 226 | 233 |
| 227 ResultFormattedResultsRuleResultsValueUrlBlocksUrlsDetails.fromJson(core.Map _
json) { | 234 ResultFormattedResultsRuleResultsValueUrlBlocksUrlsDetails.fromJson( |
| 235 core.Map _json) { |
| 228 if (_json.containsKey("args")) { | 236 if (_json.containsKey("args")) { |
| 229 args = _json["args"].map((value) => new ResultFormattedResultsRuleResultsV
alueUrlBlocksUrlsDetailsArgs.fromJson(value)).toList(); | 237 args = _json["args"] |
| 238 .map((value) => |
| 239 new ResultFormattedResultsRuleResultsValueUrlBlocksUrlsDetailsArgs |
| 240 .fromJson(value)) |
| 241 .toList(); |
| 230 } | 242 } |
| 231 if (_json.containsKey("format")) { | 243 if (_json.containsKey("format")) { |
| 232 format = _json["format"]; | 244 format = _json["format"]; |
| 233 } | 245 } |
| 234 } | 246 } |
| 235 | 247 |
| 236 core.Map<core.String, core.Object> toJson() { | 248 core.Map<core.String, core.Object> toJson() { |
| 237 final core.Map<core.String, core.Object> _json = new core.Map<core.String, c
ore.Object>(); | 249 final core.Map<core.String, core.Object> _json = |
| 250 new core.Map<core.String, core.Object>(); |
| 238 if (args != null) { | 251 if (args != null) { |
| 239 _json["args"] = args.map((value) => (value).toJson()).toList(); | 252 _json["args"] = args.map((value) => (value).toJson()).toList(); |
| 240 } | 253 } |
| 241 if (format != null) { | 254 if (format != null) { |
| 242 _json["format"] = format; | 255 _json["format"] = format; |
| 243 } | 256 } |
| 244 return _json; | 257 return _json; |
| 245 } | 258 } |
| 246 } | 259 } |
| 247 | 260 |
| 248 class ResultFormattedResultsRuleResultsValueUrlBlocksUrlsResultArgs { | 261 class ResultFormattedResultsRuleResultsValueUrlBlocksUrlsResultArgs { |
| 249 /** | 262 /// Type of argument. One of URL, STRING_LITERAL, INT_LITERAL, BYTES, or |
| 250 * Type of argument. One of URL, STRING_LITERAL, INT_LITERAL, BYTES, or | 263 /// DURATION. |
| 251 * DURATION. | |
| 252 */ | |
| 253 core.String type; | 264 core.String type; |
| 254 /** Argument value, as a localized string. */ | 265 |
| 266 /// Argument value, as a localized string. |
| 255 core.String value; | 267 core.String value; |
| 256 | 268 |
| 257 ResultFormattedResultsRuleResultsValueUrlBlocksUrlsResultArgs(); | 269 ResultFormattedResultsRuleResultsValueUrlBlocksUrlsResultArgs(); |
| 258 | 270 |
| 259 ResultFormattedResultsRuleResultsValueUrlBlocksUrlsResultArgs.fromJson(core.Ma
p _json) { | 271 ResultFormattedResultsRuleResultsValueUrlBlocksUrlsResultArgs.fromJson( |
| 272 core.Map _json) { |
| 260 if (_json.containsKey("type")) { | 273 if (_json.containsKey("type")) { |
| 261 type = _json["type"]; | 274 type = _json["type"]; |
| 262 } | 275 } |
| 263 if (_json.containsKey("value")) { | 276 if (_json.containsKey("value")) { |
| 264 value = _json["value"]; | 277 value = _json["value"]; |
| 265 } | 278 } |
| 266 } | 279 } |
| 267 | 280 |
| 268 core.Map<core.String, core.Object> toJson() { | 281 core.Map<core.String, core.Object> toJson() { |
| 269 final core.Map<core.String, core.Object> _json = new core.Map<core.String, c
ore.Object>(); | 282 final core.Map<core.String, core.Object> _json = |
| 283 new core.Map<core.String, core.Object>(); |
| 270 if (type != null) { | 284 if (type != null) { |
| 271 _json["type"] = type; | 285 _json["type"] = type; |
| 272 } | 286 } |
| 273 if (value != null) { | 287 if (value != null) { |
| 274 _json["value"] = value; | 288 _json["value"] = value; |
| 275 } | 289 } |
| 276 return _json; | 290 return _json; |
| 277 } | 291 } |
| 278 } | 292 } |
| 279 | 293 |
| 280 /** | 294 /// A format string that gives information about the URL, and a list of |
| 281 * A format string that gives information about the URL, and a list of arguments | 295 /// arguments for that format string. |
| 282 * for that format string. | |
| 283 */ | |
| 284 class ResultFormattedResultsRuleResultsValueUrlBlocksUrlsResult { | 296 class ResultFormattedResultsRuleResultsValueUrlBlocksUrlsResult { |
| 285 /** List of arguments for the format string. */ | 297 /// List of arguments for the format string. |
| 286 core.List<ResultFormattedResultsRuleResultsValueUrlBlocksUrlsResultArgs> args; | 298 core.List<ResultFormattedResultsRuleResultsValueUrlBlocksUrlsResultArgs> args; |
| 287 /** | 299 |
| 288 * A localized format string with $N placeholders, where N is the 1-indexed | 300 /// A localized format string with $N placeholders, where N is the 1-indexed |
| 289 * argument number, e.g. 'Minifying the resource at URL $1 can save $2 bytes'. | 301 /// argument number, e.g. 'Minifying the resource at URL $1 can save $2 |
| 290 */ | 302 /// bytes'. |
| 291 core.String format; | 303 core.String format; |
| 292 | 304 |
| 293 ResultFormattedResultsRuleResultsValueUrlBlocksUrlsResult(); | 305 ResultFormattedResultsRuleResultsValueUrlBlocksUrlsResult(); |
| 294 | 306 |
| 295 ResultFormattedResultsRuleResultsValueUrlBlocksUrlsResult.fromJson(core.Map _j
son) { | 307 ResultFormattedResultsRuleResultsValueUrlBlocksUrlsResult.fromJson( |
| 308 core.Map _json) { |
| 296 if (_json.containsKey("args")) { | 309 if (_json.containsKey("args")) { |
| 297 args = _json["args"].map((value) => new ResultFormattedResultsRuleResultsV
alueUrlBlocksUrlsResultArgs.fromJson(value)).toList(); | 310 args = _json["args"] |
| 311 .map((value) => |
| 312 new ResultFormattedResultsRuleResultsValueUrlBlocksUrlsResultArgs |
| 313 .fromJson(value)) |
| 314 .toList(); |
| 298 } | 315 } |
| 299 if (_json.containsKey("format")) { | 316 if (_json.containsKey("format")) { |
| 300 format = _json["format"]; | 317 format = _json["format"]; |
| 301 } | 318 } |
| 302 } | 319 } |
| 303 | 320 |
| 304 core.Map<core.String, core.Object> toJson() { | 321 core.Map<core.String, core.Object> toJson() { |
| 305 final core.Map<core.String, core.Object> _json = new core.Map<core.String, c
ore.Object>(); | 322 final core.Map<core.String, core.Object> _json = |
| 323 new core.Map<core.String, core.Object>(); |
| 306 if (args != null) { | 324 if (args != null) { |
| 307 _json["args"] = args.map((value) => (value).toJson()).toList(); | 325 _json["args"] = args.map((value) => (value).toJson()).toList(); |
| 308 } | 326 } |
| 309 if (format != null) { | 327 if (format != null) { |
| 310 _json["format"] = format; | 328 _json["format"] = format; |
| 311 } | 329 } |
| 312 return _json; | 330 return _json; |
| 313 } | 331 } |
| 314 } | 332 } |
| 315 | 333 |
| 316 class ResultFormattedResultsRuleResultsValueUrlBlocksUrls { | 334 class ResultFormattedResultsRuleResultsValueUrlBlocksUrls { |
| 317 /** | 335 /// List of entries that provide additional details about a single URL. |
| 318 * List of entries that provide additional details about a single URL. | 336 /// Optional. |
| 319 * Optional. | |
| 320 */ | |
| 321 core.List<ResultFormattedResultsRuleResultsValueUrlBlocksUrlsDetails> details; | 337 core.List<ResultFormattedResultsRuleResultsValueUrlBlocksUrlsDetails> details; |
| 322 /** | 338 |
| 323 * A format string that gives information about the URL, and a list of | 339 /// A format string that gives information about the URL, and a list of |
| 324 * arguments for that format string. | 340 /// arguments for that format string. |
| 325 */ | |
| 326 ResultFormattedResultsRuleResultsValueUrlBlocksUrlsResult result; | 341 ResultFormattedResultsRuleResultsValueUrlBlocksUrlsResult result; |
| 327 | 342 |
| 328 ResultFormattedResultsRuleResultsValueUrlBlocksUrls(); | 343 ResultFormattedResultsRuleResultsValueUrlBlocksUrls(); |
| 329 | 344 |
| 330 ResultFormattedResultsRuleResultsValueUrlBlocksUrls.fromJson(core.Map _json) { | 345 ResultFormattedResultsRuleResultsValueUrlBlocksUrls.fromJson(core.Map _json) { |
| 331 if (_json.containsKey("details")) { | 346 if (_json.containsKey("details")) { |
| 332 details = _json["details"].map((value) => new ResultFormattedResultsRuleRe
sultsValueUrlBlocksUrlsDetails.fromJson(value)).toList(); | 347 details = _json["details"] |
| 348 .map((value) => |
| 349 new ResultFormattedResultsRuleResultsValueUrlBlocksUrlsDetails |
| 350 .fromJson(value)) |
| 351 .toList(); |
| 333 } | 352 } |
| 334 if (_json.containsKey("result")) { | 353 if (_json.containsKey("result")) { |
| 335 result = new ResultFormattedResultsRuleResultsValueUrlBlocksUrlsResult.fro
mJson(_json["result"]); | 354 result = new ResultFormattedResultsRuleResultsValueUrlBlocksUrlsResult |
| 355 .fromJson(_json["result"]); |
| 336 } | 356 } |
| 337 } | 357 } |
| 338 | 358 |
| 339 core.Map<core.String, core.Object> toJson() { | 359 core.Map<core.String, core.Object> toJson() { |
| 340 final core.Map<core.String, core.Object> _json = new core.Map<core.String, c
ore.Object>(); | 360 final core.Map<core.String, core.Object> _json = |
| 361 new core.Map<core.String, core.Object>(); |
| 341 if (details != null) { | 362 if (details != null) { |
| 342 _json["details"] = details.map((value) => (value).toJson()).toList(); | 363 _json["details"] = details.map((value) => (value).toJson()).toList(); |
| 343 } | 364 } |
| 344 if (result != null) { | 365 if (result != null) { |
| 345 _json["result"] = (result).toJson(); | 366 _json["result"] = (result).toJson(); |
| 346 } | 367 } |
| 347 return _json; | 368 return _json; |
| 348 } | 369 } |
| 349 } | 370 } |
| 350 | 371 |
| 351 class ResultFormattedResultsRuleResultsValueUrlBlocks { | 372 class ResultFormattedResultsRuleResultsValueUrlBlocks { |
| 352 /** Heading to be displayed with the list of URLs. */ | 373 /// Heading to be displayed with the list of URLs. |
| 353 ResultFormattedResultsRuleResultsValueUrlBlocksHeader header; | 374 ResultFormattedResultsRuleResultsValueUrlBlocksHeader header; |
| 354 /** | 375 |
| 355 * List of entries that provide information about URLs in the url block. | 376 /// List of entries that provide information about URLs in the url block. |
| 356 * Optional. | 377 /// Optional. |
| 357 */ | |
| 358 core.List<ResultFormattedResultsRuleResultsValueUrlBlocksUrls> urls; | 378 core.List<ResultFormattedResultsRuleResultsValueUrlBlocksUrls> urls; |
| 359 | 379 |
| 360 ResultFormattedResultsRuleResultsValueUrlBlocks(); | 380 ResultFormattedResultsRuleResultsValueUrlBlocks(); |
| 361 | 381 |
| 362 ResultFormattedResultsRuleResultsValueUrlBlocks.fromJson(core.Map _json) { | 382 ResultFormattedResultsRuleResultsValueUrlBlocks.fromJson(core.Map _json) { |
| 363 if (_json.containsKey("header")) { | 383 if (_json.containsKey("header")) { |
| 364 header = new ResultFormattedResultsRuleResultsValueUrlBlocksHeader.fromJso
n(_json["header"]); | 384 header = |
| 385 new ResultFormattedResultsRuleResultsValueUrlBlocksHeader.fromJson( |
| 386 _json["header"]); |
| 365 } | 387 } |
| 366 if (_json.containsKey("urls")) { | 388 if (_json.containsKey("urls")) { |
| 367 urls = _json["urls"].map((value) => new ResultFormattedResultsRuleResultsV
alueUrlBlocksUrls.fromJson(value)).toList(); | 389 urls = _json["urls"] |
| 390 .map((value) => |
| 391 new ResultFormattedResultsRuleResultsValueUrlBlocksUrls.fromJson( |
| 392 value)) |
| 393 .toList(); |
| 368 } | 394 } |
| 369 } | 395 } |
| 370 | 396 |
| 371 core.Map<core.String, core.Object> toJson() { | 397 core.Map<core.String, core.Object> toJson() { |
| 372 final core.Map<core.String, core.Object> _json = new core.Map<core.String, c
ore.Object>(); | 398 final core.Map<core.String, core.Object> _json = |
| 399 new core.Map<core.String, core.Object>(); |
| 373 if (header != null) { | 400 if (header != null) { |
| 374 _json["header"] = (header).toJson(); | 401 _json["header"] = (header).toJson(); |
| 375 } | 402 } |
| 376 if (urls != null) { | 403 if (urls != null) { |
| 377 _json["urls"] = urls.map((value) => (value).toJson()).toList(); | 404 _json["urls"] = urls.map((value) => (value).toJson()).toList(); |
| 378 } | 405 } |
| 379 return _json; | 406 return _json; |
| 380 } | 407 } |
| 381 } | 408 } |
| 382 | 409 |
| 383 /** | 410 /// The enum-like identifier for this rule. For instance "EnableKeepAlive" or |
| 384 * The enum-like identifier for this rule. For instance "EnableKeepAlive" or | 411 /// "AvoidCssImport". Not localized. |
| 385 * "AvoidCssImport". Not localized. | |
| 386 */ | |
| 387 class ResultFormattedResultsRuleResultsValue { | 412 class ResultFormattedResultsRuleResultsValue { |
| 388 /** Localized name of the rule, intended for presentation to a user. */ | 413 /// Localized name of the rule, intended for presentation to a user. |
| 389 core.String localizedRuleName; | 414 core.String localizedRuleName; |
| 390 /** | 415 |
| 391 * The impact (unbounded floating point value) that implementing the | 416 /// The impact (unbounded floating point value) that implementing the |
| 392 * suggestions for this rule would have on making the page faster. Impact is | 417 /// suggestions for this rule would have on making the page faster. Impact is |
| 393 * comparable between rules to determine which rule's suggestions would have a | 418 /// comparable between rules to determine which rule's suggestions would have |
| 394 * higher or lower impact on making a page faster. For instance, if enabling | 419 /// a higher or lower impact on making a page faster. For instance, if |
| 395 * compression would save 1MB, while optimizing images would save 500kB, the | 420 /// enabling compression would save 1MB, while optimizing images would save |
| 396 * enable compression rule would have 2x the impact of the image optimization | 421 /// 500kB, the enable compression rule would have 2x the impact of the image |
| 397 * rule, all other things being equal. | 422 /// optimization rule, all other things being equal. |
| 398 */ | |
| 399 core.double ruleImpact; | 423 core.double ruleImpact; |
| 400 /** | 424 |
| 401 * List of blocks of URLs. Each block may contain a heading and a list of | 425 /// List of blocks of URLs. Each block may contain a heading and a list of |
| 402 * URLs. Each URL may optionally include additional details. | 426 /// URLs. Each URL may optionally include additional details. |
| 403 */ | |
| 404 core.List<ResultFormattedResultsRuleResultsValueUrlBlocks> urlBlocks; | 427 core.List<ResultFormattedResultsRuleResultsValueUrlBlocks> urlBlocks; |
| 405 | 428 |
| 406 ResultFormattedResultsRuleResultsValue(); | 429 ResultFormattedResultsRuleResultsValue(); |
| 407 | 430 |
| 408 ResultFormattedResultsRuleResultsValue.fromJson(core.Map _json) { | 431 ResultFormattedResultsRuleResultsValue.fromJson(core.Map _json) { |
| 409 if (_json.containsKey("localizedRuleName")) { | 432 if (_json.containsKey("localizedRuleName")) { |
| 410 localizedRuleName = _json["localizedRuleName"]; | 433 localizedRuleName = _json["localizedRuleName"]; |
| 411 } | 434 } |
| 412 if (_json.containsKey("ruleImpact")) { | 435 if (_json.containsKey("ruleImpact")) { |
| 413 ruleImpact = _json["ruleImpact"]; | 436 ruleImpact = _json["ruleImpact"]; |
| 414 } | 437 } |
| 415 if (_json.containsKey("urlBlocks")) { | 438 if (_json.containsKey("urlBlocks")) { |
| 416 urlBlocks = _json["urlBlocks"].map((value) => new ResultFormattedResultsRu
leResultsValueUrlBlocks.fromJson(value)).toList(); | 439 urlBlocks = _json["urlBlocks"] |
| 440 .map((value) => |
| 441 new ResultFormattedResultsRuleResultsValueUrlBlocks.fromJson( |
| 442 value)) |
| 443 .toList(); |
| 417 } | 444 } |
| 418 } | 445 } |
| 419 | 446 |
| 420 core.Map<core.String, core.Object> toJson() { | 447 core.Map<core.String, core.Object> toJson() { |
| 421 final core.Map<core.String, core.Object> _json = new core.Map<core.String, c
ore.Object>(); | 448 final core.Map<core.String, core.Object> _json = |
| 449 new core.Map<core.String, core.Object>(); |
| 422 if (localizedRuleName != null) { | 450 if (localizedRuleName != null) { |
| 423 _json["localizedRuleName"] = localizedRuleName; | 451 _json["localizedRuleName"] = localizedRuleName; |
| 424 } | 452 } |
| 425 if (ruleImpact != null) { | 453 if (ruleImpact != null) { |
| 426 _json["ruleImpact"] = ruleImpact; | 454 _json["ruleImpact"] = ruleImpact; |
| 427 } | 455 } |
| 428 if (urlBlocks != null) { | 456 if (urlBlocks != null) { |
| 429 _json["urlBlocks"] = urlBlocks.map((value) => (value).toJson()).toList(); | 457 _json["urlBlocks"] = urlBlocks.map((value) => (value).toJson()).toList(); |
| 430 } | 458 } |
| 431 return _json; | 459 return _json; |
| 432 } | 460 } |
| 433 } | 461 } |
| 434 | 462 |
| 435 /** | 463 /// Localized PageSpeed results. Contains a ruleResults entry for each |
| 436 * Localized PageSpeed results. Contains a ruleResults entry for each PageSpeed | 464 /// PageSpeed rule instantiated and run by the server. |
| 437 * rule instantiated and run by the server. | |
| 438 */ | |
| 439 class ResultFormattedResults { | 465 class ResultFormattedResults { |
| 440 /** The locale of the formattedResults, e.g. "en_US". */ | 466 /// The locale of the formattedResults, e.g. "en_US". |
| 441 core.String locale; | 467 core.String locale; |
| 442 /** | 468 |
| 443 * Dictionary of formatted rule results, with one entry for each PageSpeed | 469 /// Dictionary of formatted rule results, with one entry for each PageSpeed |
| 444 * rule instantiated and run by the server. | 470 /// rule instantiated and run by the server. |
| 445 */ | |
| 446 core.Map<core.String, ResultFormattedResultsRuleResultsValue> ruleResults; | 471 core.Map<core.String, ResultFormattedResultsRuleResultsValue> ruleResults; |
| 447 | 472 |
| 448 ResultFormattedResults(); | 473 ResultFormattedResults(); |
| 449 | 474 |
| 450 ResultFormattedResults.fromJson(core.Map _json) { | 475 ResultFormattedResults.fromJson(core.Map _json) { |
| 451 if (_json.containsKey("locale")) { | 476 if (_json.containsKey("locale")) { |
| 452 locale = _json["locale"]; | 477 locale = _json["locale"]; |
| 453 } | 478 } |
| 454 if (_json.containsKey("ruleResults")) { | 479 if (_json.containsKey("ruleResults")) { |
| 455 ruleResults = commons.mapMap<core.Map<core.String, core.Object>, ResultFor
mattedResultsRuleResultsValue>(_json["ruleResults"], (core.Map<core.String, core
.Object> item) => new ResultFormattedResultsRuleResultsValue.fromJson(item)); | 480 ruleResults = commons.mapMap<core.Map<core.String, core.Object>, |
| 481 ResultFormattedResultsRuleResultsValue>( |
| 482 _json["ruleResults"], |
| 483 (core.Map<core.String, core.Object> item) => |
| 484 new ResultFormattedResultsRuleResultsValue.fromJson(item)); |
| 456 } | 485 } |
| 457 } | 486 } |
| 458 | 487 |
| 459 core.Map<core.String, core.Object> toJson() { | 488 core.Map<core.String, core.Object> toJson() { |
| 460 final core.Map<core.String, core.Object> _json = new core.Map<core.String, c
ore.Object>(); | 489 final core.Map<core.String, core.Object> _json = |
| 490 new core.Map<core.String, core.Object>(); |
| 461 if (locale != null) { | 491 if (locale != null) { |
| 462 _json["locale"] = locale; | 492 _json["locale"] = locale; |
| 463 } | 493 } |
| 464 if (ruleResults != null) { | 494 if (ruleResults != null) { |
| 465 _json["ruleResults"] = commons.mapMap<ResultFormattedResultsRuleResultsVal
ue, core.Map<core.String, core.Object>>(ruleResults, (ResultFormattedResultsRule
ResultsValue item) => (item).toJson()); | 495 _json["ruleResults"] = commons.mapMap< |
| 496 ResultFormattedResultsRuleResultsValue, |
| 497 core.Map<core.String, core.Object>>(ruleResults, |
| 498 (ResultFormattedResultsRuleResultsValue item) => (item).toJson()); |
| 466 } | 499 } |
| 467 return _json; | 500 return _json; |
| 468 } | 501 } |
| 469 } | 502 } |
| 470 | 503 |
| 471 /** | 504 /// Summary statistics for the page, such as number of JavaScript bytes, number |
| 472 * Summary statistics for the page, such as number of JavaScript bytes, number | 505 /// of HTML bytes, etc. |
| 473 * of HTML bytes, etc. | |
| 474 */ | |
| 475 class ResultPageStats { | 506 class ResultPageStats { |
| 476 /** Number of uncompressed response bytes for CSS resources on the page. */ | 507 /// Number of uncompressed response bytes for CSS resources on the page. |
| 477 core.String cssResponseBytes; | 508 core.String cssResponseBytes; |
| 478 /** Number of response bytes for flash resources on the page. */ | 509 |
| 510 /// Number of response bytes for flash resources on the page. |
| 479 core.String flashResponseBytes; | 511 core.String flashResponseBytes; |
| 480 /** | 512 |
| 481 * Number of uncompressed response bytes for the main HTML document and all | 513 /// Number of uncompressed response bytes for the main HTML document and all |
| 482 * iframes on the page. | 514 /// iframes on the page. |
| 483 */ | |
| 484 core.String htmlResponseBytes; | 515 core.String htmlResponseBytes; |
| 485 /** Number of response bytes for image resources on the page. */ | 516 |
| 517 /// Number of response bytes for image resources on the page. |
| 486 core.String imageResponseBytes; | 518 core.String imageResponseBytes; |
| 487 /** Number of uncompressed response bytes for JS resources on the page. */ | 519 |
| 520 /// Number of uncompressed response bytes for JS resources on the page. |
| 488 core.String javascriptResponseBytes; | 521 core.String javascriptResponseBytes; |
| 489 /** Number of CSS resources referenced by the page. */ | 522 |
| 523 /// Number of CSS resources referenced by the page. |
| 490 core.int numberCssResources; | 524 core.int numberCssResources; |
| 491 /** Number of unique hosts referenced by the page. */ | 525 |
| 526 /// Number of unique hosts referenced by the page. |
| 492 core.int numberHosts; | 527 core.int numberHosts; |
| 493 /** Number of JavaScript resources referenced by the page. */ | 528 |
| 529 /// Number of JavaScript resources referenced by the page. |
| 494 core.int numberJsResources; | 530 core.int numberJsResources; |
| 495 /** Number of HTTP resources loaded by the page. */ | 531 |
| 532 /// Number of HTTP resources loaded by the page. |
| 496 core.int numberResources; | 533 core.int numberResources; |
| 497 /** Number of static (i.e. cacheable) resources on the page. */ | 534 |
| 535 /// Number of static (i.e. cacheable) resources on the page. |
| 498 core.int numberStaticResources; | 536 core.int numberStaticResources; |
| 499 /** Number of response bytes for other resources on the page. */ | 537 |
| 538 /// Number of response bytes for other resources on the page. |
| 500 core.String otherResponseBytes; | 539 core.String otherResponseBytes; |
| 501 /** | 540 |
| 502 * Number of uncompressed response bytes for text resources not covered by | 541 /// Number of uncompressed response bytes for text resources not covered by |
| 503 * other statistics (i.e non-HTML, non-script, non-CSS resources) on the page. | 542 /// other statistics (i.e non-HTML, non-script, non-CSS resources) on the |
| 504 */ | 543 /// page. |
| 505 core.String textResponseBytes; | 544 core.String textResponseBytes; |
| 506 /** Total size of all request bytes sent by the page. */ | 545 |
| 546 /// Total size of all request bytes sent by the page. |
| 507 core.String totalRequestBytes; | 547 core.String totalRequestBytes; |
| 508 | 548 |
| 509 ResultPageStats(); | 549 ResultPageStats(); |
| 510 | 550 |
| 511 ResultPageStats.fromJson(core.Map _json) { | 551 ResultPageStats.fromJson(core.Map _json) { |
| 512 if (_json.containsKey("cssResponseBytes")) { | 552 if (_json.containsKey("cssResponseBytes")) { |
| 513 cssResponseBytes = _json["cssResponseBytes"]; | 553 cssResponseBytes = _json["cssResponseBytes"]; |
| 514 } | 554 } |
| 515 if (_json.containsKey("flashResponseBytes")) { | 555 if (_json.containsKey("flashResponseBytes")) { |
| 516 flashResponseBytes = _json["flashResponseBytes"]; | 556 flashResponseBytes = _json["flashResponseBytes"]; |
| (...skipping 27 matching lines...) Expand all Loading... |
| 544 } | 584 } |
| 545 if (_json.containsKey("textResponseBytes")) { | 585 if (_json.containsKey("textResponseBytes")) { |
| 546 textResponseBytes = _json["textResponseBytes"]; | 586 textResponseBytes = _json["textResponseBytes"]; |
| 547 } | 587 } |
| 548 if (_json.containsKey("totalRequestBytes")) { | 588 if (_json.containsKey("totalRequestBytes")) { |
| 549 totalRequestBytes = _json["totalRequestBytes"]; | 589 totalRequestBytes = _json["totalRequestBytes"]; |
| 550 } | 590 } |
| 551 } | 591 } |
| 552 | 592 |
| 553 core.Map<core.String, core.Object> toJson() { | 593 core.Map<core.String, core.Object> toJson() { |
| 554 final core.Map<core.String, core.Object> _json = new core.Map<core.String, c
ore.Object>(); | 594 final core.Map<core.String, core.Object> _json = |
| 595 new core.Map<core.String, core.Object>(); |
| 555 if (cssResponseBytes != null) { | 596 if (cssResponseBytes != null) { |
| 556 _json["cssResponseBytes"] = cssResponseBytes; | 597 _json["cssResponseBytes"] = cssResponseBytes; |
| 557 } | 598 } |
| 558 if (flashResponseBytes != null) { | 599 if (flashResponseBytes != null) { |
| 559 _json["flashResponseBytes"] = flashResponseBytes; | 600 _json["flashResponseBytes"] = flashResponseBytes; |
| 560 } | 601 } |
| 561 if (htmlResponseBytes != null) { | 602 if (htmlResponseBytes != null) { |
| 562 _json["htmlResponseBytes"] = htmlResponseBytes; | 603 _json["htmlResponseBytes"] = htmlResponseBytes; |
| 563 } | 604 } |
| 564 if (imageResponseBytes != null) { | 605 if (imageResponseBytes != null) { |
| (...skipping 23 matching lines...) Expand all Loading... |
| 588 if (textResponseBytes != null) { | 629 if (textResponseBytes != null) { |
| 589 _json["textResponseBytes"] = textResponseBytes; | 630 _json["textResponseBytes"] = textResponseBytes; |
| 590 } | 631 } |
| 591 if (totalRequestBytes != null) { | 632 if (totalRequestBytes != null) { |
| 592 _json["totalRequestBytes"] = totalRequestBytes; | 633 _json["totalRequestBytes"] = totalRequestBytes; |
| 593 } | 634 } |
| 594 return _json; | 635 return _json; |
| 595 } | 636 } |
| 596 } | 637 } |
| 597 | 638 |
| 598 /** Base64-encoded screenshot of the page that was analyzed. */ | 639 /// Base64-encoded screenshot of the page that was analyzed. |
| 599 class ResultScreenshot { | 640 class ResultScreenshot { |
| 600 /** Image data base64 encoded. */ | 641 /// Image data base64 encoded. |
| 601 core.String data; | 642 core.String data; |
| 602 core.List<core.int> get dataAsBytes { | 643 core.List<core.int> get dataAsBytes { |
| 603 return convert.BASE64.decode(data); | 644 return convert.BASE64.decode(data); |
| 604 } | 645 } |
| 605 | 646 |
| 606 void set dataAsBytes(core.List<core.int> _bytes) { | 647 void set dataAsBytes(core.List<core.int> _bytes) { |
| 607 data = convert.BASE64.encode(_bytes).replaceAll("/", "_").replaceAll("+", "-
"); | 648 data = |
| 649 convert.BASE64.encode(_bytes).replaceAll("/", "_").replaceAll("+", "-"); |
| 608 } | 650 } |
| 609 /** Height of screenshot in pixels. */ | 651 |
| 652 /// Height of screenshot in pixels. |
| 610 core.int height; | 653 core.int height; |
| 611 /** Mime type of image data. E.g. "image/jpeg". */ | 654 |
| 655 /// Mime type of image data. E.g. "image/jpeg". |
| 612 core.String mimeType; | 656 core.String mimeType; |
| 613 /** Width of screenshot in pixels. */ | 657 |
| 658 /// Width of screenshot in pixels. |
| 614 core.int width; | 659 core.int width; |
| 615 | 660 |
| 616 ResultScreenshot(); | 661 ResultScreenshot(); |
| 617 | 662 |
| 618 ResultScreenshot.fromJson(core.Map _json) { | 663 ResultScreenshot.fromJson(core.Map _json) { |
| 619 if (_json.containsKey("data")) { | 664 if (_json.containsKey("data")) { |
| 620 data = _json["data"]; | 665 data = _json["data"]; |
| 621 } | 666 } |
| 622 if (_json.containsKey("height")) { | 667 if (_json.containsKey("height")) { |
| 623 height = _json["height"]; | 668 height = _json["height"]; |
| 624 } | 669 } |
| 625 if (_json.containsKey("mime_type")) { | 670 if (_json.containsKey("mime_type")) { |
| 626 mimeType = _json["mime_type"]; | 671 mimeType = _json["mime_type"]; |
| 627 } | 672 } |
| 628 if (_json.containsKey("width")) { | 673 if (_json.containsKey("width")) { |
| 629 width = _json["width"]; | 674 width = _json["width"]; |
| 630 } | 675 } |
| 631 } | 676 } |
| 632 | 677 |
| 633 core.Map<core.String, core.Object> toJson() { | 678 core.Map<core.String, core.Object> toJson() { |
| 634 final core.Map<core.String, core.Object> _json = new core.Map<core.String, c
ore.Object>(); | 679 final core.Map<core.String, core.Object> _json = |
| 680 new core.Map<core.String, core.Object>(); |
| 635 if (data != null) { | 681 if (data != null) { |
| 636 _json["data"] = data; | 682 _json["data"] = data; |
| 637 } | 683 } |
| 638 if (height != null) { | 684 if (height != null) { |
| 639 _json["height"] = height; | 685 _json["height"] = height; |
| 640 } | 686 } |
| 641 if (mimeType != null) { | 687 if (mimeType != null) { |
| 642 _json["mime_type"] = mimeType; | 688 _json["mime_type"] = mimeType; |
| 643 } | 689 } |
| 644 if (width != null) { | 690 if (width != null) { |
| 645 _json["width"] = width; | 691 _json["width"] = width; |
| 646 } | 692 } |
| 647 return _json; | 693 return _json; |
| 648 } | 694 } |
| 649 } | 695 } |
| 650 | 696 |
| 651 /** The version of PageSpeed used to generate these results. */ | 697 /// The version of PageSpeed used to generate these results. |
| 652 class ResultVersion { | 698 class ResultVersion { |
| 653 /** The major version number of PageSpeed used to generate these results. */ | 699 /// The major version number of PageSpeed used to generate these results. |
| 654 core.int major; | 700 core.int major; |
| 655 /** The minor version number of PageSpeed used to generate these results. */ | 701 |
| 702 /// The minor version number of PageSpeed used to generate these results. |
| 656 core.int minor; | 703 core.int minor; |
| 657 | 704 |
| 658 ResultVersion(); | 705 ResultVersion(); |
| 659 | 706 |
| 660 ResultVersion.fromJson(core.Map _json) { | 707 ResultVersion.fromJson(core.Map _json) { |
| 661 if (_json.containsKey("major")) { | 708 if (_json.containsKey("major")) { |
| 662 major = _json["major"]; | 709 major = _json["major"]; |
| 663 } | 710 } |
| 664 if (_json.containsKey("minor")) { | 711 if (_json.containsKey("minor")) { |
| 665 minor = _json["minor"]; | 712 minor = _json["minor"]; |
| 666 } | 713 } |
| 667 } | 714 } |
| 668 | 715 |
| 669 core.Map<core.String, core.Object> toJson() { | 716 core.Map<core.String, core.Object> toJson() { |
| 670 final core.Map<core.String, core.Object> _json = new core.Map<core.String, c
ore.Object>(); | 717 final core.Map<core.String, core.Object> _json = |
| 718 new core.Map<core.String, core.Object>(); |
| 671 if (major != null) { | 719 if (major != null) { |
| 672 _json["major"] = major; | 720 _json["major"] = major; |
| 673 } | 721 } |
| 674 if (minor != null) { | 722 if (minor != null) { |
| 675 _json["minor"] = minor; | 723 _json["minor"] = minor; |
| 676 } | 724 } |
| 677 return _json; | 725 return _json; |
| 678 } | 726 } |
| 679 } | 727 } |
| 680 | 728 |
| 681 class Result { | 729 class Result { |
| 682 /** | 730 /// Localized PageSpeed results. Contains a ruleResults entry for each |
| 683 * Localized PageSpeed results. Contains a ruleResults entry for each | 731 /// PageSpeed rule instantiated and run by the server. |
| 684 * PageSpeed rule instantiated and run by the server. | |
| 685 */ | |
| 686 ResultFormattedResults formattedResults; | 732 ResultFormattedResults formattedResults; |
| 687 /** | 733 |
| 688 * Canonicalized and final URL for the document, after following page | 734 /// Canonicalized and final URL for the document, after following page |
| 689 * redirects (if any). | 735 /// redirects (if any). |
| 690 */ | |
| 691 core.String id; | 736 core.String id; |
| 692 /** | 737 |
| 693 * List of rules that were specified in the request, but which the server did | 738 /// List of rules that were specified in the request, but which the server |
| 694 * not know how to instantiate. | 739 /// did not know how to instantiate. |
| 695 */ | |
| 696 core.List<core.String> invalidRules; | 740 core.List<core.String> invalidRules; |
| 697 /** Kind of result. */ | 741 |
| 742 /// Kind of result. |
| 698 core.String kind; | 743 core.String kind; |
| 699 /** | 744 |
| 700 * Summary statistics for the page, such as number of JavaScript bytes, number | 745 /// Summary statistics for the page, such as number of JavaScript bytes, |
| 701 * of HTML bytes, etc. | 746 /// number of HTML bytes, etc. |
| 702 */ | |
| 703 ResultPageStats pageStats; | 747 ResultPageStats pageStats; |
| 704 /** | 748 |
| 705 * Response code for the document. 200 indicates a normal page load. 4xx/5xx | 749 /// Response code for the document. 200 indicates a normal page load. 4xx/5xx |
| 706 * indicates an error. | 750 /// indicates an error. |
| 707 */ | |
| 708 core.int responseCode; | 751 core.int responseCode; |
| 709 /** | 752 |
| 710 * The PageSpeed Score (0-100), which indicates how much faster a page could | 753 /// The PageSpeed Score (0-100), which indicates how much faster a page could |
| 711 * be. A high score indicates little room for improvement, while a lower score | 754 /// be. A high score indicates little room for improvement, while a lower |
| 712 * indicates more room for improvement. | 755 /// score indicates more room for improvement. |
| 713 */ | |
| 714 core.int score; | 756 core.int score; |
| 715 /** Base64-encoded screenshot of the page that was analyzed. */ | 757 |
| 758 /// Base64-encoded screenshot of the page that was analyzed. |
| 716 ResultScreenshot screenshot; | 759 ResultScreenshot screenshot; |
| 717 /** Title of the page, as displayed in the browser's title bar. */ | 760 |
| 761 /// Title of the page, as displayed in the browser's title bar. |
| 718 core.String title; | 762 core.String title; |
| 719 /** The version of PageSpeed used to generate these results. */ | 763 |
| 764 /// The version of PageSpeed used to generate these results. |
| 720 ResultVersion version; | 765 ResultVersion version; |
| 721 | 766 |
| 722 Result(); | 767 Result(); |
| 723 | 768 |
| 724 Result.fromJson(core.Map _json) { | 769 Result.fromJson(core.Map _json) { |
| 725 if (_json.containsKey("formattedResults")) { | 770 if (_json.containsKey("formattedResults")) { |
| 726 formattedResults = new ResultFormattedResults.fromJson(_json["formattedRes
ults"]); | 771 formattedResults = |
| 772 new ResultFormattedResults.fromJson(_json["formattedResults"]); |
| 727 } | 773 } |
| 728 if (_json.containsKey("id")) { | 774 if (_json.containsKey("id")) { |
| 729 id = _json["id"]; | 775 id = _json["id"]; |
| 730 } | 776 } |
| 731 if (_json.containsKey("invalidRules")) { | 777 if (_json.containsKey("invalidRules")) { |
| 732 invalidRules = _json["invalidRules"]; | 778 invalidRules = _json["invalidRules"]; |
| 733 } | 779 } |
| 734 if (_json.containsKey("kind")) { | 780 if (_json.containsKey("kind")) { |
| 735 kind = _json["kind"]; | 781 kind = _json["kind"]; |
| 736 } | 782 } |
| (...skipping 11 matching lines...) Expand all Loading... |
| 748 } | 794 } |
| 749 if (_json.containsKey("title")) { | 795 if (_json.containsKey("title")) { |
| 750 title = _json["title"]; | 796 title = _json["title"]; |
| 751 } | 797 } |
| 752 if (_json.containsKey("version")) { | 798 if (_json.containsKey("version")) { |
| 753 version = new ResultVersion.fromJson(_json["version"]); | 799 version = new ResultVersion.fromJson(_json["version"]); |
| 754 } | 800 } |
| 755 } | 801 } |
| 756 | 802 |
| 757 core.Map<core.String, core.Object> toJson() { | 803 core.Map<core.String, core.Object> toJson() { |
| 758 final core.Map<core.String, core.Object> _json = new core.Map<core.String, c
ore.Object>(); | 804 final core.Map<core.String, core.Object> _json = |
| 805 new core.Map<core.String, core.Object>(); |
| 759 if (formattedResults != null) { | 806 if (formattedResults != null) { |
| 760 _json["formattedResults"] = (formattedResults).toJson(); | 807 _json["formattedResults"] = (formattedResults).toJson(); |
| 761 } | 808 } |
| 762 if (id != null) { | 809 if (id != null) { |
| 763 _json["id"] = id; | 810 _json["id"] = id; |
| 764 } | 811 } |
| 765 if (invalidRules != null) { | 812 if (invalidRules != null) { |
| 766 _json["invalidRules"] = invalidRules; | 813 _json["invalidRules"] = invalidRules; |
| 767 } | 814 } |
| 768 if (kind != null) { | 815 if (kind != null) { |
| (...skipping 13 matching lines...) Expand all Loading... |
| 782 } | 829 } |
| 783 if (title != null) { | 830 if (title != null) { |
| 784 _json["title"] = title; | 831 _json["title"] = title; |
| 785 } | 832 } |
| 786 if (version != null) { | 833 if (version != null) { |
| 787 _json["version"] = (version).toJson(); | 834 _json["version"] = (version).toJson(); |
| 788 } | 835 } |
| 789 return _json; | 836 return _json; |
| 790 } | 837 } |
| 791 } | 838 } |
| OLD | NEW |