From 2f8f10fa012cfed27401ede6237ba57b986b1713 Mon Sep 17 00:00:00 2001 From: Ross Grambo Date: Thu, 13 Aug 2020 15:41:16 -0700 Subject: [PATCH] Generated from OpenAPI --- samples/TagsBaseSample.yaml | 10 +++++++ .../com/asana/resources/gen/ProjectsBase.java | 2 +- .../com/asana/resources/gen/TagsBase.java | 28 ++++++++++++++++++- .../com/asana/resources/gen/TasksBase.java | 2 +- 4 files changed, 39 insertions(+), 3 deletions(-) diff --git a/samples/TagsBaseSample.yaml b/samples/TagsBaseSample.yaml index 9311efa..d6bbef9 100644 --- a/samples/TagsBaseSample.yaml +++ b/samples/TagsBaseSample.yaml @@ -23,6 +23,16 @@ tagsbase: .data("field", "value") .option("pretty", true) .execute(); + deleteTag: >- + import com.asana.Client; + + + Client client = Client.accessToken("PERSONAL_ACCESS_TOKEN"); + + + JsonElement result = client.tags.deleteTag(tagGid) + .option("pretty", true) + .execute(); getTag: >- import com.asana.Client; diff --git a/src/main/java/com/asana/resources/gen/ProjectsBase.java b/src/main/java/com/asana/resources/gen/ProjectsBase.java index 34dc597..c899951 100644 --- a/src/main/java/com/asana/resources/gen/ProjectsBase.java +++ b/src/main/java/com/asana/resources/gen/ProjectsBase.java @@ -328,7 +328,7 @@ public CollectionRequest getProjectsForWorkspace(String workspaceGid, B } /** * Get task count of a project - * Get an object that holds task count fields. **All fields are excluded by default**. You must [opt in](#input-output-options) using `opt_fields` to get any information from this endpoint. This endpoint has an additional [rate limit](#standard-rate-limits) and each field counts especially high against our [cost limits](#cost-limits). Milestones are just tasks, so they are included in the `num_tasks`, `num_incomplete_tasks`, and `num_completed_tasks` counts. + * Get an object that holds task count fields. **All fields are excluded by default**. You must [opt in](/docs/input-output-options) using `opt_fields` to get any information from this endpoint. This endpoint has an additional [rate limit](/docs/standard-rate-limits) and each field counts especially high against our [cost limits](/docs/cost-limits). Milestones are just tasks, so they are included in the `num_tasks`, `num_incomplete_tasks`, and `num_completed_tasks` counts. * @param projectGid Globally unique identifier for the project. (required) * @param offset Offset token. An offset to the next page returned by the API. A pagination request will return an offset token, which can be used as an input parameter to the next request. If an offset is not passed in, the API will return the first page of results. 'Note: You can only pass in an offset that was returned to you via a previously paginated request.' (optional) * @param limit Results per page. The number of objects to return per page. The value must be between 1 and 100. (optional) diff --git a/src/main/java/com/asana/resources/gen/TagsBase.java b/src/main/java/com/asana/resources/gen/TagsBase.java index 7dd0518..6496034 100644 --- a/src/main/java/com/asana/resources/gen/TagsBase.java +++ b/src/main/java/com/asana/resources/gen/TagsBase.java @@ -62,6 +62,32 @@ public ItemRequest createTagForWorkspace(String workspaceGid) throws IOExce return createTagForWorkspace(workspaceGid, null, false); } /** + * Delete a tag + * A specific, existing tag can be deleted by making a DELETE request on the URL for that tag. Returns an empty data record. + * @param tagGid Globally unique identifier for the tag. (required) + * @param offset Offset token. An offset to the next page returned by the API. A pagination request will return an offset token, which can be used as an input parameter to the next request. If an offset is not passed in, the API will return the first page of results. 'Note: You can only pass in an offset that was returned to you via a previously paginated request.' (optional) + * @param limit Results per page. The number of objects to return per page. The value must be between 1 and 100. (optional) + * @param optFields Defines fields to return. Some requests return *compact* representations of objects in order to conserve resources and complete the request more efficiently. Other times requests return more information than you may need. This option allows you to list the exact set of fields that the API should be sure to return for the objects. The field names should be provided as paths, described below. The id of included objects will always be returned, regardless of the field options. (optional) + * @param optPretty Provides “pretty” output. Provides the response in a “pretty” format. In the case of JSON this means doing proper line breaking and indentation to make it readable. This will take extra time and increase the response size so it is advisable only to use this during debugging. (optional) + * @return ItemRequest(JsonElement) + * @throws IOException If we fail to call the API, e.g. server error or cannot deserialize the response body + */ + public ItemRequest deleteTag(String tagGid, String offset, Integer limit, List optFields, Boolean optPretty) throws IOException { + String path = "/tags/{tag_gid}".replace("{tag_gid}", tagGid); + + ItemRequest req = new ItemRequest(this, JsonElement.class, path, "DELETE") + .query("opt_pretty", optPretty) + .query("opt_fields", optFields) + .query("limit", limit) + .query("offset", offset); + + return req; + } + + public ItemRequest deleteTag(String tagGid) throws IOException { + return deleteTag(tagGid, null, (int)Client.DEFAULTS.get("page_size"), null, false); + } + /** * Get a tag * Returns the complete tag record for a single tag. * @param tagGid Globally unique identifier for the tag. (required) @@ -168,7 +194,7 @@ public CollectionRequest getTagsForWorkspace(String workspaceGid) throws IO } /** * Update a tag - * Updates the properties of a tag. Only the fields provided in the `data` block will be updated; any unspecified fields will remain unchanged. When using this method, it is best to specify only those fields you wish to change, or else you may overwrite changes made by another user since you last retrieved the task. Returns the complete updated tag record. + * Updates the properties of a tag. Only the fields provided in the `data` block will be updated; any unspecified fields will remain unchanged. When using this method, it is best to specify only those fields you wish to change, or else you may overwrite changes made by another user since you last retrieved the tag. Returns the complete updated tag record. * @param tagGid Globally unique identifier for the tag. (required) * @param offset Offset token. An offset to the next page returned by the API. A pagination request will return an offset token, which can be used as an input parameter to the next request. If an offset is not passed in, the API will return the first page of results. 'Note: You can only pass in an offset that was returned to you via a previously paginated request.' (optional) * @param limit Results per page. The number of objects to return per page. The value must be between 1 and 100. (optional) diff --git a/src/main/java/com/asana/resources/gen/TasksBase.java b/src/main/java/com/asana/resources/gen/TasksBase.java index c729eb2..9ccccc1 100644 --- a/src/main/java/com/asana/resources/gen/TasksBase.java +++ b/src/main/java/com/asana/resources/gen/TasksBase.java @@ -317,7 +317,7 @@ public ItemRequest getTask(String taskGid) throws IOException { } /** * Get multiple tasks - * Returns the compact task records for some filtered set of tasks. Use one or more of the parameters provided to filter the tasks returned. You must specify a `project` or `tag` if you do not specify `assignee` and `workspace`. For more complex task retrieval, use [workspaces/{workspace_gid}/tasks/search](#search-tasks-in-a-workspace). + * Returns the compact task records for some filtered set of tasks. Use one or more of the parameters provided to filter the tasks returned. You must specify a `project` or `tag` if you do not specify `assignee` and `workspace`. For more complex task retrieval, use [workspaces/{workspace_gid}/tasks/search](/docs/search-tasks-in-a-workspace). * @param modifiedSince Only return tasks that have been modified since the given time. *Note: A task is considered “modified” if any of its properties change, or associations between it and other objects are modified (e.g. a task being added to a project). A task is not considered modified just because another object it is associated with (e.g. a subtask) is modified. Actions that count as modifying the task include assigning, renaming, completing, and adding stories.* (optional) * @param completedSince Only return tasks that are either incomplete or that have been completed since this time. (optional) * @param workspace The workspace to filter tasks on. *Note: If you specify `workspace`, you must also specify the `assignee` to filter on.* (optional)