Skip to content

Commit

Permalink
Merge pull request #133 from Asana/openapi-sync
Browse files Browse the repository at this point in the history
Generated from OpenAPI
  • Loading branch information
aw-asana authored Jan 26, 2022
2 parents da9a725 + 0c327ce commit 52fef9b
Show file tree
Hide file tree
Showing 9 changed files with 334 additions and 24 deletions.
45 changes: 45 additions & 0 deletions samples/ProjectBriefsBaseSample.yaml
Original file line number Diff line number Diff line change
@@ -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();
43 changes: 43 additions & 0 deletions samples/StatusUpdatesBaseSample.yaml
Original file line number Diff line number Diff line change
@@ -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<JsonElement> result = client.statusupdates.getStatusesForObject(createdSince, parent)
.option("pretty", true)
.execute();
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, assigneeNot, assigneeAny, resourceSubtype, text)
List<Task> 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: >-
Expand Down
2 changes: 1 addition & 1 deletion samples/TeamsBaseSample.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
109 changes: 109 additions & 0 deletions src/main/java/com/asana/resources/gen/ProjectBriefsBase.java
Original file line number Diff line number Diff line change
@@ -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<JsonElement> createProjectBrief(String projectGid, List<String> optFields, Boolean optPretty) throws IOException {
String path = "/projects/{project_gid}/project_briefs".replace("{project_gid}", projectGid);

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

return req;
}

public ItemRequest<JsonElement> 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<JsonElement> deleteProjectBrief(String projectBriefGid, List<String> optFields, Boolean optPretty) throws IOException {
String path = "/project_briefs/{project_brief_gid}".replace("{project_brief_gid}", projectBriefGid);

ItemRequest<JsonElement> req = new ItemRequest<JsonElement>(this, JsonElement.class, path, "DELETE")
.query("opt_pretty", optPretty)
.query("opt_fields", optFields);

return req;
}

public ItemRequest<JsonElement> 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<JsonElement> getProjectBrief(String projectBriefGid, List<String> optFields, Boolean optPretty) throws IOException {
String path = "/project_briefs/{project_brief_gid}".replace("{project_brief_gid}", projectBriefGid);

ItemRequest<JsonElement> req = new ItemRequest<JsonElement>(this, JsonElement.class, path, "GET")
.query("opt_pretty", optPretty)
.query("opt_fields", optFields);

return req;
}

public ItemRequest<JsonElement> 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 &#x60;data&#x60; 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<JsonElement> updateProjectBrief(String projectBriefGid, List<String> optFields, Boolean optPretty) throws IOException {
String path = "/project_briefs/{project_brief_gid}".replace("{project_brief_gid}", projectBriefGid);

ItemRequest<JsonElement> req = new ItemRequest<JsonElement>(this, JsonElement.class, path, "PUT")
.query("opt_pretty", optPretty)
.query("opt_fields", optFields);

return req;
}

public ItemRequest<JsonElement> updateProjectBrief(String projectBriefGid) throws IOException {
return updateProjectBrief(projectBriefGid, null, false);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -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 &#x60;/status_updates&#x60; 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)
Expand All @@ -42,7 +42,7 @@ public ItemRequest<ProjectStatus> 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 &#x60;/status_updates/{status_gid}&#x60; 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)
Expand All @@ -64,7 +64,7 @@ public ItemRequest<JsonElement> deleteProjectStatus(String projectStatusGid) thr
}
/**
* Get a project status
* Returns the complete record for a single status update.
* *Deprecated: new integrations should prefer the &#x60;/status_updates/{status_gid}&#x60; 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)
Expand All @@ -86,7 +86,7 @@ public ItemRequest<ProjectStatus> 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 &#x60;/status_updates&#x60; 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. &#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)
Expand Down
Loading

0 comments on commit 52fef9b

Please sign in to comment.