updateSettings method
Updates the Log Router settings for the given resource.Note: Settings for the Log Router can currently only be configured for Google Cloud organizations.
Once configured, it applies to all projects and folders in the Google Cloud organization.UpdateSettings will fail if 1) kms_key_name is invalid, or 2) the associated service account does not have the required roles/cloudkms.cryptoKeyEncrypterDecrypter role assigned for the key, or 3) access to the key is disabled. 4) location_id is not supported by Logging. 5) location_id violate OrgPolicy.See Enabling CMEK for Log Router (https://cloud.google.com/logging/docs/routing/managed-encryption) for more information.
request
- The metadata request object.
Request parameters:
name
- Required. The resource name for the settings to update.
"organizations/[ORGANIZATION_ID]/settings" For
example:"organizations/12345/settings"Note: Settings for the Log Router
can currently only be configured for Google Cloud organizations. Once
configured, it applies to all projects and folders in the Google Cloud
organization.
Value must have pattern ^folders/\[^/\]+$
.
updateMask
- Optional. Field mask identifying which fields from settings
should be updated. A field will be overwritten if and only if it is in the
update mask. Output only fields cannot be updated.See FieldMask for more
information.For example: "updateMask=kmsKeyName"
$fields
- Selector specifying which fields to include in a partial
response.
Completes with a Settings.
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<Settings> updateSettings(
Settings 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_ = 'v2/' + core.Uri.encodeFull('$name') + '/settings';
final response_ = await _requester.request(
url_,
'PATCH',
body: body_,
queryParams: queryParams_,
);
return Settings.fromJson(response_ as core.Map<core.String, core.dynamic>);
}