updateConfig method

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

Sets the Hosting metadata for a specific site.

request - The metadata request object.

Request parameters:

name - Required. The site for which to update the SiteConfig, in the format: sites/ site-name/config Value must have pattern ^sites/\[^/\]+/config$.

updateMask - A set of field names from your [site configuration](../sites.SiteConfig) that you want to update. A field will be overwritten if, and only if, it's in the mask. If a mask is not provided then a default mask of only [max_versions](../sites.SiteConfig.max_versions) will be used.

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

Completes with a SiteConfig.

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<SiteConfig> updateConfig(
  SiteConfig 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 = 'v1beta1/' + core.Uri.encodeFull('$name');

  final _response = await _requester.request(
    _url,
    'PATCH',
    body: _body,
    queryParams: _queryParams,
  );
  return SiteConfig.fromJson(
      _response as core.Map<core.String, core.dynamic>);
}