create method

Future<GoogleLongrunningOperation> create(
  1. GoogleCloudApigeeV1ApimServiceExtension request,
  2. String parent, {
  3. String? apimServiceExtensionId,
  4. String? $fields,
})

Creates an APIM ServiceExtension in an organization.

request - The metadata request object.

Request parameters:

parent - Required. Name of the organization in which the service extension will be created. Use the following structure in your request: organizations/{org} Value must have pattern ^organizations/\[^/\]+$.

apimServiceExtensionId - Optional. ID used to uniquely identify of the service extension. It must conform with RFC-1034, is restricted to lower-cased letters, numbers and hyphens, and can have a maximum length of 63 characters. Additionally, the first character must be a letter and the last a letter or a number.

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

Completes with a GoogleLongrunningOperation.

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

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

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