-
Notifications
You must be signed in to change notification settings - Fork 42
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #133 from Asana/openapi-sync
Generated from OpenAPI
- Loading branch information
Showing
9 changed files
with
334 additions
and
24 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
109 changes: 109 additions & 0 deletions
109
src/main/java/com/asana/resources/gen/ProjectBriefsBase.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 `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<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); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.