create method
Creates a batch job.
request - The metadata request object.
Request parameters:
parent - Required. The value for parent.
Value must have pattern ^projects/\[^/\]+/locations/\[^/\]+$.
jobId - Required. A unique identifier for the job. job_id must be up
to 128 characters and must include only characters available in DNS names,
as defined by RFC-1123.
requestId - Optional. An optional request ID to identify requests.
Specify a unique request ID in case you need to retry your request.
Requests with same request_id are ignored for at least 60 minutes since
the first request. The request ID must be a valid UUID with the exception
that zero UUID isn't supported (00000000-0000-0000-0000-000000000000).
$fields - Selector specifying which fields to include in a partial
response.
Completes with a Operation.
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<Operation> create(
Job request,
core.String parent, {
core.String? jobId,
core.String? requestId,
core.String? $fields,
}) async {
final body_ = convert.json.encode(request);
final queryParams_ = <core.String, core.List<core.String>>{
'jobId': ?jobId == null ? null : [jobId],
'requestId': ?requestId == null ? null : [requestId],
'fields': ?$fields == null ? null : [$fields],
};
final url_ = 'v1/' + core.Uri.encodeFull('$parent') + '/jobs';
final response_ = await _requester.request(
url_,
'POST',
body: body_,
queryParams: queryParams_,
);
return Operation.fromJson(response_ as core.Map<core.String, core.dynamic>);
}