Skip to content

Commit

Permalink
Merge pull request #118 from Asana/openapi-sync
Browse files Browse the repository at this point in the history
Generated from OpenAPI
  • Loading branch information
aw-asana committed Sep 28, 2021
2 parents 52106bd + 0c9df3e commit b40a67e
Show file tree
Hide file tree
Showing 4 changed files with 25 additions and 2 deletions.
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
0.10.7
0.10.8
13 changes: 13 additions & 0 deletions lib/asana/resources/gen/webhooks_base.rb
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,19 @@ def get_webhooks(client, workspace: nil, resource: nil, options: {})
Collection.new(parse(client.get(path, params: params, options: options)), type: Webhook, client: client)
end

# Update a webhook
#
# webhook_gid - [str] (required) Globally unique identifier for the webhook.
# options - [Hash] the request I/O options
# > opt_fields - [list[str]] 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.
# > opt_pretty - [bool] 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.
# data - [Hash] the attributes to PUT
def update_webhook(client, webhook_gid: required("webhook_gid"), options: {}, **data)
path = "/webhooks/{webhook_gid}"
path["{webhook_gid}"] = webhook_gid
Webhook.new(parse(client.put(path, body: data, options: options)).first, client: client)
end

end
end
end
Expand Down
2 changes: 1 addition & 1 deletion lib/asana/version.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#:nodoc:
module Asana
# Public: Version of the gem.
VERSION = '0.10.7'
VERSION = '0.10.8'
end
10 changes: 10 additions & 0 deletions samples/webhooks_sample.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -39,3 +39,13 @@ webhooks:
result = client.webhooks.get_webhooks(workspace: ''workspace_example'', param: "value", param: "value", options: {pretty: true})
update_webhook: >-
require 'asana'
client = Asana::Client.new do |c|
c.authentication :access_token, 'PERSONAL_ACCESS_TOKEN'
end
result = client.webhooks.update_webhook(webhook_gid: 'webhook_gid', field: "value", field: "value", options: {pretty: true})

0 comments on commit b40a67e

Please sign in to comment.