importBackendStorage method

Future<ImportBackendStorageResponse> importBackendStorage({
  1. required String appId,
  2. required String backendEnvironmentName,
  3. required ServiceName serviceName,
  4. String? bucketName,
})

Imports an existing backend storage resource.

May throw BadRequestException. May throw GatewayTimeoutException. May throw NotFoundException. May throw TooManyRequestsException.

Parameter appId : The app ID.

Parameter backendEnvironmentName : The name of the backend environment.

Parameter serviceName : The name of the storage service.

Parameter bucketName : The name of the S3 bucket.

Implementation

Future<ImportBackendStorageResponse> importBackendStorage({
  required String appId,
  required String backendEnvironmentName,
  required ServiceName serviceName,
  String? bucketName,
}) async {
  final $payload = <String, dynamic>{
    'serviceName': serviceName.value,
    if (bucketName != null) 'bucketName': bucketName,
  };
  final response = await _protocol.send(
    payload: $payload,
    method: 'POST',
    requestUri:
        '/backend/${Uri.encodeComponent(appId)}/storage/${Uri.encodeComponent(backendEnvironmentName)}/import',
    exceptionFnMap: _exceptionFns,
  );
  return ImportBackendStorageResponse.fromJson(response);
}