Class WorkItemsRequestBuilder
java.lang.Object
org.azd.abstractions.BaseRequestBuilder
org.azd.workitemtracking.workitems.WorkItemsRequestBuilder
Provides functionality to work with work items Api.
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic class
Represents the query parameters.static class
Request configuration object for the query parameters.static class
Represents the query parameters.static class
Request configuration object for the query parameters.static class
Represents the query parameters.static class
Request configuration object for the query parameters.Nested classes/interfaces inherited from class org.azd.abstractions.BaseRequestBuilder
BaseRequestBuilder.ProjectExcludeParameter
-
Field Summary
Fields inherited from class org.azd.abstractions.BaseRequestBuilder
accessTokenCredential, apiVersion, area, locationId, organizationUrl, serializer
-
Constructor Summary
ConstructorDescriptionWorkItemsRequestBuilder
(String organizationUrl, AccessTokenCredential accessTokenCredential) Instantiates a new RequestBuilder instance and sets the default values. -
Method Summary
Modifier and TypeMethodDescriptioncreate
(String type, List<JsonPatchDocument> jsonPatchDocuments) Creates a single work item.create
(String type, List<JsonPatchDocument> jsonPatchDocuments, Consumer<WorkItemsRequestBuilder.CreateRequestConfiguration> requestConfiguration) Creates a single work item.createAsync
(String type, List<JsonPatchDocument> jsonPatchDocuments) Creates a single work item.createAsync
(String type, List<JsonPatchDocument> jsonPatchDocuments, Consumer<WorkItemsRequestBuilder.CreateRequestConfiguration> requestConfiguration) Creates a single work item.delete
(int id) Deletes the specified work item and sends it to the Recycle Bin, so that it can be restored back, if required.delete
(int id, boolean destroy) Deletes the specified work item permanently if the destroy parameter has been set to true, WARNING: If the destroy parameter is set to true, work items deleted by this command will NOT go to recycle-bin and there is no way to restore/recover them after deletion.delete
(WorkItemDeleteBatchRequest workItemDeleteBatchRequest) Deletes specified work items and sends them to the Recycle Bin, so that it can be restored back, if required.deleteAsync
(int id) Deletes the specified work item and sends it to the Recycle Bin, so that it can be restored back, if required.deleteAsync
(int id, boolean destroy) Deletes the specified work item permanently if the destroy parameter has been set to true, WARNING: If the destroy parameter is set to true, work items deleted by this command will NOT go to recycle-bin and there is no way to restore/recover them after deletion.deleteAsync
(WorkItemDeleteBatchRequest workItemDeleteBatchRequest) Deletes specified work items and sends them to the Recycle Bin, so that it can be restored back, if required.get
(int id) Returns a single work item.get
(int id, Consumer<WorkItemsRequestBuilder.GetRequestConfiguration> requestConfiguration) Returns a single work item.getAsync
(int id) Returns a single work item.getAsync
(int id, Consumer<WorkItemsRequestBuilder.GetRequestConfiguration> requestConfiguration) Returns a single work item.getBatch
(WorkItemBatchGetRequest workItemBatchGetRequest) Gets work items for a list of work item ids (Maximum 200)getBatchAsync
(WorkItemBatchGetRequest workItemBatchGetRequest) Gets work items for a list of work item ids (Maximum 200)getTemplate
(String type) Returns a single work item from a template.getTemplate
(String type, Consumer<WorkItemsRequestBuilder.GetRequestConfiguration> requestConfiguration) Returns a single work item from a template.getTemplateAsync
(String type) Returns a single work item from a template.getTemplateAsync
(String type, Consumer<WorkItemsRequestBuilder.GetRequestConfiguration> requestConfiguration) Returns a single work item from a template.list
(int... ids) Returns a list of work items (Maximum 200)list
(Consumer<WorkItemsRequestBuilder.RequestConfiguration> requestConfiguration) Returns a list of work items (Maximum 200)listAsync
(Consumer<WorkItemsRequestBuilder.RequestConfiguration> requestConfiguration) Returns a list of work items (Maximum 200)update
(int id, List<JsonPatchDocument> jsonPatchDocuments) Updates a single work item.update
(int id, List<JsonPatchDocument> jsonPatchDocuments, Consumer<WorkItemsRequestBuilder.CreateRequestConfiguration> requestConfiguration) Updates a single work item.updateAsync
(int id, List<JsonPatchDocument> jsonPatchDocuments) Updates a single work item.updateAsync
(int id, List<JsonPatchDocument> jsonPatchDocuments, Consumer<WorkItemsRequestBuilder.CreateRequestConfiguration> requestConfiguration) Updates a single work item.Methods inherited from class org.azd.abstractions.BaseRequestBuilder
builder
-
Constructor Details
-
WorkItemsRequestBuilder
Instantiates a new RequestBuilder instance and sets the default values.- Parameters:
organizationUrl
- Represents organization location request url.accessTokenCredential
- Access token credential object.
-
-
Method Details
-
createAsync
public CompletableFuture<WorkItem> createAsync(String type, List<JsonPatchDocument> jsonPatchDocuments) throws AzDException Creates a single work item.- Parameters:
type
- The work item type of the work item to create.jsonPatchDocuments
- Request body to create the work item.- Returns:
- Work item object.
WorkItem
- Throws:
AzDException
- Default Api exception handler.
-
createAsync
public CompletableFuture<WorkItem> createAsync(String type, List<JsonPatchDocument> jsonPatchDocuments, Consumer<WorkItemsRequestBuilder.CreateRequestConfiguration> requestConfiguration) throws AzDException Creates a single work item.- Parameters:
type
- The work item type of the work item to create.jsonPatchDocuments
- Request body to create the work item.requestConfiguration
- Represents the query parameters.- Returns:
- Work item object.
WorkItem
- Throws:
AzDException
- Default Api exception handler.
-
deleteAsync
Deletes the specified work item and sends it to the Recycle Bin, so that it can be restored back, if required.- Parameters:
id
- ID of the work item to be deleted- Returns:
- Work item delete object.
WorkItemDelete
- Throws:
AzDException
- Default Api Exception handler.
-
deleteAsync
Deletes the specified work item permanently if the destroy parameter has been set to true, WARNING: If the destroy parameter is set to true, work items deleted by this command will NOT go to recycle-bin and there is no way to restore/recover them after deletion. It is recommended NOT to use this parameter. If you do, please use this parameter with extreme caution.- Parameters:
id
- ID of the work item to be deleteddestroy
- Optional parameter, if set to true, the work item is deleted permanently. Please note: the destroy action is PERMANENT and cannot be undone.- Returns:
- Describes response to delete a set of work items.
WorkItemDeleteBatch
- Throws:
AzDException
- Default Api Exception handler.
-
deleteAsync
public CompletableFuture<WorkItemDeleteBatch> deleteAsync(WorkItemDeleteBatchRequest workItemDeleteBatchRequest) throws AzDException Deletes specified work items and sends them to the Recycle Bin, so that it can be restored back, if required. Optionally, if the destroy parameter has been set to true, it destroys the work item permanently. WARNING: If the destroy parameter is set to true, work items deleted by this command will NOT go to recycle-bin and there is no way to restore/recover them after deletion.- Parameters:
workItemDeleteBatchRequest
- Describes a request to delete a set of work items- Returns:
- Describes response to delete a set of work items.
WorkItemDeleteBatch
- Throws:
AzDException
- Default Api Exception handler.
-
getAsync
Returns a single work item.- Parameters:
id
- The work item id- Returns:
- WorkItem
WorkItem
- Throws:
AzDException
- Default Api Exception handler.
-
getAsync
public CompletableFuture<WorkItem> getAsync(int id, Consumer<WorkItemsRequestBuilder.GetRequestConfiguration> requestConfiguration) throws AzDException Returns a single work item.- Parameters:
id
- The work item idrequestConfiguration
- Represents the query parameters.- Returns:
- WorkItem
WorkItem
- Throws:
AzDException
- Default Api Exception handler.
-
getTemplateAsync
Returns a single work item from a template.- Parameters:
type
- The work item type name- Returns:
- WorkItem object
WorkItem
- Throws:
AzDException
- Default Api Exception handler.
-
getTemplateAsync
public CompletableFuture<WorkItem> getTemplateAsync(String type, Consumer<WorkItemsRequestBuilder.GetRequestConfiguration> requestConfiguration) throws AzDException Returns a single work item from a template.- Parameters:
type
- The work item type namerequestConfiguration
- Represents the query parameters.- Returns:
- WorkItem object
WorkItem
- Throws:
AzDException
- Default Api Exception handler.
-
getBatchAsync
public CompletableFuture<WorkItemList> getBatchAsync(WorkItemBatchGetRequest workItemBatchGetRequest) throws AzDException Gets work items for a list of work item ids (Maximum 200)- Parameters:
workItemBatchGetRequest
- Describes a request to get a set of work items- Returns:
- Array of work item
WorkItemList
- Throws:
AzDException
- Default Api Exception handler.
-
listAsync
public CompletableFuture<WorkItemList> listAsync(Consumer<WorkItemsRequestBuilder.RequestConfiguration> requestConfiguration) throws AzDException Returns a list of work items (Maximum 200)- Parameters:
requestConfiguration
- Represents the query parameters.- Returns:
- Collection of WorkItem object
WorkItemList
- Throws:
AzDException
- Default Api Exception handler.
-
updateAsync
public CompletableFuture<WorkItem> updateAsync(int id, List<JsonPatchDocument> jsonPatchDocuments) throws AzDException Updates a single work item.- Parameters:
id
- The id of the work item to updatejsonPatchDocuments
- Request body to update a work item- Returns:
- WorkItem object
WorkItem
- Throws:
AzDException
- Default Api Exception handler.
-
updateAsync
public CompletableFuture<WorkItem> updateAsync(int id, List<JsonPatchDocument> jsonPatchDocuments, Consumer<WorkItemsRequestBuilder.CreateRequestConfiguration> requestConfiguration) throws AzDException Updates a single work item.- Parameters:
id
- The id of the work item to updatejsonPatchDocuments
- Request body to update a work itemrequestConfiguration
- Represents the query parameters.- Returns:
- WorkItem object
WorkItem
- Throws:
AzDException
- Default Api Exception handler.
-
create
Creates a single work item.- Parameters:
type
- The work item type of the work item to create.jsonPatchDocuments
- Request body to create the work item.- Returns:
- Work item object.
WorkItem
- Throws:
AzDException
- Default Api exception handler.
-
create
public WorkItem create(String type, List<JsonPatchDocument> jsonPatchDocuments, Consumer<WorkItemsRequestBuilder.CreateRequestConfiguration> requestConfiguration) throws AzDException Creates a single work item.- Parameters:
type
- The work item type of the work item to create.jsonPatchDocuments
- Request body to create the work item.requestConfiguration
- Represents the query parameters.- Returns:
- Work item object.
WorkItem
- Throws:
AzDException
- Default Api exception handler.
-
delete
Deletes the specified work item and sends it to the Recycle Bin, so that it can be restored back, if required.- Parameters:
id
- ID of the work item to be deleted- Returns:
- Work item delete object.
WorkItemDelete
- Throws:
AzDException
- Default Api Exception handler.
-
delete
Deletes the specified work item permanently if the destroy parameter has been set to true, WARNING: If the destroy parameter is set to true, work items deleted by this command will NOT go to recycle-bin and there is no way to restore/recover them after deletion. It is recommended NOT to use this parameter. If you do, please use this parameter with extreme caution.- Parameters:
id
- ID of the work item to be deleteddestroy
- Optional parameter, if set to true, the work item is deleted permanently. Please note: the destroy action is PERMANENT and cannot be undone.- Returns:
- Describes response to delete a set of work items.
WorkItemDeleteBatch
- Throws:
AzDException
- Default Api Exception handler.
-
delete
public WorkItemDeleteBatch delete(WorkItemDeleteBatchRequest workItemDeleteBatchRequest) throws AzDException Deletes specified work items and sends them to the Recycle Bin, so that it can be restored back, if required. Optionally, if the destroy parameter has been set to true, it destroys the work item permanently. WARNING: If the destroy parameter is set to true, work items deleted by this command will NOT go to recycle-bin and there is no way to restore/recover them after deletion.- Parameters:
workItemDeleteBatchRequest
- Describes a request to delete a set of work items- Returns:
- Describes response to delete a set of work items.
WorkItemDeleteBatch
- Throws:
AzDException
- Default Api Exception handler.
-
get
Returns a single work item.- Parameters:
id
- The work item id- Returns:
- WorkItem
WorkItem
- Throws:
AzDException
- Default Api Exception handler.
-
get
public WorkItem get(int id, Consumer<WorkItemsRequestBuilder.GetRequestConfiguration> requestConfiguration) throws AzDException Returns a single work item.- Parameters:
id
- The work item idrequestConfiguration
- Represents the query parameters.- Returns:
- WorkItem
WorkItem
- Throws:
AzDException
- Default Api Exception handler.
-
getTemplate
Returns a single work item from a template.- Parameters:
type
- The work item type name- Returns:
- WorkItem object
WorkItem
- Throws:
AzDException
- Default Api Exception handler.
-
getTemplate
public WorkItem getTemplate(String type, Consumer<WorkItemsRequestBuilder.GetRequestConfiguration> requestConfiguration) throws AzDException Returns a single work item from a template.- Parameters:
type
- The work item type namerequestConfiguration
- Represents the query parameters.- Returns:
- WorkItem object
WorkItem
- Throws:
AzDException
- Default Api Exception handler.
-
getBatch
Gets work items for a list of work item ids (Maximum 200)- Parameters:
workItemBatchGetRequest
- Describes a request to get a set of work items- Returns:
- Array of work item
WorkItemList
- Throws:
AzDException
- Default Api Exception handler.
-
list
Returns a list of work items (Maximum 200)- Parameters:
ids
- Array of work item ids to list.- Returns:
- Collection of WorkItem object
WorkItemList
- Throws:
AzDException
- Default Api Exception handler.
-
list
public WorkItemList list(Consumer<WorkItemsRequestBuilder.RequestConfiguration> requestConfiguration) throws AzDException Returns a list of work items (Maximum 200)- Parameters:
requestConfiguration
- Represents the query parameters.- Returns:
- Collection of WorkItem object
WorkItemList
- Throws:
AzDException
- Default Api Exception handler.
-
update
Updates a single work item.- Parameters:
id
- The id of the work item to updatejsonPatchDocuments
- Request body to update a work item- Returns:
- WorkItem object
WorkItem
- Throws:
AzDException
- Default Api Exception handler.
-
update
public WorkItem update(int id, List<JsonPatchDocument> jsonPatchDocuments, Consumer<WorkItemsRequestBuilder.CreateRequestConfiguration> requestConfiguration) throws AzDException Updates a single work item.- Parameters:
id
- The id of the work item to updatejsonPatchDocuments
- Request body to update a work itemrequestConfiguration
- Represents the query parameters.- Returns:
- WorkItem object
WorkItem
- Throws:
AzDException
- Default Api Exception handler.
-