patch method
- DataSegment request,
- String name, {
- String? updateMask,
- String? $fields,
Updates a data segment.
request - The metadata request object.
Request parameters:
name - Immutable. Identifier. The unique identifier for the data
segment. Account ID corresponds to the account ID that created the
segment. Format:
curators/{curatorAccountId}/dataSegments/{curatorDataSegmentId}
Value must have pattern ^curators/\[^/\]+/dataSegments/\[^/\]+$.
updateMask - Optional. List of fields to be updated. If empty or
unspecified, the service will update all fields populated in the update
request excluding the output only fields and primitive fields with default
value. Note that explicit field mask is required in order to reset a
primitive field back to its default value, for example, false for boolean
fields, 0 for integer fields. A special field mask consisting of a single
path "*" can be used to indicate full replacement(the equivalent of PUT
method), updatable fields unset or unspecified in the input will be
cleared or set to default value. Output only fields will be ignored
regardless of the value of updateMask.
$fields - Selector specifying which fields to include in a partial
response.
Completes with a DataSegment.
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<DataSegment> patch(
DataSegment request,
core.String name, {
core.String? updateMask,
core.String? $fields,
}) async {
final body_ = convert.json.encode(request);
final queryParams_ = <core.String, core.List<core.String>>{
'updateMask': ?updateMask == null ? null : [updateMask],
'fields': ?$fields == null ? null : [$fields],
};
final url_ = 'v1/' + core.Uri.encodeFull('$name');
final response_ = await _requester.request(
url_,
'PATCH',
body: body_,
queryParams: queryParams_,
);
return DataSegment.fromJson(
response_ as core.Map<core.String, core.dynamic>,
);
}