Skip to content

Commit ef8250c

Browse files
Updated Python SDK: v5.2.0
1 parent 5ea5521 commit ef8250c

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

44 files changed

+719
-427
lines changed

README.md

Lines changed: 196 additions & 195 deletions
Large diffs are not rendered by default.

asana/__init__.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@
2323
from asana.api.custom_fields_api import CustomFieldsApi
2424
from asana.api.custom_types_api import CustomTypesApi
2525
from asana.api.events_api import EventsApi
26+
from asana.api.exports_api import ExportsApi
2627
from asana.api.goal_relationships_api import GoalRelationshipsApi
2728
from asana.api.goals_api import GoalsApi
2829
from asana.api.jobs_api import JobsApi

asana/api/__init__.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
from asana.api.custom_fields_api import CustomFieldsApi
1212
from asana.api.custom_types_api import CustomTypesApi
1313
from asana.api.events_api import EventsApi
14+
from asana.api.exports_api import ExportsApi
1415
from asana.api.goal_relationships_api import GoalRelationshipsApi
1516
from asana.api.goals_api import GoalsApi
1617
from asana.api.jobs_api import JobsApi

asana/api/attachments_api.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ def __init__(self, api_client=None):
3535
def create_attachment_for_object(self, opts, **kwargs): # noqa: E501
3636
"""Upload an attachment # noqa: E501
3737
38-
Upload an attachment. This method uploads an attachment on an object and returns the compact record for the created attachment object. This is possible by either: - Providing the URL of the external resource being attached, or - Downloading the file content first and then uploading it as any other attachment. Note that it is not possible to attach files from third party services such as Dropbox, Box, Vimeo & Google Drive via the API The 100MB size limit on attachments in Asana is enforced on this endpoint. This endpoint expects a multipart/form-data encoded request containing the full contents of the file to be uploaded. Requests made should follow the HTTP/1.1 specification that line terminators are of the form `CRLF` or `\\r\\n` outlined [here](http://www.w3.org/Protocols/HTTP/1.1/draft-ietf-http-v11-spec-01#Basic-Rules) in order for the server to reliably and properly handle the request. For file names that contain non-ASCII characters, the file name should be URL-encoded. For example, a file named `résumé.pdf` should be encoded as `r%C3%A9sum%C3%A9.pdf` and the `filename` parameter in the `Content-Disposition` header should be set to the encoded file name. Below is an example of a cURL request with the `Content-Disposition` header: ``` export ASANA_PAT=\"<YOUR_ASANA_PERSONAL_ACCESS_TOKEN>\" export PARENT_ID=\"<PARENT_GID>\" export ENCODED_NAME=\"r%C3%A9sum%C3%A9.pdf\" curl --location 'https://app.asana.com/api/1.0/attachments' \\ --header 'Content-Type: multipart/form-data' \\ --header 'Accept: application/json' \\ --header \"Authorization: Bearer $ASANA_PAT\" \\ --form \"parent=$PARENT_ID\" \\ --form \"file=@/Users/exampleUser/Downloads/résumé.pdf;headers=\\\"Content-Disposition: form-data; name=\"file\"; filename=\"$ENCODED_NAME.pdf\"; filename*=UTF-8''$ENCODED_NAME.pdf\\\"\" ``` # noqa: E501
38+
<b>Required scope: </b><code>attachments:write</code> Upload an attachment. This method uploads an attachment on an object and returns the compact record for the created attachment object. This is possible by either: - Providing the URL of the external resource being attached, or - Downloading the file content first and then uploading it as any other attachment. Note that it is not possible to attach files from third party services such as Dropbox, Box, Vimeo & Google Drive via the API The 100MB size limit on attachments in Asana is enforced on this endpoint. This endpoint expects a multipart/form-data encoded request containing the full contents of the file to be uploaded. Requests made should follow the HTTP/1.1 specification that line terminators are of the form `CRLF` or `\\r\\n` outlined [here](http://www.w3.org/Protocols/HTTP/1.1/draft-ietf-http-v11-spec-01#Basic-Rules) in order for the server to reliably and properly handle the request. For file names that contain non-ASCII characters, the file name should be URL-encoded. For example, a file named `résumé.pdf` should be encoded as `r%C3%A9sum%C3%A9.pdf` and the `filename` parameter in the `Content-Disposition` header should be set to the encoded file name. Below is an example of a cURL request with the `Content-Disposition` header: ``` export ASANA_PAT=\"<YOUR_ASANA_PERSONAL_ACCESS_TOKEN>\" export PARENT_ID=\"<PARENT_GID>\" export ENCODED_NAME=\"r%C3%A9sum%C3%A9.pdf\" curl --location 'https://app.asana.com/api/1.0/attachments' \\ --header 'Content-Type: multipart/form-data' \\ --header 'Accept: application/json' \\ --header \"Authorization: Bearer $ASANA_PAT\" \\ --form \"parent=$PARENT_ID\" \\ --form \"file=@/Users/exampleUser/Downloads/résumé.pdf;headers=\\\"Content-Disposition: form-data; name=\"file\"; filename=\"$ENCODED_NAME.pdf\"; filename*=UTF-8''$ENCODED_NAME.pdf\\\"\" ``` # noqa: E501
3939
This method makes a synchronous HTTP request by default. To make an
4040
asynchronous HTTP request, please pass async_req=True
4141
>>> thread = api.create_attachment_for_object(async_req=True)
@@ -63,7 +63,7 @@ def create_attachment_for_object(self, opts, **kwargs): # noqa: E501
6363
def create_attachment_for_object_with_http_info(self, opts, **kwargs): # noqa: E501
6464
"""Upload an attachment # noqa: E501
6565
66-
Upload an attachment. This method uploads an attachment on an object and returns the compact record for the created attachment object. This is possible by either: - Providing the URL of the external resource being attached, or - Downloading the file content first and then uploading it as any other attachment. Note that it is not possible to attach files from third party services such as Dropbox, Box, Vimeo & Google Drive via the API The 100MB size limit on attachments in Asana is enforced on this endpoint. This endpoint expects a multipart/form-data encoded request containing the full contents of the file to be uploaded. Requests made should follow the HTTP/1.1 specification that line terminators are of the form `CRLF` or `\\r\\n` outlined [here](http://www.w3.org/Protocols/HTTP/1.1/draft-ietf-http-v11-spec-01#Basic-Rules) in order for the server to reliably and properly handle the request. For file names that contain non-ASCII characters, the file name should be URL-encoded. For example, a file named `résumé.pdf` should be encoded as `r%C3%A9sum%C3%A9.pdf` and the `filename` parameter in the `Content-Disposition` header should be set to the encoded file name. Below is an example of a cURL request with the `Content-Disposition` header: ``` export ASANA_PAT=\"<YOUR_ASANA_PERSONAL_ACCESS_TOKEN>\" export PARENT_ID=\"<PARENT_GID>\" export ENCODED_NAME=\"r%C3%A9sum%C3%A9.pdf\" curl --location 'https://app.asana.com/api/1.0/attachments' \\ --header 'Content-Type: multipart/form-data' \\ --header 'Accept: application/json' \\ --header \"Authorization: Bearer $ASANA_PAT\" \\ --form \"parent=$PARENT_ID\" \\ --form \"file=@/Users/exampleUser/Downloads/résumé.pdf;headers=\\\"Content-Disposition: form-data; name=\"file\"; filename=\"$ENCODED_NAME.pdf\"; filename*=UTF-8''$ENCODED_NAME.pdf\\\"\" ``` # noqa: E501
66+
<b>Required scope: </b><code>attachments:write</code> Upload an attachment. This method uploads an attachment on an object and returns the compact record for the created attachment object. This is possible by either: - Providing the URL of the external resource being attached, or - Downloading the file content first and then uploading it as any other attachment. Note that it is not possible to attach files from third party services such as Dropbox, Box, Vimeo & Google Drive via the API The 100MB size limit on attachments in Asana is enforced on this endpoint. This endpoint expects a multipart/form-data encoded request containing the full contents of the file to be uploaded. Requests made should follow the HTTP/1.1 specification that line terminators are of the form `CRLF` or `\\r\\n` outlined [here](http://www.w3.org/Protocols/HTTP/1.1/draft-ietf-http-v11-spec-01#Basic-Rules) in order for the server to reliably and properly handle the request. For file names that contain non-ASCII characters, the file name should be URL-encoded. For example, a file named `résumé.pdf` should be encoded as `r%C3%A9sum%C3%A9.pdf` and the `filename` parameter in the `Content-Disposition` header should be set to the encoded file name. Below is an example of a cURL request with the `Content-Disposition` header: ``` export ASANA_PAT=\"<YOUR_ASANA_PERSONAL_ACCESS_TOKEN>\" export PARENT_ID=\"<PARENT_GID>\" export ENCODED_NAME=\"r%C3%A9sum%C3%A9.pdf\" curl --location 'https://app.asana.com/api/1.0/attachments' \\ --header 'Content-Type: multipart/form-data' \\ --header 'Accept: application/json' \\ --header \"Authorization: Bearer $ASANA_PAT\" \\ --form \"parent=$PARENT_ID\" \\ --form \"file=@/Users/exampleUser/Downloads/résumé.pdf;headers=\\\"Content-Disposition: form-data; name=\"file\"; filename=\"$ENCODED_NAME.pdf\"; filename*=UTF-8''$ENCODED_NAME.pdf\\\"\" ``` # noqa: E501
6767
This method makes a synchronous HTTP request by default. To make an
6868
asynchronous HTTP request, please pass async_req=True
6969
>>> thread = api.create_attachment_for_object_with_http_info(async_req=True)
@@ -350,7 +350,7 @@ def delete_attachment_with_http_info(self, attachment_gid, **kwargs): # noqa: E
350350
def get_attachment(self, attachment_gid, opts, **kwargs): # noqa: E501
351351
"""Get an attachment # noqa: E501
352352
353-
Get the full record for a single attachment. # noqa: E501
353+
<b>Required scope: </b><code>attachments:read</code> Get the full record for a single attachment. # noqa: E501
354354
This method makes a synchronous HTTP request by default. To make an
355355
asynchronous HTTP request, please pass async_req=True
356356
>>> thread = api.get_attachment(attachment_gid, async_req=True)
@@ -373,7 +373,7 @@ def get_attachment(self, attachment_gid, opts, **kwargs): # noqa: E501
373373
def get_attachment_with_http_info(self, attachment_gid, opts, **kwargs): # noqa: E501
374374
"""Get an attachment # noqa: E501
375375
376-
Get the full record for a single attachment. # noqa: E501
376+
<b>Required scope: </b><code>attachments:read</code> Get the full record for a single attachment. # noqa: E501
377377
This method makes a synchronous HTTP request by default. To make an
378378
asynchronous HTTP request, please pass async_req=True
379379
>>> thread = api.get_attachment_with_http_info(attachment_gid, async_req=True)
@@ -489,7 +489,7 @@ def get_attachment_with_http_info(self, attachment_gid, opts, **kwargs): # noqa
489489
def get_attachments_for_object(self, parent, opts, **kwargs): # noqa: E501
490490
"""Get attachments from an object # noqa: E501
491491
492-
Returns the compact records for all attachments on the object. There are three possible `parent` values for this request: `project`, `project_brief`, and `task`. For a project, an attachment refers to a file uploaded to the \"Key resources\" section in the project Overview. For a project brief, an attachment refers to inline files in the project brief itself. For a task, an attachment refers to a file directly associated to that task. Note that within the Asana app, inline images in the task description do not appear in the index of image thumbnails nor as stories in the task. However, requests made to `GET /attachments` for a task will return all of the images in the task, including inline images. # noqa: E501
492+
<b>Required scope: </b><code>attachments:read</code> Returns the compact records for all attachments on the object. There are three possible `parent` values for this request: `project`, `project_brief`, and `task`. For a project, an attachment refers to a file uploaded to the \"Key resources\" section in the project Overview. For a project brief, an attachment refers to inline files in the project brief itself. For a task, an attachment refers to a file directly associated to that task. Note that within the Asana app, inline images in the task description do not appear in the index of image thumbnails nor as stories in the task. However, requests made to `GET /attachments` for a task will return all of the images in the task, including inline images. # noqa: E501
493493
This method makes a synchronous HTTP request by default. To make an
494494
asynchronous HTTP request, please pass async_req=True
495495
>>> thread = api.get_attachments_for_object(parent, async_req=True)
@@ -514,7 +514,7 @@ def get_attachments_for_object(self, parent, opts, **kwargs): # noqa: E501
514514
def get_attachments_for_object_with_http_info(self, parent, opts, **kwargs): # noqa: E501
515515
"""Get attachments from an object # noqa: E501
516516
517-
Returns the compact records for all attachments on the object. There are three possible `parent` values for this request: `project`, `project_brief`, and `task`. For a project, an attachment refers to a file uploaded to the \"Key resources\" section in the project Overview. For a project brief, an attachment refers to inline files in the project brief itself. For a task, an attachment refers to a file directly associated to that task. Note that within the Asana app, inline images in the task description do not appear in the index of image thumbnails nor as stories in the task. However, requests made to `GET /attachments` for a task will return all of the images in the task, including inline images. # noqa: E501
517+
<b>Required scope: </b><code>attachments:read</code> Returns the compact records for all attachments on the object. There are three possible `parent` values for this request: `project`, `project_brief`, and `task`. For a project, an attachment refers to a file uploaded to the \"Key resources\" section in the project Overview. For a project brief, an attachment refers to inline files in the project brief itself. For a task, an attachment refers to a file directly associated to that task. Note that within the Asana app, inline images in the task description do not appear in the index of image thumbnails nor as stories in the task. However, requests made to `GET /attachments` for a task will return all of the images in the task, including inline images. # noqa: E501
518518
This method makes a synchronous HTTP request by default. To make an
519519
asynchronous HTTP request, please pass async_req=True
520520
>>> thread = api.get_attachments_for_object_with_http_info(parent, async_req=True)

0 commit comments

Comments
 (0)