Delete A Project Outline Code Introduction
This example allows you to delete a project Outline Code using Aspose.Tasks Cloud API in your applications. You can use our REST API with any language: .NET, Java, PHP, Ruby, Rails, Python, jQuery and many more.
API
Type
Description
Resource Link
/tasks/{name}/outlineCodes/{index}
DELETE
Deletes a project outline code
DeleteOutlineCodeByIndex
cURL Example
SDKs
The Aspose.Tasks Cloud SDKs can be downloaded from the following page: Available SDKs
SDK Examples
C#
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// For complete examples and data files, please go to https://github.com/aspose-tasks-cloud/aspose-tasks-cloud-dotnet/
var remoteName = await UploadFileToStorageAsync("NewProductDev.mpp");
var response = await TasksApi.DeleteOutlineCodeByIndexAsync(new DeleteOutlineCodeByIndexRequest
{
Index = 1,
Name = remoteName,
Folder = this.DataFolder
});
Assert.AreEqual((int)HttpStatusCode.OK, response.Code);
PHP
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?
// For complete examples and data files, please go to https://github.com/aspose-tasks-cloud/aspose-tasks-cloud-php/
$remoteName = "DeleteOutlineCodeByIndex.mpp";
$folder = $this->uploadFile("NewProductDev.mpp", $remoteName, '');
$response = $this->tasks->deleteOutlineCodeByIndex(new Requests\DeleteOutlineCodeByIndexRequest($remoteName, 1, self::$storageName, $folder));
Assert::assertEquals(200, $response->getCode());
$response = $this->tasks->getOutlineCodes(new Requests\GetOutlineCodesRequest($remoteName, self::$storageName, $folder));
Assert::assertEquals(200, $response->getCode());
Assert::assertNotNull($response->getOutlineCodes());
Assert::assertEquals(1, count($response->getOutlineCodes()->getList()));
Assert::assertEquals(1, $response->getOutlineCodes()->getList()[0]->getIndex());
Python
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# For complete examples and data files, please go to https://github.com/aspose-tasks-cloud/aspose-tasks-cloud-python
filename = 'NewProductDev.mpp'
self.upload_file(filename)
delete_request = DeleteOutlineCodeByIndexRequest(filename, 1)
delete_result = self.tasks_api.delete_outline_code_by_index(delete_request)
self.assertIsNotNone(delete_result)
self.assertIsInstance(delete_result, AsposeResponse)
get_request = GetOutlineCodesRequest(filename)
get_result = self.tasks_api.get_outline_codes(get_request)
self.assertIsNotNone(get_result)
self.assertIsInstance(get_result, OutlineCodeItemsResponse)
self.assertEqual(1, len(get_result.outline_codes.list))
self.assertEqual(1, get_result.outline_codes.list[0].index)
Node.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// For complete examples and data files, please go to https://github.com/aspose-tasks-cloud/aspose-tasks-cloud-node
const fileName = "NewProductDev.mpp";
const localPath = "./Data/" + fileName;
const remotePath = "Temp/Data";
const remoteFullPath = remotePath + "/" + fileName;
await tasksApi.uploadFileToStorage(remoteFullPath, localPath);
const request = new DeleteOutlineCodeByIndexRequest();
request.name = fileName;
request.folder = remotePath;
request.index = 1;
const result = await tasksApi.deleteOutlineCodeByIndex(request);
expect(result.response.statusCode).to.equal(200);
Go
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// For complete examples and data files, please go to https://github.com/aspose-tasks-cloud/aspose-tasks-cloud-go/
client, ctx := UploadTestFileToStorage(t, localFileName, remoteBaseTestDataFolder+"/"+remoteFileName)
deleteOptions := &requests.DeleteOutlineCodeByIndexOpts{
Name: remoteFileName,
Folder: optional.NewString(remoteBaseTestDataFolder),
Index: 1,
}
deleteResult, _, err := client.TasksApi.DeleteOutlineCodeByIndex(ctx, deleteOptions)
if err != nil {
t.Error(err)
}
assert.Equal(t, int32(200), deleteResult.Code)
Java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// For complete examples and data files, please go to https://github.com/aspose-tasks-cloud/aspose-tasks-cloud-java/
String localFileName = "NewProductDev.mpp";
String remoteFileName = TestInitializer.UploadFile(localFileName);
DeleteOutlineCodeByIndexRequest request1 = new DeleteOutlineCodeByIndexRequest(remoteFileName, 1, null, null);
AsposeResponse result1 = TestInitializer.tasksApi.deleteOutlineCodeByIndex(request1);
assertNotNull(result1);
assertEquals(200, (int) result1.getCode());