create method

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

Creates 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 which to create the resource file in the following format: organizations/{org}/environments/{env}. Value must have pattern ^organizations/\[^/\]+/environments/\[^/\]+$.

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

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

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

  final url_ = 'v1/' + core.Uri.encodeFull('$parent') + '/resourcefiles';

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