Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
34 changes: 2 additions & 32 deletions asana/resources/gen/__init__.py
Original file line number Diff line number Diff line change
@@ -1,32 +1,2 @@
from . import (
attachments,
audit_log_api,
batch_api,
custom_field_settings,
custom_fields,
events,
goals,
jobs,
organization_exports,
portfolios,
portfolio_memberships,
project_briefs,
project_memberships,
project_statuses,
project_templates,
projects,
sections,
status_updates,
stories,
tags,
tasks,
team_memberships,
teams,
time_periods,
typeahead,
users,
user_task_lists,
webhooks,
workspace_memberships,
workspaces
)
from . import *

34 changes: 28 additions & 6 deletions asana/resources/gen/attachments.py
Original file line number Diff line number Diff line change
@@ -1,49 +1,71 @@
# coding=utf-8
class _Attachments:
class Attachments:

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

def create_attachment_for_object(self, params=None, **options):
"""Upload an attachment
:param Object params: Parameters for the request
- opt_fields {[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.
: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 = "/attachments"
return self.client.post(path, params, **options)


def delete_attachment(self, attachment_gid, params=None, **options):
"""Delete an attachment
:param str attachment_gid: (required) Globally unique identifier for the attachment.
:param Object params: Parameters for the request
- opt_fields {[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.
: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
"""

if params is None:
params = {}
path = "/attachments/{attachment_gid}".replace("{attachment_gid}", attachment_gid)
return self.client.delete(path, params, **options)


def get_attachment(self, attachment_gid, params=None, **options):
"""Get an attachment
:param str attachment_gid: (required) Globally unique identifier for the attachment.
:param Object params: Parameters for the request
- opt_fields {[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.
: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
"""

if params is None:
params = {}
path = "/attachments/{attachment_gid}".replace("{attachment_gid}", attachment_gid)
return self.client.get(path, params, **options)


def get_attachments_for_object(self, params=None, **options):
"""Get attachments from an object
:param Object params: Parameters for the request
- opt_fields {[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.
- limit {int}: Results per page. The number of objects to return per page. The value must be between 1 and 100.
- 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.'
- 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.'
- 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_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 = "/attachments"
return self.client.get_collection(path, params, **options)


20 changes: 15 additions & 5 deletions asana/resources/gen/audit_log_api.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
# coding=utf-8
class _AuditLogAPI:
from asana.page_iteratorimport import AuditLogAPIIterator

class AuditLogAPI:

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

def get_audit_log_events(self, workspace_gid, params=None, **options):
"""Get audit log events
:param str workspace_gid: (required) Globally unique identifier for the workspace or organization.
Expand All @@ -14,12 +16,20 @@ def get_audit_log_events(self, workspace_gid, params=None, **options):
- actor_type {str}: Filter to events with an actor of this type. This only needs to be included if querying for actor types without an ID. If `actor_gid` is included, this should be excluded.
- 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.'
- limit {int}: Results per page. The number of objects to return per page. The value must be between 1 and 100.
- 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.'
:param **options
:return: Object
"""
if params is None:
params = {}
path = "/workspaces/{workspace_gid}/audit_log_events".replace("{workspace_gid}", workspace_gid)
return self.client.get_collection(path, params, **options)
options = self.client._merge_options(options)
iterator_type = options.get('iterator_type')
if iterator_type == 'items':
return AuditLogAPIIterator(self.client, path, params, options).items()
if iterator_type is None:
return self.client.get(path, params, **options)
raise Exception(f'Unknown value for "iterator_type" option: {iterator_type}')


7 changes: 5 additions & 2 deletions asana/resources/gen/batch_api.py
Original file line number Diff line number Diff line change
@@ -1,18 +1,21 @@
# coding=utf-8
class _BatchAPI:
class BatchAPI:

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

def create_batch_request(self, params=None, **options):
"""Submit parallel requests
:param Object params: Parameters for the request
- opt_fields {[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.
: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
"""

if params is None:
params = {}
path = "/batch"
return self.client.post(path, params, **options)


23 changes: 14 additions & 9 deletions asana/resources/gen/custom_field_settings.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# coding=utf-8
class _CustomFieldSettings:
class CustomFieldSettings:

def __init__(self, client=None):
self.client = client
Expand All @@ -8,30 +8,35 @@ def get_custom_field_settings_for_portfolio(self, portfolio_gid, params=None, **
"""Get a portfolio's custom fields
:param str portfolio_gid: (required) Globally unique identifier for the portfolio.
:param Object params: Parameters for the request
: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.'
- opt_fields {[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.
- 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.
- 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.'
: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 = "/portfolios/{portfolio_gid}/custom_field_settings".replace("{portfolio_gid}", portfolio_gid)
return self.client.get_collection(path, params, **options)
return self.client.get(path, params, **options)


def get_custom_field_settings_for_project(self, project_gid, params=None, **options):
"""Get a project's custom fields
:param str project_gid: (required) Globally unique identifier for the project.
:param Object params: Parameters for the request
: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.'
- opt_fields {[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.
- 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.
- 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.'
: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 = "/projects/{project_gid}/custom_field_settings".replace("{project_gid}", project_gid)
return self.client.get_collection(path, params, **options)
return self.client.get(path, params, **options)


Loading