diff --git a/samples/AttachmentsBaseSample.yaml b/samples/AttachmentsBaseSample.yaml index 7ddc892..dcdf3d8 100644 --- a/samples/AttachmentsBaseSample.yaml +++ b/samples/AttachmentsBaseSample.yaml @@ -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) diff --git a/samples/WebhooksBaseSample.yaml b/samples/WebhooksBaseSample.yaml index 0c68bd9..a1bcf79 100644 --- a/samples/WebhooksBaseSample.yaml +++ b/samples/WebhooksBaseSample.yaml @@ -41,3 +41,15 @@ webhooksbase: List 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(); diff --git a/src/main/java/com/asana/resources/gen/ProjectsBase.java b/src/main/java/com/asana/resources/gen/ProjectsBase.java index 03f3f7b..d1547ee 100644 --- a/src/main/java/com/asana/resources/gen/ProjectsBase.java +++ b/src/main/java/com/asana/resources/gen/ProjectsBase.java @@ -40,7 +40,7 @@ public ItemRequest 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 \"tasks added\" 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) @@ -62,7 +62,7 @@ public ItemRequest 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's default notification settings (i.e., in the \"Notifcations\" tab of \"My Profile Settings\") will override this endpoint's default behavior of setting \"Tasks added\" notifications to `false`. 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) diff --git a/src/main/java/com/asana/resources/gen/WebhooksBase.java b/src/main/java/com/asana/resources/gen/WebhooksBase.java index ddd832a..5fc4e30 100644 --- a/src/main/java/com/asana/resources/gen/WebhooksBase.java +++ b/src/main/java/com/asana/resources/gen/WebhooksBase.java @@ -112,4 +112,26 @@ public CollectionRequest getWebhooks(String resource, String workspace, public CollectionRequest 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's filters can be updated by making a PUT request on the URL for that webhook. Note that the webhook's previous `filters` array will be completely overwritten by the `filters` 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 updateWebhook(String webhookGid, List optFields, Boolean optPretty) throws IOException { + String path = "/webhooks/{webhook_gid}".replace("{webhook_gid}", webhookGid); + + ItemRequest req = new ItemRequest(this, Webhook.class, path, "PUT") + .query("opt_pretty", optPretty) + .query("opt_fields", optFields); + + return req; + } + + public ItemRequest updateWebhook(String webhookGid) throws IOException { + return updateWebhook(webhookGid, null, false); + } }