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.vision.v1; | 3 library googleapis.vision.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 vision/v1'; | 15 const core.String USER_AGENT = 'dart-api-client vision/v1'; |
17 | 16 |
18 /** | 17 /** |
19 * Integrates Google Vision features, including image labeling, face, logo, and | 18 * Integrates Google Vision features, including image labeling, face, logo, and |
20 * landmark detection, optical character recognition (OCR), and detection of | 19 * landmark detection, optical character recognition (OCR), and detection of |
(...skipping 891 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
912 } | 911 } |
913 return _json; | 912 return _json; |
914 } | 913 } |
915 } | 914 } |
916 | 915 |
917 /** Client image to perform Google Cloud Vision API tasks over. */ | 916 /** Client image to perform Google Cloud Vision API tasks over. */ |
918 class Image { | 917 class Image { |
919 /** Image content, represented as a stream of bytes. */ | 918 /** Image content, represented as a stream of bytes. */ |
920 core.String content; | 919 core.String content; |
921 core.List<core.int> get contentAsBytes { | 920 core.List<core.int> get contentAsBytes { |
922 return crypto.CryptoUtils.base64StringToBytes(content); | 921 return convert.BASE64.decode(content); |
923 } | 922 } |
924 | 923 |
925 void set contentAsBytes(core.List<core.int> _bytes) { | 924 void set contentAsBytes(core.List<core.int> _bytes) { |
926 content = crypto.CryptoUtils.bytesToBase64(_bytes, urlSafe: true); | 925 content = convert.BASE64.encode(_bytes).replaceAll("/", "_").replaceAll("+",
"-"); |
927 } | 926 } |
928 /** | 927 /** |
929 * Google Cloud Storage image location. If both 'content' and 'source' | 928 * Google Cloud Storage image location. If both 'content' and 'source' |
930 * are filled for an image, 'content' takes precedence and it will be | 929 * are filled for an image, 'content' takes precedence and it will be |
931 * used for performing the image annotation request. | 930 * used for performing the image annotation request. |
932 */ | 931 */ |
933 ImageSource source; | 932 ImageSource source; |
934 | 933 |
935 Image(); | 934 Image(); |
936 | 935 |
(...skipping 596 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1533 var _json = new core.Map(); | 1532 var _json = new core.Map(); |
1534 if (x != null) { | 1533 if (x != null) { |
1535 _json["x"] = x; | 1534 _json["x"] = x; |
1536 } | 1535 } |
1537 if (y != null) { | 1536 if (y != null) { |
1538 _json["y"] = y; | 1537 _json["y"] = y; |
1539 } | 1538 } |
1540 return _json; | 1539 return _json; |
1541 } | 1540 } |
1542 } | 1541 } |
OLD | NEW |