update method

Future<GoogleCloudApigeeV1ResourceFile> update(
  1. GoogleApiHttpBody request,
  2. String parent,
  3. String type,
  4. String name, {
  5. String? $fields,
})

Updates a resource file.

Specify the Content-Type as application/octet-stream or multipart/form-data. For more information about resource files, see Resource files.

request - The metadata request object.

Request parameters:

parent - Required. Name of the environment in the following format: organizations/{org}/environments/{env}. Value must have pattern ^organizations/\[^/\]+/environments/\[^/\]+$.

type - Required. Resource file type. {{ resource_file_type }}

name - Required. ID of the resource file to update. Must match the regular expression: [a-zA-Z0-9:/\!@#$%^&{}[]()+-=,.~'` ]{1,255}

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

Completes with a GoogleCloudApigeeV1ResourceFile.

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<GoogleCloudApigeeV1ResourceFile> update(
  GoogleApiHttpBody request,
  core.String parent,
  core.String type,
  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_ = 'v1/' +
      core.Uri.encodeFull('$parent') +
      '/resourcefiles/' +
      commons.escapeVariable('$type') +
      '/' +
      commons.escapeVariable('$name');

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