Skip to content

Commit 532065b

Browse files
committed
Generated from OpenAPI
1 parent 1f47580 commit 532065b

9 files changed

Lines changed: 126 additions & 5 deletions

File tree

VERSION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
0.10.9
1+
0.10.10

asana/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
__title__ = 'asana'
2-
__version__ = '0.10.9'
2+
__version__ = '0.10.10'
33
__license__ = 'MIT'
44
__copyright__ = 'Copyright 2016 Asana, Inc.'
55

Lines changed: 66 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,66 @@
1+
# coding=utf-8
2+
class _ProjectTemplates:
3+
4+
def __init__(self, client=None):
5+
self.client = client
6+
7+
def get_project_template(self, project_template_gid, params=None, **options):
8+
"""Get a project template
9+
:param str project_template_gid: (required) Globally unique identifier for the project template.
10+
:param Object params: Parameters for the request
11+
:param **options
12+
- 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.
13+
- 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.
14+
:return: Object
15+
"""
16+
if params is None:
17+
params = {}
18+
path = "/project_templates/{project_template_gid}".replace("{project_template_gid}", project_template_gid)
19+
return self.client.get(path, params, **options)
20+
21+
def get_project_templates(self, params=None, **options):
22+
"""Get multiple project templates
23+
:param Object params: Parameters for the request
24+
- workspace {str}: The workspace to filter results on.
25+
- team {str}: The team to filter projects on.
26+
:param **options
27+
- 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.'
28+
- limit {int}: Results per page. The number of objects to return per page. The value must be between 1 and 100.
29+
- 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.
30+
- 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.
31+
:return: Object
32+
"""
33+
if params is None:
34+
params = {}
35+
path = "/project_templates"
36+
return self.client.get_collection(path, params, **options)
37+
38+
def get_project_templates_for_team(self, team_gid, params=None, **options):
39+
"""Get a team's project templates
40+
:param str team_gid: (required) Globally unique identifier for the team.
41+
:param Object params: Parameters for the request
42+
:param **options
43+
- 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.'
44+
- limit {int}: Results per page. The number of objects to return per page. The value must be between 1 and 100.
45+
- 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.
46+
- 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.
47+
:return: Object
48+
"""
49+
if params is None:
50+
params = {}
51+
path = "/teams/{team_gid}/project_templates".replace("{team_gid}", team_gid)
52+
return self.client.get_collection(path, params, **options)
53+
54+
def instantiate_project(self, project_template_gid, params=None, **options):
55+
"""Instantiate a project from a project template
56+
:param str project_template_gid: (required) Globally unique identifier for the project template.
57+
:param Object params: Parameters for the request
58+
:param **options
59+
- 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.
60+
- 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.
61+
:return: Object
62+
"""
63+
if params is None:
64+
params = {}
65+
path = "/project_templates/{project_template_gid}/instantiateProject".replace("{project_template_gid}", project_template_gid)
66+
return self.client.post(path, params, **options)

asana/resources/gen/projects.py

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -212,6 +212,20 @@ def get_task_counts_for_project(self, project_gid, params=None, **options):
212212
path = "/projects/{project_gid}/task_counts".replace("{project_gid}", project_gid)
213213
return self.client.get(path, params, **options)
214214

215+
def project_save_as_template(self, project_gid, params=None, **options):
216+
"""Create a project template from a project
217+
:param str project_gid: (required) Globally unique identifier for the project.
218+
:param Object params: Parameters for the request
219+
:param **options
220+
- 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.
221+
- 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.
222+
:return: Object
223+
"""
224+
if params is None:
225+
params = {}
226+
path = "/projects/{project_gid}/saveAsTemplate".replace("{project_gid}", project_gid)
227+
return self.client.post(path, params, **options)
228+
215229
def remove_custom_field_setting_for_project(self, project_gid, params=None, **options):
216230
"""Remove a custom field from a project
217231
:param str project_gid: (required) Globally unique identifier for the project.

asana/resources/gen/typeahead.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ def typeahead_for_workspace(self, workspace_gid, params=None, **options):
88
"""Get objects via typeahead
99
:param str workspace_gid: (required) Globally unique identifier for the workspace or organization.
1010
:param Object params: Parameters for the request
11-
- 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.
11+
- 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.
1212
- type {str}: *Deprecated: new integrations should prefer the resource_type field.*
1313
- 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.
1414
- 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.

asana/version.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
VERSION = '0.10.9'
1+
VERSION = '0.10.10'
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
projecttemplates:
2+
get_project_template: >-
3+
import asana
4+
5+
6+
client = asana.Client.access_token('PERSONAL_ACCESS_TOKEN')
7+
8+
9+
result = client.project_templates.get_project_template(project_template_gid, {'param': 'value', 'param': 'value'}, opt_pretty=True)
10+
get_project_templates: >-
11+
import asana
12+
13+
14+
client = asana.Client.access_token('PERSONAL_ACCESS_TOKEN')
15+
16+
17+
result = client.project_templates.get_project_templates({'param': 'value', 'param': 'value'}, opt_pretty=True)
18+
get_project_templates_for_team: >-
19+
import asana
20+
21+
22+
client = asana.Client.access_token('PERSONAL_ACCESS_TOKEN')
23+
24+
25+
result = client.project_templates.get_project_templates_for_team(team_gid, {'param': 'value', 'param': 'value'}, opt_pretty=True)
26+
instantiate_project: >-
27+
import asana
28+
29+
30+
client = asana.Client.access_token('PERSONAL_ACCESS_TOKEN')
31+
32+
33+
result = client.project_templates.instantiate_project(project_template_gid, {'field': 'value', 'field': 'value'}, opt_pretty=True)

samples/projects_sample.yaml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -111,6 +111,14 @@ projects:
111111
112112
113113
result = client.projects.get_task_counts_for_project(project_gid, {'param': 'value', 'param': 'value'}, opt_pretty=True)
114+
project_save_as_template: >-
115+
import asana
116+
117+
118+
client = asana.Client.access_token('PERSONAL_ACCESS_TOKEN')
119+
120+
121+
result = client.projects.project_save_as_template(project_gid, {'field': 'value', 'field': 'value'}, opt_pretty=True)
114122
remove_custom_field_setting_for_project: >-
115123
import asana
116124

setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010

1111
setup(
1212
name='asana',
13-
version='0.10.9',
13+
version='0.10.10',
1414
description='Asana API client',
1515
license='MIT',
1616
classifiers=[

0 commit comments

Comments
 (0)