patch method
Updates an account regardless of its type: standalone, advanced account or sub-account.
Executing this method requires admin access.
request
- The metadata request object.
Request parameters:
name
- Identifier. The resource name of the account. Format:
accounts/{account}
Value must have pattern ^accounts/\[^/\]+$
.
updateMask
- Optional. List of fields being updated. The following
fields are supported (in both snake_case
and lowerCamelCase
): -
account_name
- adult_content
- language_code
- time_zone
$fields
- Selector specifying which fields to include in a partial
response.
Completes with a Account.
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<Account> patch(
Account 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_ = 'accounts/v1/' + core.Uri.encodeFull('$name');
final response_ = await _requester.request(
url_,
'PATCH',
body: body_,
queryParams: queryParams_,
);
return Account.fromJson(response_ as core.Map<core.String, core.dynamic>);
}