fetch method
Performs the data fetch immediately (even outside fetch schedule) on a data source from your Merchant Center Account.
If you need to call this method more than once per day, you should use the Products service to update your product data instead. This method only works on data sources with a file input set.
request
- The metadata request object.
Request parameters:
name
- Required. The name of the data source resource to fetch. Format:
accounts/{account}/dataSources/{datasource}
Value must have pattern ^accounts/\[^/\]+/dataSources/\[^/\]+$
.
$fields
- Selector specifying which fields to include in a partial
response.
Completes with a Empty.
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<Empty> fetch(
FetchDataSourceRequest request,
core.String name, {
core.String? $fields,
}) async {
final body_ = convert.json.encode(request);
final queryParams_ = <core.String, core.List<core.String>>{
if ($fields != null) 'fields': [$fields],
};
final url_ = 'datasources/v1/' + core.Uri.encodeFull('$name') + ':fetch';
final response_ = await _requester.request(
url_,
'POST',
body: body_,
queryParams: queryParams_,
);
return Empty.fromJson(response_ as core.Map<core.String, core.dynamic>);
}