patch method
- GoogleChatV1Section request,
- String name, {
- String? updateMask,
- String? $fields,
Updates a section.
Only sections of type CUSTOM_SECTION can be updated. For details, see
Create and organize sections in Google Chat.
Requires
user authentication
with the
authorization scope:
https://www.googleapis.com/auth/chat.users.sections
request - The metadata request object.
Request parameters:
name - Identifier. Resource name of the section. For system sections,
the section ID is a constant string: - DEFAULT_DIRECT_MESSAGES:
users/{user}/sections/default-direct-messages - DEFAULT_SPACES:
users/{user}/sections/default-spaces - DEFAULT_APPS:
users/{user}/sections/default-apps Format:
users/{user}/sections/{section}
Value must have pattern ^users/\[^/\]+/sections/\[^/\]+$.
updateMask - Required. The mask to specify which fields to update.
Currently supported field paths: - display_name
$fields - Selector specifying which fields to include in a partial
response.
Completes with a GoogleChatV1Section.
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<GoogleChatV1Section> patch(
GoogleChatV1Section 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 GoogleChatV1Section.fromJson(
response_ as core.Map<core.String, core.dynamic>,
);
}