-
Notifications
You must be signed in to change notification settings - Fork 105
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #137 from Asana/openapi-sync
Generated from OpenAPI
- Loading branch information
Showing
9 changed files
with
126 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
0.10.9 | ||
0.10.10 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
VERSION = '0.10.9' | ||
VERSION = '0.10.10' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters