create method

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

Creates a new RestoreVerificationPlanAssociation in a given RestoreVerificationPlan.

request - The metadata request object.

Request parameters:

parent - Required. The parent resource where this association will be created. Format: projects/{project}/locations/{location}/restoreVerificationPlans/{restore_verification_plan} Value must have pattern ^projects/\[^/\]+/locations/\[^/\]+/restoreVerificationPlans/\[^/\]+$.

requestId - Optional. An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know that the server has already received the duplicate request and can avoid responding with an error. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).

restoreVerificationPlanAssociationId - Required. The ID to use for the association, which will become the final component of the association's resource name. This value should be 1-63 characters, and valid characters are /[a-z0-9_-]/.

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

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

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