| 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:crypto/crypto.dart' as crypto; | |
| 11 import 'package:http/http.dart' as http; | 10 import 'package:http/http.dart' as http; |
| 12 | 11 |
| 13 export 'package:_discoveryapis_commons/_discoveryapis_commons.dart' show | 12 export 'package:_discoveryapis_commons/_discoveryapis_commons.dart' show |
| 14 ApiRequestError, DetailedApiRequestError; | 13 ApiRequestError, DetailedApiRequestError; |
| 15 | 14 |
| 16 const core.String USER_AGENT = 'dart-api-client pagespeedonline/v1'; | 15 const core.String USER_AGENT = 'dart-api-client pagespeedonline/v1'; |
| 17 | 16 |
| 18 /** | 17 /** |
| 19 * 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 |
| 20 * make that page faster. | 19 * make that page faster. |
| (...skipping 573 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 594 } | 593 } |
| 595 return _json; | 594 return _json; |
| 596 } | 595 } |
| 597 } | 596 } |
| 598 | 597 |
| 599 /** Base64-encoded screenshot of the page that was analyzed. */ | 598 /** Base64-encoded screenshot of the page that was analyzed. */ |
| 600 class ResultScreenshot { | 599 class ResultScreenshot { |
| 601 /** Image data base64 encoded. */ | 600 /** Image data base64 encoded. */ |
| 602 core.String data; | 601 core.String data; |
| 603 core.List<core.int> get dataAsBytes { | 602 core.List<core.int> get dataAsBytes { |
| 604 return crypto.CryptoUtils.base64StringToBytes(data); | 603 return convert.BASE64.decode(data); |
| 605 } | 604 } |
| 606 | 605 |
| 607 void set dataAsBytes(core.List<core.int> _bytes) { | 606 void set dataAsBytes(core.List<core.int> _bytes) { |
| 608 data = crypto.CryptoUtils.bytesToBase64(_bytes, urlSafe: true); | 607 data = convert.BASE64.encode(_bytes).replaceAll("/", "_").replaceAll("+", "-
"); |
| 609 } | 608 } |
| 610 /** Height of screenshot in pixels. */ | 609 /** Height of screenshot in pixels. */ |
| 611 core.int height; | 610 core.int height; |
| 612 /** Mime type of image data. E.g. "image/jpeg". */ | 611 /** Mime type of image data. E.g. "image/jpeg". */ |
| 613 core.String mimeType; | 612 core.String mimeType; |
| 614 /** Width of screenshot in pixels. */ | 613 /** Width of screenshot in pixels. */ |
| 615 core.int width; | 614 core.int width; |
| 616 | 615 |
| 617 ResultScreenshot(); | 616 ResultScreenshot(); |
| 618 | 617 |
| (...skipping 164 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 783 } | 782 } |
| 784 if (title != null) { | 783 if (title != null) { |
| 785 _json["title"] = title; | 784 _json["title"] = title; |
| 786 } | 785 } |
| 787 if (version != null) { | 786 if (version != null) { |
| 788 _json["version"] = (version).toJson(); | 787 _json["version"] = (version).toJson(); |
| 789 } | 788 } |
| 790 return _json; | 789 return _json; |
| 791 } | 790 } |
| 792 } | 791 } |
| OLD | NEW |