Skip to content

Commit

Permalink
Merge pull request #130 from Asana/openapi-sync
Browse files Browse the repository at this point in the history
Generated from OpenAPI
  • Loading branch information
aw-asana authored Sep 28, 2021
2 parents c0f1a32 + 5a0e011 commit 795a32e
Show file tree
Hide file tree
Showing 4 changed files with 37 additions and 3 deletions.
2 changes: 1 addition & 1 deletion samples/AttachmentsBaseSample.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ attachmentsbase:
Client client = Client.accessToken("PERSONAL_ACCESS_TOKEN");
Attachment result = client.attachments.createAttachmentForTask(taskGid, file, url, name)
Attachment result = client.attachments.createAttachmentForTask(taskGid, file, parent, url, name)
.data("field", "value")
.data("field", "value")
.option("pretty", true)
Expand Down
12 changes: 12 additions & 0 deletions samples/WebhooksBaseSample.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -41,3 +41,15 @@ webhooksbase:
List<Webhook> result = client.webhooks.getWebhooks(resource, workspace)
.option("pretty", true)
.execute();
updateWebhook: >-
import com.asana.Client;
Client client = Client.accessToken("PERSONAL_ACCESS_TOKEN");
Webhook result = client.webhooks.updateWebhook(webhookGid)
.data("field", "value")
.data("field", "value")
.option("pretty", true)
.execute();
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 @@ -40,7 +40,7 @@ public ItemRequest<CustomFieldSetting> addCustomFieldSettingForProject(String pr
}
/**
* Add followers to a project
* Adds the specified list of users as followers to the project. Followers are a subset of members, therefore if the users are not already members of the project they will also become members as a result of this operation. Returns the updated project record.
* Adds the specified list of users as followers to the project. Followers are a subset of members who have opted in to receive \&quot;tasks added\&quot; notifications for a project. Therefore, if the users are not already members of the project, they will also become members as a result of this operation. Returns the updated project record.
* @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 @@ -62,7 +62,7 @@ public ItemRequest<JsonElement> addFollowersForProject(String projectGid) throws
}
/**
* Add users to a project
* Adds the specified list of users as members of the project. Returns the updated project record.
* Adds the specified list of users as members of the project. Note that a user being added as a member may also be added as a *follower* as a result of this operation. This is because the user&#x27;s default notification settings (i.e., in the \&quot;Notifcations\&quot; tab of \&quot;My Profile Settings\&quot;) will override this endpoint&#x27;s default behavior of setting \&quot;Tasks added\&quot; notifications to &#x60;false&#x60;. Returns the updated project record.
* @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 Down
22 changes: 22 additions & 0 deletions src/main/java/com/asana/resources/gen/WebhooksBase.java
Original file line number Diff line number Diff line change
Expand Up @@ -112,4 +112,26 @@ public CollectionRequest<Webhook> getWebhooks(String resource, String workspace,
public CollectionRequest<Webhook> getWebhooks(String resource, String workspace) throws IOException {
return getWebhooks(resource, workspace, null, (int)Client.DEFAULTS.get("page_size"), null, false);
}
/**
* Update a webhook
* An existing webhook&#x27;s filters can be updated by making a PUT request on the URL for that webhook. Note that the webhook&#x27;s previous &#x60;filters&#x60; array will be completely overwritten by the &#x60;filters&#x60; sent in the PUT request.
* @param webhookGid Globally unique identifier for the webhook. (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(Webhook)
* @throws IOException If we fail to call the API, e.g. server error or cannot deserialize the response body
*/
public ItemRequest<Webhook> updateWebhook(String webhookGid, List<String> optFields, Boolean optPretty) throws IOException {
String path = "/webhooks/{webhook_gid}".replace("{webhook_gid}", webhookGid);

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

return req;
}

public ItemRequest<Webhook> updateWebhook(String webhookGid) throws IOException {
return updateWebhook(webhookGid, null, false);
}
}

0 comments on commit 795a32e

Please sign in to comment.