Delete A Project Extended Attribute Introduction
This example allows you to delete a project extended attribute 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.
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 deleteResponse = await TasksApi.DeleteExtendedAttributeByIndexAsync(new DeleteExtendedAttributeByIndexRequest
{
Index = 1,
Name = remoteName,
Folder = this.DataFolder
});
Assert.AreEqual((int)HttpStatusCode.OK, deleteResponse.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 = "DeleteExtendedAttribute.mpp";
$folder = $this->uploadFile("NewProductDev.mpp", $remoteName, '');
$response = $this->tasks->deleteExtendedAttributeByIndex(new Requests\DeleteExtendedAttributeByIndexRequest($remoteName, 1, self::$storageName, $folder));
Assert::assertEquals(200, $response->getCode());
$response = $this->tasks->getExtendedAttributes(new Requests\GetExtendedAttributesRequest($remoteName, self::$storageName, $folder));
Assert::assertEquals(200, $response->getCode());
Assert::assertNotNull($response->getExtendedAttributes());
Assert::assertEquals(1, count($response->getExtendedAttributes()->getList()));
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 = DeleteExtendedAttributeByIndexRequest(filename, 1)
delete_result = self.tasks_api.delete_extended_attribute_by_index(delete_request)
self.assertIsNotNone(delete_result)
self.assertIsInstance(delete_result, AsposeResponse)
get_request = GetExtendedAttributesRequest(filename)
get_result = self.tasks_api.get_extended_attributes(get_request)
self.assertIsNotNone(get_result)
self.assertIsInstance(get_result, ExtendedAttributeItemsResponse)
self.assertIsNotNone(get_result.extended_attributes)
self.assertEqual(1, len(get_result.extended_attributes.list))
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 DeleteExtendedAttributeByIndexRequest();
request.name = fileName;
request.folder = remotePath;
request.index = 1;
const result = await tasksApi.deleteExtendedAttributeByIndex(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)
deleteResult, _, err := client.TasksApi.DeleteExtendedAttributeByIndex(ctx, &requests.DeleteExtendedAttributeByIndexOpts{
Name: remoteFileName,
Folder: optional.NewString(remoteBaseTestDataFolder),
Index: 1,
})
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);
DeleteExtendedAttributeByIndexRequest request1 = new DeleteExtendedAttributeByIndexRequest(remoteFileName, 1,null, null);
AsposeResponse result1 = TestInitializer.tasksApi.deleteExtendedAttributeByIndex(request1);
assertEquals(200, (int) result1.getCode());