diff --git a/asana/resources/gen/__init__.py b/asana/resources/gen/__init__.py index 2786f20b..bf95bd29 100644 --- a/asana/resources/gen/__init__.py +++ b/asana/resources/gen/__init__.py @@ -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 * + diff --git a/asana/resources/gen/attachments.py b/asana/resources/gen/attachments.py index cb5f2998..473bd5a9 100644 --- a/asana/resources/gen/attachments.py +++ b/asana/resources/gen/attachments.py @@ -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) + + diff --git a/asana/resources/gen/audit_log_api.py b/asana/resources/gen/audit_log_api.py index d21723bf..bdaaa097 100644 --- a/asana/resources/gen/audit_log_api.py +++ b/asana/resources/gen/audit_log_api.py @@ -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. @@ -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}') + + diff --git a/asana/resources/gen/batch_api.py b/asana/resources/gen/batch_api.py index 3652b3d3..a5bfb936 100644 --- a/asana/resources/gen/batch_api.py +++ b/asana/resources/gen/batch_api.py @@ -1,5 +1,5 @@ # coding=utf-8 -class _BatchAPI: +class BatchAPI: def __init__(self, client=None): self.client = client @@ -7,12 +7,15 @@ def __init__(self, client=None): 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) + + diff --git a/asana/resources/gen/custom_field_settings.py b/asana/resources/gen/custom_field_settings.py index 563a68c3..8a722795 100644 --- a/asana/resources/gen/custom_field_settings.py +++ b/asana/resources/gen/custom_field_settings.py @@ -1,5 +1,5 @@ # coding=utf-8 -class _CustomFieldSettings: +class CustomFieldSettings: def __init__(self, client=None): self.client = client @@ -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) + + diff --git a/asana/resources/gen/custom_fields.py b/asana/resources/gen/custom_fields.py index ba1a673e..1aeaa843 100644 --- a/asana/resources/gen/custom_fields.py +++ b/asana/resources/gen/custom_fields.py @@ -1,5 +1,5 @@ # coding=utf-8 -class _CustomFields: +class CustomFields: def __init__(self, client=None): self.client = client @@ -7,116 +7,133 @@ def __init__(self, client=None): def create_custom_field(self, params=None, **options): """Create a custom field :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 = "/custom_fields" return self.client.post(path, params, **options) + def create_enum_option_for_custom_field(self, custom_field_gid, params=None, **options): """Create an enum option :param str custom_field_gid: (required) Globally unique identifier for the custom field. :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 = "/custom_fields/{custom_field_gid}/enum_options".replace("{custom_field_gid}", custom_field_gid) return self.client.post(path, params, **options) + def delete_custom_field(self, custom_field_gid, params=None, **options): """Delete a custom field :param str custom_field_gid: (required) Globally unique identifier for the custom field. :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 = "/custom_fields/{custom_field_gid}".replace("{custom_field_gid}", custom_field_gid) return self.client.delete(path, params, **options) + def get_custom_field(self, custom_field_gid, params=None, **options): """Get a custom field :param str custom_field_gid: (required) Globally unique identifier for the custom field. :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 = "/custom_fields/{custom_field_gid}".replace("{custom_field_gid}", custom_field_gid) return self.client.get(path, params, **options) + def get_custom_fields_for_workspace(self, workspace_gid, params=None, **options): """Get a workspace's custom fields :param str workspace_gid: (required) Globally unique identifier for the workspace or organization. :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 = "/workspaces/{workspace_gid}/custom_fields".replace("{workspace_gid}", workspace_gid) - return self.client.get_collection(path, params, **options) + return self.client.get(path, params, **options) + def insert_enum_option_for_custom_field(self, custom_field_gid, params=None, **options): """Reorder a custom field's enum :param str custom_field_gid: (required) Globally unique identifier for the custom field. :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 = "/custom_fields/{custom_field_gid}/enum_options/insert".replace("{custom_field_gid}", custom_field_gid) return self.client.post(path, params, **options) + def update_custom_field(self, custom_field_gid, params=None, **options): """Update a custom field :param str custom_field_gid: (required) Globally unique identifier for the custom field. :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 = "/custom_fields/{custom_field_gid}".replace("{custom_field_gid}", custom_field_gid) return self.client.put(path, params, **options) + def update_enum_option(self, enum_option_gid, params=None, **options): """Update an enum option :param str enum_option_gid: (required) Globally unique identifier for the enum option. :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 = "/enum_options/{enum_option_gid}".replace("{enum_option_gid}", enum_option_gid) return self.client.put(path, params, **options) + + diff --git a/asana/resources/gen/events.py b/asana/resources/gen/events.py index 5ba54075..27c571eb 100644 --- a/asana/resources/gen/events.py +++ b/asana/resources/gen/events.py @@ -1,5 +1,6 @@ # coding=utf-8 -class _Events: +from asana.page_iterator import EventsPageIterator +class Events: def __init__(self, client=None): self.client = client @@ -9,12 +10,30 @@ def get_events(self, params=None, **options): :param Object params: Parameters for the request - resource {str}: (required) A resource ID to subscribe to. The resource can be a task or project. - sync {str}: A sync token received from the last request, or none on first sync. Events will be returned from the point in time that the sync token was generated. *Note: On your first request, omit the sync token. The response will be the same as for an expired sync token, and will include a new valid sync token.If the sync token is too old (which may happen from time to time) the API will return a `412 Precondition Failed` error, and include a fresh sync token in the response.* + - 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 = "/events" return self.client.get_collection(path, params, **options) + + + + def get_events_iterator(self, params=None, **options): + """Get events on a resource + :param Object params: Parameters for the request + - resource {str}: (required) A resource ID to subscribe to. The resource can be a task or project. + - sync {str}: A sync token received from the last request, or none on first sync. Events will be returned from the point in time that the sync token was generated. *Note: On your first request, omit the sync token. The response will be the same as for an expired sync token, and will include a new valid sync token.If the sync token is too old (which may happen from time to time) the API will return a `412 Precondition Failed` error, and include a fresh sync token in the response.* + - 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 = {} + return EventsPageIterator(self.client, '/events', params, options).items() + diff --git a/asana/resources/gen/goal_relationships.py b/asana/resources/gen/goal_relationships.py index e5ee197c..62c99d77 100644 --- a/asana/resources/gen/goal_relationships.py +++ b/asana/resources/gen/goal_relationships.py @@ -1,5 +1,5 @@ # coding=utf-8 -class _GoalRelationships: +class GoalRelationships: def __init__(self, client=None): self.client = client @@ -8,69 +8,80 @@ def add_supporting_relationship(self, goal_gid, params=None, **options): """Add a supporting goal relationship :param str goal_gid: (required) Globally unique identifier for the goal. :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 = "/goals/{goal_gid}/addSupportingRelationship".replace("{goal_gid}", goal_gid) return self.client.post(path, params, **options) + def get_goal_relationship(self, goal_relationship_gid, params=None, **options): """Get a goal relationship :param str goal_relationship_gid: (required) Globally unique identifier for the goal relationship. :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 = "/goal_relationships/{goal_relationship_gid}".replace("{goal_relationship_gid}", goal_relationship_gid) return self.client.get(path, params, **options) + def get_goal_relationships(self, params=None, **options): """Get goal relationships :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. - supported_goal {str}: (required) Globally unique identifier for the supported goal in the goal relationship. - resource_subtype {str}: If provided, filter to goal relationships with a given resource_subtype. :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 = "/goal_relationships" return self.client.get_collection(path, params, **options) + def remove_supporting_relationship(self, goal_gid, params=None, **options): """Removes a supporting goal relationship :param str goal_gid: (required) Globally unique identifier for the goal. :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 = "/goals/{goal_gid}/removeSupportingRelationship".replace("{goal_gid}", goal_gid) return self.client.post(path, params, **options) + def update_goal_relationship(self, goal_relationship_gid, params=None, **options): """Update a goal relationship :param str goal_relationship_gid: (required) Globally unique identifier for the goal relationship. :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 = "/goal_relationships/{goal_relationship_gid}".replace("{goal_relationship_gid}", goal_relationship_gid) return self.client.put(path, params, **options) + + diff --git a/asana/resources/gen/goals.py b/asana/resources/gen/goals.py index 79e47743..1627c409 100644 --- a/asana/resources/gen/goals.py +++ b/asana/resources/gen/goals.py @@ -1,5 +1,5 @@ # coding=utf-8 -class _Goals: +class Goals: def __init__(self, client=None): self.client = client @@ -8,146 +8,167 @@ def add_followers(self, goal_gid, params=None, **options): """Add a collaborator to a goal :param str goal_gid: (required) Globally unique identifier for the goal. :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 = "/goals/{goal_gid}/addFollowers".replace("{goal_gid}", goal_gid) return self.client.post(path, params, **options) + def create_goal(self, params=None, **options): """Create a goal :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 = "/goals" return self.client.post(path, params, **options) + def create_goal_metric(self, goal_gid, params=None, **options): """Create a goal metric :param str goal_gid: (required) Globally unique identifier for the goal. :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 = "/goals/{goal_gid}/setMetric".replace("{goal_gid}", goal_gid) 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 + - 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 = "/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 + - 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 = "/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 + - 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.' - 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. - - time_periods {list[str]}: Globally unique identifiers for the time periods. + - time_periods {[str]}: Globally unique identifiers for the time periods. :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, goal_gid, params=None, **options): """Get parent goals from a goal :param str goal_gid: (required) Globally unique identifier for the goal. :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 = "/goals/{goal_gid}/parentGoals".replace("{goal_gid}", goal_gid) - return self.client.get_collection(path, params, **options) + return self.client.get(path, params, **options) + def remove_followers(self, goal_gid, params=None, **options): """Remove a collaborator from a goal :param str goal_gid: (required) Globally unique identifier for the goal. :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 = "/goals/{goal_gid}/removeFollowers".replace("{goal_gid}", goal_gid) return self.client.post(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 + - 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 = "/goals/{goal_gid}".replace("{goal_gid}", goal_gid) return self.client.put(path, params, **options) + def update_goal_metric(self, goal_gid, params=None, **options): """Update a goal metric :param str goal_gid: (required) Globally unique identifier for the goal. :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 = "/goals/{goal_gid}/setMetricCurrentValue".replace("{goal_gid}", goal_gid) return self.client.post(path, params, **options) + + diff --git a/asana/resources/gen/jobs.py b/asana/resources/gen/jobs.py index 2c1d7027..b1ec0bc0 100644 --- a/asana/resources/gen/jobs.py +++ b/asana/resources/gen/jobs.py @@ -1,5 +1,5 @@ # coding=utf-8 -class _Jobs: +class Jobs: def __init__(self, client=None): self.client = client @@ -8,12 +8,15 @@ def get_job(self, job_gid, params=None, **options): """Get a job by id :param str job_gid: (required) Globally unique identifier for the job. :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 = "/jobs/{job_gid}".replace("{job_gid}", job_gid) return self.client.get(path, params, **options) + + diff --git a/asana/resources/gen/organization_exports.py b/asana/resources/gen/organization_exports.py index 0c196941..a3203e1e 100644 --- a/asana/resources/gen/organization_exports.py +++ b/asana/resources/gen/organization_exports.py @@ -1,5 +1,5 @@ # coding=utf-8 -class _OrganizationExports: +class OrganizationExports: def __init__(self, client=None): self.client = client @@ -7,28 +7,33 @@ def __init__(self, client=None): def create_organization_export(self, params=None, **options): """Create an organization export request :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 = "/organization_exports" return self.client.post(path, params, **options) + def get_organization_export(self, organization_export_gid, params=None, **options): """Get details on an org export request :param str organization_export_gid: (required) Globally unique identifier for the organization export. :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 = "/organization_exports/{organization_export_gid}".replace("{organization_export_gid}", organization_export_gid) return self.client.get(path, params, **options) + + diff --git a/asana/resources/gen/portfolio_memberships.py b/asana/resources/gen/portfolio_memberships.py index bbae489d..ac9727bb 100644 --- a/asana/resources/gen/portfolio_memberships.py +++ b/asana/resources/gen/portfolio_memberships.py @@ -1,5 +1,5 @@ # coding=utf-8 -class _PortfolioMemberships: +class PortfolioMemberships: def __init__(self, client=None): self.client = client @@ -8,47 +8,54 @@ def get_portfolio_membership(self, portfolio_membership_gid, params=None, **opti """Get a portfolio membership :param str portfolio_membership_gid: (required) :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 = "/portfolio_memberships/{portfolio_membership_gid}".replace("{portfolio_membership_gid}", portfolio_membership_gid) return self.client.get(path, params, **options) + def get_portfolio_memberships(self, params=None, **options): """Get multiple portfolio memberships :param Object params: Parameters for the request - portfolio {str}: The portfolio to filter results on. - workspace {str}: The workspace to filter results on. - user {str}: A string identifying a user. This can either be the string \"me\", an email, or the gid of a user. - :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 = "/portfolio_memberships" return self.client.get_collection(path, params, **options) + def get_portfolio_memberships_for_portfolio(self, portfolio_gid, params=None, **options): """Get memberships from a portfolio :param str portfolio_gid: (required) Globally unique identifier for the portfolio. :param Object params: Parameters for the request - user {str}: A string identifying a user. This can either be the string \"me\", an email, or the gid of a user. - :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}/portfolio_memberships".replace("{portfolio_gid}", portfolio_gid) - return self.client.get_collection(path, params, **options) + return self.client.get(path, params, **options) + + diff --git a/asana/resources/gen/portfolios.py b/asana/resources/gen/portfolios.py index 6ecbd7b7..3dca838f 100644 --- a/asana/resources/gen/portfolios.py +++ b/asana/resources/gen/portfolios.py @@ -1,5 +1,5 @@ # coding=utf-8 -class _Portfolios: +class Portfolios: def __init__(self, client=None): self.client = client @@ -12,113 +12,129 @@ def add_custom_field_setting_for_portfolio(self, portfolio_gid, params=None, **o - 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}/addCustomFieldSetting".replace("{portfolio_gid}", portfolio_gid) return self.client.post(path, params, **options) + def add_item_for_portfolio(self, portfolio_gid, params=None, **options): """Add a portfolio item :param str portfolio_gid: (required) Globally unique identifier for the portfolio. :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 = "/portfolios/{portfolio_gid}/addItem".replace("{portfolio_gid}", portfolio_gid) return self.client.post(path, params, **options) + def add_members_for_portfolio(self, portfolio_gid, params=None, **options): """Add users to a portfolio :param str portfolio_gid: (required) Globally unique identifier for the portfolio. :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 = "/portfolios/{portfolio_gid}/addMembers".replace("{portfolio_gid}", portfolio_gid) return self.client.post(path, params, **options) + def create_portfolio(self, params=None, **options): """Create a portfolio :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 = "/portfolios" return self.client.post(path, params, **options) + def delete_portfolio(self, portfolio_gid, params=None, **options): """Delete a portfolio :param str portfolio_gid: (required) Globally unique identifier for the portfolio. :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 = "/portfolios/{portfolio_gid}".replace("{portfolio_gid}", portfolio_gid) return self.client.delete(path, params, **options) + def get_items_for_portfolio(self, portfolio_gid, params=None, **options): """Get portfolio items :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}/items".replace("{portfolio_gid}", portfolio_gid) - return self.client.get_collection(path, params, **options) + return self.client.get(path, params, **options) + def get_portfolio(self, portfolio_gid, params=None, **options): """Get a portfolio :param str portfolio_gid: (required) Globally unique identifier for the portfolio. :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 = "/portfolios/{portfolio_gid}".replace("{portfolio_gid}", portfolio_gid) return self.client.get(path, params, **options) + def get_portfolios(self, params=None, **options): """Get multiple portfolios :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.' - workspace {str}: (required) The workspace or organization to filter portfolios on. - owner {str}: (required) The user who owns the portfolio. Currently, API users can only get a list of portfolios that they themselves own. :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 = "/portfolios" return self.client.get_collection(path, params, **options) + def remove_custom_field_setting_for_portfolio(self, portfolio_gid, params=None, **options): """Remove a custom field from a portfolio :param str portfolio_gid: (required) Globally unique identifier for the portfolio. @@ -127,49 +143,58 @@ def remove_custom_field_setting_for_portfolio(self, portfolio_gid, params=None, - 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}/removeCustomFieldSetting".replace("{portfolio_gid}", portfolio_gid) return self.client.post(path, params, **options) + def remove_item_for_portfolio(self, portfolio_gid, params=None, **options): """Remove a portfolio item :param str portfolio_gid: (required) Globally unique identifier for the portfolio. :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 = "/portfolios/{portfolio_gid}/removeItem".replace("{portfolio_gid}", portfolio_gid) return self.client.post(path, params, **options) + def remove_members_for_portfolio(self, portfolio_gid, params=None, **options): """Remove users from a portfolio :param str portfolio_gid: (required) Globally unique identifier for the portfolio. :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 = "/portfolios/{portfolio_gid}/removeMembers".replace("{portfolio_gid}", portfolio_gid) return self.client.post(path, params, **options) + def update_portfolio(self, portfolio_gid, params=None, **options): """Update a portfolio :param str portfolio_gid: (required) Globally unique identifier for the portfolio. :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 = "/portfolios/{portfolio_gid}".replace("{portfolio_gid}", portfolio_gid) return self.client.put(path, params, **options) + + diff --git a/asana/resources/gen/project_briefs.py b/asana/resources/gen/project_briefs.py index 4d59ff55..d7c408e3 100644 --- a/asana/resources/gen/project_briefs.py +++ b/asana/resources/gen/project_briefs.py @@ -1,5 +1,5 @@ # coding=utf-8 -class _ProjectBriefs: +class ProjectBriefs: def __init__(self, client=None): self.client = client @@ -8,54 +8,63 @@ def create_project_brief(self, project_gid, params=None, **options): """Create a project brief :param str project_gid: (required) Globally unique identifier for the project. :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 = "/projects/{project_gid}/project_briefs".replace("{project_gid}", project_gid) return self.client.post(path, params, **options) + def delete_project_brief(self, project_brief_gid, params=None, **options): """Delete a project brief :param str project_brief_gid: (required) Globally unique identifier for the project brief. :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 = "/project_briefs/{project_brief_gid}".replace("{project_brief_gid}", project_brief_gid) return self.client.delete(path, params, **options) + def get_project_brief(self, project_brief_gid, params=None, **options): """Get a project brief :param str project_brief_gid: (required) Globally unique identifier for the project brief. :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 = "/project_briefs/{project_brief_gid}".replace("{project_brief_gid}", project_brief_gid) return self.client.get(path, params, **options) + def update_project_brief(self, project_brief_gid, params=None, **options): """Update a project brief :param str project_brief_gid: (required) Globally unique identifier for the project brief. :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 = "/project_briefs/{project_brief_gid}".replace("{project_brief_gid}", project_brief_gid) return self.client.put(path, params, **options) + + diff --git a/asana/resources/gen/project_memberships.py b/asana/resources/gen/project_memberships.py index a78c0af5..74803232 100644 --- a/asana/resources/gen/project_memberships.py +++ b/asana/resources/gen/project_memberships.py @@ -1,5 +1,5 @@ # coding=utf-8 -class _ProjectMemberships: +class ProjectMemberships: def __init__(self, client=None): self.client = client @@ -8,29 +8,34 @@ def get_project_membership(self, project_membership_gid, params=None, **options) """Get a project membership :param str project_membership_gid: (required) :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 = "/project_memberships/{project_membership_gid}".replace("{project_membership_gid}", project_membership_gid) return self.client.get(path, params, **options) + def get_project_memberships_for_project(self, project_gid, params=None, **options): """Get memberships from a project :param str project_gid: (required) Globally unique identifier for the project. :param Object params: Parameters for the request - user {str}: A string identifying a user. This can either be the string \"me\", an email, or the gid of a user. - :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}/project_memberships".replace("{project_gid}", project_gid) - return self.client.get_collection(path, params, **options) + return self.client.get(path, params, **options) + + diff --git a/asana/resources/gen/project_statuses.py b/asana/resources/gen/project_statuses.py index 94e9af82..3f64c01e 100644 --- a/asana/resources/gen/project_statuses.py +++ b/asana/resources/gen/project_statuses.py @@ -1,5 +1,5 @@ # coding=utf-8 -class _ProjectStatuses: +class ProjectStatuses: def __init__(self, client=None): self.client = client @@ -8,56 +8,65 @@ def create_project_status_for_project(self, project_gid, params=None, **options) """Create a project status :param str project_gid: (required) Globally unique identifier for the project. :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 = "/projects/{project_gid}/project_statuses".replace("{project_gid}", project_gid) return self.client.post(path, params, **options) + def delete_project_status(self, project_status_gid, params=None, **options): """Delete a project status :param str project_status_gid: (required) The project status update to get. :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 = "/project_statuses/{project_status_gid}".replace("{project_status_gid}", project_status_gid) return self.client.delete(path, params, **options) + def get_project_status(self, project_status_gid, params=None, **options): """Get a project status :param str project_status_gid: (required) The project status update to get. :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 = "/project_statuses/{project_status_gid}".replace("{project_status_gid}", project_status_gid) return self.client.get(path, params, **options) + def get_project_statuses_for_project(self, project_gid, params=None, **options): """Get statuses from a project :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}/project_statuses".replace("{project_gid}", project_gid) - return self.client.get_collection(path, params, **options) + return self.client.get(path, params, **options) + + diff --git a/asana/resources/gen/project_templates.py b/asana/resources/gen/project_templates.py index 87c99d29..ee72956e 100644 --- a/asana/resources/gen/project_templates.py +++ b/asana/resources/gen/project_templates.py @@ -1,5 +1,5 @@ # coding=utf-8 -class _ProjectTemplates: +class ProjectTemplates: def __init__(self, client=None): self.client = client @@ -8,59 +8,68 @@ 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 + - 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 = "/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 + - 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. - 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. + - 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 = "/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.' + - 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 = "/teams/{team_gid}/project_templates".replace("{team_gid}", team_gid) - return self.client.get_collection(path, params, **options) + return self.client.get(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 + - 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 = "/project_templates/{project_template_gid}/instantiateProject".replace("{project_template_gid}", project_template_gid) return self.client.post(path, params, **options) + + diff --git a/asana/resources/gen/projects.py b/asana/resources/gen/projects.py index f93fba92..adc0ca2d 100644 --- a/asana/resources/gen/projects.py +++ b/asana/resources/gen/projects.py @@ -1,5 +1,5 @@ # coding=utf-8 -class _Projects: +class Projects: def __init__(self, client=None): self.client = client @@ -12,220 +12,250 @@ def add_custom_field_setting_for_project(self, project_gid, params=None, **optio - 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}/addCustomFieldSetting".replace("{project_gid}", project_gid) return self.client.post(path, params, **options) + def add_followers_for_project(self, project_gid, params=None, **options): """Add followers to a project :param str project_gid: (required) Globally unique identifier for the project. :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 = "/projects/{project_gid}/addFollowers".replace("{project_gid}", project_gid) return self.client.post(path, params, **options) + def add_members_for_project(self, project_gid, params=None, **options): """Add users to a project :param str project_gid: (required) Globally unique identifier for the project. :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 = "/projects/{project_gid}/addMembers".replace("{project_gid}", project_gid) return self.client.post(path, params, **options) + def create_project(self, params=None, **options): """Create a project :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 = "/projects" return self.client.post(path, params, **options) + def create_project_for_team(self, team_gid, params=None, **options): """Create a project in a team :param str team_gid: (required) Globally unique identifier for the team. :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 = "/teams/{team_gid}/projects".replace("{team_gid}", team_gid) return self.client.post(path, params, **options) + def create_project_for_workspace(self, workspace_gid, params=None, **options): """Create a project in a workspace :param str workspace_gid: (required) Globally unique identifier for the workspace or organization. :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 = "/workspaces/{workspace_gid}/projects".replace("{workspace_gid}", workspace_gid) return self.client.post(path, params, **options) + def delete_project(self, project_gid, params=None, **options): """Delete a project :param str project_gid: (required) Globally unique identifier for the project. :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 = "/projects/{project_gid}".replace("{project_gid}", project_gid) return self.client.delete(path, params, **options) + def duplicate_project(self, project_gid, params=None, **options): """Duplicate a project :param str project_gid: (required) Globally unique identifier for the project. :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 = "/projects/{project_gid}/duplicate".replace("{project_gid}", project_gid) return self.client.post(path, params, **options) + def get_project(self, project_gid, params=None, **options): """Get a project :param str project_gid: (required) Globally unique identifier for the project. :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 = "/projects/{project_gid}".replace("{project_gid}", project_gid) return self.client.get(path, params, **options) + def get_projects(self, params=None, **options): """Get multiple projects :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.' - workspace {str}: The workspace or organization to filter projects on. - team {str}: The team to filter projects on. - archived {bool}: Only return projects whose `archived` field takes on the value of this parameter. :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 = "/projects" return self.client.get_collection(path, params, **options) + def get_projects_for_task(self, task_gid, params=None, **options): """Get projects a task is in :param str task_gid: (required) The task to operate on. :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 = "/tasks/{task_gid}/projects".replace("{task_gid}", task_gid) - return self.client.get_collection(path, params, **options) + return self.client.get(path, params, **options) + def get_projects_for_team(self, team_gid, params=None, **options): """Get a team's projects :param str team_gid: (required) Globally unique identifier for the team. :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.' - archived {bool}: Only return projects whose `archived` field takes on the value of this parameter. :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}/projects".replace("{team_gid}", team_gid) - return self.client.get_collection(path, params, **options) + return self.client.get(path, params, **options) + def get_projects_for_workspace(self, workspace_gid, params=None, **options): """Get all projects in a workspace :param str workspace_gid: (required) Globally unique identifier for the workspace or organization. :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.' - archived {bool}: Only return projects whose `archived` field takes on the value of this parameter. :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 = "/workspaces/{workspace_gid}/projects".replace("{workspace_gid}", workspace_gid) - return self.client.get_collection(path, params, **options) + return self.client.get(path, params, **options) + def get_task_counts_for_project(self, project_gid, params=None, **options): """Get task count of a project :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}/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 + - 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 = "/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. @@ -234,49 +264,58 @@ def remove_custom_field_setting_for_project(self, project_gid, params=None, **op - 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}/removeCustomFieldSetting".replace("{project_gid}", project_gid) return self.client.post(path, params, **options) + def remove_followers_for_project(self, project_gid, params=None, **options): """Remove followers from a project :param str project_gid: (required) Globally unique identifier for the project. :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 = "/projects/{project_gid}/removeFollowers".replace("{project_gid}", project_gid) return self.client.post(path, params, **options) + def remove_members_for_project(self, project_gid, params=None, **options): """Remove users from a project :param str project_gid: (required) Globally unique identifier for the project. :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 = "/projects/{project_gid}/removeMembers".replace("{project_gid}", project_gid) return self.client.post(path, params, **options) + def update_project(self, project_gid, params=None, **options): """Update a project :param str project_gid: (required) Globally unique identifier for the project. :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 = "/projects/{project_gid}".replace("{project_gid}", project_gid) return self.client.put(path, params, **options) + + diff --git a/asana/resources/gen/sections.py b/asana/resources/gen/sections.py index 043ac4c0..43695b38 100644 --- a/asana/resources/gen/sections.py +++ b/asana/resources/gen/sections.py @@ -1,5 +1,5 @@ # coding=utf-8 -class _Sections: +class Sections: def __init__(self, client=None): self.client = client @@ -8,98 +8,113 @@ def add_task_for_section(self, section_gid, params=None, **options): """Add task to section :param str section_gid: (required) The globally unique identifier for the section. :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 = "/sections/{section_gid}/addTask".replace("{section_gid}", section_gid) return self.client.post(path, params, **options) + def create_section_for_project(self, project_gid, params=None, **options): """Create a section in a project :param str project_gid: (required) Globally unique identifier for the project. :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 = "/projects/{project_gid}/sections".replace("{project_gid}", project_gid) return self.client.post(path, params, **options) + def delete_section(self, section_gid, params=None, **options): """Delete a section :param str section_gid: (required) The globally unique identifier for the section. :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 = "/sections/{section_gid}".replace("{section_gid}", section_gid) return self.client.delete(path, params, **options) + def get_section(self, section_gid, params=None, **options): """Get a section :param str section_gid: (required) The globally unique identifier for the section. :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 = "/sections/{section_gid}".replace("{section_gid}", section_gid) return self.client.get(path, params, **options) + def get_sections_for_project(self, project_gid, params=None, **options): """Get sections in a project :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}/sections".replace("{project_gid}", project_gid) - return self.client.get_collection(path, params, **options) + return self.client.get(path, params, **options) + def insert_section_for_project(self, project_gid, params=None, **options): """Move or Insert sections :param str project_gid: (required) Globally unique identifier for the project. :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 = "/projects/{project_gid}/sections/insert".replace("{project_gid}", project_gid) return self.client.post(path, params, **options) + def update_section(self, section_gid, params=None, **options): """Update a section :param str section_gid: (required) The globally unique identifier for the section. :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 = "/sections/{section_gid}".replace("{section_gid}", section_gid) return self.client.put(path, params, **options) + + diff --git a/asana/resources/gen/status_updates.py b/asana/resources/gen/status_updates.py index 9bfe59bf..3f74cdc0 100644 --- a/asana/resources/gen/status_updates.py +++ b/asana/resources/gen/status_updates.py @@ -1,5 +1,5 @@ # coding=utf-8 -class _StatusUpdates: +class StatusUpdates: def __init__(self, client=None): self.client = client @@ -7,73 +7,68 @@ def __init__(self, client=None): def create_status_for_object(self, params=None, **options): """Create a status update :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 = "/status_updates" return self.client.post(path, params, **options) + def delete_status(self, status_gid, params=None, **options): """Delete a status update :param str status_gid: (required) The status update to get. :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 = "/status_updates/{status_gid}".replace("{status_gid}", status_gid) - return self.client.delete(path, params, **options) - def delete_status_message(self, message_gid, params=None, **options): - """Delete a status update - :param str message_gid: (required) The message to get. - :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 = "/status_updates/{message_gid}".replace("{message_gid}", message_gid) + path = "/status_updates/{status_gid}".replace("{status_gid}", status_gid) return self.client.delete(path, params, **options) + def get_status(self, status_gid, params=None, **options): """Get a status update :param str status_gid: (required) The status update to get. :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 = "/status_updates/{status_gid}".replace("{status_gid}", status_gid) return self.client.get(path, params, **options) + def get_statuses_for_object(self, params=None, **options): """Get status updates 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, portfolio, or goal. - created_since {datetime}: Only return statuses that have been created since the given time. :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 = "/status_updates" return self.client.get_collection(path, params, **options) + + diff --git a/asana/resources/gen/stories.py b/asana/resources/gen/stories.py index d0dd73ed..fae0c8c0 100644 --- a/asana/resources/gen/stories.py +++ b/asana/resources/gen/stories.py @@ -1,5 +1,5 @@ # coding=utf-8 -class _Stories: +class Stories: def __init__(self, client=None): self.client = client @@ -8,72 +8,83 @@ def create_story_for_task(self, task_gid, params=None, **options): """Create a story on a task :param str task_gid: (required) The task to operate on. :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 = "/tasks/{task_gid}/stories".replace("{task_gid}", task_gid) return self.client.post(path, params, **options) + def delete_story(self, story_gid, params=None, **options): """Delete a story :param str story_gid: (required) Globally unique identifier for the story. :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 = "/stories/{story_gid}".replace("{story_gid}", story_gid) return self.client.delete(path, params, **options) + def get_stories_for_task(self, task_gid, params=None, **options): """Get stories from a task :param str task_gid: (required) The task to operate on. :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 = "/tasks/{task_gid}/stories".replace("{task_gid}", task_gid) - return self.client.get_collection(path, params, **options) + return self.client.get(path, params, **options) + def get_story(self, story_gid, params=None, **options): """Get a story :param str story_gid: (required) Globally unique identifier for the story. :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 = "/stories/{story_gid}".replace("{story_gid}", story_gid) return self.client.get(path, params, **options) + def update_story(self, story_gid, params=None, **options): """Update a story :param str story_gid: (required) Globally unique identifier for the story. :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 = "/stories/{story_gid}".replace("{story_gid}", story_gid) return self.client.put(path, params, **options) + + diff --git a/asana/resources/gen/tags.py b/asana/resources/gen/tags.py index 52fd7988..1f0a3078 100644 --- a/asana/resources/gen/tags.py +++ b/asana/resources/gen/tags.py @@ -1,5 +1,5 @@ # coding=utf-8 -class _Tags: +class Tags: def __init__(self, client=None): self.client = client @@ -7,122 +7,139 @@ def __init__(self, client=None): def create_tag(self, params=None, **options): """Create a tag :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 = "/tags" return self.client.post(path, params, **options) + def create_tag_for_workspace(self, workspace_gid, params=None, **options): """Create a tag in a workspace :param str workspace_gid: (required) Globally unique identifier for the workspace or organization. :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 = "/workspaces/{workspace_gid}/tags".replace("{workspace_gid}", workspace_gid) return self.client.post(path, params, **options) + def delete_tag(self, tag_gid, params=None, **options): """Delete a tag :param str tag_gid: (required) Globally unique identifier for the tag. :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 = "/tags/{tag_gid}".replace("{tag_gid}", tag_gid) return self.client.delete(path, params, **options) + def get_tag(self, tag_gid, params=None, **options): """Get a tag :param str tag_gid: (required) Globally unique identifier for the tag. :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 = "/tags/{tag_gid}".replace("{tag_gid}", tag_gid) return self.client.get(path, params, **options) + def get_tags(self, params=None, **options): """Get multiple tags :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.' - workspace {str}: The workspace to filter tags 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 = "/tags" return self.client.get_collection(path, params, **options) + def get_tags_for_task(self, task_gid, params=None, **options): """Get a task's tags :param str task_gid: (required) The task to operate on. :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 = "/tasks/{task_gid}/tags".replace("{task_gid}", task_gid) - return self.client.get_collection(path, params, **options) + return self.client.get(path, params, **options) + def get_tags_for_workspace(self, workspace_gid, params=None, **options): """Get tags in a workspace :param str workspace_gid: (required) Globally unique identifier for the workspace or organization. :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 = "/workspaces/{workspace_gid}/tags".replace("{workspace_gid}", workspace_gid) - return self.client.get_collection(path, params, **options) + return self.client.get(path, params, **options) + def update_tag(self, tag_gid, params=None, **options): """Update a tag :param str tag_gid: (required) Globally unique identifier for the tag. :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 = "/tags/{tag_gid}".replace("{tag_gid}", tag_gid) return self.client.put(path, params, **options) + + diff --git a/asana/resources/gen/tasks.py b/asana/resources/gen/tasks.py index 98ab1754..102e84e6 100644 --- a/asana/resources/gen/tasks.py +++ b/asana/resources/gen/tasks.py @@ -1,5 +1,5 @@ # coding=utf-8 -class _Tasks: +class Tasks: def __init__(self, client=None): self.client = client @@ -8,192 +8,221 @@ def add_dependencies_for_task(self, task_gid, params=None, **options): """Set dependencies for a task :param str task_gid: (required) The task to operate on. :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 = "/tasks/{task_gid}/addDependencies".replace("{task_gid}", task_gid) return self.client.post(path, params, **options) + def add_dependents_for_task(self, task_gid, params=None, **options): """Set dependents for a task :param str task_gid: (required) The task to operate on. :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 = "/tasks/{task_gid}/addDependents".replace("{task_gid}", task_gid) return self.client.post(path, params, **options) + def add_followers_for_task(self, task_gid, params=None, **options): """Add followers to a task :param str task_gid: (required) The task to operate on. :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 = "/tasks/{task_gid}/addFollowers".replace("{task_gid}", task_gid) return self.client.post(path, params, **options) + def add_project_for_task(self, task_gid, params=None, **options): """Add a project to a task :param str task_gid: (required) The task to operate on. :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 = "/tasks/{task_gid}/addProject".replace("{task_gid}", task_gid) return self.client.post(path, params, **options) + def add_tag_for_task(self, task_gid, params=None, **options): """Add a tag to a task :param str task_gid: (required) The task to operate on. :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 = "/tasks/{task_gid}/addTag".replace("{task_gid}", task_gid) return self.client.post(path, params, **options) + def create_subtask_for_task(self, task_gid, params=None, **options): """Create a subtask :param str task_gid: (required) The task to operate on. :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 = "/tasks/{task_gid}/subtasks".replace("{task_gid}", task_gid) return self.client.post(path, params, **options) + def create_task(self, params=None, **options): """Create a task :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 = "/tasks" return self.client.post(path, params, **options) + def delete_task(self, task_gid, params=None, **options): """Delete a task :param str task_gid: (required) The task to operate on. :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 = "/tasks/{task_gid}".replace("{task_gid}", task_gid) return self.client.delete(path, params, **options) + def duplicate_task(self, task_gid, params=None, **options): """Duplicate a task :param str task_gid: (required) The task to operate on. :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 = "/tasks/{task_gid}/duplicate".replace("{task_gid}", task_gid) return self.client.post(path, params, **options) + def get_dependencies_for_task(self, task_gid, params=None, **options): """Get dependencies from a task :param str task_gid: (required) The task to operate on. :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 = "/tasks/{task_gid}/dependencies".replace("{task_gid}", task_gid) - return self.client.get_collection(path, params, **options) + return self.client.get(path, params, **options) + def get_dependents_for_task(self, task_gid, params=None, **options): """Get dependents from a task :param str task_gid: (required) The task to operate on. :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 = "/tasks/{task_gid}/dependents".replace("{task_gid}", task_gid) - return self.client.get_collection(path, params, **options) + return self.client.get(path, params, **options) + def get_subtasks_for_task(self, task_gid, params=None, **options): """Get subtasks from a task :param str task_gid: (required) The task to operate on. :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 = "/tasks/{task_gid}/subtasks".replace("{task_gid}", task_gid) - return self.client.get_collection(path, params, **options) + return self.client.get(path, params, **options) + def get_task(self, task_gid, params=None, **options): """Get a task :param str task_gid: (required) The task to operate on. :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 = "/tasks/{task_gid}".replace("{task_gid}", task_gid) return self.client.get(path, params, **options) + def get_tasks(self, params=None, **options): """Get multiple tasks :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.' - assignee {str}: The assignee to filter tasks on. If searching for unassigned tasks, assignee.any = null can be specified. *Note: If you specify `assignee`, you must also specify the `workspace` to filter on.* - project {str}: The project to filter tasks on. - section {str}: The section to filter tasks on. *Note: Currently, this is only supported in board views.* @@ -201,157 +230,175 @@ def get_tasks(self, params=None, **options): - completed_since {datetime}: Only return tasks that are either incomplete or that have been completed since this time. - modified_since {datetime}: Only return tasks that have been modified since the given time. *Note: A task is considered “modified” if any of its properties change, or associations between it and other objects are modified (e.g. a task being added to a project). A task is not considered modified just because another object it is associated with (e.g. a subtask) is modified. Actions that count as modifying the task include assigning, renaming, completing, and adding stories.* :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 = "/tasks" return self.client.get_collection(path, params, **options) + def get_tasks_for_project(self, project_gid, params=None, **options): """Get tasks from a project :param str project_gid: (required) Globally unique identifier for the project. :param Object params: Parameters for the request - completed_since {str}: Only return tasks that are either incomplete or that have been completed since this time. Accepts a date-time string or the keyword *now*. - :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}/tasks".replace("{project_gid}", project_gid) - return self.client.get_collection(path, params, **options) + return self.client.get(path, params, **options) + def get_tasks_for_section(self, section_gid, params=None, **options): """Get tasks from a section :param str section_gid: (required) The globally unique identifier for the section. :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 = "/sections/{section_gid}/tasks".replace("{section_gid}", section_gid) - return self.client.get_collection(path, params, **options) + return self.client.get(path, params, **options) + def get_tasks_for_tag(self, tag_gid, params=None, **options): """Get tasks from a tag :param str tag_gid: (required) Globally unique identifier for the tag. :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 = "/tags/{tag_gid}/tasks".replace("{tag_gid}", tag_gid) - return self.client.get_collection(path, params, **options) + return self.client.get(path, params, **options) + def get_tasks_for_user_task_list(self, user_task_list_gid, params=None, **options): """Get tasks from a user task list :param str user_task_list_gid: (required) Globally unique identifier for the user task list. :param Object params: Parameters for the request - completed_since {str}: Only return tasks that are either incomplete or that have been completed since this time. Accepts a date-time string or the keyword *now*. - :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 = "/user_task_lists/{user_task_list_gid}/tasks".replace("{user_task_list_gid}", user_task_list_gid) - return self.client.get_collection(path, params, **options) + return self.client.get(path, params, **options) + def remove_dependencies_for_task(self, task_gid, params=None, **options): """Unlink dependencies from a task :param str task_gid: (required) The task to operate on. :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 = "/tasks/{task_gid}/removeDependencies".replace("{task_gid}", task_gid) return self.client.post(path, params, **options) + def remove_dependents_for_task(self, task_gid, params=None, **options): """Unlink dependents from a task :param str task_gid: (required) The task to operate on. :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 = "/tasks/{task_gid}/removeDependents".replace("{task_gid}", task_gid) return self.client.post(path, params, **options) + def remove_follower_for_task(self, task_gid, params=None, **options): """Remove followers from a task :param str task_gid: (required) The task to operate on. :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 = "/tasks/{task_gid}/removeFollowers".replace("{task_gid}", task_gid) return self.client.post(path, params, **options) + def remove_project_for_task(self, task_gid, params=None, **options): """Remove a project from a task :param str task_gid: (required) The task to operate on. :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 = "/tasks/{task_gid}/removeProject".replace("{task_gid}", task_gid) return self.client.post(path, params, **options) + def remove_tag_for_task(self, task_gid, params=None, **options): """Remove a tag from a task :param str task_gid: (required) The task to operate on. :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 = "/tasks/{task_gid}/removeTag".replace("{task_gid}", task_gid) return self.client.post(path, params, **options) + def search_tasks_for_workspace(self, workspace_gid, params=None, **options): """Search tasks in a workspace :param str workspace_gid: (required) Globally unique identifier for the workspace or organization. :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. - text {str}: Performs full-text search on both task name and description - resource_subtype {str}: Filters results by the task's resource_subtype - assignee_any {str}: Comma-separated list of user identifiers @@ -376,25 +423,25 @@ def search_tasks_for_workspace(self, workspace_gid, params=None, **options): - commented_on_by_not {str}: Comma-separated list of user identifiers - due_on_before {date}: ISO 8601 date string - due_on_after {date}: ISO 8601 date string - - due_on {date}: ISO 8601 date string or `null` + - due_on {date, none_type}: ISO 8601 date string or `null` - due_at_before {datetime}: ISO 8601 datetime string - due_at_after {datetime}: ISO 8601 datetime string - start_on_before {date}: ISO 8601 date string - start_on_after {date}: ISO 8601 date string - - start_on {date}: ISO 8601 date string or `null` + - start_on {date, none_type}: ISO 8601 date string or `null` - created_on_before {date}: ISO 8601 date string - created_on_after {date}: ISO 8601 date string - - created_on {date}: ISO 8601 date string or `null` + - created_on {date, none_type}: ISO 8601 date string or `null` - created_at_before {datetime}: ISO 8601 datetime string - created_at_after {datetime}: ISO 8601 datetime string - completed_on_before {date}: ISO 8601 date string - completed_on_after {date}: ISO 8601 date string - - completed_on {date}: ISO 8601 date string or `null` + - completed_on {date, none_type}: ISO 8601 date string or `null` - completed_at_before {datetime}: ISO 8601 datetime string - completed_at_after {datetime}: ISO 8601 datetime string - modified_on_before {date}: ISO 8601 date string - modified_on_after {date}: ISO 8601 date string - - modified_on {date}: ISO 8601 date string or `null` + - modified_on {date, none_type}: ISO 8601 date string or `null` - modified_at_before {datetime}: ISO 8601 datetime string - modified_at_after {datetime}: ISO 8601 datetime string - is_blocking {bool}: Filter to incomplete tasks with dependents @@ -405,39 +452,45 @@ def search_tasks_for_workspace(self, workspace_gid, params=None, **options): - sort_by {str}: One of `due_date`, `created_at`, `completed_at`, `likes`, or `modified_at`, defaults to `modified_at` - sort_ascending {bool}: Default `false` :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 = "/workspaces/{workspace_gid}/tasks/search".replace("{workspace_gid}", workspace_gid) - return self.client.get_collection(path, params, **options) + return self.client.get(path, params, **options) + def set_parent_for_task(self, task_gid, params=None, **options): """Set the parent of a task :param str task_gid: (required) The task to operate on. :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 = "/tasks/{task_gid}/setParent".replace("{task_gid}", task_gid) return self.client.post(path, params, **options) + def update_task(self, task_gid, params=None, **options): """Update a task :param str task_gid: (required) The task to operate on. :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 = "/tasks/{task_gid}".replace("{task_gid}", task_gid) return self.client.put(path, params, **options) + + diff --git a/asana/resources/gen/team_memberships.py b/asana/resources/gen/team_memberships.py index ef3ba93c..a7ef8978 100644 --- a/asana/resources/gen/team_memberships.py +++ b/asana/resources/gen/team_memberships.py @@ -1,5 +1,5 @@ # coding=utf-8 -class _TeamMemberships: +class TeamMemberships: def __init__(self, client=None): self.client = client @@ -8,63 +8,72 @@ def get_team_membership(self, team_membership_gid, params=None, **options): """Get a team membership :param str team_membership_gid: (required) :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 = "/team_memberships/{team_membership_gid}".replace("{team_membership_gid}", team_membership_gid) return self.client.get(path, params, **options) + def get_team_memberships(self, params=None, **options): """Get team memberships :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.' - team {str}: Globally unique identifier for the team. - user {str}: A string identifying a user. This can either be the string \"me\", an email, or the gid of a user. This parameter must be used with the workspace parameter. - workspace {str}: Globally unique identifier for the workspace. This parameter must be used with the user parameter. :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 = "/team_memberships" return self.client.get_collection(path, params, **options) + def get_team_memberships_for_team(self, team_gid, params=None, **options): """Get memberships from a team :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.' + - 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 = "/teams/{team_gid}/team_memberships".replace("{team_gid}", team_gid) - return self.client.get_collection(path, params, **options) + return self.client.get(path, params, **options) + def get_team_memberships_for_user(self, user_gid, params=None, **options): """Get memberships from a user :param str user_gid: (required) A string identifying a user. This can either be the string \"me\", an email, or the gid of a user. :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.' - workspace {str}: (required) 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 = "/users/{user_gid}/team_memberships".replace("{user_gid}", user_gid) - return self.client.get_collection(path, params, **options) + return self.client.get(path, params, **options) + + diff --git a/asana/resources/gen/teams.py b/asana/resources/gen/teams.py index 459f0b34..4afa5c6f 100644 --- a/asana/resources/gen/teams.py +++ b/asana/resources/gen/teams.py @@ -1,5 +1,5 @@ # coding=utf-8 -class _Teams: +class Teams: def __init__(self, client=None): self.client = client @@ -8,105 +8,120 @@ def add_user_for_team(self, team_gid, params=None, **options): """Add a user to a team :param str team_gid: (required) Globally unique identifier for the team. :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 = "/teams/{team_gid}/addUser".replace("{team_gid}", team_gid) return self.client.post(path, params, **options) + def create_team(self, params=None, **options): """Create a 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.' + - 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 = "/teams" return self.client.post(path, params, **options) + def get_team(self, team_gid, params=None, **options): """Get a team :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.' + - 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 = "/teams/{team_gid}".replace("{team_gid}", team_gid) return self.client.get(path, params, **options) + def get_teams_for_user(self, user_gid, params=None, **options): """Get teams for a user :param str user_gid: (required) A string identifying a user. This can either be the string \"me\", an email, or the gid of a user. :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.' - organization {str}: (required) The workspace or organization to filter teams 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 = "/users/{user_gid}/teams".replace("{user_gid}", user_gid) - return self.client.get_collection(path, params, **options) + return self.client.get(path, params, **options) + def get_teams_for_workspace(self, workspace_gid, params=None, **options): """Get teams in a workspace :param str workspace_gid: (required) Globally unique identifier for the workspace or organization. :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 = "/workspaces/{workspace_gid}/teams".replace("{workspace_gid}", workspace_gid) - return self.client.get_collection(path, params, **options) + return self.client.get(path, params, **options) + def remove_user_for_team(self, team_gid, params=None, **options): """Remove a user from a team :param str team_gid: (required) Globally unique identifier for the team. :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 = "/teams/{team_gid}/removeUser".replace("{team_gid}", team_gid) return self.client.post(path, params, **options) + def update_team(self, params=None, **options): """Update a 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.' + - 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 = "/teams" return self.client.put(path, params, **options) + + diff --git a/asana/resources/gen/time_periods.py b/asana/resources/gen/time_periods.py index a1471b9f..349b986a 100644 --- a/asana/resources/gen/time_periods.py +++ b/asana/resources/gen/time_periods.py @@ -1,5 +1,5 @@ # coding=utf-8 -class _TimePeriods: +class TimePeriods: def __init__(self, client=None): self.client = client @@ -8,30 +8,35 @@ def get_time_period(self, time_period_gid, params=None, **options): """Get a time period :param str time_period_gid: (required) Globally unique identifier for the time period. :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 = "/time_periods/{time_period_gid}".replace("{time_period_gid}", time_period_gid) return self.client.get(path, params, **options) + def get_time_periods(self, params=None, **options): """Get time periods :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.' - start_on {date}: ISO 8601 date string - end_on {date}: ISO 8601 date string - workspace {str}: (required) 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 = "/time_periods" return self.client.get_collection(path, params, **options) + + diff --git a/asana/resources/gen/typeahead.py b/asana/resources/gen/typeahead.py index c23110cf..23274d24 100644 --- a/asana/resources/gen/typeahead.py +++ b/asana/resources/gen/typeahead.py @@ -1,5 +1,5 @@ # coding=utf-8 -class _Typeahead: +class Typeahead: def __init__(self, client=None): self.client = client @@ -12,12 +12,15 @@ def typeahead_for_workspace(self, workspace_gid, params=None, **options): - 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 return results. - 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. + - 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 = "/workspaces/{workspace_gid}/typeahead".replace("{workspace_gid}", workspace_gid) - return self.client.get_collection(path, params, **options) + return self.client.get(path, params, **options) + + diff --git a/asana/resources/gen/user_task_lists.py b/asana/resources/gen/user_task_lists.py index b59a9d56..f5448a3c 100644 --- a/asana/resources/gen/user_task_lists.py +++ b/asana/resources/gen/user_task_lists.py @@ -1,5 +1,5 @@ # coding=utf-8 -class _UserTaskLists: +class UserTaskLists: def __init__(self, client=None): self.client = client @@ -8,27 +8,32 @@ def get_user_task_list(self, user_task_list_gid, params=None, **options): """Get a user task list :param str user_task_list_gid: (required) Globally unique identifier for the user task list. :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 = "/user_task_lists/{user_task_list_gid}".replace("{user_task_list_gid}", user_task_list_gid) return self.client.get(path, params, **options) + def get_user_task_list_for_user(self, user_gid, params=None, **options): """Get a user's task list :param str user_gid: (required) A string identifying a user. This can either be the string \"me\", an email, or the gid of a user. :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. - workspace {str}: (required) The workspace in which to get the user task list. :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 = "/users/{user_gid}/user_task_list".replace("{user_gid}", user_gid) return self.client.get(path, params, **options) + + diff --git a/asana/resources/gen/users.py b/asana/resources/gen/users.py index 55538f6e..6464820b 100644 --- a/asana/resources/gen/users.py +++ b/asana/resources/gen/users.py @@ -1,5 +1,5 @@ # coding=utf-8 -class _Users: +class Users: def __init__(self, client=None): self.client = client @@ -8,75 +8,86 @@ def get_favorites_for_user(self, user_gid, params=None, **options): """Get a user's favorites :param str user_gid: (required) A string identifying a user. This can either be the string \"me\", an email, or the gid of a user. :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. - resource_type {str}: (required) The resource type of favorites to be returned. - workspace {str}: (required) The workspace in which to get favorites. :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 = "/users/{user_gid}/favorites".replace("{user_gid}", user_gid) - return self.client.get_collection(path, params, **options) + return self.client.get(path, params, **options) + def get_user(self, user_gid, params=None, **options): """Get a user :param str user_gid: (required) A string identifying a user. This can either be the string \"me\", an email, or the gid of a user. :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 = "/users/{user_gid}".replace("{user_gid}", user_gid) return self.client.get(path, params, **options) + def get_users(self, params=None, **options): """Get multiple users :param Object params: Parameters for the request - workspace {str}: The workspace or organization ID to filter users on. - team {str}: The team ID to filter users 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.' + - 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 = "/users" return self.client.get_collection(path, params, **options) + def get_users_for_team(self, team_gid, params=None, **options): """Get users in a team :param str team_gid: (required) Globally unique identifier for the team. :param Object params: Parameters for the request - :param **options + - 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. - 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 {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. + :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 = "/teams/{team_gid}/users".replace("{team_gid}", team_gid) - return self.client.get_collection(path, params, **options) + return self.client.get(path, params, **options) + def get_users_for_workspace(self, workspace_gid, params=None, **options): """Get users in a workspace or organization :param str workspace_gid: (required) Globally unique identifier for the workspace or organization. :param Object params: Parameters for the request - :param **options + - 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. - 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 {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. + :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 = "/workspaces/{workspace_gid}/users".replace("{workspace_gid}", workspace_gid) - return self.client.get_collection(path, params, **options) + return self.client.get(path, params, **options) + + diff --git a/asana/resources/gen/webhooks.py b/asana/resources/gen/webhooks.py index 29a59840..3f2c3137 100644 --- a/asana/resources/gen/webhooks.py +++ b/asana/resources/gen/webhooks.py @@ -1,5 +1,5 @@ # coding=utf-8 -class _Webhooks: +class Webhooks: def __init__(self, client=None): self.client = client @@ -7,71 +7,82 @@ def __init__(self, client=None): def create_webhook(self, params=None, **options): """Establish a webhook :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 = "/webhooks" return self.client.post(path, params, **options) + def delete_webhook(self, webhook_gid, params=None, **options): """Delete a webhook :param str webhook_gid: (required) Globally unique identifier for the webhook. :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 = "/webhooks/{webhook_gid}".replace("{webhook_gid}", webhook_gid) return self.client.delete(path, params, **options) + def get_webhook(self, webhook_gid, params=None, **options): """Get a webhook :param str webhook_gid: (required) Globally unique identifier for the webhook. :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 = "/webhooks/{webhook_gid}".replace("{webhook_gid}", webhook_gid) return self.client.get(path, params, **options) + def get_webhooks(self, params=None, **options): """Get multiple webhooks :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.' - workspace {str}: (required) The workspace to query for webhooks in. - resource {str}: Only return webhooks for the given resource. :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 = "/webhooks" return self.client.get_collection(path, params, **options) + def update_webhook(self, webhook_gid, params=None, **options): """Update a webhook :param str webhook_gid: (required) Globally unique identifier for the webhook. :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 = "/webhooks/{webhook_gid}".replace("{webhook_gid}", webhook_gid) return self.client.put(path, params, **options) + + diff --git a/asana/resources/gen/workspace_memberships.py b/asana/resources/gen/workspace_memberships.py index ec84ddb7..f5c95b75 100644 --- a/asana/resources/gen/workspace_memberships.py +++ b/asana/resources/gen/workspace_memberships.py @@ -1,5 +1,5 @@ # coding=utf-8 -class _WorkspaceMemberships: +class WorkspaceMemberships: def __init__(self, client=None): self.client = client @@ -8,45 +8,52 @@ def get_workspace_membership(self, workspace_membership_gid, params=None, **opti """Get a workspace membership :param str workspace_membership_gid: (required) :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 = "/workspace_memberships/{workspace_membership_gid}".replace("{workspace_membership_gid}", workspace_membership_gid) return self.client.get(path, params, **options) + def get_workspace_memberships_for_user(self, user_gid, params=None, **options): """Get workspace memberships for a user :param str user_gid: (required) A string identifying a user. This can either be the string \"me\", an email, or the gid of a user. :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 = "/users/{user_gid}/workspace_memberships".replace("{user_gid}", user_gid) - return self.client.get_collection(path, params, **options) + return self.client.get(path, params, **options) + def get_workspace_memberships_for_workspace(self, workspace_gid, params=None, **options): """Get the workspace memberships for a workspace :param str workspace_gid: (required) Globally unique identifier for the workspace or organization. :param Object params: Parameters for the request - user {str}: A string identifying a user. This can either be the string \"me\", an email, or the gid of a user. - :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 = "/workspaces/{workspace_gid}/workspace_memberships".replace("{workspace_gid}", workspace_gid) - return self.client.get_collection(path, params, **options) + return self.client.get(path, params, **options) + + diff --git a/asana/resources/gen/workspaces.py b/asana/resources/gen/workspaces.py index 0250dffd..f0a0c195 100644 --- a/asana/resources/gen/workspaces.py +++ b/asana/resources/gen/workspaces.py @@ -1,5 +1,5 @@ # coding=utf-8 -class _Workspaces: +class Workspaces: def __init__(self, client=None): self.client = client @@ -8,69 +8,80 @@ def add_user_for_workspace(self, workspace_gid, params=None, **options): """Add a user to a workspace or organization :param str workspace_gid: (required) Globally unique identifier for the workspace or organization. :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 = "/workspaces/{workspace_gid}/addUser".replace("{workspace_gid}", workspace_gid) return self.client.post(path, params, **options) + def get_workspace(self, workspace_gid, params=None, **options): """Get a workspace :param str workspace_gid: (required) Globally unique identifier for the workspace or organization. :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 = "/workspaces/{workspace_gid}".replace("{workspace_gid}", workspace_gid) return self.client.get(path, params, **options) + def get_workspaces(self, params=None, **options): """Get multiple workspaces :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 = "/workspaces" return self.client.get_collection(path, params, **options) + def remove_user_for_workspace(self, workspace_gid, params=None, **options): """Remove a user from a workspace or organization :param str workspace_gid: (required) Globally unique identifier for the workspace or organization. :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 = "/workspaces/{workspace_gid}/removeUser".replace("{workspace_gid}", workspace_gid) return self.client.post(path, params, **options) + def update_workspace(self, workspace_gid, params=None, **options): """Update a workspace :param str workspace_gid: (required) Globally unique identifier for the workspace or organization. :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 = "/workspaces/{workspace_gid}".replace("{workspace_gid}", workspace_gid) return self.client.put(path, params, **options) + + diff --git a/samples/attachments_sample.yaml b/samples/attachments_sample.yaml index 06d430e2..3abe65e0 100644 --- a/samples/attachments_sample.yaml +++ b/samples/attachments_sample.yaml @@ -1,11 +1,10 @@ -attachments: +: create_attachment_for_object: >- import asana client = asana.Client.access_token('PERSONAL_ACCESS_TOKEN') - result = client.attachments.create_attachment_for_object({'field': 'value', 'field': 'value'}, opt_pretty=True) delete_attachment: >- import asana @@ -13,7 +12,6 @@ attachments: client = asana.Client.access_token('PERSONAL_ACCESS_TOKEN') - result = client.attachments.delete_attachment(attachment_gid, opt_pretty=True) get_attachment: >- import asana @@ -21,7 +19,6 @@ attachments: client = asana.Client.access_token('PERSONAL_ACCESS_TOKEN') - result = client.attachments.get_attachment(attachment_gid, {'param': 'value', 'param': 'value'}, opt_pretty=True) get_attachments_for_object: >- import asana @@ -29,5 +26,4 @@ attachments: client = asana.Client.access_token('PERSONAL_ACCESS_TOKEN') - result = client.attachments.get_attachments_for_object({'param': 'value', 'param': 'value'}, opt_pretty=True) diff --git a/samples/audit_log_api_sample.yaml b/samples/audit_log_api_sample.yaml index 8dbcccf5..4e2b827f 100644 --- a/samples/audit_log_api_sample.yaml +++ b/samples/audit_log_api_sample.yaml @@ -1,9 +1,8 @@ -auditlogapi: +: get_audit_log_events: >- import asana client = asana.Client.access_token('PERSONAL_ACCESS_TOKEN') - - result = client.audit_log_api.get_audit_log_events(workspace_gid, {'param': 'value', 'param': 'value'}, opt_pretty=True) + result = client.audit log api.get_audit_log_events(workspace_gid, {'param': 'value', 'param': 'value'}, opt_pretty=True) diff --git a/samples/batch_api_sample.yaml b/samples/batch_api_sample.yaml index a4a1b1b3..7c8296ee 100644 --- a/samples/batch_api_sample.yaml +++ b/samples/batch_api_sample.yaml @@ -1,9 +1,8 @@ -batchapi: +: create_batch_request: >- import asana client = asana.Client.access_token('PERSONAL_ACCESS_TOKEN') - - result = client.batch_api.create_batch_request({'field': 'value', 'field': 'value'}, opt_pretty=True) + result = client.batch api.create_batch_request({'field': 'value', 'field': 'value'}, opt_pretty=True) diff --git a/samples/custom_field_settings_sample.yaml b/samples/custom_field_settings_sample.yaml index ded3bf82..dedc8f07 100644 --- a/samples/custom_field_settings_sample.yaml +++ b/samples/custom_field_settings_sample.yaml @@ -1,17 +1,15 @@ -customfieldsettings: +: get_custom_field_settings_for_portfolio: >- import asana client = asana.Client.access_token('PERSONAL_ACCESS_TOKEN') - - result = client.custom_field_settings.get_custom_field_settings_for_portfolio(portfolio_gid, {'param': 'value', 'param': 'value'}, opt_pretty=True) + result = client.custom field settings.get_custom_field_settings_for_portfolio(portfolio_gid, {'param': 'value', 'param': 'value'}, opt_pretty=True) get_custom_field_settings_for_project: >- import asana client = asana.Client.access_token('PERSONAL_ACCESS_TOKEN') - - result = client.custom_field_settings.get_custom_field_settings_for_project(project_gid, {'param': 'value', 'param': 'value'}, opt_pretty=True) + result = client.custom field settings.get_custom_field_settings_for_project(project_gid, {'param': 'value', 'param': 'value'}, opt_pretty=True) diff --git a/samples/custom_fields_sample.yaml b/samples/custom_fields_sample.yaml index e3b48a1b..e8eb1883 100644 --- a/samples/custom_fields_sample.yaml +++ b/samples/custom_fields_sample.yaml @@ -1,65 +1,57 @@ -customfields: +: create_custom_field: >- import asana client = asana.Client.access_token('PERSONAL_ACCESS_TOKEN') - - result = client.custom_fields.create_custom_field({'field': 'value', 'field': 'value'}, opt_pretty=True) + result = client.custom fields.create_custom_field({'field': 'value', 'field': 'value'}, opt_pretty=True) create_enum_option_for_custom_field: >- import asana client = asana.Client.access_token('PERSONAL_ACCESS_TOKEN') - - result = client.custom_fields.create_enum_option_for_custom_field(custom_field_gid, {'field': 'value', 'field': 'value'}, opt_pretty=True) + result = client.custom fields.create_enum_option_for_custom_field(custom_field_gid, {'field': 'value', 'field': 'value'}, opt_pretty=True) delete_custom_field: >- import asana client = asana.Client.access_token('PERSONAL_ACCESS_TOKEN') - - result = client.custom_fields.delete_custom_field(custom_field_gid, opt_pretty=True) + result = client.custom fields.delete_custom_field(custom_field_gid, opt_pretty=True) get_custom_field: >- import asana client = asana.Client.access_token('PERSONAL_ACCESS_TOKEN') - - result = client.custom_fields.get_custom_field(custom_field_gid, {'param': 'value', 'param': 'value'}, opt_pretty=True) + result = client.custom fields.get_custom_field(custom_field_gid, {'param': 'value', 'param': 'value'}, opt_pretty=True) get_custom_fields_for_workspace: >- import asana client = asana.Client.access_token('PERSONAL_ACCESS_TOKEN') - - result = client.custom_fields.get_custom_fields_for_workspace(workspace_gid, {'param': 'value', 'param': 'value'}, opt_pretty=True) + result = client.custom fields.get_custom_fields_for_workspace(workspace_gid, {'param': 'value', 'param': 'value'}, opt_pretty=True) insert_enum_option_for_custom_field: >- import asana client = asana.Client.access_token('PERSONAL_ACCESS_TOKEN') - - result = client.custom_fields.insert_enum_option_for_custom_field(custom_field_gid, {'field': 'value', 'field': 'value'}, opt_pretty=True) + result = client.custom fields.insert_enum_option_for_custom_field(custom_field_gid, {'field': 'value', 'field': 'value'}, opt_pretty=True) update_custom_field: >- import asana client = asana.Client.access_token('PERSONAL_ACCESS_TOKEN') - - result = client.custom_fields.update_custom_field(custom_field_gid, {'field': 'value', 'field': 'value'}, opt_pretty=True) + result = client.custom fields.update_custom_field(custom_field_gid, {'field': 'value', 'field': 'value'}, opt_pretty=True) update_enum_option: >- import asana client = asana.Client.access_token('PERSONAL_ACCESS_TOKEN') - - result = client.custom_fields.update_enum_option(enum_option_gid, {'field': 'value', 'field': 'value'}, opt_pretty=True) + result = client.custom fields.update_enum_option(enum_option_gid, {'field': 'value', 'field': 'value'}, opt_pretty=True) diff --git a/samples/events_sample.yaml b/samples/events_sample.yaml index 951bede8..3679046a 100644 --- a/samples/events_sample.yaml +++ b/samples/events_sample.yaml @@ -1,9 +1,8 @@ -events: +: get_events: >- import asana client = asana.Client.access_token('PERSONAL_ACCESS_TOKEN') - result = client.events.get_events({'param': 'value', 'param': 'value'}, opt_pretty=True) diff --git a/samples/goal_relationships_sample.yaml b/samples/goal_relationships_sample.yaml index 74384947..410daf98 100644 --- a/samples/goal_relationships_sample.yaml +++ b/samples/goal_relationships_sample.yaml @@ -1,41 +1,36 @@ -goalrelationships: +: add_supporting_relationship: >- import asana client = asana.Client.access_token('PERSONAL_ACCESS_TOKEN') - - result = client.goal_relationships.add_supporting_relationship(goal_gid, {'field': 'value', 'field': 'value'}, opt_pretty=True) + result = client.goal relationships.add_supporting_relationship(goal_gid, {'field': 'value', 'field': 'value'}, opt_pretty=True) get_goal_relationship: >- import asana client = asana.Client.access_token('PERSONAL_ACCESS_TOKEN') - - result = client.goal_relationships.get_goal_relationship(goal_relationship_gid, {'param': 'value', 'param': 'value'}, opt_pretty=True) + result = client.goal relationships.get_goal_relationship(goal_relationship_gid, {'param': 'value', 'param': 'value'}, opt_pretty=True) get_goal_relationships: >- import asana client = asana.Client.access_token('PERSONAL_ACCESS_TOKEN') - - result = client.goal_relationships.get_goal_relationships({'param': 'value', 'param': 'value'}, opt_pretty=True) + result = client.goal relationships.get_goal_relationships({'param': 'value', 'param': 'value'}, opt_pretty=True) remove_supporting_relationship: >- import asana client = asana.Client.access_token('PERSONAL_ACCESS_TOKEN') - - result = client.goal_relationships.remove_supporting_relationship(goal_gid, {'field': 'value', 'field': 'value'}, opt_pretty=True) + result = client.goal relationships.remove_supporting_relationship(goal_gid, {'field': 'value', 'field': 'value'}, opt_pretty=True) update_goal_relationship: >- import asana client = asana.Client.access_token('PERSONAL_ACCESS_TOKEN') - - result = client.goal_relationships.update_goal_relationship(goal_relationship_gid, {'field': 'value', 'field': 'value'}, opt_pretty=True) + result = client.goal relationships.update_goal_relationship(goal_relationship_gid, {'field': 'value', 'field': 'value'}, opt_pretty=True) diff --git a/samples/goals_sample.yaml b/samples/goals_sample.yaml index 100819cc..069eed65 100644 --- a/samples/goals_sample.yaml +++ b/samples/goals_sample.yaml @@ -1,11 +1,10 @@ -goals: +: add_followers: >- import asana client = asana.Client.access_token('PERSONAL_ACCESS_TOKEN') - result = client.goals.add_followers(goal_gid, {'field': 'value', 'field': 'value'}, opt_pretty=True) create_goal: >- import asana @@ -13,7 +12,6 @@ goals: client = asana.Client.access_token('PERSONAL_ACCESS_TOKEN') - result = client.goals.create_goal({'field': 'value', 'field': 'value'}, opt_pretty=True) create_goal_metric: >- import asana @@ -21,7 +19,6 @@ goals: client = asana.Client.access_token('PERSONAL_ACCESS_TOKEN') - result = client.goals.create_goal_metric(goal_gid, {'field': 'value', 'field': 'value'}, opt_pretty=True) delete_goal: >- import asana @@ -29,7 +26,6 @@ goals: client = asana.Client.access_token('PERSONAL_ACCESS_TOKEN') - result = client.goals.delete_goal(goal_gid, opt_pretty=True) get_goal: >- import asana @@ -37,7 +33,6 @@ goals: 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 @@ -45,7 +40,6 @@ goals: 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 @@ -53,7 +47,6 @@ goals: client = asana.Client.access_token('PERSONAL_ACCESS_TOKEN') - result = client.goals.get_parent_goals_for_goal(goal_gid, {'param': 'value', 'param': 'value'}, opt_pretty=True) remove_followers: >- import asana @@ -61,7 +54,6 @@ goals: client = asana.Client.access_token('PERSONAL_ACCESS_TOKEN') - result = client.goals.remove_followers(goal_gid, {'field': 'value', 'field': 'value'}, opt_pretty=True) update_goal: >- import asana @@ -69,7 +61,6 @@ goals: 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 @@ -77,5 +68,4 @@ goals: client = asana.Client.access_token('PERSONAL_ACCESS_TOKEN') - result = client.goals.update_goal_metric(goal_gid, {'field': 'value', 'field': 'value'}, opt_pretty=True) diff --git a/samples/jobs_sample.yaml b/samples/jobs_sample.yaml index 1d97b5ea..b6753a08 100644 --- a/samples/jobs_sample.yaml +++ b/samples/jobs_sample.yaml @@ -1,9 +1,8 @@ -jobs: +: get_job: >- import asana client = asana.Client.access_token('PERSONAL_ACCESS_TOKEN') - result = client.jobs.get_job(job_gid, {'param': 'value', 'param': 'value'}, opt_pretty=True) diff --git a/samples/organization_exports_sample.yaml b/samples/organization_exports_sample.yaml index 1e1414c6..54fc92f1 100644 --- a/samples/organization_exports_sample.yaml +++ b/samples/organization_exports_sample.yaml @@ -1,17 +1,15 @@ -organizationexports: +: create_organization_export: >- import asana client = asana.Client.access_token('PERSONAL_ACCESS_TOKEN') - - result = client.organization_exports.create_organization_export({'field': 'value', 'field': 'value'}, opt_pretty=True) + result = client.organization exports.create_organization_export({'field': 'value', 'field': 'value'}, opt_pretty=True) get_organization_export: >- import asana client = asana.Client.access_token('PERSONAL_ACCESS_TOKEN') - - result = client.organization_exports.get_organization_export(organization_export_gid, {'param': 'value', 'param': 'value'}, opt_pretty=True) + result = client.organization exports.get_organization_export(organization_export_gid, {'param': 'value', 'param': 'value'}, opt_pretty=True) diff --git a/samples/portfolio_memberships_sample.yaml b/samples/portfolio_memberships_sample.yaml index ca32a779..c3a8f289 100644 --- a/samples/portfolio_memberships_sample.yaml +++ b/samples/portfolio_memberships_sample.yaml @@ -1,25 +1,22 @@ -portfoliomemberships: +: get_portfolio_membership: >- import asana client = asana.Client.access_token('PERSONAL_ACCESS_TOKEN') - - result = client.portfolio_memberships.get_portfolio_membership(portfolio_membership_gid, {'param': 'value', 'param': 'value'}, opt_pretty=True) + result = client.portfolio memberships.get_portfolio_membership(portfolio_membership_gid, {'param': 'value', 'param': 'value'}, opt_pretty=True) get_portfolio_memberships: >- import asana client = asana.Client.access_token('PERSONAL_ACCESS_TOKEN') - - result = client.portfolio_memberships.get_portfolio_memberships({'param': 'value', 'param': 'value'}, opt_pretty=True) + result = client.portfolio memberships.get_portfolio_memberships({'param': 'value', 'param': 'value'}, opt_pretty=True) get_portfolio_memberships_for_portfolio: >- import asana client = asana.Client.access_token('PERSONAL_ACCESS_TOKEN') - - result = client.portfolio_memberships.get_portfolio_memberships_for_portfolio(portfolio_gid, {'param': 'value', 'param': 'value'}, opt_pretty=True) + result = client.portfolio memberships.get_portfolio_memberships_for_portfolio(portfolio_gid, {'param': 'value', 'param': 'value'}, opt_pretty=True) diff --git a/samples/portfolios_sample.yaml b/samples/portfolios_sample.yaml index 4bbc0f6a..6f0ad6d4 100644 --- a/samples/portfolios_sample.yaml +++ b/samples/portfolios_sample.yaml @@ -1,11 +1,10 @@ -portfolios: +: add_custom_field_setting_for_portfolio: >- import asana client = asana.Client.access_token('PERSONAL_ACCESS_TOKEN') - result = client.portfolios.add_custom_field_setting_for_portfolio(portfolio_gid, {'field': 'value', 'field': 'value'}, opt_pretty=True) add_item_for_portfolio: >- import asana @@ -13,7 +12,6 @@ portfolios: client = asana.Client.access_token('PERSONAL_ACCESS_TOKEN') - result = client.portfolios.add_item_for_portfolio(portfolio_gid, {'field': 'value', 'field': 'value'}, opt_pretty=True) add_members_for_portfolio: >- import asana @@ -21,7 +19,6 @@ portfolios: client = asana.Client.access_token('PERSONAL_ACCESS_TOKEN') - result = client.portfolios.add_members_for_portfolio(portfolio_gid, {'field': 'value', 'field': 'value'}, opt_pretty=True) create_portfolio: >- import asana @@ -29,7 +26,6 @@ portfolios: client = asana.Client.access_token('PERSONAL_ACCESS_TOKEN') - result = client.portfolios.create_portfolio({'field': 'value', 'field': 'value'}, opt_pretty=True) delete_portfolio: >- import asana @@ -37,7 +33,6 @@ portfolios: client = asana.Client.access_token('PERSONAL_ACCESS_TOKEN') - result = client.portfolios.delete_portfolio(portfolio_gid, opt_pretty=True) get_items_for_portfolio: >- import asana @@ -45,7 +40,6 @@ portfolios: client = asana.Client.access_token('PERSONAL_ACCESS_TOKEN') - result = client.portfolios.get_items_for_portfolio(portfolio_gid, {'param': 'value', 'param': 'value'}, opt_pretty=True) get_portfolio: >- import asana @@ -53,7 +47,6 @@ portfolios: client = asana.Client.access_token('PERSONAL_ACCESS_TOKEN') - result = client.portfolios.get_portfolio(portfolio_gid, {'param': 'value', 'param': 'value'}, opt_pretty=True) get_portfolios: >- import asana @@ -61,7 +54,6 @@ portfolios: client = asana.Client.access_token('PERSONAL_ACCESS_TOKEN') - result = client.portfolios.get_portfolios({'param': 'value', 'param': 'value'}, opt_pretty=True) remove_custom_field_setting_for_portfolio: >- import asana @@ -69,7 +61,6 @@ portfolios: client = asana.Client.access_token('PERSONAL_ACCESS_TOKEN') - result = client.portfolios.remove_custom_field_setting_for_portfolio(portfolio_gid, {'field': 'value', 'field': 'value'}, opt_pretty=True) remove_item_for_portfolio: >- import asana @@ -77,7 +68,6 @@ portfolios: client = asana.Client.access_token('PERSONAL_ACCESS_TOKEN') - result = client.portfolios.remove_item_for_portfolio(portfolio_gid, {'field': 'value', 'field': 'value'}, opt_pretty=True) remove_members_for_portfolio: >- import asana @@ -85,7 +75,6 @@ portfolios: client = asana.Client.access_token('PERSONAL_ACCESS_TOKEN') - result = client.portfolios.remove_members_for_portfolio(portfolio_gid, {'field': 'value', 'field': 'value'}, opt_pretty=True) update_portfolio: >- import asana @@ -93,5 +82,4 @@ portfolios: client = asana.Client.access_token('PERSONAL_ACCESS_TOKEN') - result = client.portfolios.update_portfolio(portfolio_gid, {'field': 'value', 'field': 'value'}, opt_pretty=True) diff --git a/samples/project_briefs_sample.yaml b/samples/project_briefs_sample.yaml index af64d5a7..0ce775c9 100644 --- a/samples/project_briefs_sample.yaml +++ b/samples/project_briefs_sample.yaml @@ -1,33 +1,29 @@ -projectbriefs: +: create_project_brief: >- import asana client = asana.Client.access_token('PERSONAL_ACCESS_TOKEN') - - result = client.project_briefs.create_project_brief(project_gid, {'field': 'value', 'field': 'value'}, opt_pretty=True) + result = client.project briefs.create_project_brief(project_gid, {'field': 'value', 'field': 'value'}, opt_pretty=True) delete_project_brief: >- import asana client = asana.Client.access_token('PERSONAL_ACCESS_TOKEN') - - result = client.project_briefs.delete_project_brief(project_brief_gid, opt_pretty=True) + result = client.project briefs.delete_project_brief(project_brief_gid, opt_pretty=True) get_project_brief: >- import asana client = asana.Client.access_token('PERSONAL_ACCESS_TOKEN') - - result = client.project_briefs.get_project_brief(project_brief_gid, {'param': 'value', 'param': 'value'}, opt_pretty=True) + result = client.project briefs.get_project_brief(project_brief_gid, {'param': 'value', 'param': 'value'}, opt_pretty=True) update_project_brief: >- import asana client = asana.Client.access_token('PERSONAL_ACCESS_TOKEN') - - result = client.project_briefs.update_project_brief(project_brief_gid, {'field': 'value', 'field': 'value'}, opt_pretty=True) + result = client.project briefs.update_project_brief(project_brief_gid, {'field': 'value', 'field': 'value'}, opt_pretty=True) diff --git a/samples/project_memberships_sample.yaml b/samples/project_memberships_sample.yaml index 32539a28..742ebfdc 100644 --- a/samples/project_memberships_sample.yaml +++ b/samples/project_memberships_sample.yaml @@ -1,17 +1,15 @@ -projectmemberships: +: get_project_membership: >- import asana client = asana.Client.access_token('PERSONAL_ACCESS_TOKEN') - - result = client.project_memberships.get_project_membership(project_membership_gid, {'param': 'value', 'param': 'value'}, opt_pretty=True) + result = client.project memberships.get_project_membership(project_membership_gid, {'param': 'value', 'param': 'value'}, opt_pretty=True) get_project_memberships_for_project: >- import asana client = asana.Client.access_token('PERSONAL_ACCESS_TOKEN') - - result = client.project_memberships.get_project_memberships_for_project(project_gid, {'param': 'value', 'param': 'value'}, opt_pretty=True) + result = client.project memberships.get_project_memberships_for_project(project_gid, {'param': 'value', 'param': 'value'}, opt_pretty=True) diff --git a/samples/project_statuses_sample.yaml b/samples/project_statuses_sample.yaml index 4b9703d6..8a32d6dd 100644 --- a/samples/project_statuses_sample.yaml +++ b/samples/project_statuses_sample.yaml @@ -1,33 +1,29 @@ -projectstatuses: +: create_project_status_for_project: >- import asana client = asana.Client.access_token('PERSONAL_ACCESS_TOKEN') - - result = client.project_statuses.create_project_status_for_project(project_gid, {'field': 'value', 'field': 'value'}, opt_pretty=True) + result = client.project statuses.create_project_status_for_project(project_gid, {'field': 'value', 'field': 'value'}, opt_pretty=True) delete_project_status: >- import asana client = asana.Client.access_token('PERSONAL_ACCESS_TOKEN') - - result = client.project_statuses.delete_project_status(project_status_gid, opt_pretty=True) + result = client.project statuses.delete_project_status(project_status_gid, opt_pretty=True) get_project_status: >- import asana client = asana.Client.access_token('PERSONAL_ACCESS_TOKEN') - - result = client.project_statuses.get_project_status(project_status_gid, {'param': 'value', 'param': 'value'}, opt_pretty=True) + result = client.project statuses.get_project_status(project_status_gid, {'param': 'value', 'param': 'value'}, opt_pretty=True) get_project_statuses_for_project: >- import asana client = asana.Client.access_token('PERSONAL_ACCESS_TOKEN') - - result = client.project_statuses.get_project_statuses_for_project(project_gid, {'param': 'value', 'param': 'value'}, opt_pretty=True) + result = client.project statuses.get_project_statuses_for_project(project_gid, {'param': 'value', 'param': 'value'}, opt_pretty=True) diff --git a/samples/project_templates_sample.yaml b/samples/project_templates_sample.yaml index ae4b37d5..51f30103 100644 --- a/samples/project_templates_sample.yaml +++ b/samples/project_templates_sample.yaml @@ -1,33 +1,29 @@ -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) + 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) + 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) + 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) + result = client.project templates.instantiate_project(project_template_gid, {'field': 'value', 'field': 'value'}, opt_pretty=True) diff --git a/samples/projects_sample.yaml b/samples/projects_sample.yaml index 30fd7d09..fc179ed8 100644 --- a/samples/projects_sample.yaml +++ b/samples/projects_sample.yaml @@ -1,11 +1,10 @@ -projects: +: add_custom_field_setting_for_project: >- import asana client = asana.Client.access_token('PERSONAL_ACCESS_TOKEN') - result = client.projects.add_custom_field_setting_for_project(project_gid, {'field': 'value', 'field': 'value'}, opt_pretty=True) add_followers_for_project: >- import asana @@ -13,7 +12,6 @@ projects: client = asana.Client.access_token('PERSONAL_ACCESS_TOKEN') - result = client.projects.add_followers_for_project(project_gid, {'field': 'value', 'field': 'value'}, opt_pretty=True) add_members_for_project: >- import asana @@ -21,7 +19,6 @@ projects: client = asana.Client.access_token('PERSONAL_ACCESS_TOKEN') - result = client.projects.add_members_for_project(project_gid, {'field': 'value', 'field': 'value'}, opt_pretty=True) create_project: >- import asana @@ -29,7 +26,6 @@ projects: client = asana.Client.access_token('PERSONAL_ACCESS_TOKEN') - result = client.projects.create_project({'field': 'value', 'field': 'value'}, opt_pretty=True) create_project_for_team: >- import asana @@ -37,7 +33,6 @@ projects: client = asana.Client.access_token('PERSONAL_ACCESS_TOKEN') - result = client.projects.create_project_for_team(team_gid, {'field': 'value', 'field': 'value'}, opt_pretty=True) create_project_for_workspace: >- import asana @@ -45,7 +40,6 @@ projects: client = asana.Client.access_token('PERSONAL_ACCESS_TOKEN') - result = client.projects.create_project_for_workspace(workspace_gid, {'field': 'value', 'field': 'value'}, opt_pretty=True) delete_project: >- import asana @@ -53,7 +47,6 @@ projects: client = asana.Client.access_token('PERSONAL_ACCESS_TOKEN') - result = client.projects.delete_project(project_gid, opt_pretty=True) duplicate_project: >- import asana @@ -61,7 +54,6 @@ projects: client = asana.Client.access_token('PERSONAL_ACCESS_TOKEN') - result = client.projects.duplicate_project(project_gid, {'field': 'value', 'field': 'value'}, opt_pretty=True) get_project: >- import asana @@ -69,7 +61,6 @@ projects: client = asana.Client.access_token('PERSONAL_ACCESS_TOKEN') - result = client.projects.get_project(project_gid, {'param': 'value', 'param': 'value'}, opt_pretty=True) get_projects: >- import asana @@ -77,7 +68,6 @@ projects: client = asana.Client.access_token('PERSONAL_ACCESS_TOKEN') - result = client.projects.get_projects({'param': 'value', 'param': 'value'}, opt_pretty=True) get_projects_for_task: >- import asana @@ -85,7 +75,6 @@ projects: client = asana.Client.access_token('PERSONAL_ACCESS_TOKEN') - result = client.projects.get_projects_for_task(task_gid, {'param': 'value', 'param': 'value'}, opt_pretty=True) get_projects_for_team: >- import asana @@ -93,7 +82,6 @@ projects: client = asana.Client.access_token('PERSONAL_ACCESS_TOKEN') - result = client.projects.get_projects_for_team(team_gid, {'param': 'value', 'param': 'value'}, opt_pretty=True) get_projects_for_workspace: >- import asana @@ -101,7 +89,6 @@ projects: client = asana.Client.access_token('PERSONAL_ACCESS_TOKEN') - result = client.projects.get_projects_for_workspace(workspace_gid, {'param': 'value', 'param': 'value'}, opt_pretty=True) get_task_counts_for_project: >- import asana @@ -109,7 +96,6 @@ projects: client = asana.Client.access_token('PERSONAL_ACCESS_TOKEN') - result = client.projects.get_task_counts_for_project(project_gid, {'param': 'value', 'param': 'value'}, opt_pretty=True) project_save_as_template: >- import asana @@ -117,7 +103,6 @@ projects: 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 @@ -125,7 +110,6 @@ projects: client = asana.Client.access_token('PERSONAL_ACCESS_TOKEN') - result = client.projects.remove_custom_field_setting_for_project(project_gid, {'field': 'value', 'field': 'value'}, opt_pretty=True) remove_followers_for_project: >- import asana @@ -133,7 +117,6 @@ projects: client = asana.Client.access_token('PERSONAL_ACCESS_TOKEN') - result = client.projects.remove_followers_for_project(project_gid, {'field': 'value', 'field': 'value'}, opt_pretty=True) remove_members_for_project: >- import asana @@ -141,7 +124,6 @@ projects: client = asana.Client.access_token('PERSONAL_ACCESS_TOKEN') - result = client.projects.remove_members_for_project(project_gid, {'field': 'value', 'field': 'value'}, opt_pretty=True) update_project: >- import asana @@ -149,5 +131,4 @@ projects: client = asana.Client.access_token('PERSONAL_ACCESS_TOKEN') - result = client.projects.update_project(project_gid, {'field': 'value', 'field': 'value'}, opt_pretty=True) diff --git a/samples/sections_sample.yaml b/samples/sections_sample.yaml index c6e7eeca..3cac361d 100644 --- a/samples/sections_sample.yaml +++ b/samples/sections_sample.yaml @@ -1,11 +1,10 @@ -sections: +: add_task_for_section: >- import asana client = asana.Client.access_token('PERSONAL_ACCESS_TOKEN') - result = client.sections.add_task_for_section(section_gid, {'field': 'value', 'field': 'value'}, opt_pretty=True) create_section_for_project: >- import asana @@ -13,7 +12,6 @@ sections: client = asana.Client.access_token('PERSONAL_ACCESS_TOKEN') - result = client.sections.create_section_for_project(project_gid, {'field': 'value', 'field': 'value'}, opt_pretty=True) delete_section: >- import asana @@ -21,7 +19,6 @@ sections: client = asana.Client.access_token('PERSONAL_ACCESS_TOKEN') - result = client.sections.delete_section(section_gid, opt_pretty=True) get_section: >- import asana @@ -29,7 +26,6 @@ sections: client = asana.Client.access_token('PERSONAL_ACCESS_TOKEN') - result = client.sections.get_section(section_gid, {'param': 'value', 'param': 'value'}, opt_pretty=True) get_sections_for_project: >- import asana @@ -37,7 +33,6 @@ sections: client = asana.Client.access_token('PERSONAL_ACCESS_TOKEN') - result = client.sections.get_sections_for_project(project_gid, {'param': 'value', 'param': 'value'}, opt_pretty=True) insert_section_for_project: >- import asana @@ -45,7 +40,6 @@ sections: client = asana.Client.access_token('PERSONAL_ACCESS_TOKEN') - result = client.sections.insert_section_for_project(project_gid, {'field': 'value', 'field': 'value'}, opt_pretty=True) update_section: >- import asana @@ -53,5 +47,4 @@ sections: client = asana.Client.access_token('PERSONAL_ACCESS_TOKEN') - result = client.sections.update_section(section_gid, {'field': 'value', 'field': 'value'}, opt_pretty=True) diff --git a/samples/status_updates_sample.yaml b/samples/status_updates_sample.yaml index 7c58ca9c..3be99c67 100644 --- a/samples/status_updates_sample.yaml +++ b/samples/status_updates_sample.yaml @@ -1,41 +1,29 @@ -statusupdates: +: create_status_for_object: >- import asana client = asana.Client.access_token('PERSONAL_ACCESS_TOKEN') - - result = client.status_updates.create_status_for_object({'field': 'value', 'field': 'value'}, opt_pretty=True) + result = client.status updates.create_status_for_object({'field': 'value', 'field': 'value'}, opt_pretty=True) delete_status: >- import asana client = asana.Client.access_token('PERSONAL_ACCESS_TOKEN') - - result = client.status_updates.delete_status(status_gid, opt_pretty=True) - delete_status_message: >- - import asana - - - client = asana.Client.access_token('PERSONAL_ACCESS_TOKEN') - - - result = client.status_updates.delete_status_message(message_gid, opt_pretty=True) + result = client.status updates.delete_status(status_gid, opt_pretty=True) get_status: >- import asana client = asana.Client.access_token('PERSONAL_ACCESS_TOKEN') - - result = client.status_updates.get_status(status_gid, {'param': 'value', 'param': 'value'}, opt_pretty=True) + result = client.status updates.get_status(status_gid, {'param': 'value', 'param': 'value'}, opt_pretty=True) get_statuses_for_object: >- import asana client = asana.Client.access_token('PERSONAL_ACCESS_TOKEN') - - result = client.status_updates.get_statuses_for_object({'param': 'value', 'param': 'value'}, opt_pretty=True) + result = client.status updates.get_statuses_for_object({'param': 'value', 'param': 'value'}, opt_pretty=True) diff --git a/samples/stories_sample.yaml b/samples/stories_sample.yaml index c6d858fb..e20a41c1 100644 --- a/samples/stories_sample.yaml +++ b/samples/stories_sample.yaml @@ -1,11 +1,10 @@ -stories: +: create_story_for_task: >- import asana client = asana.Client.access_token('PERSONAL_ACCESS_TOKEN') - result = client.stories.create_story_for_task(task_gid, {'field': 'value', 'field': 'value'}, opt_pretty=True) delete_story: >- import asana @@ -13,7 +12,6 @@ stories: client = asana.Client.access_token('PERSONAL_ACCESS_TOKEN') - result = client.stories.delete_story(story_gid, opt_pretty=True) get_stories_for_task: >- import asana @@ -21,7 +19,6 @@ stories: client = asana.Client.access_token('PERSONAL_ACCESS_TOKEN') - result = client.stories.get_stories_for_task(task_gid, {'param': 'value', 'param': 'value'}, opt_pretty=True) get_story: >- import asana @@ -29,7 +26,6 @@ stories: client = asana.Client.access_token('PERSONAL_ACCESS_TOKEN') - result = client.stories.get_story(story_gid, {'param': 'value', 'param': 'value'}, opt_pretty=True) update_story: >- import asana @@ -37,5 +33,4 @@ stories: client = asana.Client.access_token('PERSONAL_ACCESS_TOKEN') - result = client.stories.update_story(story_gid, {'field': 'value', 'field': 'value'}, opt_pretty=True) diff --git a/samples/tags_sample.yaml b/samples/tags_sample.yaml index fdf954cb..e7ca18d4 100644 --- a/samples/tags_sample.yaml +++ b/samples/tags_sample.yaml @@ -1,11 +1,10 @@ -tags: +: create_tag: >- import asana client = asana.Client.access_token('PERSONAL_ACCESS_TOKEN') - result = client.tags.create_tag({'field': 'value', 'field': 'value'}, opt_pretty=True) create_tag_for_workspace: >- import asana @@ -13,7 +12,6 @@ tags: client = asana.Client.access_token('PERSONAL_ACCESS_TOKEN') - result = client.tags.create_tag_for_workspace(workspace_gid, {'field': 'value', 'field': 'value'}, opt_pretty=True) delete_tag: >- import asana @@ -21,7 +19,6 @@ tags: client = asana.Client.access_token('PERSONAL_ACCESS_TOKEN') - result = client.tags.delete_tag(tag_gid, opt_pretty=True) get_tag: >- import asana @@ -29,7 +26,6 @@ tags: client = asana.Client.access_token('PERSONAL_ACCESS_TOKEN') - result = client.tags.get_tag(tag_gid, {'param': 'value', 'param': 'value'}, opt_pretty=True) get_tags: >- import asana @@ -37,7 +33,6 @@ tags: client = asana.Client.access_token('PERSONAL_ACCESS_TOKEN') - result = client.tags.get_tags({'param': 'value', 'param': 'value'}, opt_pretty=True) get_tags_for_task: >- import asana @@ -45,7 +40,6 @@ tags: client = asana.Client.access_token('PERSONAL_ACCESS_TOKEN') - result = client.tags.get_tags_for_task(task_gid, {'param': 'value', 'param': 'value'}, opt_pretty=True) get_tags_for_workspace: >- import asana @@ -53,7 +47,6 @@ tags: client = asana.Client.access_token('PERSONAL_ACCESS_TOKEN') - result = client.tags.get_tags_for_workspace(workspace_gid, {'param': 'value', 'param': 'value'}, opt_pretty=True) update_tag: >- import asana @@ -61,5 +54,4 @@ tags: client = asana.Client.access_token('PERSONAL_ACCESS_TOKEN') - result = client.tags.update_tag(tag_gid, {'field': 'value', 'field': 'value'}, opt_pretty=True) diff --git a/samples/tasks_sample.yaml b/samples/tasks_sample.yaml index b551a3dc..c53c6a83 100644 --- a/samples/tasks_sample.yaml +++ b/samples/tasks_sample.yaml @@ -1,11 +1,10 @@ -tasks: +: add_dependencies_for_task: >- import asana client = asana.Client.access_token('PERSONAL_ACCESS_TOKEN') - result = client.tasks.add_dependencies_for_task(task_gid, {'field': 'value', 'field': 'value'}, opt_pretty=True) add_dependents_for_task: >- import asana @@ -13,7 +12,6 @@ tasks: client = asana.Client.access_token('PERSONAL_ACCESS_TOKEN') - result = client.tasks.add_dependents_for_task(task_gid, {'field': 'value', 'field': 'value'}, opt_pretty=True) add_followers_for_task: >- import asana @@ -21,7 +19,6 @@ tasks: client = asana.Client.access_token('PERSONAL_ACCESS_TOKEN') - result = client.tasks.add_followers_for_task(task_gid, {'field': 'value', 'field': 'value'}, opt_pretty=True) add_project_for_task: >- import asana @@ -29,7 +26,6 @@ tasks: client = asana.Client.access_token('PERSONAL_ACCESS_TOKEN') - result = client.tasks.add_project_for_task(task_gid, {'field': 'value', 'field': 'value'}, opt_pretty=True) add_tag_for_task: >- import asana @@ -37,7 +33,6 @@ tasks: client = asana.Client.access_token('PERSONAL_ACCESS_TOKEN') - result = client.tasks.add_tag_for_task(task_gid, {'field': 'value', 'field': 'value'}, opt_pretty=True) create_subtask_for_task: >- import asana @@ -45,7 +40,6 @@ tasks: client = asana.Client.access_token('PERSONAL_ACCESS_TOKEN') - result = client.tasks.create_subtask_for_task(task_gid, {'field': 'value', 'field': 'value'}, opt_pretty=True) create_task: >- import asana @@ -53,7 +47,6 @@ tasks: client = asana.Client.access_token('PERSONAL_ACCESS_TOKEN') - result = client.tasks.create_task({'field': 'value', 'field': 'value'}, opt_pretty=True) delete_task: >- import asana @@ -61,7 +54,6 @@ tasks: client = asana.Client.access_token('PERSONAL_ACCESS_TOKEN') - result = client.tasks.delete_task(task_gid, opt_pretty=True) duplicate_task: >- import asana @@ -69,7 +61,6 @@ tasks: client = asana.Client.access_token('PERSONAL_ACCESS_TOKEN') - result = client.tasks.duplicate_task(task_gid, {'field': 'value', 'field': 'value'}, opt_pretty=True) get_dependencies_for_task: >- import asana @@ -77,7 +68,6 @@ tasks: client = asana.Client.access_token('PERSONAL_ACCESS_TOKEN') - result = client.tasks.get_dependencies_for_task(task_gid, {'param': 'value', 'param': 'value'}, opt_pretty=True) get_dependents_for_task: >- import asana @@ -85,7 +75,6 @@ tasks: client = asana.Client.access_token('PERSONAL_ACCESS_TOKEN') - result = client.tasks.get_dependents_for_task(task_gid, {'param': 'value', 'param': 'value'}, opt_pretty=True) get_subtasks_for_task: >- import asana @@ -93,7 +82,6 @@ tasks: client = asana.Client.access_token('PERSONAL_ACCESS_TOKEN') - result = client.tasks.get_subtasks_for_task(task_gid, {'param': 'value', 'param': 'value'}, opt_pretty=True) get_task: >- import asana @@ -101,7 +89,6 @@ tasks: client = asana.Client.access_token('PERSONAL_ACCESS_TOKEN') - result = client.tasks.get_task(task_gid, {'param': 'value', 'param': 'value'}, opt_pretty=True) get_tasks: >- import asana @@ -109,7 +96,6 @@ tasks: client = asana.Client.access_token('PERSONAL_ACCESS_TOKEN') - result = client.tasks.get_tasks({'param': 'value', 'param': 'value'}, opt_pretty=True) get_tasks_for_project: >- import asana @@ -117,7 +103,6 @@ tasks: client = asana.Client.access_token('PERSONAL_ACCESS_TOKEN') - result = client.tasks.get_tasks_for_project(project_gid, {'param': 'value', 'param': 'value'}, opt_pretty=True) get_tasks_for_section: >- import asana @@ -125,7 +110,6 @@ tasks: client = asana.Client.access_token('PERSONAL_ACCESS_TOKEN') - result = client.tasks.get_tasks_for_section(section_gid, {'param': 'value', 'param': 'value'}, opt_pretty=True) get_tasks_for_tag: >- import asana @@ -133,7 +117,6 @@ tasks: client = asana.Client.access_token('PERSONAL_ACCESS_TOKEN') - result = client.tasks.get_tasks_for_tag(tag_gid, {'param': 'value', 'param': 'value'}, opt_pretty=True) get_tasks_for_user_task_list: >- import asana @@ -141,7 +124,6 @@ tasks: client = asana.Client.access_token('PERSONAL_ACCESS_TOKEN') - result = client.tasks.get_tasks_for_user_task_list(user_task_list_gid, {'param': 'value', 'param': 'value'}, opt_pretty=True) remove_dependencies_for_task: >- import asana @@ -149,7 +131,6 @@ tasks: client = asana.Client.access_token('PERSONAL_ACCESS_TOKEN') - result = client.tasks.remove_dependencies_for_task(task_gid, {'field': 'value', 'field': 'value'}, opt_pretty=True) remove_dependents_for_task: >- import asana @@ -157,7 +138,6 @@ tasks: client = asana.Client.access_token('PERSONAL_ACCESS_TOKEN') - result = client.tasks.remove_dependents_for_task(task_gid, {'field': 'value', 'field': 'value'}, opt_pretty=True) remove_follower_for_task: >- import asana @@ -165,7 +145,6 @@ tasks: client = asana.Client.access_token('PERSONAL_ACCESS_TOKEN') - result = client.tasks.remove_follower_for_task(task_gid, {'field': 'value', 'field': 'value'}, opt_pretty=True) remove_project_for_task: >- import asana @@ -173,7 +152,6 @@ tasks: client = asana.Client.access_token('PERSONAL_ACCESS_TOKEN') - result = client.tasks.remove_project_for_task(task_gid, {'field': 'value', 'field': 'value'}, opt_pretty=True) remove_tag_for_task: >- import asana @@ -181,7 +159,6 @@ tasks: client = asana.Client.access_token('PERSONAL_ACCESS_TOKEN') - result = client.tasks.remove_tag_for_task(task_gid, {'field': 'value', 'field': 'value'}, opt_pretty=True) search_tasks_for_workspace: >- import asana @@ -189,7 +166,6 @@ tasks: client = asana.Client.access_token('PERSONAL_ACCESS_TOKEN') - result = client.tasks.search_tasks_for_workspace(workspace_gid, {'param': 'value', 'param': 'value'}, opt_pretty=True) set_parent_for_task: >- import asana @@ -197,7 +173,6 @@ tasks: client = asana.Client.access_token('PERSONAL_ACCESS_TOKEN') - result = client.tasks.set_parent_for_task(task_gid, {'field': 'value', 'field': 'value'}, opt_pretty=True) update_task: >- import asana @@ -205,5 +180,4 @@ tasks: client = asana.Client.access_token('PERSONAL_ACCESS_TOKEN') - result = client.tasks.update_task(task_gid, {'field': 'value', 'field': 'value'}, opt_pretty=True) diff --git a/samples/team_memberships_sample.yaml b/samples/team_memberships_sample.yaml index 2b30cfb1..93fd6c8a 100644 --- a/samples/team_memberships_sample.yaml +++ b/samples/team_memberships_sample.yaml @@ -1,33 +1,29 @@ -teammemberships: +: get_team_membership: >- import asana client = asana.Client.access_token('PERSONAL_ACCESS_TOKEN') - - result = client.team_memberships.get_team_membership(team_membership_gid, {'param': 'value', 'param': 'value'}, opt_pretty=True) + result = client.team memberships.get_team_membership(team_membership_gid, {'param': 'value', 'param': 'value'}, opt_pretty=True) get_team_memberships: >- import asana client = asana.Client.access_token('PERSONAL_ACCESS_TOKEN') - - result = client.team_memberships.get_team_memberships({'param': 'value', 'param': 'value'}, opt_pretty=True) + result = client.team memberships.get_team_memberships({'param': 'value', 'param': 'value'}, opt_pretty=True) get_team_memberships_for_team: >- import asana client = asana.Client.access_token('PERSONAL_ACCESS_TOKEN') - - result = client.team_memberships.get_team_memberships_for_team(team_gid, {'param': 'value', 'param': 'value'}, opt_pretty=True) + result = client.team memberships.get_team_memberships_for_team(team_gid, {'param': 'value', 'param': 'value'}, opt_pretty=True) get_team_memberships_for_user: >- import asana client = asana.Client.access_token('PERSONAL_ACCESS_TOKEN') - - result = client.team_memberships.get_team_memberships_for_user(user_gid, {'param': 'value', 'param': 'value'}, opt_pretty=True) + result = client.team memberships.get_team_memberships_for_user(user_gid, {'param': 'value', 'param': 'value'}, opt_pretty=True) diff --git a/samples/teams_sample.yaml b/samples/teams_sample.yaml index d2e09aca..6db81b6f 100644 --- a/samples/teams_sample.yaml +++ b/samples/teams_sample.yaml @@ -1,11 +1,10 @@ -teams: +: add_user_for_team: >- import asana client = asana.Client.access_token('PERSONAL_ACCESS_TOKEN') - result = client.teams.add_user_for_team(team_gid, {'field': 'value', 'field': 'value'}, opt_pretty=True) create_team: >- import asana @@ -13,7 +12,6 @@ teams: client = asana.Client.access_token('PERSONAL_ACCESS_TOKEN') - result = client.teams.create_team({'field': 'value', 'field': 'value'}, opt_pretty=True) get_team: >- import asana @@ -21,7 +19,6 @@ teams: client = asana.Client.access_token('PERSONAL_ACCESS_TOKEN') - result = client.teams.get_team(team_gid, {'param': 'value', 'param': 'value'}, opt_pretty=True) get_teams_for_user: >- import asana @@ -29,7 +26,6 @@ teams: client = asana.Client.access_token('PERSONAL_ACCESS_TOKEN') - result = client.teams.get_teams_for_user(user_gid, {'param': 'value', 'param': 'value'}, opt_pretty=True) get_teams_for_workspace: >- import asana @@ -37,7 +33,6 @@ teams: client = asana.Client.access_token('PERSONAL_ACCESS_TOKEN') - result = client.teams.get_teams_for_workspace(workspace_gid, {'param': 'value', 'param': 'value'}, opt_pretty=True) remove_user_for_team: >- import asana @@ -45,7 +40,6 @@ teams: client = asana.Client.access_token('PERSONAL_ACCESS_TOKEN') - result = client.teams.remove_user_for_team(team_gid, {'field': 'value', 'field': 'value'}, opt_pretty=True) update_team: >- import asana @@ -53,5 +47,4 @@ teams: client = asana.Client.access_token('PERSONAL_ACCESS_TOKEN') - result = client.teams.update_team({'field': 'value', 'field': 'value'}, opt_pretty=True) diff --git a/samples/time_periods_sample.yaml b/samples/time_periods_sample.yaml index e9c7e415..c63954c3 100644 --- a/samples/time_periods_sample.yaml +++ b/samples/time_periods_sample.yaml @@ -1,17 +1,15 @@ -timeperiods: +: get_time_period: >- import asana client = asana.Client.access_token('PERSONAL_ACCESS_TOKEN') - - result = client.time_periods.get_time_period(time_period_gid, {'param': 'value', 'param': 'value'}, opt_pretty=True) + result = client.time periods.get_time_period(time_period_gid, {'param': 'value', 'param': 'value'}, opt_pretty=True) get_time_periods: >- import asana client = asana.Client.access_token('PERSONAL_ACCESS_TOKEN') - - result = client.time_periods.get_time_periods({'param': 'value', 'param': 'value'}, opt_pretty=True) + result = client.time periods.get_time_periods({'param': 'value', 'param': 'value'}, opt_pretty=True) diff --git a/samples/typeahead_sample.yaml b/samples/typeahead_sample.yaml index 37b55e19..fb9ba52b 100644 --- a/samples/typeahead_sample.yaml +++ b/samples/typeahead_sample.yaml @@ -1,9 +1,8 @@ -typeahead: +: typeahead_for_workspace: >- import asana client = asana.Client.access_token('PERSONAL_ACCESS_TOKEN') - result = client.typeahead.typeahead_for_workspace(workspace_gid, {'param': 'value', 'param': 'value'}, opt_pretty=True) diff --git a/samples/user_task_lists_sample.yaml b/samples/user_task_lists_sample.yaml index 8c73f216..787e2a50 100644 --- a/samples/user_task_lists_sample.yaml +++ b/samples/user_task_lists_sample.yaml @@ -1,17 +1,15 @@ -usertasklists: +: get_user_task_list: >- import asana client = asana.Client.access_token('PERSONAL_ACCESS_TOKEN') - - result = client.user_task_lists.get_user_task_list(user_task_list_gid, {'param': 'value', 'param': 'value'}, opt_pretty=True) + result = client.user task lists.get_user_task_list(user_task_list_gid, {'param': 'value', 'param': 'value'}, opt_pretty=True) get_user_task_list_for_user: >- import asana client = asana.Client.access_token('PERSONAL_ACCESS_TOKEN') - - result = client.user_task_lists.get_user_task_list_for_user(user_gid, {'param': 'value', 'param': 'value'}, opt_pretty=True) + result = client.user task lists.get_user_task_list_for_user(user_gid, {'param': 'value', 'param': 'value'}, opt_pretty=True) diff --git a/samples/users_sample.yaml b/samples/users_sample.yaml index dfbae326..7a3d3153 100644 --- a/samples/users_sample.yaml +++ b/samples/users_sample.yaml @@ -1,11 +1,10 @@ -users: +: get_favorites_for_user: >- import asana client = asana.Client.access_token('PERSONAL_ACCESS_TOKEN') - result = client.users.get_favorites_for_user(user_gid, {'param': 'value', 'param': 'value'}, opt_pretty=True) get_user: >- import asana @@ -13,7 +12,6 @@ users: client = asana.Client.access_token('PERSONAL_ACCESS_TOKEN') - result = client.users.get_user(user_gid, {'param': 'value', 'param': 'value'}, opt_pretty=True) get_users: >- import asana @@ -21,7 +19,6 @@ users: client = asana.Client.access_token('PERSONAL_ACCESS_TOKEN') - result = client.users.get_users({'param': 'value', 'param': 'value'}, opt_pretty=True) get_users_for_team: >- import asana @@ -29,7 +26,6 @@ users: client = asana.Client.access_token('PERSONAL_ACCESS_TOKEN') - result = client.users.get_users_for_team(team_gid, {'param': 'value', 'param': 'value'}, opt_pretty=True) get_users_for_workspace: >- import asana @@ -37,5 +33,4 @@ users: client = asana.Client.access_token('PERSONAL_ACCESS_TOKEN') - result = client.users.get_users_for_workspace(workspace_gid, {'param': 'value', 'param': 'value'}, opt_pretty=True) diff --git a/samples/webhooks_sample.yaml b/samples/webhooks_sample.yaml index 7cd66242..6b82fefb 100644 --- a/samples/webhooks_sample.yaml +++ b/samples/webhooks_sample.yaml @@ -1,11 +1,10 @@ -webhooks: +: create_webhook: >- import asana client = asana.Client.access_token('PERSONAL_ACCESS_TOKEN') - result = client.webhooks.create_webhook({'field': 'value', 'field': 'value'}, opt_pretty=True) delete_webhook: >- import asana @@ -13,7 +12,6 @@ webhooks: client = asana.Client.access_token('PERSONAL_ACCESS_TOKEN') - result = client.webhooks.delete_webhook(webhook_gid, opt_pretty=True) get_webhook: >- import asana @@ -21,7 +19,6 @@ webhooks: client = asana.Client.access_token('PERSONAL_ACCESS_TOKEN') - result = client.webhooks.get_webhook(webhook_gid, {'param': 'value', 'param': 'value'}, opt_pretty=True) get_webhooks: >- import asana @@ -29,7 +26,6 @@ webhooks: client = asana.Client.access_token('PERSONAL_ACCESS_TOKEN') - result = client.webhooks.get_webhooks({'param': 'value', 'param': 'value'}, opt_pretty=True) update_webhook: >- import asana @@ -37,5 +33,4 @@ webhooks: client = asana.Client.access_token('PERSONAL_ACCESS_TOKEN') - result = client.webhooks.update_webhook(webhook_gid, {'field': 'value', 'field': 'value'}, opt_pretty=True) diff --git a/samples/workspace_memberships_sample.yaml b/samples/workspace_memberships_sample.yaml index 0901c48f..f4e0d6f5 100644 --- a/samples/workspace_memberships_sample.yaml +++ b/samples/workspace_memberships_sample.yaml @@ -1,25 +1,22 @@ -workspacememberships: +: get_workspace_membership: >- import asana client = asana.Client.access_token('PERSONAL_ACCESS_TOKEN') - - result = client.workspace_memberships.get_workspace_membership(workspace_membership_gid, {'param': 'value', 'param': 'value'}, opt_pretty=True) + result = client.workspace memberships.get_workspace_membership(workspace_membership_gid, {'param': 'value', 'param': 'value'}, opt_pretty=True) get_workspace_memberships_for_user: >- import asana client = asana.Client.access_token('PERSONAL_ACCESS_TOKEN') - - result = client.workspace_memberships.get_workspace_memberships_for_user(user_gid, {'param': 'value', 'param': 'value'}, opt_pretty=True) + result = client.workspace memberships.get_workspace_memberships_for_user(user_gid, {'param': 'value', 'param': 'value'}, opt_pretty=True) get_workspace_memberships_for_workspace: >- import asana client = asana.Client.access_token('PERSONAL_ACCESS_TOKEN') - - result = client.workspace_memberships.get_workspace_memberships_for_workspace(workspace_gid, {'param': 'value', 'param': 'value'}, opt_pretty=True) + result = client.workspace memberships.get_workspace_memberships_for_workspace(workspace_gid, {'param': 'value', 'param': 'value'}, opt_pretty=True) diff --git a/samples/workspaces_sample.yaml b/samples/workspaces_sample.yaml index cff9a078..06cb2684 100644 --- a/samples/workspaces_sample.yaml +++ b/samples/workspaces_sample.yaml @@ -1,11 +1,10 @@ -workspaces: +: add_user_for_workspace: >- import asana client = asana.Client.access_token('PERSONAL_ACCESS_TOKEN') - result = client.workspaces.add_user_for_workspace(workspace_gid, {'field': 'value', 'field': 'value'}, opt_pretty=True) get_workspace: >- import asana @@ -13,7 +12,6 @@ workspaces: client = asana.Client.access_token('PERSONAL_ACCESS_TOKEN') - result = client.workspaces.get_workspace(workspace_gid, {'param': 'value', 'param': 'value'}, opt_pretty=True) get_workspaces: >- import asana @@ -21,7 +19,6 @@ workspaces: client = asana.Client.access_token('PERSONAL_ACCESS_TOKEN') - result = client.workspaces.get_workspaces({'param': 'value', 'param': 'value'}, opt_pretty=True) remove_user_for_workspace: >- import asana @@ -29,7 +26,6 @@ workspaces: client = asana.Client.access_token('PERSONAL_ACCESS_TOKEN') - result = client.workspaces.remove_user_for_workspace(workspace_gid, {'field': 'value', 'field': 'value'}, opt_pretty=True) update_workspace: >- import asana @@ -37,5 +33,4 @@ workspaces: client = asana.Client.access_token('PERSONAL_ACCESS_TOKEN') - result = client.workspaces.update_workspace(workspace_gid, {'field': 'value', 'field': 'value'}, opt_pretty=True)