| OLD | NEW |
| 1 // This is a generated file (see the discoveryapis_generator project). |
| 2 |
| 1 library googleapis.freebase.v1; | 3 library googleapis.freebase.v1; |
| 2 | 4 |
| 3 import "dart:core" as core; | 5 import 'dart:core' as core; |
| 4 import "dart:collection" as collection; | 6 import 'dart:collection' as collection; |
| 5 import "dart:async" as async; | 7 import 'dart:async' as async; |
| 6 import "dart:convert" as convert; | 8 import 'dart:convert' as convert; |
| 7 | 9 |
| 8 import "package:crypto/crypto.dart" as crypto; | 10 import 'package:_discoveryapis_commons/_discoveryapis_commons.dart' as commons; |
| 11 import 'package:crypto/crypto.dart' as crypto; |
| 9 import 'package:http/http.dart' as http; | 12 import 'package:http/http.dart' as http; |
| 10 import '../src/common_internal.dart' as common_internal; | |
| 11 import '../common/common.dart' as common; | |
| 12 | 13 |
| 13 export '../common/common.dart' show ApiRequestError; | 14 export 'package:_discoveryapis_commons/_discoveryapis_commons.dart' show |
| 14 export '../common/common.dart' show DetailedApiRequestError; | 15 ApiRequestError, DetailedApiRequestError, Media, UploadOptions, |
| 16 ResumableUploadOptions, DownloadOptions, PartialDownloadOptions, |
| 17 ByteRange; |
| 18 |
| 19 const core.String USER_AGENT = 'dart-api-client freebase/v1'; |
| 15 | 20 |
| 16 /** Find Freebase entities using textual queries and other constraints. */ | 21 /** Find Freebase entities using textual queries and other constraints. */ |
| 17 class FreebaseApi { | 22 class FreebaseApi { |
| 18 | 23 |
| 19 final common_internal.ApiRequester _requester; | 24 final commons.ApiRequester _requester; |
| 20 | 25 |
| 21 FreebaseApi(http.Client client, {core.String rootUrl: "https://www.googleapis.
com/", core.String servicePath: "freebase/v1/"}) : | 26 FreebaseApi(http.Client client, {core.String rootUrl: "https://www.googleapis.
com/", core.String servicePath: "freebase/v1/"}) : |
| 22 _requester = new common_internal.ApiRequester(client, rootUrl, servicePath
); | 27 _requester = new commons.ApiRequester(client, rootUrl, servicePath, USER_A
GENT); |
| 23 | 28 |
| 24 /** | 29 /** |
| 25 * Reconcile entities to Freebase open data. | 30 * Reconcile entities to Freebase open data. |
| 26 * | 31 * |
| 27 * Request parameters: | 32 * Request parameters: |
| 28 * | 33 * |
| 29 * [confidence] - Required confidence for a candidate to match. Must be | 34 * [confidence] - Required confidence for a candidate to match. Must be |
| 30 * between .5 and 1.0 | 35 * between .5 and 1.0 |
| 31 * Value must be between "0.0" and "1.0". | 36 * Value must be between "0.0" and "1.0". |
| 32 * | 37 * |
| 33 * [kind] - Classifications of entity e.g. type, category, title. | 38 * [kind] - Classifications of entity e.g. type, category, title. |
| 34 * | 39 * |
| 35 * [lang] - Languages for names and values. First language is used for | 40 * [lang] - Languages for names and values. First language is used for |
| 36 * display. Default is 'en'. | 41 * display. Default is 'en'. |
| 37 * | 42 * |
| 38 * [limit] - Maximum number of candidates to return. | 43 * [limit] - Maximum number of candidates to return. |
| 39 * Value must be between "0" and "25". | 44 * Value must be between "0" and "25". |
| 40 * | 45 * |
| 41 * [name] - Name of entity. | 46 * [name] - Name of entity. |
| 42 * | 47 * |
| 43 * [prop] - Property values for entity formatted as | 48 * [prop] - Property values for entity formatted as |
| 44 * : | 49 * : |
| 45 * | 50 * |
| 46 * Completes with a [ReconcileGet]. | 51 * Completes with a [ReconcileGet]. |
| 47 * | 52 * |
| 48 * Completes with a [common.ApiRequestError] if the API endpoint returned an | 53 * Completes with a [commons.ApiRequestError] if the API endpoint returned an |
| 49 * error. | 54 * error. |
| 50 * | 55 * |
| 51 * If the used [http.Client] completes with an error when making a REST call, | 56 * If the used [http.Client] completes with an error when making a REST call, |
| 52 * this method will complete with the same error. | 57 * this method will complete with the same error. |
| 53 */ | 58 */ |
| 54 async.Future<ReconcileGet> reconcile({core.double confidence, core.List<core.S
tring> kind, core.List<core.String> lang, core.int limit, core.String name, core
.List<core.String> prop}) { | 59 async.Future<ReconcileGet> reconcile({core.double confidence, core.List<core.S
tring> kind, core.List<core.String> lang, core.int limit, core.String name, core
.List<core.String> prop}) { |
| 55 var _url = null; | 60 var _url = null; |
| 56 var _queryParams = new core.Map(); | 61 var _queryParams = new core.Map(); |
| 57 var _uploadMedia = null; | 62 var _uploadMedia = null; |
| 58 var _uploadOptions = null; | 63 var _uploadOptions = null; |
| 59 var _downloadOptions = common.DownloadOptions.Metadata; | 64 var _downloadOptions = commons.DownloadOptions.Metadata; |
| 60 var _body = null; | 65 var _body = null; |
| 61 | 66 |
| 62 if (confidence != null) { | 67 if (confidence != null) { |
| 63 _queryParams["confidence"] = ["${confidence}"]; | 68 _queryParams["confidence"] = ["${confidence}"]; |
| 64 } | 69 } |
| 65 if (kind != null) { | 70 if (kind != null) { |
| 66 _queryParams["kind"] = kind; | 71 _queryParams["kind"] = kind; |
| 67 } | 72 } |
| 68 if (lang != null) { | 73 if (lang != null) { |
| 69 _queryParams["lang"] = lang; | 74 _queryParams["lang"] = lang; |
| (...skipping 103 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 173 * [type] - Restrict to topics with this Freebase type id. | 178 * [type] - Restrict to topics with this Freebase type id. |
| 174 * | 179 * |
| 175 * [with_] - A rule to match against. | 180 * [with_] - A rule to match against. |
| 176 * | 181 * |
| 177 * [without] - A rule to not match against. | 182 * [without] - A rule to not match against. |
| 178 * | 183 * |
| 179 * [downloadOptions] - Options for downloading. A download can be either a | 184 * [downloadOptions] - Options for downloading. A download can be either a |
| 180 * Metadata (default) or Media download. Partial Media downloads are possible | 185 * Metadata (default) or Media download. Partial Media downloads are possible |
| 181 * as well. | 186 * as well. |
| 182 * | 187 * |
| 183 * Completes with a [common.ApiRequestError] if the API endpoint returned an | 188 * Completes with a [commons.ApiRequestError] if the API endpoint returned an |
| 184 * error. | 189 * error. |
| 185 * | 190 * |
| 186 * If the used [http.Client] completes with an error when making a REST call, | 191 * If the used [http.Client] completes with an error when making a REST call, |
| 187 * this method will complete with the same error. | 192 * this method will complete with the same error. |
| 188 */ | 193 */ |
| 189 async.Future search({core.String asOfTime, core.String callback, core.int curs
or, core.List<core.String> domain, core.String encode, core.bool exact, core.Lis
t<core.String> filter, core.String format, core.String help, core.bool indent, c
ore.List<core.String> lang, core.int limit, core.List<core.String> mid, core.Str
ing mqlOutput, core.String output, core.bool prefixed, core.String query, core.S
tring scoring, core.String spell, core.bool stemmed, core.List<core.String> type
, core.List<core.String> with_, core.List<core.String> without, common.DownloadO
ptions downloadOptions: common.DownloadOptions.Metadata}) { | 194 async.Future search({core.String asOfTime, core.String callback, core.int curs
or, core.List<core.String> domain, core.String encode, core.bool exact, core.Lis
t<core.String> filter, core.String format, core.String help, core.bool indent, c
ore.List<core.String> lang, core.int limit, core.List<core.String> mid, core.Str
ing mqlOutput, core.String output, core.bool prefixed, core.String query, core.S
tring scoring, core.String spell, core.bool stemmed, core.List<core.String> type
, core.List<core.String> with_, core.List<core.String> without, commons.Download
Options downloadOptions: commons.DownloadOptions.Metadata}) { |
| 190 var _url = null; | 195 var _url = null; |
| 191 var _queryParams = new core.Map(); | 196 var _queryParams = new core.Map(); |
| 192 var _uploadMedia = null; | 197 var _uploadMedia = null; |
| 193 var _uploadOptions = null; | 198 var _uploadOptions = null; |
| 194 var _downloadOptions = common.DownloadOptions.Metadata; | 199 var _downloadOptions = commons.DownloadOptions.Metadata; |
| 195 var _body = null; | 200 var _body = null; |
| 196 | 201 |
| 197 if (asOfTime != null) { | 202 if (asOfTime != null) { |
| 198 _queryParams["as_of_time"] = [asOfTime]; | 203 _queryParams["as_of_time"] = [asOfTime]; |
| 199 } | 204 } |
| 200 if (callback != null) { | 205 if (callback != null) { |
| 201 _queryParams["callback"] = [callback]; | 206 _queryParams["callback"] = [callback]; |
| 202 } | 207 } |
| 203 if (cursor != null) { | 208 if (cursor != null) { |
| 204 _queryParams["cursor"] = ["${cursor}"]; | 209 _queryParams["cursor"] = ["${cursor}"]; |
| (...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 269 _url = 'search'; | 274 _url = 'search'; |
| 270 | 275 |
| 271 var _response = _requester.request(_url, | 276 var _response = _requester.request(_url, |
| 272 "GET", | 277 "GET", |
| 273 body: _body, | 278 body: _body, |
| 274 queryParams: _queryParams, | 279 queryParams: _queryParams, |
| 275 uploadOptions: _uploadOptions, | 280 uploadOptions: _uploadOptions, |
| 276 uploadMedia: _uploadMedia, | 281 uploadMedia: _uploadMedia, |
| 277 downloadOptions: _downloadOptions); | 282 downloadOptions: _downloadOptions); |
| 278 if (_downloadOptions == null || | 283 if (_downloadOptions == null || |
| 279 _downloadOptions == common.DownloadOptions.Metadata) { | 284 _downloadOptions == commons.DownloadOptions.Metadata) { |
| 280 return _response.then((data) => null); | 285 return _response.then((data) => null); |
| 281 } else { | 286 } else { |
| 282 return _response; | 287 return _response; |
| 283 } | 288 } |
| 284 } | 289 } |
| 285 | 290 |
| 286 } | 291 } |
| 287 | 292 |
| 288 | 293 |
| 289 | 294 |
| (...skipping 23 matching lines...) Expand all Loading... |
| 313 _json["id"] = id; | 318 _json["id"] = id; |
| 314 } | 319 } |
| 315 if (name != null) { | 320 if (name != null) { |
| 316 _json["name"] = name; | 321 _json["name"] = name; |
| 317 } | 322 } |
| 318 return _json; | 323 return _json; |
| 319 } | 324 } |
| 320 } | 325 } |
| 321 | 326 |
| 322 | 327 |
| 323 /** Not documented yet. */ | |
| 324 class ReconcileCandidate { | 328 class ReconcileCandidate { |
| 325 /** | 329 /** |
| 326 * Percentage likelihood that this candidate is the unique matching entity. | 330 * Percentage likelihood that this candidate is the unique matching entity. |
| 327 * Value will be between 0.0 and 1.0 | 331 * Value will be between 0.0 and 1.0 |
| 328 */ | 332 */ |
| 329 core.double confidence; | 333 core.double confidence; |
| 330 | 334 |
| 331 /** Language code that candidate and notable names are displayed in. */ | 335 /** Language code that candidate and notable names are displayed in. */ |
| 332 core.String lang; | 336 core.String lang; |
| 333 | 337 |
| (...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 409 _json["hits"] = hits; | 413 _json["hits"] = hits; |
| 410 } | 414 } |
| 411 if (ms != null) { | 415 if (ms != null) { |
| 412 _json["ms"] = ms; | 416 _json["ms"] = ms; |
| 413 } | 417 } |
| 414 return _json; | 418 return _json; |
| 415 } | 419 } |
| 416 } | 420 } |
| 417 | 421 |
| 418 | 422 |
| 419 /** Not documented yet. */ | |
| 420 class ReconcileGetWarning { | 423 class ReconcileGetWarning { |
| 421 /** Location of warning in the request e.g. invalid predicate. */ | 424 /** Location of warning in the request e.g. invalid predicate. */ |
| 422 core.String location; | 425 core.String location; |
| 423 | 426 |
| 424 /** Warning message to display to the user. */ | 427 /** Warning message to display to the user. */ |
| 425 core.String message; | 428 core.String message; |
| 426 | 429 |
| 427 /** Code for identifying classes of warnings. */ | 430 /** Code for identifying classes of warnings. */ |
| 428 core.String reason; | 431 core.String reason; |
| 429 | 432 |
| (...skipping 21 matching lines...) Expand all Loading... |
| 451 _json["message"] = message; | 454 _json["message"] = message; |
| 452 } | 455 } |
| 453 if (reason != null) { | 456 if (reason != null) { |
| 454 _json["reason"] = reason; | 457 _json["reason"] = reason; |
| 455 } | 458 } |
| 456 return _json; | 459 return _json; |
| 457 } | 460 } |
| 458 } | 461 } |
| 459 | 462 |
| 460 | 463 |
| 461 /** Not documented yet. */ | |
| 462 class ReconcileGet { | 464 class ReconcileGet { |
| 463 /** | 465 /** |
| 464 * If filled, then the listed candidates are potential matches, and such | 466 * If filled, then the listed candidates are potential matches, and such |
| 465 * should be evaluated by a more discerning algorithm or human. The matches | 467 * should be evaluated by a more discerning algorithm or human. The matches |
| 466 * are ordered by confidence. | 468 * are ordered by confidence. |
| 467 */ | 469 */ |
| 468 core.List<ReconcileCandidate> candidate; | 470 core.List<ReconcileCandidate> candidate; |
| 469 | 471 |
| 470 /** Server costs for reconciling. */ | 472 /** Server costs for reconciling. */ |
| 471 ReconcileGetCosts costs; | 473 ReconcileGetCosts costs; |
| (...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 513 } | 515 } |
| 514 if (match != null) { | 516 if (match != null) { |
| 515 _json["match"] = (match).toJson(); | 517 _json["match"] = (match).toJson(); |
| 516 } | 518 } |
| 517 if (warning != null) { | 519 if (warning != null) { |
| 518 _json["warning"] = warning.map((value) => (value).toJson()).toList(); | 520 _json["warning"] = warning.map((value) => (value).toJson()).toList(); |
| 519 } | 521 } |
| 520 return _json; | 522 return _json; |
| 521 } | 523 } |
| 522 } | 524 } |
| 523 | |
| 524 | |
| OLD | NEW |