Skip to content

Commit

Permalink
Merge pull request #137 from Asana/openapi-sync
Browse files Browse the repository at this point in the history
Generated from OpenAPI
  • Loading branch information
jv-asana authored Mar 4, 2022
2 parents 1f47580 + 532065b commit b6e4ff4
Show file tree
Hide file tree
Showing 9 changed files with 126 additions and 5 deletions.
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
0.10.9
0.10.10
2 changes: 1 addition & 1 deletion asana/__init__.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
__title__ = 'asana'
__version__ = '0.10.9'
__version__ = '0.10.10'
__license__ = 'MIT'
__copyright__ = 'Copyright 2016 Asana, Inc.'

Expand Down
66 changes: 66 additions & 0 deletions asana/resources/gen/project_templates.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
# coding=utf-8
class _ProjectTemplates:

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

def get_project_template(self, project_template_gid, params=None, **options):
"""Get a project template
:param str project_template_gid: (required) Globally unique identifier for the project template.
: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
"""
if params is None:
params = {}
path = "/project_templates/{project_template_gid}".replace("{project_template_gid}", project_template_gid)
return self.client.get(path, params, **options)

def get_project_templates(self, params=None, **options):
"""Get multiple project templates
:param Object params: Parameters for the request
- workspace {str}: The workspace to filter results on.
- team {str}: The team to filter projects on.
: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 = "/project_templates"
return self.client.get_collection(path, params, **options)

def get_project_templates_for_team(self, team_gid, params=None, **options):
"""Get a team's project templates
:param str team_gid: (required) Globally unique identifier for the team.
: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.'
- 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 = "/teams/{team_gid}/project_templates".replace("{team_gid}", team_gid)
return self.client.get_collection(path, params, **options)

def instantiate_project(self, project_template_gid, params=None, **options):
"""Instantiate a project from a project template
:param str project_template_gid: (required) Globally unique identifier for the project template.
: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
"""
if params is None:
params = {}
path = "/project_templates/{project_template_gid}/instantiateProject".replace("{project_template_gid}", project_template_gid)
return self.client.post(path, params, **options)
14 changes: 14 additions & 0 deletions asana/resources/gen/projects.py
Original file line number Diff line number Diff line change
Expand Up @@ -212,6 +212,20 @@ def get_task_counts_for_project(self, project_gid, params=None, **options):
path = "/projects/{project_gid}/task_counts".replace("{project_gid}", project_gid)
return self.client.get(path, params, **options)

def project_save_as_template(self, project_gid, params=None, **options):
"""Create a project template from a project
:param str project_gid: (required) Globally unique identifier for the project.
: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
"""
if params is None:
params = {}
path = "/projects/{project_gid}/saveAsTemplate".replace("{project_gid}", project_gid)
return self.client.post(path, params, **options)

def remove_custom_field_setting_for_project(self, project_gid, params=None, **options):
"""Remove a custom field from a project
:param str project_gid: (required) Globally unique identifier for the project.
Expand Down
2 changes: 1 addition & 1 deletion asana/resources/gen/typeahead.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ def typeahead_for_workspace(self, workspace_gid, params=None, **options):
"""Get objects via typeahead
:param str workspace_gid: (required) Globally unique identifier for the workspace or organization.
:param Object params: Parameters for the request
- resource_type {str}: (required) The type of values the typeahead should return. You can choose from one of the following: `custom_field`, `project`, `portfolio`, `tag`, `task`, and `user`. Note that unlike in the names of endpoints, the types listed here are in singular form (e.g. `task`). Using multiple types is not yet supported.
- resource_type {str}: (required) The type of values the typeahead should return. You can choose from one of the following: `custom_field`, `project`, `project_template`, `portfolio`, `tag`, `task`, and `user`. Note that unlike in the names of endpoints, the types listed here are in singular form (e.g. `task`). Using multiple types is not yet supported.
- type {str}: *Deprecated: new integrations should prefer the resource_type field.*
- query {str}: The string that will be used to search for relevant objects. If an empty string is passed in, the API will currently return an empty result set.
- count {int}: The number of results to return. The default is 20 if this parameter is omitted, with a minimum of 1 and a maximum of 100. If there are fewer results found than requested, all will be returned.
Expand Down
2 changes: 1 addition & 1 deletion asana/version.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
VERSION = '0.10.9'
VERSION = '0.10.10'
33 changes: 33 additions & 0 deletions samples/project_templates_sample.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
projecttemplates:
get_project_template: >-
import asana
client = asana.Client.access_token('PERSONAL_ACCESS_TOKEN')
result = client.project_templates.get_project_template(project_template_gid, {'param': 'value', 'param': 'value'}, opt_pretty=True)
get_project_templates: >-
import asana
client = asana.Client.access_token('PERSONAL_ACCESS_TOKEN')
result = client.project_templates.get_project_templates({'param': 'value', 'param': 'value'}, opt_pretty=True)
get_project_templates_for_team: >-
import asana
client = asana.Client.access_token('PERSONAL_ACCESS_TOKEN')
result = client.project_templates.get_project_templates_for_team(team_gid, {'param': 'value', 'param': 'value'}, opt_pretty=True)
instantiate_project: >-
import asana
client = asana.Client.access_token('PERSONAL_ACCESS_TOKEN')
result = client.project_templates.instantiate_project(project_template_gid, {'field': 'value', 'field': 'value'}, opt_pretty=True)
8 changes: 8 additions & 0 deletions samples/projects_sample.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,14 @@ projects:
result = client.projects.get_task_counts_for_project(project_gid, {'param': 'value', 'param': 'value'}, opt_pretty=True)
project_save_as_template: >-
import asana
client = asana.Client.access_token('PERSONAL_ACCESS_TOKEN')
result = client.projects.project_save_as_template(project_gid, {'field': 'value', 'field': 'value'}, opt_pretty=True)
remove_custom_field_setting_for_project: >-
import asana
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@

setup(
name='asana',
version='0.10.9',
version='0.10.10',
description='Asana API client',
license='MIT',
classifiers=[
Expand Down

0 comments on commit b6e4ff4

Please sign in to comment.