list method
Lists entity rows of a particular entity type contained in the request.
Note: 1. Currently, only max of one 'sort_by' column is supported. 2. If no 'sort_by' column is provided, the primary key of the table is used. If zero or more than one primary key is available, we default to the unpaginated list entities logic which only returns the first page. 3. The values of the 'sort_by' columns must uniquely identify an entity row, otherwise undefined behaviors may be observed during pagination. 4. Since transactions are not supported, any updates, inserts or deletes during pagination can lead to stale data being returned or other unexpected behaviors.
Request parameters:
parent
- Required. Resource name of the Entity Type. Format:
projects/{project}/locations/{location}/connections/{connection}/entityTypes/{type}
Value must have pattern
^projects/\[^/\]+/locations/\[^/\]+/connections/\[^/\]+/entityTypes/\[^/\]+$
.
conditions
- Conditions to be used when listing entities. From a proto
standpoint, There are no restrictions on what can be passed using this
field. The connector documentation should have information about what
format of filters/conditions are supported.
pageSize
- Number of entity rows to return. Defaults page size = 25. Max
page size = 200.
pageToken
- Page token value if available from a previous request.
sortBy
- List of 'sort_by' columns to use when returning the results.
$fields
- Selector specifying which fields to include in a partial
response.
Completes with a ListEntitiesResponse.
Completes with a commons.ApiRequestError if the API endpoint returned an error.
If the used http.Client
completes with an error when making a REST call,
this method will complete with the same error.
Implementation
async.Future<ListEntitiesResponse> list(
core.String parent, {
core.String? conditions,
core.int? pageSize,
core.String? pageToken,
core.List<core.String>? sortBy,
core.String? $fields,
}) async {
final queryParams_ = <core.String, core.List<core.String>>{
if (conditions != null) 'conditions': [conditions],
if (pageSize != null) 'pageSize': ['${pageSize}'],
if (pageToken != null) 'pageToken': [pageToken],
if (sortBy != null) 'sortBy': sortBy,
if ($fields != null) 'fields': [$fields],
};
final url_ = 'v2/' + core.Uri.encodeFull('$parent') + '/entities';
final response_ = await _requester.request(
url_,
'GET',
queryParams: queryParams_,
);
return ListEntitiesResponse.fromJson(
response_ as core.Map<core.String, core.dynamic>);
}