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 * [limit] - Limits the number of entities to be returned. |
| 43 * |
42 * [prefix] - Enables prefix match against names and aliases of entities | 44 * [prefix] - Enables prefix match against names and aliases of entities |
43 * | 45 * |
44 * [query] - The literal query string for search. | 46 * [query] - The literal query string for search. |
45 * | 47 * |
46 * [types] - Restricts returned entities with these types, e.g. Person | 48 * [types] - Restricts returned entities with these types, e.g. Person |
47 * (as defined in http://schema.org/Person). If multiple types are specified, | 49 * (as defined in http://schema.org/Person). If multiple types are specified, |
48 * returned entities will contain one or more of these types. | 50 * returned entities will contain one or more of these types. |
49 * | 51 * |
50 * [indent] - Enables indenting of json results. | 52 * [indent] - Enables indenting of json results. |
51 * | 53 * |
52 * [languages] - The list of language codes (defined in ISO 693) to run the | 54 * [languages] - The list of language codes (defined in ISO 693) to run the |
53 * query with, | 55 * query with, |
54 * e.g. 'en'. | 56 * e.g. 'en'. |
55 * | 57 * |
56 * [ids] - The list of entity id to be used for search instead of query | 58 * [ids] - The list of entity id to be used for search instead of query |
57 * string. | 59 * string. |
58 * To specify multiple ids in the HTTP request, repeat the parameter in the | 60 * To specify multiple ids in the HTTP request, repeat the parameter in the |
59 * URL as in ...?ids=A&ids=B | 61 * URL as in ...?ids=A&ids=B |
60 * | 62 * |
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.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}) { | 71 async.Future<SearchResponse> search({core.int limit, core.bool prefix, core.St
ring query, core.List<core.String> types, core.bool indent, core.List<core.Strin
g> languages, core.List<core.String> ids}) { |
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 (limit != null) { |
| 80 _queryParams["limit"] = ["${limit}"]; |
| 81 } |
79 if (prefix != null) { | 82 if (prefix != null) { |
80 _queryParams["prefix"] = ["${prefix}"]; | 83 _queryParams["prefix"] = ["${prefix}"]; |
81 } | 84 } |
82 if (query != null) { | 85 if (query != null) { |
83 _queryParams["query"] = [query]; | 86 _queryParams["query"] = [query]; |
84 } | 87 } |
85 if (types != null) { | 88 if (types != null) { |
86 _queryParams["types"] = types; | 89 _queryParams["types"] = types; |
87 } | 90 } |
88 if (indent != null) { | 91 if (indent != null) { |
89 _queryParams["indent"] = ["${indent}"]; | 92 _queryParams["indent"] = ["${indent}"]; |
90 } | 93 } |
91 if (languages != null) { | 94 if (languages != null) { |
92 _queryParams["languages"] = languages; | 95 _queryParams["languages"] = languages; |
93 } | 96 } |
94 if (ids != null) { | 97 if (ids != null) { |
95 _queryParams["ids"] = ids; | 98 _queryParams["ids"] = ids; |
96 } | 99 } |
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 |