From 0c327ce6b6c971de292f8509a25a4aefd722f8bf Mon Sep 17 00:00:00 2001 From: Andrew Wong Date: Tue, 25 Jan 2022 19:37:36 -0800 Subject: [PATCH] Generated from OpenAPI --- samples/ProjectBriefsBaseSample.yaml | 45 +++++++ samples/StatusUpdatesBaseSample.yaml | 43 +++++++ samples/TasksBaseSample.yaml | 2 +- samples/TeamsBaseSample.yaml | 2 +- .../resources/gen/ProjectBriefsBase.java | 109 ++++++++++++++++ .../resources/gen/ProjectStatusesBase.java | 8 +- .../resources/gen/StatusUpdatesBase.java | 119 ++++++++++++++++++ .../com/asana/resources/gen/TasksBase.java | 20 ++- .../com/asana/resources/gen/TeamsBase.java | 10 +- 9 files changed, 334 insertions(+), 24 deletions(-) create mode 100644 samples/ProjectBriefsBaseSample.yaml create mode 100644 samples/StatusUpdatesBaseSample.yaml create mode 100644 src/main/java/com/asana/resources/gen/ProjectBriefsBase.java create mode 100644 src/main/java/com/asana/resources/gen/StatusUpdatesBase.java diff --git a/samples/ProjectBriefsBaseSample.yaml b/samples/ProjectBriefsBaseSample.yaml new file mode 100644 index 0000000..8d4ba76 --- /dev/null +++ b/samples/ProjectBriefsBaseSample.yaml @@ -0,0 +1,45 @@ +projectbriefsbase: + createProjectBrief: >- + import com.asana.Client; + + + Client client = Client.accessToken("PERSONAL_ACCESS_TOKEN"); + + + JsonElement result = client.projectbriefs.createProjectBrief(projectGid) + .data("field", "value") + .data("field", "value") + .option("pretty", true) + .execute(); + deleteProjectBrief: >- + import com.asana.Client; + + + Client client = Client.accessToken("PERSONAL_ACCESS_TOKEN"); + + + JsonElement result = client.projectbriefs.deleteProjectBrief(projectBriefGid) + .option("pretty", true) + .execute(); + getProjectBrief: >- + import com.asana.Client; + + + Client client = Client.accessToken("PERSONAL_ACCESS_TOKEN"); + + + JsonElement result = client.projectbriefs.getProjectBrief(projectBriefGid) + .option("pretty", true) + .execute(); + updateProjectBrief: >- + import com.asana.Client; + + + Client client = Client.accessToken("PERSONAL_ACCESS_TOKEN"); + + + JsonElement result = client.projectbriefs.updateProjectBrief(projectBriefGid) + .data("field", "value") + .data("field", "value") + .option("pretty", true) + .execute(); diff --git a/samples/StatusUpdatesBaseSample.yaml b/samples/StatusUpdatesBaseSample.yaml new file mode 100644 index 0000000..2bab241 --- /dev/null +++ b/samples/StatusUpdatesBaseSample.yaml @@ -0,0 +1,43 @@ +statusupdatesbase: + createStatusForObject: >- + import com.asana.Client; + + + Client client = Client.accessToken("PERSONAL_ACCESS_TOKEN"); + + + JsonElement result = client.statusupdates.createStatusForObject() + .data("field", "value") + .data("field", "value") + .option("pretty", true) + .execute(); + deleteStatus: >- + import com.asana.Client; + + + Client client = Client.accessToken("PERSONAL_ACCESS_TOKEN"); + + + JsonElement result = client.statusupdates.deleteStatus(statusGid) + .option("pretty", true) + .execute(); + getStatus: >- + import com.asana.Client; + + + Client client = Client.accessToken("PERSONAL_ACCESS_TOKEN"); + + + JsonElement result = client.statusupdates.getStatus(statusGid) + .option("pretty", true) + .execute(); + getStatusesForObject: >- + import com.asana.Client; + + + Client client = Client.accessToken("PERSONAL_ACCESS_TOKEN"); + + + List result = client.statusupdates.getStatusesForObject(createdSince, parent) + .option("pretty", true) + .execute(); diff --git a/samples/TasksBaseSample.yaml b/samples/TasksBaseSample.yaml index e232422..d06036c 100644 --- a/samples/TasksBaseSample.yaml +++ b/samples/TasksBaseSample.yaml @@ -262,7 +262,7 @@ tasksbase: Client client = Client.accessToken("PERSONAL_ACCESS_TOKEN"); - List result = client.tasks.searchTasksForWorkspace(workspaceGid, sortAscending, sortBy, isSubtask, completed, hasAttachment, isBlocked, isBlocking, modifiedAtAfter, modifiedAtBefore, dueOnBefore, modifiedOn, modifiedOnAfter, modifiedOnBefore, completedAtAfter, completedAtBefore, completedOn, completedOnAfter, completedOnBefore, createdAtAfter, commentedOnByNot, createdAtBefore, createdOn, createdOnAfter, createdOnBefore, startOn, startOnAfter, startOnBefore, dueAtAfter, dueAtBefore, dueOn, commentedOnByAny, dueOnAfter, likedByNot, likedByAny, assignedByNot, assignedByAny, createdByNot, createdByAny, followersNot, followersAny, teamsAny, tagsAll, tagsNot, tagsAny, sectionsAll, sectionsNot, sectionsAny, projectsAll, projectsNot, projectsAny, portfoliosAny, assigneeNot, assigneeAny, resourceSubtype, text) + List result = client.tasks.searchTasksForWorkspace(workspaceGid, sortAscending, sortBy, isSubtask, completed, hasAttachment, isBlocked, isBlocking, modifiedAtAfter, modifiedAtBefore, dueOn, modifiedOn, modifiedOnAfter, modifiedOnBefore, completedAtAfter, completedAtBefore, completedOn, completedOnAfter, completedOnBefore, createdAtAfter, dueOnAfter, createdAtBefore, createdOn, createdOnAfter, createdOnBefore, startOn, startOnAfter, startOnBefore, dueAtAfter, dueAtBefore, dueOnBefore, commentedOnByNot, likedByNot, assignedByNot, assignedByAny, createdByNot, createdByAny, followersNot, teamsAny, tagsAll, tagsNot, tagsAny, sectionsAll, sectionsNot, sectionsAny, projectsAll, projectsNot, projectsAny, portfoliosAny, assigneeNot, assigneeAny, resourceSubtype, text) .option("pretty", true) .execute(); setParentForTask: >- diff --git a/samples/TeamsBaseSample.yaml b/samples/TeamsBaseSample.yaml index f751284..1742996 100644 --- a/samples/TeamsBaseSample.yaml +++ b/samples/TeamsBaseSample.yaml @@ -6,7 +6,7 @@ teamsbase: Client client = Client.accessToken("PERSONAL_ACCESS_TOKEN"); - User result = client.teams.addUserForTeam(teamGid) + JsonElement result = client.teams.addUserForTeam(teamGid) .data("field", "value") .data("field", "value") .option("pretty", true) diff --git a/src/main/java/com/asana/resources/gen/ProjectBriefsBase.java b/src/main/java/com/asana/resources/gen/ProjectBriefsBase.java new file mode 100644 index 0000000..6601ff6 --- /dev/null +++ b/src/main/java/com/asana/resources/gen/ProjectBriefsBase.java @@ -0,0 +1,109 @@ +package com.asana.resources.gen; + +import com.asana.Client; +import com.asana.resources.Resource; +import com.asana.requests.ItemRequest; +import com.asana.requests.CollectionRequest; +import com.asana.models.*; +import com.google.gson.JsonElement; + +import java.io.IOException; +import java.time.LocalDate; +import java.time.OffsetDateTime; +import java.util.List; + + public class ProjectBriefsBase extends Resource { + /** + * @param client Parent client instance + */ + public ProjectBriefsBase(Client client) { super(client); } + + /** + * Create a project brief + * Creates a new project brief. Returns the full record of the newly created project brief. + * @param projectGid Globally unique identifier for the project. (required) + * @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 createProjectBrief(String projectGid, List optFields, Boolean optPretty) throws IOException { + String path = "/projects/{project_gid}/project_briefs".replace("{project_gid}", projectGid); + + ItemRequest req = new ItemRequest(this, JsonElement.class, path, "POST") + .query("opt_pretty", optPretty) + .query("opt_fields", optFields); + + return req; + } + + public ItemRequest createProjectBrief(String projectGid) throws IOException { + return createProjectBrief(projectGid, null, false); + } + /** + * Delete a project brief + * Deletes a specific, existing project brief. Returns an empty data record. + * @param projectBriefGid Globally unique identifier for the project brief. (required) + * @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 deleteProjectBrief(String projectBriefGid, List optFields, Boolean optPretty) throws IOException { + String path = "/project_briefs/{project_brief_gid}".replace("{project_brief_gid}", projectBriefGid); + + ItemRequest req = new ItemRequest(this, JsonElement.class, path, "DELETE") + .query("opt_pretty", optPretty) + .query("opt_fields", optFields); + + return req; + } + + public ItemRequest deleteProjectBrief(String projectBriefGid) throws IOException { + return deleteProjectBrief(projectBriefGid, null, false); + } + /** + * Get a project brief + * Get the full record for a project brief. + * @param projectBriefGid Globally unique identifier for the project brief. (required) + * @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 getProjectBrief(String projectBriefGid, List optFields, Boolean optPretty) throws IOException { + String path = "/project_briefs/{project_brief_gid}".replace("{project_brief_gid}", projectBriefGid); + + ItemRequest req = new ItemRequest(this, JsonElement.class, path, "GET") + .query("opt_pretty", optPretty) + .query("opt_fields", optFields); + + return req; + } + + public ItemRequest getProjectBrief(String projectBriefGid) throws IOException { + return getProjectBrief(projectBriefGid, null, false); + } + /** + * Update a project brief + * An existing project brief can be updated by making a PUT request on the URL for that project brief. Only the fields provided in the `data` block will be updated; any unspecified fields will remain unchanged. Returns the complete updated project brief record. + * @param projectBriefGid Globally unique identifier for the project brief. (required) + * @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 updateProjectBrief(String projectBriefGid, List optFields, Boolean optPretty) throws IOException { + String path = "/project_briefs/{project_brief_gid}".replace("{project_brief_gid}", projectBriefGid); + + ItemRequest req = new ItemRequest(this, JsonElement.class, path, "PUT") + .query("opt_pretty", optPretty) + .query("opt_fields", optFields); + + return req; + } + + public ItemRequest updateProjectBrief(String projectBriefGid) throws IOException { + return updateProjectBrief(projectBriefGid, null, false); + } + } diff --git a/src/main/java/com/asana/resources/gen/ProjectStatusesBase.java b/src/main/java/com/asana/resources/gen/ProjectStatusesBase.java index 3ba38d1..459fe53 100644 --- a/src/main/java/com/asana/resources/gen/ProjectStatusesBase.java +++ b/src/main/java/com/asana/resources/gen/ProjectStatusesBase.java @@ -20,7 +20,7 @@ public class ProjectStatusesBase extends Resource { /** * Create a project status - * Creates a new status update on the project. Returns the full record of the newly created project status update. + * *Deprecated: new integrations should prefer the `/status_updates` route.* Creates a new status update on the project. Returns the full record of the newly created project status update. * @param projectGid Globally unique identifier for the project. (required) * @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) @@ -42,7 +42,7 @@ public ItemRequest createProjectStatusForProject(String projectGi } /** * Delete a project status - * Deletes a specific, existing project status update. Returns an empty data record. + * *Deprecated: new integrations should prefer the `/status_updates/{status_gid}` route.* Deletes a specific, existing project status update. Returns an empty data record. * @param projectStatusGid The project status update to get. (required) * @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) @@ -64,7 +64,7 @@ public ItemRequest deleteProjectStatus(String projectStatusGid) thr } /** * Get a project status - * Returns the complete record for a single status update. + * *Deprecated: new integrations should prefer the `/status_updates/{status_gid}` route.* Returns the complete record for a single status update. * @param projectStatusGid The project status update to get. (required) * @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) @@ -86,7 +86,7 @@ public ItemRequest getProjectStatus(String projectStatusGid) thro } /** * Get statuses from a project - * Returns the compact project status update records for all updates on the project. + * *Deprecated: new integrations should prefer the `/status_updates` route.* Returns the compact project status update records for all updates on the project. * @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/StatusUpdatesBase.java b/src/main/java/com/asana/resources/gen/StatusUpdatesBase.java new file mode 100644 index 0000000..d323f98 --- /dev/null +++ b/src/main/java/com/asana/resources/gen/StatusUpdatesBase.java @@ -0,0 +1,119 @@ +package com.asana.resources.gen; + +import com.asana.Client; +import com.asana.resources.Resource; +import com.asana.requests.ItemRequest; +import com.asana.requests.CollectionRequest; +import com.asana.models.*; +import com.google.gson.JsonElement; + +import java.io.IOException; +import java.time.LocalDate; +import java.time.OffsetDateTime; +import java.util.List; + + public class StatusUpdatesBase extends Resource { + /** + * @param client Parent client instance + */ + public StatusUpdatesBase(Client client) { super(client); } + + /** + * Create a status update + * Creates a new status update on an object. Returns the full record of the newly created status update. + * @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 createStatusForObject(String offset, Integer limit, List optFields, Boolean optPretty) throws IOException { + String path = "/status_updates"; + + ItemRequest req = new ItemRequest(this, JsonElement.class, path, "POST") + .query("opt_pretty", optPretty) + .query("opt_fields", optFields) + .query("limit", limit) + .query("offset", offset); + + return req; + } + + public ItemRequest createStatusForObject() throws IOException { + return createStatusForObject(null, (int)Client.DEFAULTS.get("page_size"), null, false); + } + /** + * Delete a status update + * Deletes a specific, existing status update. Returns an empty data record. + * @param statusGid The status update to get. (required) + * @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 deleteStatus(String statusGid, List optFields, Boolean optPretty) throws IOException { + String path = "/status_updates/{status_gid}".replace("{status_gid}", statusGid); + + ItemRequest req = new ItemRequest(this, JsonElement.class, path, "DELETE") + .query("opt_pretty", optPretty) + .query("opt_fields", optFields); + + return req; + } + + public ItemRequest deleteStatus(String statusGid) throws IOException { + return deleteStatus(statusGid, null, false); + } + /** + * Get a status update + * Returns the complete record for a single status update. + * @param statusGid The status update to get. (required) + * @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 getStatus(String statusGid, List optFields, Boolean optPretty) throws IOException { + String path = "/status_updates/{status_gid}".replace("{status_gid}", statusGid); + + ItemRequest req = new ItemRequest(this, JsonElement.class, path, "GET") + .query("opt_pretty", optPretty) + .query("opt_fields", optFields); + + return req; + } + + public ItemRequest getStatus(String statusGid) throws IOException { + return getStatus(statusGid, null, false); + } + /** + * Get status updates from an object + * Returns the compact status update records for all updates on the object. + * @param createdSince Only return statuses that have been created since the given time. (optional) + * @param parent Globally unique identifier for object to fetch statuses from. (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 CollectionRequest(JsonElement) + * @throws IOException If we fail to call the API, e.g. server error or cannot deserialize the response body + */ + public CollectionRequest getStatusesForObject(OffsetDateTime createdSince, String parent, String offset, Integer limit, List optFields, Boolean optPretty) throws IOException { + String path = "/status_updates"; + + CollectionRequest req = new CollectionRequest(this, JsonElement.class, path, "GET") + .query("opt_pretty", optPretty) + .query("opt_fields", optFields) + .query("limit", limit) + .query("offset", offset) + .query("parent", parent) + .query("created_since", createdSince); + + return req; + } + + public CollectionRequest getStatusesForObject(OffsetDateTime createdSince, String parent) throws IOException { + return getStatusesForObject(createdSince, parent, null, (int)Client.DEFAULTS.get("page_size"), null, false); + } + } diff --git a/src/main/java/com/asana/resources/gen/TasksBase.java b/src/main/java/com/asana/resources/gen/TasksBase.java index b3dc908..3999876 100644 --- a/src/main/java/com/asana/resources/gen/TasksBase.java +++ b/src/main/java/com/asana/resources/gen/TasksBase.java @@ -581,7 +581,7 @@ public ItemRequest removeTagForTask(String taskGid) throws IOExcept * @param isBlocking Filter to incomplete tasks with dependents (optional) * @param modifiedAtAfter ISO 8601 datetime string (optional) * @param modifiedAtBefore ISO 8601 datetime string (optional) - * @param dueOnBefore ISO 8601 date string (optional) + * @param dueOn ISO 8601 date string or `null` (optional) * @param modifiedOn ISO 8601 date string or `null` (optional) * @param modifiedOnAfter ISO 8601 date string (optional) * @param modifiedOnBefore ISO 8601 date string (optional) @@ -591,7 +591,7 @@ public ItemRequest removeTagForTask(String taskGid) throws IOExcept * @param completedOnAfter ISO 8601 date string (optional) * @param completedOnBefore ISO 8601 date string (optional) * @param createdAtAfter ISO 8601 datetime string (optional) - * @param commentedOnByNot Comma-separated list of user identifiers (optional) + * @param dueOnAfter ISO 8601 date string (optional) * @param createdAtBefore ISO 8601 datetime string (optional) * @param createdOn ISO 8601 date string or `null` (optional) * @param createdOnAfter ISO 8601 date string (optional) @@ -601,17 +601,14 @@ public ItemRequest removeTagForTask(String taskGid) throws IOExcept * @param startOnBefore ISO 8601 date string (optional) * @param dueAtAfter ISO 8601 datetime string (optional) * @param dueAtBefore ISO 8601 datetime string (optional) - * @param dueOn ISO 8601 date string or `null` (optional) - * @param commentedOnByAny Comma-separated list of user identifiers (optional) - * @param dueOnAfter ISO 8601 date string (optional) + * @param dueOnBefore ISO 8601 date string (optional) + * @param commentedOnByNot Comma-separated list of user identifiers (optional) * @param likedByNot Comma-separated list of user identifiers (optional) - * @param likedByAny Comma-separated list of user identifiers (optional) * @param assignedByNot Comma-separated list of user identifiers (optional) * @param assignedByAny Comma-separated list of user identifiers (optional) * @param createdByNot Comma-separated list of user identifiers (optional) * @param createdByAny Comma-separated list of user identifiers (optional) * @param followersNot Comma-separated list of user identifiers (optional) - * @param followersAny Comma-separated list of user identifiers (optional) * @param teamsAny Comma-separated list of team IDs (optional) * @param tagsAll Comma-separated list of tag IDs (optional) * @param tagsNot Comma-separated list of tag IDs (optional) @@ -632,7 +629,7 @@ public ItemRequest removeTagForTask(String taskGid) throws IOExcept * @return CollectionRequest(Task) * @throws IOException If we fail to call the API, e.g. server error or cannot deserialize the response body */ - public CollectionRequest searchTasksForWorkspace(String workspaceGid, Boolean sortAscending, String sortBy, Boolean isSubtask, Boolean completed, Boolean hasAttachment, Boolean isBlocked, Boolean isBlocking, OffsetDateTime modifiedAtAfter, OffsetDateTime modifiedAtBefore, LocalDate dueOnBefore, LocalDate modifiedOn, LocalDate modifiedOnAfter, LocalDate modifiedOnBefore, OffsetDateTime completedAtAfter, OffsetDateTime completedAtBefore, LocalDate completedOn, LocalDate completedOnAfter, LocalDate completedOnBefore, OffsetDateTime createdAtAfter, String commentedOnByNot, OffsetDateTime createdAtBefore, LocalDate createdOn, LocalDate createdOnAfter, LocalDate createdOnBefore, LocalDate startOn, LocalDate startOnAfter, LocalDate startOnBefore, OffsetDateTime dueAtAfter, OffsetDateTime dueAtBefore, LocalDate dueOn, String commentedOnByAny, LocalDate dueOnAfter, String likedByNot, String likedByAny, String assignedByNot, String assignedByAny, String createdByNot, String createdByAny, String followersNot, String followersAny, String teamsAny, String tagsAll, String tagsNot, String tagsAny, String sectionsAll, String sectionsNot, String sectionsAny, String projectsAll, String projectsNot, String projectsAny, String portfoliosAny, String assigneeNot, String assigneeAny, String resourceSubtype, String text, List optFields, Boolean optPretty) throws IOException { + public CollectionRequest searchTasksForWorkspace(String workspaceGid, Boolean sortAscending, String sortBy, Boolean isSubtask, Boolean completed, Boolean hasAttachment, Boolean isBlocked, Boolean isBlocking, OffsetDateTime modifiedAtAfter, OffsetDateTime modifiedAtBefore, LocalDate dueOn, LocalDate modifiedOn, LocalDate modifiedOnAfter, LocalDate modifiedOnBefore, OffsetDateTime completedAtAfter, OffsetDateTime completedAtBefore, LocalDate completedOn, LocalDate completedOnAfter, LocalDate completedOnBefore, OffsetDateTime createdAtAfter, LocalDate dueOnAfter, OffsetDateTime createdAtBefore, LocalDate createdOn, LocalDate createdOnAfter, LocalDate createdOnBefore, LocalDate startOn, LocalDate startOnAfter, LocalDate startOnBefore, OffsetDateTime dueAtAfter, OffsetDateTime dueAtBefore, LocalDate dueOnBefore, String commentedOnByNot, String likedByNot, String assignedByNot, String assignedByAny, String createdByNot, String createdByAny, String followersNot, String teamsAny, String tagsAll, String tagsNot, String tagsAny, String sectionsAll, String sectionsNot, String sectionsAny, String projectsAll, String projectsNot, String projectsAny, String portfoliosAny, String assigneeNot, String assigneeAny, String resourceSubtype, String text, List optFields, Boolean optPretty) throws IOException { String path = "/workspaces/{workspace_gid}/tasks/search".replace("{workspace_gid}", workspaceGid); CollectionRequest req = new CollectionRequest(this, Task.class, path, "GET") @@ -653,15 +650,12 @@ public CollectionRequest searchTasksForWorkspace(String workspaceGid, Bool .query("tags.not", tagsNot) .query("tags.all", tagsAll) .query("teams.any", teamsAny) - .query("followers.any", followersAny) .query("followers.not", followersNot) .query("created_by.any", createdByAny) .query("created_by.not", createdByNot) .query("assigned_by.any", assignedByAny) .query("assigned_by.not", assignedByNot) - .query("liked_by.any", likedByAny) .query("liked_by.not", likedByNot) - .query("commented_on_by.any", commentedOnByAny) .query("commented_on_by.not", commentedOnByNot) .query("due_on.before", dueOnBefore) .query("due_on.after", dueOnAfter) @@ -697,8 +691,8 @@ public CollectionRequest searchTasksForWorkspace(String workspaceGid, Bool return req; } - public CollectionRequest searchTasksForWorkspace(String workspaceGid, Boolean sortAscending, String sortBy, Boolean isSubtask, Boolean completed, Boolean hasAttachment, Boolean isBlocked, Boolean isBlocking, OffsetDateTime modifiedAtAfter, OffsetDateTime modifiedAtBefore, LocalDate dueOnBefore, LocalDate modifiedOn, LocalDate modifiedOnAfter, LocalDate modifiedOnBefore, OffsetDateTime completedAtAfter, OffsetDateTime completedAtBefore, LocalDate completedOn, LocalDate completedOnAfter, LocalDate completedOnBefore, OffsetDateTime createdAtAfter, String commentedOnByNot, OffsetDateTime createdAtBefore, LocalDate createdOn, LocalDate createdOnAfter, LocalDate createdOnBefore, LocalDate startOn, LocalDate startOnAfter, LocalDate startOnBefore, OffsetDateTime dueAtAfter, OffsetDateTime dueAtBefore, LocalDate dueOn, String commentedOnByAny, LocalDate dueOnAfter, String likedByNot, String likedByAny, String assignedByNot, String assignedByAny, String createdByNot, String createdByAny, String followersNot, String followersAny, String teamsAny, String tagsAll, String tagsNot, String tagsAny, String sectionsAll, String sectionsNot, String sectionsAny, String projectsAll, String projectsNot, String projectsAny, String portfoliosAny, String assigneeNot, String assigneeAny, String resourceSubtype, String text) throws IOException { - return searchTasksForWorkspace(workspaceGid, sortAscending, sortBy, isSubtask, completed, hasAttachment, isBlocked, isBlocking, modifiedAtAfter, modifiedAtBefore, dueOnBefore, modifiedOn, modifiedOnAfter, modifiedOnBefore, completedAtAfter, completedAtBefore, completedOn, completedOnAfter, completedOnBefore, createdAtAfter, commentedOnByNot, createdAtBefore, createdOn, createdOnAfter, createdOnBefore, startOn, startOnAfter, startOnBefore, dueAtAfter, dueAtBefore, dueOn, commentedOnByAny, dueOnAfter, likedByNot, likedByAny, assignedByNot, assignedByAny, createdByNot, createdByAny, followersNot, followersAny, teamsAny, tagsAll, tagsNot, tagsAny, sectionsAll, sectionsNot, sectionsAny, projectsAll, projectsNot, projectsAny, portfoliosAny, assigneeNot, assigneeAny, resourceSubtype, text, null, false); + public CollectionRequest searchTasksForWorkspace(String workspaceGid, Boolean sortAscending, String sortBy, Boolean isSubtask, Boolean completed, Boolean hasAttachment, Boolean isBlocked, Boolean isBlocking, OffsetDateTime modifiedAtAfter, OffsetDateTime modifiedAtBefore, LocalDate dueOn, LocalDate modifiedOn, LocalDate modifiedOnAfter, LocalDate modifiedOnBefore, OffsetDateTime completedAtAfter, OffsetDateTime completedAtBefore, LocalDate completedOn, LocalDate completedOnAfter, LocalDate completedOnBefore, OffsetDateTime createdAtAfter, LocalDate dueOnAfter, OffsetDateTime createdAtBefore, LocalDate createdOn, LocalDate createdOnAfter, LocalDate createdOnBefore, LocalDate startOn, LocalDate startOnAfter, LocalDate startOnBefore, OffsetDateTime dueAtAfter, OffsetDateTime dueAtBefore, LocalDate dueOnBefore, String commentedOnByNot, String likedByNot, String assignedByNot, String assignedByAny, String createdByNot, String createdByAny, String followersNot, String teamsAny, String tagsAll, String tagsNot, String tagsAny, String sectionsAll, String sectionsNot, String sectionsAny, String projectsAll, String projectsNot, String projectsAny, String portfoliosAny, String assigneeNot, String assigneeAny, String resourceSubtype, String text) throws IOException { + return searchTasksForWorkspace(workspaceGid, sortAscending, sortBy, isSubtask, completed, hasAttachment, isBlocked, isBlocking, modifiedAtAfter, modifiedAtBefore, dueOn, modifiedOn, modifiedOnAfter, modifiedOnBefore, completedAtAfter, completedAtBefore, completedOn, completedOnAfter, completedOnBefore, createdAtAfter, dueOnAfter, createdAtBefore, createdOn, createdOnAfter, createdOnBefore, startOn, startOnAfter, startOnBefore, dueAtAfter, dueAtBefore, dueOnBefore, commentedOnByNot, likedByNot, assignedByNot, assignedByAny, createdByNot, createdByAny, followersNot, teamsAny, tagsAll, tagsNot, tagsAny, sectionsAll, sectionsNot, sectionsAny, projectsAll, projectsNot, projectsAny, portfoliosAny, assigneeNot, assigneeAny, resourceSubtype, text, null, false); } /** * Set the parent of a task diff --git a/src/main/java/com/asana/resources/gen/TeamsBase.java b/src/main/java/com/asana/resources/gen/TeamsBase.java index 6930f54..02a1bdc 100644 --- a/src/main/java/com/asana/resources/gen/TeamsBase.java +++ b/src/main/java/com/asana/resources/gen/TeamsBase.java @@ -20,24 +20,24 @@ public class TeamsBase extends Resource { /** * Add a user to a team - * The user making this call must be a member of the team in order to add others. The user being added must exist in the same organization as the team. + * The user making this call must be a member of the team in order to add others. The user being added must exist in the same organization as the team. Returns the complete team membership record for the newly added user. * @param teamGid Globally unique identifier for the team. (required) * @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(User) + * @return ItemRequest(JsonElement) * @throws IOException If we fail to call the API, e.g. server error or cannot deserialize the response body */ - public ItemRequest addUserForTeam(String teamGid, List optFields, Boolean optPretty) throws IOException { + public ItemRequest addUserForTeam(String teamGid, List optFields, Boolean optPretty) throws IOException { String path = "/teams/{team_gid}/addUser".replace("{team_gid}", teamGid); - ItemRequest req = new ItemRequest(this, User.class, path, "POST") + ItemRequest req = new ItemRequest(this, JsonElement.class, path, "POST") .query("opt_pretty", optPretty) .query("opt_fields", optFields); return req; } - public ItemRequest addUserForTeam(String teamGid) throws IOException { + public ItemRequest addUserForTeam(String teamGid) throws IOException { return addUserForTeam(teamGid, null, false); } /**