modifyDatabaseConnection method

Future<Response> modifyDatabaseConnection({
  1. required String databaseName,
  2. required String dbName,
  3. required String host,
  4. required String password,
  5. required String port,
  6. required String username,
})

Implementation

Future<http.Response> modifyDatabaseConnection({
  required String databaseName,
  required String dbName,
  required String host,
  required String password,
  required String port,
  required String username,
}) async {
  final url = Uri.parse('$baseUrl/modifyDatabaseConnection?workspaceId=$workspaceId&databaseName=$databaseName&is_encrypt=true');
  final headers = {
    'Content-Type': 'application/json',
    'Authorization': 'Bearer $token',
  };
  final body = jsonEncode({
    "database_attributes": {
      "dbName": dbName,
      "host": host,
      "password": password,
      "port": port,
      "username": username
    }
  });

  return await http.patch(url, headers: headers, body: body);
}