Skip to content

Commit

Permalink
Update v3 to v3.2.3 + Add important message to README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
jv-asana committed Apr 24, 2024
1 parent f5a7b09 commit d58abb3
Show file tree
Hide file tree
Showing 54 changed files with 673 additions and 273 deletions.
16 changes: 5 additions & 11 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
# asana [![Build][github-actions-image]][github-actions-url] [![PyPi Version][pypi-image]][pypi-url]
# asana

> **Warning**
> Python client library version `>4.X.X` is currently in BETA and subject to change. Please use v3.2.X for stable / production environments `pip install asana` or `pip install asana==3.2.2`. If you have feedback on the new version, please your feedback [here](https://form.asana.com/?k=C4sELCq6hAUsoWEY0kJwAA&d=15793206719).
> You can try out our new python beta by installing version [v4.0.11](https://github.com/Asana/python-asana/tree/v4.0.11) (`pip install asana==4.0.11`)
> **Important:**
> Versions 3.X.X and earlier of this package are no longer supported. For new features and support, please upgrade to [the latest version](https://pypi.org/project/asana/).
>
>To view sample code for version 3, select the `python-sdk-v3` tab on a specific endpoint's page in the [Asana API reference](https://developers.asana.com/reference/rest-api-reference), or check the [v3 samples](https://github.com/Asana/python-asana/tree/v3.2.3/samples) directory on GitHub.
Python client library for Asana.

Expand Down Expand Up @@ -174,10 +174,4 @@ Run `deploy.py [major|minor|patch]`. See `deploy.py -h` for additional info.

GitHub Actions will automatically build and deploy the tagged release to [PyPI](https://pypi.org/).

[github-actions-url]: https://github.com/Asana/python-asana/actions
[github-actions-image]: https://github.com/Asana/python-asana/workflows/Build/badge.svg

[pypi-url]: https://pypi.python.org/pypi/asana/
[pypi-image]: https://img.shields.io/pypi/v/asana.svg?style=flat-square

[asana-docs]: https://developers.asana.com/docs
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
3.2.2
3.2.3
10 changes: 7 additions & 3 deletions asana/resources/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
from . import (
allocations,
attachments,
audit_log_api,
batch_api,
Expand All @@ -11,24 +12,27 @@
memberships,
message,
organization_exports,
portfolios,
portfolio_memberships,
portfolios,
project_briefs,
project_memberships,
project_statuses,
project_templates,
projects,
rules,
sections,
status_updates,
stories,
tags,
task_templates,
tasks,
team_memberships,
teams,
time_periods,
team_memberships,
time_tracking_entries,
typeahead,
users,
user_task_lists,
users,
webhooks,
workspace_memberships,
workspaces
Expand Down
6 changes: 6 additions & 0 deletions asana/resources/allocations.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@

from .gen.allocations import _Allocations

class Allocations(_Allocations):
"""Allocations resource"""
pass
11 changes: 9 additions & 2 deletions asana/resources/gen/__init__.py
Original file line number Diff line number Diff line change
@@ -1,31 +1,38 @@
from . import (
allocations,
attachments,
audit_log_api,
batch_api,
custom_field_settings,
custom_fields,
events,
goal_relationships,
goals,
jobs,
memberships,
message,
organization_exports,
portfolios,
portfolio_memberships,
portfolios,
project_briefs,
project_memberships,
project_statuses,
project_templates,
projects,
rules,
sections,
status_updates,
stories,
tags,
task_templates,
tasks,
team_memberships,
teams,
time_periods,
time_tracking_entries,
typeahead,
users,
user_task_lists,
users,
webhooks,
workspace_memberships,
workspaces
Expand Down
77 changes: 77 additions & 0 deletions asana/resources/gen/allocations.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
# coding=utf-8
class _Allocations:

def __init__(self, client=None):
self.client = client

def create_allocation(self, params=None, **options):
"""Create an allocation
:param Object params: Parameters for the request
:param **options
- opt_fields {list[str]}: This endpoint returns a compact resource, which excludes some properties by default. To include those optional properties, set this query parameter to a comma-separated list of the properties you wish to include.
- 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.
:return: Object
"""
if params is None:
params = {}
path = "/allocations"
return self.client.post(path, params, **options)

def delete_allocation(self, allocation_gid, params=None, **options):
"""Delete an allocation
:param str allocation_gid: (required) Globally unique identifier for the allocation.
:param Object params: Parameters for the request
:param **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.
:return: Object
"""
if params is None:
params = {}
path = "/allocations/{allocation_gid}".replace("{allocation_gid}", allocation_gid)
return self.client.delete(path, params, **options)

def get_allocation(self, allocation_gid, params=None, **options):
"""Get an allocation
:param str allocation_gid: (required) Globally unique identifier for the allocation.
:param Object params: Parameters for the request
:param **options
- opt_fields {list[str]}: This endpoint returns a compact resource, which excludes some properties by default. To include those optional properties, set this query parameter to a comma-separated list of the properties you wish to include.
- 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.
:return: Object
"""
if params is None:
params = {}
path = "/allocations/{allocation_gid}".replace("{allocation_gid}", allocation_gid)
return self.client.get(path, params, **options)

def get_allocations(self, params=None, **options):
"""Get multiple allocations
:param Object params: Parameters for the request
- parent {str}: Globally unique identifier for the project to filter allocations by.
- assignee {str}: Globally unique identifier for the user the allocation is assigned to.
- workspace {str}: Globally unique identifier for the workspace.
:param **options
- offset {str}: 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. *Note: You can only pass in an offset that was returned to you via a previously paginated request.*
- limit {int}: Results per page. The number of objects to return per page. The value must be between 1 and 100.
- opt_fields {list[str]}: This endpoint returns a compact resource, which excludes some properties by default. To include those optional properties, set this query parameter to a comma-separated list of the properties you wish to include.
- 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.
:return: Object
"""
if params is None:
params = {}
path = "/allocations"
return self.client.get_collection(path, params, **options)

def update_allocation(self, allocation_gid, params=None, **options):
"""Update an allocation
:param str allocation_gid: (required) Globally unique identifier for the allocation.
:param Object params: Parameters for the request
:param **options
- opt_fields {list[str]}: This endpoint returns a compact resource, which excludes some properties by default. To include those optional properties, set this query parameter to a comma-separated list of the properties you wish to include.
- 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.
:return: Object
"""
if params is None:
params = {}
path = "/allocations/{allocation_gid}".replace("{allocation_gid}", allocation_gid)
return self.client.put(path, params, **options)
7 changes: 3 additions & 4 deletions asana/resources/gen/attachments.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ def delete_attachment(self, attachment_gid, params=None, **options):
:param str attachment_gid: (required) Globally unique identifier for the attachment.
:param Object params: Parameters for the request
:param **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.
:return: Object
"""
Expand All @@ -23,7 +22,7 @@ def get_attachment(self, attachment_gid, params=None, **options):
:param str attachment_gid: (required) Globally unique identifier for the attachment.
:param Object params: Parameters for the request
:param **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_fields {list[str]}: This endpoint returns a compact resource, which excludes some properties by default. To include those optional properties, set this query parameter to a comma-separated list of the properties you wish to include.
- 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.
:return: Object
"""
Expand All @@ -37,9 +36,9 @@ def get_attachments_for_object(self, params=None, **options):
:param Object params: Parameters for the request
- parent {str}: (required) Globally unique identifier for object to fetch statuses from. Must be a GID for a `project`, `project_brief`, or `task`.
:param **options
- offset {str}: 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. 'Note: You can only pass in an offset that was returned to you via a previously paginated request.'
- offset {str}: 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. *Note: You can only pass in an offset that was returned to you via a previously paginated request.*
- limit {int}: Results per page. The number of objects to return per page. The value must be between 1 and 100.
- 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_fields {list[str]}: This endpoint returns a compact resource, which excludes some properties by default. To include those optional properties, set this query parameter to a comma-separated list of the properties you wish to include.
- 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.
:return: Object
"""
Expand Down
2 changes: 1 addition & 1 deletion asana/resources/gen/audit_log_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ def get_audit_log_events(self, workspace_gid, params=None, **options):
- actor_gid {str}: Filter to events triggered by the actor with this ID.
- resource_gid {str}: Filter to events with this resource ID.
:param **options
- offset {str}: 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. 'Note: You can only pass in an offset that was returned to you via a previously paginated request.'
- offset {str}: 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. *Note: You can only pass in an offset that was returned to you via a previously paginated request.*
- limit {int}: Results per page. The number of objects to return per page. The value must be between 1 and 100.
:return: Object
"""
Expand Down
2 changes: 1 addition & 1 deletion asana/resources/gen/batch_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ def create_batch_request(self, params=None, **options):
"""Submit parallel requests
:param Object params: Parameters for the request
:param **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_fields {list[str]}: This endpoint returns a compact resource, which excludes some properties by default. To include those optional properties, set this query parameter to a comma-separated list of the properties you wish to include.
- 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.
:return: Object
"""
Expand Down
Loading

0 comments on commit d58abb3

Please sign in to comment.