removeControl method

Future<GoogleCloudRetailV2ServingConfig> removeControl(
  1. GoogleCloudRetailV2RemoveControlRequest request,
  2. String servingConfig, {
  3. String? $fields,
})

Disables a Control on the specified ServingConfig.

The control is removed from the ServingConfig. Returns a NOT_FOUND error if the Control is not enabled for the ServingConfig.

request - The metadata request object.

Request parameters:

servingConfig - Required. The source ServingConfig resource name . Format: projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}/servingConfigs/{serving_config_id} Value must have pattern ^projects/\[^/\]+/locations/\[^/\]+/catalogs/\[^/\]+/servingConfigs/\[^/\]+$.

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

Completes with a GoogleCloudRetailV2ServingConfig.

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<GoogleCloudRetailV2ServingConfig> removeControl(
  GoogleCloudRetailV2RemoveControlRequest request,
  core.String servingConfig, {
  core.String? $fields,
}) async {
  final body_ = convert.json.encode(request);
  final queryParams_ = <core.String, core.List<core.String>>{
    if ($fields != null) 'fields': [$fields],
  };

  final url_ =
      'v2/' + core.Uri.encodeFull('$servingConfig') + ':removeControl';

  final response_ = await _requester.request(
    url_,
    'POST',
    body: body_,
    queryParams: queryParams_,
  );
  return GoogleCloudRetailV2ServingConfig.fromJson(
      response_ as core.Map<core.String, core.dynamic>);
}