patch method
- GoogleCloudDialogflowV2Environment request,
- String name, {
- bool? allowLoadToDraftAndDiscardChanges,
- String? updateMask,
- String? $fields,
Updates the specified agent environment.
This method allows you to deploy new agent versions into the environment.
When an environment is pointed to a new agent version by setting
environment.agent_version
, the environment is temporarily set to the
LOADING
state. During that time, the environment continues serving the
previous version of the agent. After the new agent version is done
loading, the environment is set back to the RUNNING
state. You can use
"-" as Environment ID in environment name to update an agent version in
the default environment. WARNING: this will negate all recent changes to
the draft agent and can't be undone. You may want to save the draft agent
to a version before calling this method.
request
- The metadata request object.
Request parameters:
name
- Output only. The unique identifier of this agent environment.
Supported formats: - projects//agent/environments/
-
projects//locations//agent/environments/
The environment ID for the
default environment is -
.
Value must have pattern ^projects/\[^/\]+/agent/environments/\[^/\]+$
.
allowLoadToDraftAndDiscardChanges
- Optional. This field is used to
prevent accidental overwrite of the default environment, which is an
operation that cannot be undone. To confirm that the caller desires this
overwrite, this field must be explicitly set to true when updating the
default environment (environment ID = -
).
updateMask
- Required. The mask to control which fields get updated.
$fields
- Selector specifying which fields to include in a partial
response.
Completes with a GoogleCloudDialogflowV2Environment.
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<GoogleCloudDialogflowV2Environment> patch(
GoogleCloudDialogflowV2Environment request,
core.String name, {
core.bool? allowLoadToDraftAndDiscardChanges,
core.String? updateMask,
core.String? $fields,
}) async {
final body_ = convert.json.encode(request);
final queryParams_ = <core.String, core.List<core.String>>{
if (allowLoadToDraftAndDiscardChanges != null)
'allowLoadToDraftAndDiscardChanges': [
'${allowLoadToDraftAndDiscardChanges}'
],
if (updateMask != null) 'updateMask': [updateMask],
if ($fields != null) 'fields': [$fields],
};
final url_ = 'v2/' + core.Uri.encodeFull('$name');
final response_ = await _requester.request(
url_,
'PATCH',
body: body_,
queryParams: queryParams_,
);
return GoogleCloudDialogflowV2Environment.fromJson(
response_ as core.Map<core.String, core.dynamic>);
}