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.kgsearch.v1; | 3 library googleapis.kgsearch.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; |
(...skipping 21 matching lines...) Expand all Loading... |
32 EntitiesResourceApi(commons.ApiRequester client) : | 32 EntitiesResourceApi(commons.ApiRequester client) : |
33 _requester = client; | 33 _requester = client; |
34 | 34 |
35 /** | 35 /** |
36 * Searches Knowledge Graph for entities that match the constraints. | 36 * Searches Knowledge Graph for entities that match the constraints. |
37 * A list of matched entities will be returned in response, which will be in | 37 * A list of matched entities will be returned in response, which will be in |
38 * JSON-LD format and compatible with http://schema.org | 38 * JSON-LD format and compatible with http://schema.org |
39 * | 39 * |
40 * Request parameters: | 40 * Request parameters: |
41 * | 41 * |
42 * [ids] - The list of entity id to be used for search instead of query | |
43 * string. | |
44 * To specify multiple ids in the HTTP request, repeat the parameter in the | |
45 * URL as in ...?ids=A&ids=B | |
46 * | |
47 * [limit] - Limits the number of entities to be returned. | |
48 * | |
49 * [prefix] - Enables prefix match against names and aliases of entities | 42 * [prefix] - Enables prefix match against names and aliases of entities |
50 * | 43 * |
51 * [query] - The literal query string for search. | 44 * [query] - The literal query string for search. |
52 * | 45 * |
53 * [types] - Restricts returned entities with these types, e.g. Person | 46 * [types] - Restricts returned entities with these types, e.g. Person |
54 * (as defined in http://schema.org/Person). If multiple types are specified, | 47 * (as defined in http://schema.org/Person). If multiple types are specified, |
55 * returned entities will contain one or more of these types. | 48 * returned entities will contain one or more of these types. |
56 * | 49 * |
57 * [indent] - Enables indenting of json results. | 50 * [indent] - Enables indenting of json results. |
58 * | 51 * |
59 * [languages] - The list of language codes (defined in ISO 693) to run the | 52 * [languages] - The list of language codes (defined in ISO 693) to run the |
60 * query with, | 53 * query with, |
61 * e.g. 'en'. | 54 * e.g. 'en'. |
62 * | 55 * |
| 56 * [ids] - The list of entity id to be used for search instead of query |
| 57 * string. |
| 58 * To specify multiple ids in the HTTP request, repeat the parameter in the |
| 59 * URL as in ...?ids=A&ids=B |
| 60 * |
| 61 * [limit] - Limits the number of entities to be returned. |
| 62 * |
63 * Completes with a [SearchResponse]. | 63 * Completes with a [SearchResponse]. |
64 * | 64 * |
65 * Completes with a [commons.ApiRequestError] if the API endpoint returned an | 65 * Completes with a [commons.ApiRequestError] if the API endpoint returned an |
66 * error. | 66 * error. |
67 * | 67 * |
68 * If the used [http.Client] completes with an error when making a REST call, | 68 * If the used [http.Client] completes with an error when making a REST call, |
69 * this method will complete with the same error. | 69 * this method will complete with the same error. |
70 */ | 70 */ |
71 async.Future<SearchResponse> search({core.List<core.String> ids, core.int limi
t, core.bool prefix, core.String query, core.List<core.String> types, core.bool
indent, core.List<core.String> languages}) { | 71 async.Future<SearchResponse> search({core.bool prefix, core.String query, core
.List<core.String> types, core.bool indent, core.List<core.String> languages, co
re.List<core.String> ids, core.int limit}) { |
72 var _url = null; | 72 var _url = null; |
73 var _queryParams = new core.Map(); | 73 var _queryParams = new core.Map(); |
74 var _uploadMedia = null; | 74 var _uploadMedia = null; |
75 var _uploadOptions = null; | 75 var _uploadOptions = null; |
76 var _downloadOptions = commons.DownloadOptions.Metadata; | 76 var _downloadOptions = commons.DownloadOptions.Metadata; |
77 var _body = null; | 77 var _body = null; |
78 | 78 |
79 if (ids != null) { | |
80 _queryParams["ids"] = ids; | |
81 } | |
82 if (limit != null) { | |
83 _queryParams["limit"] = ["${limit}"]; | |
84 } | |
85 if (prefix != null) { | 79 if (prefix != null) { |
86 _queryParams["prefix"] = ["${prefix}"]; | 80 _queryParams["prefix"] = ["${prefix}"]; |
87 } | 81 } |
88 if (query != null) { | 82 if (query != null) { |
89 _queryParams["query"] = [query]; | 83 _queryParams["query"] = [query]; |
90 } | 84 } |
91 if (types != null) { | 85 if (types != null) { |
92 _queryParams["types"] = types; | 86 _queryParams["types"] = types; |
93 } | 87 } |
94 if (indent != null) { | 88 if (indent != null) { |
95 _queryParams["indent"] = ["${indent}"]; | 89 _queryParams["indent"] = ["${indent}"]; |
96 } | 90 } |
97 if (languages != null) { | 91 if (languages != null) { |
98 _queryParams["languages"] = languages; | 92 _queryParams["languages"] = languages; |
99 } | 93 } |
| 94 if (ids != null) { |
| 95 _queryParams["ids"] = ids; |
| 96 } |
| 97 if (limit != null) { |
| 98 _queryParams["limit"] = ["${limit}"]; |
| 99 } |
100 | 100 |
101 _url = 'v1/entities:search'; | 101 _url = 'v1/entities:search'; |
102 | 102 |
103 var _response = _requester.request(_url, | 103 var _response = _requester.request(_url, |
104 "GET", | 104 "GET", |
105 body: _body, | 105 body: _body, |
106 queryParams: _queryParams, | 106 queryParams: _queryParams, |
107 uploadOptions: _uploadOptions, | 107 uploadOptions: _uploadOptions, |
108 uploadMedia: _uploadMedia, | 108 uploadMedia: _uploadMedia, |
109 downloadOptions: _downloadOptions); | 109 downloadOptions: _downloadOptions); |
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
163 } | 163 } |
164 if (P_type != null) { | 164 if (P_type != null) { |
165 _json["@type"] = P_type; | 165 _json["@type"] = P_type; |
166 } | 166 } |
167 if (itemListElement != null) { | 167 if (itemListElement != null) { |
168 _json["itemListElement"] = itemListElement; | 168 _json["itemListElement"] = itemListElement; |
169 } | 169 } |
170 return _json; | 170 return _json; |
171 } | 171 } |
172 } | 172 } |
OLD | NEW |