Skip to content

Commit

Permalink
Generated from OpenAPI
Browse files Browse the repository at this point in the history
  • Loading branch information
rossgrambo-zz committed Apr 14, 2021
1 parent 466c3cf commit aa6839a
Show file tree
Hide file tree
Showing 11 changed files with 62 additions and 29 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ If you use [Maven](http://maven.apache.org/) to manage dependencies you can incl
<dependency>
<groupId>com.asana</groupId>
<artifactId>asana</artifactId>
<version>0.10.3</version>
<version>0.10.4</version>
</dependency>

Or, you can build the artifact and install it to your local Maven repository:
Expand Down
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<groupId>com.asana</groupId>
<artifactId>asana</artifactId>
<packaging>jar</packaging>
<version>0.10.3</version>
<version>0.10.4</version>
<url>http://maven.apache.org</url>
<name>java-asana</name>
<description>A Java client for the Asana API.</description>
Expand Down
2 changes: 1 addition & 1 deletion samples/TasksBaseSample.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -262,7 +262,7 @@ tasksbase:
Client client = Client.accessToken("PERSONAL_ACCESS_TOKEN");
List<Task> 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, assigneeStatus, assigneeNot, assigneeAny, resourceSubtype, text)
List<Task> 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)
.option("pretty", true)
.execute();
setParentForTask: >-
Expand Down
12 changes: 12 additions & 0 deletions samples/TeamsBaseSample.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,18 @@ teamsbase:
.data("field", "value")
.option("pretty", true)
.execute();
createTeam: >-
import com.asana.Client;
Client client = Client.accessToken("PERSONAL_ACCESS_TOKEN");
Team result = client.teams.createTeam()
.data("field", "value")
.data("field", "value")
.option("pretty", true)
.execute();
getTeam: >-
import com.asana.Client;
Expand Down
2 changes: 1 addition & 1 deletion samples/UsersBaseSample.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ usersbase:
Client client = Client.accessToken("PERSONAL_ACCESS_TOKEN");
List<User> result = client.users.getUsers(workspace)
List<User> result = client.users.getUsers(team, workspace)
.option("pretty", true)
.execute();
getUsersForTeam: >-
Expand Down
4 changes: 2 additions & 2 deletions src/main/java/com/asana/errors/AsanaError.java
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
import com.asana.Json;
import com.asana.models.ErrorBody;
import com.google.api.client.http.HttpResponseException;
import com.google.api.client.repackaged.com.google.common.base.Joiner;
import com.google.api.client.util.Joiner;

import java.io.IOException;

