createBackupSelection method

Future<CreateBackupSelectionOutput> createBackupSelection({
  1. required String backupPlanId,
  2. required BackupSelection backupSelection,
  3. String? creatorRequestId,
})

Creates a JSON document that specifies a set of resources to assign to a backup plan. For examples, see Assigning resources programmatically.

May throw AlreadyExistsException. May throw InvalidParameterValueException. May throw LimitExceededException. May throw MissingParameterValueException. May throw ServiceUnavailableException.

Parameter backupPlanId : The ID of the backup plan.

Parameter backupSelection : The body of a request to assign a set of resources to a backup plan.

Parameter creatorRequestId : A unique string that identifies the request and allows failed requests to be retried without the risk of running the operation twice. This parameter is optional.

If used, this parameter must contain 1 to 50 alphanumeric or '-_.' characters.

Implementation

Future<CreateBackupSelectionOutput> createBackupSelection({
  required String backupPlanId,
  required BackupSelection backupSelection,
  String? creatorRequestId,
}) async {
  final $payload = <String, dynamic>{
    'BackupSelection': backupSelection,
    'CreatorRequestId': creatorRequestId ?? _s.generateIdempotencyToken(),
  };
  final response = await _protocol.send(
    payload: $payload,
    method: 'PUT',
    requestUri:
        '/backup/plans/${Uri.encodeComponent(backupPlanId)}/selections',
    exceptionFnMap: _exceptionFns,
  );
  return CreateBackupSelectionOutput.fromJson(response);
}