patch method

Future<BillingAccount> patch(
  1. BillingAccount request,
  2. String name, {
  3. String? updateMask,
  4. String? $fields,
})

Updates a billing account's fields.

Currently the only field that can be edited is display_name. The current authenticated user must have the billing.accounts.update IAM permission, which is typically given to the administrator of the billing account.

request - The metadata request object.

Request parameters:

name - Required. The name of the billing account resource to be updated. Value must have pattern ^billingAccounts/\[^/\]+$.

updateMask - The update mask applied to the resource. Only "display_name" is currently supported.

$fields - Selector specifying which fields to include in a partial response.

Completes with a BillingAccount.

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<BillingAccount> patch(
  BillingAccount 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 BillingAccount.fromJson(
      response_ as core.Map<core.String, core.dynamic>);
}