diff --git a/VERSION b/VERSION index 1bfc9536..8877d790 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -0.10.4 \ No newline at end of file +0.10.5 \ No newline at end of file diff --git a/asana/__init__.py b/asana/__init__.py index 912b301c..6400d8b8 100644 --- a/asana/__init__.py +++ b/asana/__init__.py @@ -1,5 +1,5 @@ __title__ = 'asana' -__version__ = '0.10.4' +__version__ = '0.10.5' __license__ = 'MIT' __copyright__ = 'Copyright 2016 Asana, Inc.' diff --git a/asana/resources/gen/goals.py b/asana/resources/gen/goals.py new file mode 100644 index 00000000..dc814524 --- /dev/null +++ b/asana/resources/gen/goals.py @@ -0,0 +1,210 @@ +# coding=utf-8 +class _Goals: + + def __init__(self, client=None): + self.client = client + + def add_followers(self, params=None, **options): + """Add a collaborator to a goal + :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 = "/goals/{goal_gid}/addFollowers" + return self.client.post(path, params, **options) + + def add_subgoal(self, params=None, **options): + """Add a subgoal to a parent goal + :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 = "/goals/{goal_gid}/addSubgoal" + return self.client.post(path, params, **options) + + def add_supporting_work_for_goal(self, params=None, **options): + """Add a project/portfolio as supporting work for a goal. + :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 = "/goals/{goal_gid}/addSupportingWork" + return self.client.post(path, params, **options) + + def create_goal_metric(self, params=None, **options): + """Create a goal metric + :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 = "/goals/{goal_gid}/setMetric" + return self.client.post(path, params, **options) + + def delete_goal(self, goal_gid, params=None, **options): + """Delete a goal + :param str goal_gid: (required) Globally unique identifier for the goal. + :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 = "/goals/{goal_gid}".replace("{goal_gid}", goal_gid) + return self.client.delete(path, params, **options) + + def get_goal(self, goal_gid, params=None, **options): + """Get a goal + :param str goal_gid: (required) Globally unique identifier for the goal. + :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 = "/goals/{goal_gid}".replace("{goal_gid}", goal_gid) + return self.client.get(path, params, **options) + + def get_goals(self, params=None, **options): + """Get goals + :param Object params: Parameters for the request + - portfolio {str}: Globally unique identifier for supporting portfolio. + - project {str}: Globally unique identifier for supporting project. + - is_workspace_level {bool}: Filter to goals with is_workspace_level set to query value. Must be used with the workspace parameter. + - team {str}: Globally unique identifier for the team. + - workspace {str}: Globally unique identifier for the workspace. + :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 = "/goals" + return self.client.get_collection(path, params, **options) + + def get_parent_goals_for_goal(self, params=None, **options): + """Get parent goals from a goal + :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 = "/goals/{goal_gid}/parentGoals" + return self.client.get_collection(path, params, **options) + + def get_subgoals_for_goal(self, params=None, **options): + """Get subgoals from a goal + :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 = "/goals/{goal_gid}/subgoals" + return self.client.get_collection(path, params, **options) + + def remove_followers(self, params=None, **options): + """Remove a collaborator from a goal + :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 = "/goals/{goal_gid}/removeFollowers" + return self.client.post(path, params, **options) + + def remove_subgoal(self, params=None, **options): + """Remove a subgoal from a goal + :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 = "/goals/{goal_gid}/removeSubgoal" + return self.client.post(path, params, **options) + + def remove_supporting_work_for_goal(self, params=None, **options): + """Remove a project/portfolio as supporting work for a goal. + :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 = "/goals/{goal_gid}/removeSupportingWork" + return self.client.post(path, params, **options) + + def supporting_work(self, params=None, **options): + """Get supporting work from a goal + :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 = "/goals/{goal_gid}/supportingWork" + return self.client.get_collection(path, params, **options) + + def update_goal(self, goal_gid, params=None, **options): + """Update a goal + :param str goal_gid: (required) Globally unique identifier for the goal. + :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 = "/goals/{goal_gid}".replace("{goal_gid}", goal_gid) + return self.client.put(path, params, **options) + + def update_goal_metric(self, params=None, **options): + """Update a goal metric + :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 = "/goals/{goal_gid}/setMetricCurrentValue" + return self.client.post(path, params, **options) diff --git a/asana/version.py b/asana/version.py index 1da3331f..5308a7d1 100644 --- a/asana/version.py +++ b/asana/version.py @@ -1 +1 @@ -VERSION = '0.10.4' +VERSION = '0.10.5' diff --git a/samples/goals_sample.yaml b/samples/goals_sample.yaml new file mode 100644 index 00000000..928d868e --- /dev/null +++ b/samples/goals_sample.yaml @@ -0,0 +1,121 @@ +goals: + add_followers: >- + import asana + + + client = asana.Client.access_token('PERSONAL_ACCESS_TOKEN') + + + result = client.goals.add_followers({'field': 'value', 'field': 'value'}, opt_pretty=True) + add_subgoal: >- + import asana + + + client = asana.Client.access_token('PERSONAL_ACCESS_TOKEN') + + + result = client.goals.add_subgoal({'field': 'value', 'field': 'value'}, opt_pretty=True) + add_supporting_work_for_goal: >- + import asana + + + client = asana.Client.access_token('PERSONAL_ACCESS_TOKEN') + + + result = client.goals.add_supporting_work_for_goal({'field': 'value', 'field': 'value'}, opt_pretty=True) + create_goal_metric: >- + import asana + + + client = asana.Client.access_token('PERSONAL_ACCESS_TOKEN') + + + result = client.goals.create_goal_metric({'field': 'value', 'field': 'value'}, opt_pretty=True) + delete_goal: >- + import asana + + + client = asana.Client.access_token('PERSONAL_ACCESS_TOKEN') + + + result = client.goals.delete_goal(goal_gid, opt_pretty=True) + get_goal: >- + import asana + + + client = asana.Client.access_token('PERSONAL_ACCESS_TOKEN') + + + result = client.goals.get_goal(goal_gid, {'param': 'value', 'param': 'value'}, opt_pretty=True) + get_goals: >- + import asana + + + client = asana.Client.access_token('PERSONAL_ACCESS_TOKEN') + + + result = client.goals.get_goals({'param': 'value', 'param': 'value'}, opt_pretty=True) + get_parent_goals_for_goal: >- + import asana + + + client = asana.Client.access_token('PERSONAL_ACCESS_TOKEN') + + + result = client.goals.get_parent_goals_for_goal({'param': 'value', 'param': 'value'}, opt_pretty=True) + get_subgoals_for_goal: >- + import asana + + + client = asana.Client.access_token('PERSONAL_ACCESS_TOKEN') + + + result = client.goals.get_subgoals_for_goal({'param': 'value', 'param': 'value'}, opt_pretty=True) + remove_followers: >- + import asana + + + client = asana.Client.access_token('PERSONAL_ACCESS_TOKEN') + + + result = client.goals.remove_followers({'field': 'value', 'field': 'value'}, opt_pretty=True) + remove_subgoal: >- + import asana + + + client = asana.Client.access_token('PERSONAL_ACCESS_TOKEN') + + + result = client.goals.remove_subgoal({'field': 'value', 'field': 'value'}, opt_pretty=True) + remove_supporting_work_for_goal: >- + import asana + + + client = asana.Client.access_token('PERSONAL_ACCESS_TOKEN') + + + result = client.goals.remove_supporting_work_for_goal({'field': 'value', 'field': 'value'}, opt_pretty=True) + supporting_work: >- + import asana + + + client = asana.Client.access_token('PERSONAL_ACCESS_TOKEN') + + + result = client.goals.supporting_work({'param': 'value', 'param': 'value'}, opt_pretty=True) + update_goal: >- + import asana + + + client = asana.Client.access_token('PERSONAL_ACCESS_TOKEN') + + + result = client.goals.update_goal(goal_gid, {'field': 'value', 'field': 'value'}, opt_pretty=True) + update_goal_metric: >- + import asana + + + client = asana.Client.access_token('PERSONAL_ACCESS_TOKEN') + + + result = client.goals.update_goal_metric({'field': 'value', 'field': 'value'}, opt_pretty=True) diff --git a/setup.py b/setup.py index 5d825795..2c551f0e 100755 --- a/setup.py +++ b/setup.py @@ -10,7 +10,7 @@ setup( name='asana', - version='0.10.4', + version='0.10.5', description='Asana API client', license='MIT', classifiers=[