create method

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

Uploads a ZIP-formatted shared flow configuration bundle to an organization.

If the shared flow already exists, this creates a new revision of it. If the shared flow does not exist, this creates it. Once imported, the shared flow revision must be deployed before it can be accessed at runtime. The size limit of a shared flow bundle is 15 MB.

request - The metadata request object.

Request parameters:

parent - Required. The name of the parent organization under which to create the shared flow. Must be of the form: organizations/{organization_id} Value must have pattern ^organizations/\[^/\]+$.

action - Required. Must be set to either import or validate.

name - Required. The name to give the shared flow

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

Completes with a GoogleCloudApigeeV1SharedFlowRevision.

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

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

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