Expand Down Expand Up @@ -45,7 +45,7 @@ private static String constructMessage(String message, HttpResponseException exc
try {
ErrorBody body = Json.getInstance().fromJson(exception.getContent(), ErrorBody.class);
if (body.errors.size() > 0) {
return message + " (" + Joiner.on("; ").join(body.errors) + ")";
return message + " (" + Joiner.on(';').join(body.errors) + ")";
}
} catch (Exception e) {
}
Expand Down
4 changes: 2 additions & 2 deletions src/main/java/com/asana/resources/gen/ProjectsBase.java
Original file line number Diff line number Diff line change
Expand Up @@ -215,7 +215,7 @@ public ItemRequest<Project> getProject(String projectGid) throws IOException {
}
/**
* Get multiple projects
* Returns the compact project records for some filtered set of projects. Use one or more of the parameters provided to filter the projects returned.
* Returns the compact project records for some filtered set of projects. Use one or more of the parameters provided to filter the projects returned. *Note: This endpoint may timeout for large domains. Try filtering by team!*
* @param archived Only return projects whose &#x60;archived&#x60; field takes on the value of this parameter. (optional)
* @param team The team to filter projects on. (optional)
* @param workspace The workspace or organization to filter projects on. (optional)
Expand Down Expand Up @@ -300,7 +300,7 @@ public CollectionRequest<Project> getProjectsForTeam(String teamGid, Boolean arc
}
/**
* Get all projects in a workspace
* Returns the compact project records for all projects in the workspace.
* Returns the compact project records for all projects in the workspace. *Note: This endpoint may timeout for large domains. Prefer the &#x60;/teams/{team_gid}/projects&#x60; endpoint.*
* @param workspaceGid Globally unique identifier for the workspace or organization. (required)
* @param archived Only return projects whose &#x60;archived&#x60; field takes on the value of this parameter. (optional)
* @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. &#x27;Note: You can only pass in an offset that was returned to you via a previously paginated request.&#x27; (optional)
Expand Down
10 changes: 4 additions & 6 deletions src/main/java/com/asana/resources/gen/TasksBase.java
Original file line number Diff line number Diff line change
Expand Up @@ -432,7 +432,7 @@ public CollectionRequest<Task> getTasksForTag(String tagGid) throws IOException
}
/**
* Get tasks from a user task list
* Returns the compact list of tasks in a user’s My Tasks list. The returned tasks will be in order within each assignee status group of &#x60;Inbox&#x60;, &#x60;Today&#x60;, and &#x60;Upcoming&#x60;. *Note: tasks in &#x60;Later&#x60; have a different ordering in the Asana web app than the other assignee status groups; this endpoint will still return them in list order in &#x60;Later&#x60; (differently than they show up in Asana, but the same order as in Asana’s mobile apps).* *Note: Access control is enforced for this endpoint as with all Asana API endpoints, meaning a user’s private tasks will be filtered out if the API-authenticated user does not have access to them.* *Note: Both complete and incomplete tasks are returned by default unless they are filtered out (for example, setting &#x60;completed_since&#x3D;now&#x60; will return only incomplete tasks, which is the default view for “My Tasks” in Asana.)*
* Returns the compact list of tasks in a user’s My Tasks list. *Note: Access control is enforced for this endpoint as with all Asana API endpoints, meaning a user’s private tasks will be filtered out if the API-authenticated user does not have access to them.* *Note: Both complete and incomplete tasks are returned by default unless they are filtered out (for example, setting &#x60;completed_since&#x3D;now&#x60; will return only incomplete tasks, which is the default view for “My Tasks” in Asana.)*
* @param userTaskListGid Globally unique identifier for the user task list. (required)
* @param completedSince Only return tasks that are either incomplete or that have been completed since this time. Accepts a date-time string or the keyword *now*. (optional)
* @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. &#x27;Note: You can only pass in an offset that was returned to you via a previously paginated request.&#x27; (optional)
Expand Down Expand Up @@ -623,7 +623,6 @@ public ItemRequest<JsonElement> removeTagForTask(String taskGid) throws IOExcept
* @param projectsNot Comma-separated list of project IDs (optional)
* @param projectsAny Comma-separated list of project IDs (optional)
* @param portfoliosAny Comma-separated list of portfolio IDs (optional)
* @param assigneeStatus One of &#x60;inbox&#x60;, &#x60;today&#x60;, &#x60;upcoming&#x60;, or &#x60;later&#x60; (optional)
* @param assigneeNot Comma-separated list of user identifiers (optional)
* @param assigneeAny Comma-separated list of user identifiers (optional)
* @param resourceSubtype Filters results by the task&#x27;s resource_subtype (optional)
Expand All @@ -633,7 +632,7 @@ public ItemRequest<JsonElement> 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<Task> 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 assigneeStatus, String assigneeNot, String assigneeAny, String resourceSubtype, String text, List<String> optFields, Boolean optPretty) throws IOException {
public CollectionRequest<Task> 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<String> optFields, Boolean optPretty) throws IOException {
String path = "/workspaces/{workspace_gid}/tasks/search".replace("{workspace_gid}", workspaceGid);

CollectionRequest<Task> req = new CollectionRequest<Task>(this, Task.class, path, "GET")
Expand All @@ -643,7 +642,6 @@ public CollectionRequest<Task> searchTasksForWorkspace(String workspaceGid, Bool
.query("resource_subtype", resourceSubtype)
.query("assignee.any", assigneeAny)
.query("assignee.not", assigneeNot)
.query("assignee_status", assigneeStatus)
.query("portfolios.any", portfoliosAny)
.query("projects.any", projectsAny)
.query("projects.not", projectsNot)
Expand Down Expand Up @@ -699,8 +697,8 @@ public CollectionRequest<Task> searchTasksForWorkspace(String workspaceGid, Bool
return req;
}

public CollectionRequest<Task> 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 assigneeStatus, 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, assigneeStatus, assigneeNot, assigneeAny, resourceSubtype, text, null, false);
public CollectionRequest<Task> 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);
}
/**
* Set the parent of a task
Expand Down
25 changes: 25 additions & 0 deletions src/main/java/com/asana/resources/gen/TeamsBase.java
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,31 @@ public ItemRequest<User> addUserForTeam(String teamGid) throws IOException {
return addUserForTeam(teamGid, null, false);
}
/**
* Create a team
* Creates a team within the current workspace.
* @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. &#x27;Note: You can only pass in an offset that was returned to you via a previously paginated request.&#x27; (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(Team)
* @throws IOException If we fail to call the API, e.g. server error or cannot deserialize the response body
*/
public ItemRequest<Team> createTeam(String offset, Integer limit, List<String> optFields, Boolean optPretty) throws IOException {
String path = "/teams";

ItemRequest<Team> req = new ItemRequest<Team>(this, Team.class, path, "POST")
.query("opt_pretty", optPretty)
.query("opt_fields", optFields)
.query("limit", limit)
.query("offset", offset);

return req;
}

public ItemRequest<Team> createTeam() throws IOException {
return createTeam(null, (int)Client.DEFAULTS.get("page_size"), null, false);
}
/**
* Get a team
* Returns the full record for a single team.
* @param teamGid Globally unique identifier for the team. (required)
Expand Down
Loading

0 comments on commit aa6839a

Please sign in to comment.