close method

Future<Case> close(
  1. CloseCaseRequest request,
  2. String name, {
  3. String? $fields,
})

Close a case.

EXAMPLES: cURL: shell case="projects/some-project/cases/43595344" curl \ --request POST \ --header "Authorization: Bearer $(gcloud auth print-access-token)" \ "https://cloudsupport.googleapis.com/v2/$case:close" Python: python import googleapiclient.discovery api_version = "v2" supportApiService = googleapiclient.discovery.build( serviceName="cloudsupport", version=api_version, discoveryServiceUrl=f"https://cloudsupport.googleapis.com/$discovery/rest?version={api_version}", ) request = supportApiService.cases().close( name="projects/some-project/cases/43595344" ) print(request.execute())

request - The metadata request object.

Request parameters:

name - Required. The name of the case to close. Value must have pattern ^\[^/\]+/\[^/\]+/cases/\[^/\]+$.

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

Completes with a Case.

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<Case> close(
  CloseCaseRequest request,
  core.String name, {
  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('$name') + ':close';

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