patch method
- GoogleCloudApihubV1Attribute request,
- String name, {
- String? updateMask,
- String? $fields,
Update the attribute.
The following fields in the Attribute resource can be updated: * display_name The display name can be updated for user defined attributes only. * description The description can be updated for user defined attributes only. * allowed_values To update the list of allowed values, clients need to use the fetched list of allowed values and add or remove values to or from the same list. The mutable allowed values can be updated for both user defined and System defined attributes. The immutable allowed values cannot be updated or deleted. The updated list of allowed values cannot be empty. If an allowed value that is already used by some resource's attribute is deleted, then the association between the resource and the attribute value will also be deleted. * cardinality The cardinality can be updated for user defined attributes only. Cardinality can only be increased during an update. The update_mask should be used to specify the fields being updated.
request
- The metadata request object.
Request parameters:
name
- Identifier. The name of the attribute in the API Hub. Format:
projects/{project}/locations/{location}/attributes/{attribute}
Value must have pattern
^projects/\[^/\]+/locations/\[^/\]+/attributes/\[^/\]+$
.
updateMask
- Required. The list of fields to update.
$fields
- Selector specifying which fields to include in a partial
response.
Completes with a GoogleCloudApihubV1Attribute.
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<GoogleCloudApihubV1Attribute> patch(
GoogleCloudApihubV1Attribute 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>>{
if (updateMask != null) 'updateMask': [updateMask],
if ($fields != null) 'fields': [$fields],
};
final url_ = 'v1/' + core.Uri.encodeFull('$name');
final response_ = await _requester.request(
url_,
'PATCH',
body: body_,
queryParams: queryParams_,
);
return GoogleCloudApihubV1Attribute.fromJson(
response_ as core.Map<core.String, core.dynamic>,
);
}