create method

Future<Operation> create(
  1. AutonomousDatabase request,
  2. String parent, {
  3. String? autonomousDatabaseId,
  4. String? requestId,
  5. String? $fields,
})

Creates a new Autonomous Database in a given project and location.

request - The metadata request object.

Request parameters:

parent - Required. The name of the parent in the following format: projects/{project}/locations/{location}. Value must have pattern ^projects/\[^/\]+/locations/\[^/\]+$.

autonomousDatabaseId - Required. The ID of the Autonomous Database to create. This value is restricted to (^[a-z]([a-z0-9-]{0,61}[a-z0-9])?$) and must be a maximum of 63 characters in length. The value must start with a letter and end with a letter or a number.

requestId - Optional. An optional ID to identify the request. This value is used to identify duplicate requests. If you make a request with the same request ID and the original request is still in progress or completed, the server ignores the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).

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

Completes with a Operation.

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

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

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