From 6395f272bc77c6c164a3fe3aac5c7424bb1a8ebb Mon Sep 17 00:00:00 2001 From: jv-asana Date: Fri, 11 Aug 2023 18:54:55 +0000 Subject: [PATCH] Updated Python SDK: v4.0.5 --- README.md | 477 +- asana/api/attachments_api.py | 864 ++-- asana/api/audit_log_api_api.py | 269 +- asana/api/batch_api_api.py | 223 +- asana/api/custom_field_settings_api.py | 448 +- asana/api/custom_fields_api.py | 1700 +++---- asana/api/events_api.py | 223 +- asana/api/goal_relationships_api.py | 1105 ++--- asana/api/goals_api.py | 2192 ++++----- asana/api/jobs_api.py | 215 +- asana/api/memberships_api.py | 613 +-- asana/api/organization_exports_api.py | 424 +- asana/api/portfolio_memberships_api.py | 665 +-- asana/api/portfolios_api.py | 2592 +++++----- asana/api/project_briefs_api.py | 856 ++-- asana/api/project_memberships_api.py | 440 +- asana/api/project_statuses_api.py | 848 ++-- asana/api/project_templates_api.py | 1057 ++-- asana/api/projects_api.py | 4155 ++++++++-------- asana/api/rules_api.py | 229 +- asana/api/sections_api.py | 1471 +++--- asana/api/status_updates_api.py | 856 ++-- asana/api/stories_api.py | 1073 ++--- asana/api/tags_api.py | 1684 +++---- asana/api/tasks_api.py | 6086 ++++++++++++------------ asana/api/team_memberships_api.py | 890 ++-- asana/api/teams_api.py | 1539 +++--- asana/api/time_periods_api.py | 448 +- asana/api/time_tracking_entries_api.py | 1073 ++--- asana/api/typeahead_api.py | 255 +- asana/api/user_task_lists_api.py | 432 +- asana/api/users_api.py | 1099 ++--- asana/api/webhooks_api.py | 1065 ++--- asana/api/workspace_memberships_api.py | 657 +-- asana/api/workspaces_api.py | 1081 ++--- asana/api_client.py | 4 +- asana/configuration.py | 2 +- asana/models/project_base.py | 40 +- asana/models/project_request.py | 70 +- asana/models/project_response.py | 70 +- asana/models/project_update_request.py | 36 +- docs/AttachmentsApi.md | 44 +- docs/AttachmentsApi.yaml | 44 +- docs/AuditLogAPIApi.md | 11 +- docs/AuditLogAPIApi.yaml | 11 +- docs/BatchAPIApi.md | 11 +- docs/BatchAPIApi.yaml | 11 +- docs/CustomFieldSettingsApi.md | 22 +- docs/CustomFieldSettingsApi.yaml | 22 +- docs/CustomFieldsApi.md | 88 +- docs/CustomFieldsApi.yaml | 88 +- docs/EventsApi.md | 11 +- docs/EventsApi.yaml | 11 +- docs/GoalRelationshipsApi.md | 55 +- docs/GoalRelationshipsApi.yaml | 55 +- docs/GoalsApi.md | 110 +- docs/GoalsApi.yaml | 110 +- docs/JobsApi.md | 11 +- docs/JobsApi.yaml | 11 +- docs/MembershipsApi.md | 39 +- docs/MembershipsApi.yaml | 35 +- docs/OrganizationExportsApi.md | 22 +- docs/OrganizationExportsApi.yaml | 22 +- docs/PortfolioMembershipsApi.md | 33 +- docs/PortfolioMembershipsApi.yaml | 33 +- docs/PortfoliosApi.md | 132 +- docs/PortfoliosApi.yaml | 132 +- docs/ProjectBase.md | 1 + docs/ProjectBriefsApi.md | 44 +- docs/ProjectBriefsApi.yaml | 44 +- docs/ProjectMembershipsApi.md | 22 +- docs/ProjectMembershipsApi.yaml | 22 +- docs/ProjectRequest.md | 2 +- docs/ProjectResponse.md | 2 +- docs/ProjectStatusesApi.md | 44 +- docs/ProjectStatusesApi.yaml | 44 +- docs/ProjectTemplatesApi.md | 55 +- docs/ProjectTemplatesApi.yaml | 55 +- docs/ProjectUpdateRequest.md | 1 + docs/ProjectsApi.md | 209 +- docs/ProjectsApi.yaml | 209 +- docs/RulesApi.md | 11 +- docs/RulesApi.yaml | 11 +- docs/SectionsApi.md | 77 +- docs/SectionsApi.yaml | 77 +- docs/StatusUpdatesApi.md | 44 +- docs/StatusUpdatesApi.yaml | 44 +- docs/StoriesApi.md | 55 +- docs/StoriesApi.yaml | 55 +- docs/TagsApi.md | 88 +- docs/TagsApi.yaml | 88 +- docs/TasksApi.md | 286 +- docs/TasksApi.yaml | 286 +- docs/TeamMembershipsApi.md | 44 +- docs/TeamMembershipsApi.yaml | 44 +- docs/TeamsApi.md | 77 +- docs/TeamsApi.yaml | 77 +- docs/TimePeriodsApi.md | 22 +- docs/TimePeriodsApi.yaml | 22 +- docs/TimeTrackingEntriesApi.md | 55 +- docs/TimeTrackingEntriesApi.yaml | 55 +- docs/TypeaheadApi.md | 11 +- docs/TypeaheadApi.yaml | 11 +- docs/UserTaskListsApi.md | 22 +- docs/UserTaskListsApi.yaml | 22 +- docs/UsersApi.md | 55 +- docs/UsersApi.yaml | 55 +- docs/WebhooksApi.md | 55 +- docs/WebhooksApi.yaml | 55 +- docs/WorkspaceMembershipsApi.md | 33 +- docs/WorkspaceMembershipsApi.yaml | 33 +- docs/WorkspacesApi.md | 55 +- docs/WorkspacesApi.yaml | 55 +- setup.py | 2 +- 114 files changed, 22156 insertions(+), 21280 deletions(-) diff --git a/README.md b/README.md index d2bf2b02..b9e6c883 100644 --- a/README.md +++ b/README.md @@ -3,7 +3,7 @@ Python client library for Asana - API version: 1.0 -- Package version: 4.0.4 +- Package version: 4.0.5 ## Requirements. @@ -47,9 +47,10 @@ from pprint import pprint # Configure OAuth2 access token for authorization: configuration = asana.Configuration() configuration.access_token = '' +api_client = asana.ApiClient(configuration) # create an instance of the API class -users_api_instance = asana.UsersApi(asana.ApiClient(configuration)) +users_api_instance = asana.UsersApi(api_client) user_gid = 'me' # str | A string identifying a user. This can either be the string \"me\", an email, or the gid of a user. opt_fields = ["email","name","photo","photo.image_1024x1024","photo.image_128x128","photo.image_21x21","photo.image_27x27","photo.image_36x36","photo.image_60x60","workspaces","workspaces.name"] # list[str] | Properties to include in the response. Set this query parameter to a comma-separated list of the properties you wish to include. (optional) @@ -72,9 +73,10 @@ from pprint import pprint # Configure OAuth2 access token for authorization: configuration = asana.Configuration() configuration.access_token = '' +api_client = asana.ApiClient(configuration) # create an instance of the API class -tasks_api_instance = asana.TasksApi(asana.ApiClient(configuration)) +tasks_api_instance = asana.TasksApi(api_client) limit = 50 project = "" opt_fields = [ @@ -136,9 +138,10 @@ from pprint import pprint # Configure OAuth2 access token for authorization: configuration = asana.Configuration() configuration.access_token = '' +api_client = asana.ApiClient(configuration) # create an instance of the API class -tasks_api_instance = asana.TasksApi(asana.ApiClient(configuration)) +tasks_api_instance = asana.TasksApi(api_client) body = asana.TasksBody( { "name": "New Task", @@ -163,9 +166,10 @@ from pprint import pprint # Configure OAuth2 access token for authorization: configuration = asana.Configuration() configuration.access_token = '' +api_client = asana.ApiClient(configuration) # create an instance of the API class -tasks_api_instance = asana.TasksApi(asana.ApiClient(configuration)) +tasks_api_instance = asana.TasksApi(api_client) task_gid = "" body = asana.TasksBody( { @@ -190,9 +194,10 @@ from pprint import pprint # Configure OAuth2 access token for authorization: configuration = asana.Configuration() configuration.access_token = '' +api_client = asana.ApiClient(configuration) # create an instance of the API class -tasks_api_instance = asana.TasksApi(asana.ApiClient(configuration)) +tasks_api_instance = asana.TasksApi(api_client) task_gid = "" try: @@ -825,10 +830,197 @@ Class | Method | HTTP request | Description - **profile**: Provides access to the user’s name and profile photo through the OpenID Connect user info endpoint. -## Documentation for Using the `callApi` method +## Getting events + +In order to get events you will need a sync token. This sync token can be acquired in the error message from the initial +request to [get_events](docs/EventsApi.md#get_events). + +```python +import asana +from asana.rest import ApiException +from pprint import pprint + +# Configure OAuth2 access token for authorization: +configuration = asana.Configuration() +configuration.access_token = '' +api_client = asana.ApiClient(configuration) + +# create an instance of the API class +events_api_instance = asana.EventsApi(api_client) +resource = '12345' # str | 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.* (optional) + +try: + # Initial request to get the sync token + api_response = events_api_instance.get_events(resource, sync=sync) +except ApiException as e: + # Set the sync token + sync = json.loads(e.body.decode('utf-8'))['sync'] + +try: + # Follow up request to get events + api_response = events_api_instance.get_events(resource, sync=sync) + pprint(api_response) +except ApiException as e: + print("Exception when calling EventsApi->get_events: %s\n" % e) +``` + +## Pagination + +```python +import asana +from asana.rest import ApiException +from pprint import pprint + +# Configure OAuth2 access token for authorization: +configuration = asana.Configuration() +configuration.access_token = '' +api_client = asana.ApiClient(configuration) + +# create an instance of the API class +task_api_instance = asana.TasksApi(api_client) +limit = 10 # int | Results per page. The number of objects to return per page. The value must be between 1 and 100. (optional) +project = '321654' # str | The project to filter tasks on. (optional) + +try: + # Get multiple tasks with next_page + offset = None + while True: + # If the "offset" is None make a request without providing the offset query parameter + # Asana throws an error if we make a request with a "offset" query param of None + if offset is None: + api_response = task_api_instance.get_tasks(limit=limit, project=project) + else: + api_response = task_api_instance.get_tasks(limit=limit, project=project, offset=offset) + + # Do something + # EX: print response + pprint(api_response) + + # Check to see if there is a next_page + if api_response.next_page: + offset = api_response.next_page.offset + else: + break +except ApiException as e: + print("Exception when calling TasksApi->get_tasks: %s\n" % e) +``` + +## Accessing repsonse data + +By default, the client library returns a class object of the resource. You can use dot notation to access the response data. + +TIP: look at the "Return type" section of the documented endpoint to understand which properties are accessible. (EX: [get_task](docs/TasksApi.md#get_task)) + +### Example: Accessing task data (dot notation) +```python +. +. +. +try: + task = tasks_api_instance.get_task(task_gid).data + task_name = task.name + task_notes = task.notes +except ApiException as e: + . + . + . +``` + +If you would like to convert the class object into a dictionary and access the data via bracket notation, you can use the `to_dict()` method. + +### Example: Accessing task data (bracket notation) +```python +. +. +. +try: + task_dict = tasks_api_instance.get_task(task_gid).to_dict() + task_dict_data = task_dict['data'] + task_name = task_dict_data['name'] + task_notes = task_dict_data['notes'] +except ApiException as e: + . + . + . +``` + +## Accessing response status code and headers + +In the scenario you want to access the response headers or the status code along with the response data you can +provide the `_return_http_data_only` parameter argument in the request method and set the value to `False` + +```python +import asana +from asana.rest import ApiException +from pprint import pprint + +# Configure OAuth2 access token for authorization: +configuration = asana.Configuration() +configuration.access_token = '' +api_client = asana.ApiClient(configuration) + +# create an instance of the API class +api_instance = asana.UsersApi(api_client) +user_gid = 'me' # str | A string identifying a user. This can either be the string \"me\", an email, or the gid of a user. + +try: + # Get a user - Add asana-enable in the request + api_response = api_instance.get_user(user_gid, _return_http_data_only=False) # returns a tuple: (object, status, headers) + pprint(api_response) +except ApiException as e: + print("Exception when calling UsersApi->get_user: %s\n" % e) +``` + +## Adding deprecation flag to your "asana-enable" header + +### On the client +```python +import asana +from asana.rest import ApiException +from pprint import pprint + +# Configure OAuth2 access token for authorization: +configuration = asana.Configuration() +configuration.access_token = '' +api_client = asana.ApiClient(configuration) + +# Add asana-enable header for the client +api_client.default_headers['asana-enable'] = 'string_ids' +``` + +OR + +### On the request +```python +import asana +from asana.rest import ApiException +from pprint import pprint + +# Configure OAuth2 access token for authorization: +configuration = asana.Configuration() +configuration.access_token = '' +api_client = asana.ApiClient(configuration) + +# create an instance of the API class +api_instance = asana.UsersApi(api_client) +user_gid = 'me' # str | A string identifying a user. This can either be the string \"me\", an email, or the gid of a user. + +try: + # Get a user - Add asana-enable in the request + api_response = api_instance.get_user(user_gid, header_params={'asana-enable': 'string_ids'}) + pprint(api_response) +except ApiException as e: + print("Exception when calling UsersApi->get_user: %s\n" % e) +``` + +## Documentation for Using the `call_api` method Use this to make HTTP calls when the endpoint does not exist in the current library version or has bugs +### Example: GET, POST, PUT, DELETE on tasks + +#### GET - get a task ```python import asana from asana.rest import ApiException @@ -839,100 +1031,183 @@ configuration = asana.Configuration() configuration.access_token = '' api_client = asana.ApiClient(configuration) -# GET - get a task -api_response = api_client.call_api( - "/tasks/{task_gid}", - "GET", - path_params={"task_gid": ""}, - query_params=[], - header_params={"Accept": "application/json; charset=utf-8"}, - body=None, - post_params=[], - files={}, - response_type=object, # If there is an existing response model for the resource you can use that EX: "TaskResponseData" or you can specify one of the following types: float, bool, bytes, str, object - auth_settings=["oauth2"], - async_req=None, - _return_http_data_only=True, - _preload_content=True, - _request_timeout=None, - collection_formats={}, -) -pprint(api_response) - -# POST - create a task -api_response = api_client.call_api( - "/tasks", - "POST", - path_params={}, - query_params=[], - header_params={ - "Accept": "application/json; charset=utf-8", - "Content-Type": "application/json; charset=utf-8", - }, - body={ - "data": { - "name": "New Task", - "projects": [""], - } - }, - post_params=[], - files={}, - response_type=object, # If there is an existing response model for the resource you can use that EX: "TaskResponseData" or you can specify one of the following types: float, bool, bytes, str, object - auth_settings=["oauth2"], - async_req=None, - _return_http_data_only=True, - _preload_content=True, - _request_timeout=None, - collection_formats={}, -) -pprint(api_response) - -# PUT - update a task -api_response = api_client.call_api( - "/tasks/{task_gid}", - "PUT", - path_params={"task_gid": ""}, - query_params=[], - header_params={ - "Accept": "application/json; charset=utf-8", - "Content-Type": "application/json; charset=utf-8", - }, - body={ - "data": { - "name": "Updated Task", - } - }, - post_params=[], - files={}, - response_type=object, # If there is an existing response model for the resource you can use that EX: "TaskResponseData" or you can specify one of the following types: float, bool, bytes, str, object - auth_settings=["oauth2"], - async_req=None, - _return_http_data_only=True, - _preload_content=True, - _request_timeout=None, - collection_formats={}, -) -pprint(api_response) - -# DELETE - delete a task -api_response = api_client.call_api( - "/tasks/{task_gid}", - "DELETE", - path_params={"task_gid": ""}, - query_params=[], - header_params={"Accept": "application/json; charset=utf-8"}, - body=None, - post_params=[], - files={}, - response_type=object, # If there is an existing response model for the resource you can use that EX: "EmptyResponseData" or you can specify one of the following types: float, bool, bytes, str, object - auth_settings=["oauth2"], - async_req=None, - _return_http_data_only=True, - _preload_content=True, - _request_timeout=None, - collection_formats={}, -) -pprint(api_response) +try: + # GET - get a task + api_response = api_client.call_api( + "/tasks/{task_gid}", + "GET", + path_params={"task_gid": ""}, + query_params=[], + header_params={"Accept": "application/json; charset=utf-8"}, + body=None, + post_params=[], + files={}, + response_type=object, # If there is an existing response model for the resource you can use that EX: "TaskResponseData" or you can specify one of the following types: float, bool, bytes, str, object + auth_settings=["oauth2"], + async_req=None, + _return_http_data_only=True, + _preload_content=True, + _request_timeout=None, + collection_formats={}, + ) + pprint(api_response) +except ApiException as e: + print("Exception: %s\n" % e) +``` + +#### GET - get multiple tasks -> with opt_fields +```python +import asana +from asana.rest import ApiException +from pprint import pprint + +# Configure OAuth2 access token for authorization: +configuration = asana.Configuration() +configuration.access_token = '' +api_client = asana.ApiClient(configuration) + +try: + # GET - get multiple tasks + api_response = api_client.call_api( + "/tasks", + "GET", + path_params={}, + query_params=[('opt_fields', 'name,notes,projects')], + header_params={"Accept": "application/json; charset=utf-8"}, + body=None, + post_params=[], + files={}, + response_type=object, # If there is an existing response model for the resource you can use that EX: "TaskResponseData" or you can specify one of the following types: float, bool, bytes, str, object + auth_settings=["oauth2"], + async_req=None, + _return_http_data_only=True, + _preload_content=True, + _request_timeout=None, + collection_formats={}, + ) + pprint(api_response) +except ApiException as e: + print("Exception: %s\n" % e) +``` + +#### POST - create a task +```python +import asana +from asana.rest import ApiException +from pprint import pprint + +# Configure OAuth2 access token for authorization: +configuration = asana.Configuration() +configuration.access_token = '' +api_client = asana.ApiClient(configuration) + +try: + # POST - create a task + api_response = api_client.call_api( + "/tasks", + "POST", + path_params={}, + query_params=[], + header_params={ + "Accept": "application/json; charset=utf-8", + "Content-Type": "application/json; charset=utf-8", + }, + body={ + "data": { + "name": "New Task", + "projects": [""], + } + }, + post_params=[], + files={}, + response_type=object, # If there is an existing response model for the resource you can use that EX: "TaskResponseData" or you can specify one of the following types: float, bool, bytes, str, object + auth_settings=["oauth2"], + async_req=None, + _return_http_data_only=True, + _preload_content=True, + _request_timeout=None, + collection_formats={}, + ) + pprint(api_response) +except ApiException as e: + print("Exception: %s\n" % e) +``` + +#### PUT - update a task +```python +import asana +from asana.rest import ApiException +from pprint import pprint + +# Configure OAuth2 access token for authorization: +configuration = asana.Configuration() +configuration.access_token = '' +api_client = asana.ApiClient(configuration) + +try: + # PUT - update a task + api_response = api_client.call_api( + "/tasks/{task_gid}", + "PUT", + path_params={"task_gid": ""}, + query_params=[], + header_params={ + "Accept": "application/json; charset=utf-8", + "Content-Type": "application/json; charset=utf-8", + }, + body={ + "data": { + "name": "Updated Task", + } + }, + post_params=[], + files={}, + response_type=object, # If there is an existing response model for the resource you can use that EX: "TaskResponseData" or you can specify one of the following types: float, bool, bytes, str, object + auth_settings=["oauth2"], + async_req=None, + _return_http_data_only=True, + _preload_content=True, + _request_timeout=None, + collection_formats={}, + ) + pprint(api_response) +except ApiException as e: + print("Exception: %s\n" % e) +``` + +#### DELETE - delete a task +```python +import asana +from asana.rest import ApiException +from pprint import pprint + +# Configure OAuth2 access token for authorization: +configuration = asana.Configuration() +configuration.access_token = '' +api_client = asana.ApiClient(configuration) + +try: + # DELETE - delete a task + api_response = api_client.call_api( + "/tasks/{task_gid}", + "DELETE", + path_params={"task_gid": ""}, + query_params=[], + header_params={"Accept": "application/json; charset=utf-8"}, + body=None, + post_params=[], + files={}, + response_type=object, # If there is an existing response model for the resource you can use that EX: "EmptyResponseData" or you can specify one of the following types: float, bool, bytes, str, object + auth_settings=["oauth2"], + async_req=None, + _return_http_data_only=True, + _preload_content=True, + _request_timeout=None, + collection_formats={}, + ) + pprint(api_response) +except ApiException as e: + print("Exception: %s\n" % e) ``` ## Author diff --git a/asana/api/attachments_api.py b/asana/api/attachments_api.py index 25aa964a..f56c54c3 100644 --- a/asana/api/attachments_api.py +++ b/asana/api/attachments_api.py @@ -21,436 +21,440 @@ class AttachmentsApi(object): - """NOTE: This class is auto generated by the swagger code generator program. +"""NOTE: This class is auto generated by the swagger code generator program. - Do not edit the class manually. - Ref: https://github.com/swagger-api/swagger-codegen +Do not edit the class manually. +Ref: https://github.com/swagger-api/swagger-codegen +""" + +def __init__(self, api_client=None): + if api_client is None: + api_client = ApiClient() + self.api_client = api_client + +def create_attachment_for_object(self, **kwargs): # noqa: E501 + """Upload an attachment # noqa: E501 + + Upload an attachment. This method uploads an attachment on an object and returns the compact record for the created attachment object. This is possible by either: - Providing the URL of the external resource being attached, or - Downloading the file content first and then uploading it as any other attachment. Note that it is not possible to attach files from third party services such as Dropbox, Box, Vimeo & Google Drive via the API The 100MB size limit on attachments in Asana is enforced on this endpoint. This endpoint expects a multipart/form-data encoded request containing the full contents of the file to be uploaded. Requests made should follow the HTTP/1.1 specification that line terminators are of the form `CRLF` or `\\r\\n` outlined [here](http://www.w3.org/Protocols/HTTP/1.1/draft-ietf-http-v11-spec-01#Basic-Rules) in order for the server to reliably and properly handle the request. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.create_attachment_for_object(async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str resource_subtype: + :param str file: + :param str parent: + :param str url: + :param str name: + :param bool connect_to_app: + :param list[str] opt_fields: This endpoint returns a compact resource, which excludes some properties by default. To include those optional properties, set this query parameter to a comma-separated list of the properties you wish to include. + :return: AttachmentResponseData + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = kwargs.get("_return_http_data_only", True) + if kwargs.get('async_req'): + return self.create_attachment_for_object_with_http_info(**kwargs) # noqa: E501 + else: + (data) = self.create_attachment_for_object_with_http_info(**kwargs) # noqa: E501 + return data + +def create_attachment_for_object_with_http_info(self, **kwargs): # noqa: E501 + """Upload an attachment # noqa: E501 + + Upload an attachment. This method uploads an attachment on an object and returns the compact record for the created attachment object. This is possible by either: - Providing the URL of the external resource being attached, or - Downloading the file content first and then uploading it as any other attachment. Note that it is not possible to attach files from third party services such as Dropbox, Box, Vimeo & Google Drive via the API The 100MB size limit on attachments in Asana is enforced on this endpoint. This endpoint expects a multipart/form-data encoded request containing the full contents of the file to be uploaded. Requests made should follow the HTTP/1.1 specification that line terminators are of the form `CRLF` or `\\r\\n` outlined [here](http://www.w3.org/Protocols/HTTP/1.1/draft-ietf-http-v11-spec-01#Basic-Rules) in order for the server to reliably and properly handle the request. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.create_attachment_for_object_with_http_info(async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str resource_subtype: + :param str file: + :param str parent: + :param str url: + :param str name: + :param bool connect_to_app: + :param list[str] opt_fields: This endpoint returns a compact resource, which excludes some properties by default. To include those optional properties, set this query parameter to a comma-separated list of the properties you wish to include. + :return: AttachmentResponseData + If the method is called asynchronously, + returns the request thread. + """ + + all_params = ['resource_subtype', 'file', 'parent', 'url', 'name', 'connect_to_app', 'opt_fields'] # noqa: E501 + all_params.append('async_req') + all_params.append('header_params') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + params = locals() + for key, val in six.iteritems(params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method create_attachment_for_object" % key + ) + params[key] = val + del params['kwargs'] + + collection_formats = {} + + path_params = {} + + query_params = [] + if 'opt_fields' in params: + query_params.append(('opt_fields', params['opt_fields'])) # noqa: E501 + collection_formats['opt_fields'] = 'csv' # noqa: E501 + + header_params = kwargs.get("header_params", {}) + + form_params = [] + local_var_files = {} + if 'resource_subtype' in params: + form_params.append(('resource_subtype', params['resource_subtype'])) # noqa: E501 + if 'file' in params: + local_var_files['file'] = params['file'] # noqa: E501 + if 'parent' in params: + form_params.append(('parent', params['parent'])) # noqa: E501 + if 'url' in params: + form_params.append(('url', params['url'])) # noqa: E501 + if 'name' in params: + form_params.append(('name', params['name'])) # noqa: E501 + if 'connect_to_app' in params: + form_params.append(('connect_to_app', params['connect_to_app'])) # noqa: E501 + + body_params = None + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['application/json; charset=UTF-8']) # noqa: E501 + + # HTTP header `Content-Type` + header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 + ['multipart/form-data']) # noqa: E501 + + # Authentication setting + auth_settings = ['oauth2'] # noqa: E501 + + return self.api_client.call_api( + '/attachments', 'POST', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='AttachmentResponseData', # noqa: E501 + auth_settings=auth_settings, + async_req=params.get('async_req'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) + +def delete_attachment(self, attachment_gid, **kwargs): # noqa: E501 + """Delete an attachment # noqa: E501 + + Deletes a specific, existing attachment. Returns an empty data record. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.delete_attachment(attachment_gid, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str attachment_gid: Globally unique identifier for the attachment. (required) + :return: EmptyResponseData + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = kwargs.get("_return_http_data_only", True) + if kwargs.get('async_req'): + return self.delete_attachment_with_http_info(attachment_gid, **kwargs) # noqa: E501 + else: + (data) = self.delete_attachment_with_http_info(attachment_gid, **kwargs) # noqa: E501 + return data + +def delete_attachment_with_http_info(self, attachment_gid, **kwargs): # noqa: E501 + """Delete an attachment # noqa: E501 + + Deletes a specific, existing attachment. Returns an empty data record. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.delete_attachment_with_http_info(attachment_gid, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str attachment_gid: Globally unique identifier for the attachment. (required) + :return: EmptyResponseData + If the method is called asynchronously, + returns the request thread. + """ + + all_params = ['attachment_gid'] # noqa: E501 + all_params.append('async_req') + all_params.append('header_params') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + params = locals() + for key, val in six.iteritems(params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method delete_attachment" % key + ) + params[key] = val + del params['kwargs'] + # verify the required parameter 'attachment_gid' is set + if ('attachment_gid' not in params or + params['attachment_gid'] is None): + raise ValueError("Missing the required parameter `attachment_gid` when calling `delete_attachment`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'attachment_gid' in params: + path_params['attachment_gid'] = params['attachment_gid'] # noqa: E501 + + query_params = [] + + header_params = kwargs.get("header_params", {}) + + form_params = [] + local_var_files = {} + + body_params = None + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['application/json; charset=UTF-8']) # noqa: E501 + + # Authentication setting + auth_settings = ['oauth2'] # noqa: E501 + + return self.api_client.call_api( + '/attachments/{attachment_gid}', 'DELETE', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='EmptyResponseData', # noqa: E501 + auth_settings=auth_settings, + async_req=params.get('async_req'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) + +def get_attachment(self, attachment_gid, **kwargs): # noqa: E501 + """Get an attachment # noqa: E501 + + Get the full record for a single attachment. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.get_attachment(attachment_gid, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str attachment_gid: Globally unique identifier for the attachment. (required) + :param list[str] opt_fields: This endpoint returns a compact resource, which excludes some properties by default. To include those optional properties, set this query parameter to a comma-separated list of the properties you wish to include. + :return: AttachmentResponseData + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = kwargs.get("_return_http_data_only", True) + if kwargs.get('async_req'): + return self.get_attachment_with_http_info(attachment_gid, **kwargs) # noqa: E501 + else: + (data) = self.get_attachment_with_http_info(attachment_gid, **kwargs) # noqa: E501 + return data + +def get_attachment_with_http_info(self, attachment_gid, **kwargs): # noqa: E501 + """Get an attachment # noqa: E501 + + Get the full record for a single attachment. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.get_attachment_with_http_info(attachment_gid, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str attachment_gid: Globally unique identifier for the attachment. (required) + :param list[str] opt_fields: This endpoint returns a compact resource, which excludes some properties by default. To include those optional properties, set this query parameter to a comma-separated list of the properties you wish to include. + :return: AttachmentResponseData + If the method is called asynchronously, + returns the request thread. + """ + + all_params = ['attachment_gid', 'opt_fields'] # noqa: E501 + all_params.append('async_req') + all_params.append('header_params') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + params = locals() + for key, val in six.iteritems(params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method get_attachment" % key + ) + params[key] = val + del params['kwargs'] + # verify the required parameter 'attachment_gid' is set + if ('attachment_gid' not in params or + params['attachment_gid'] is None): + raise ValueError("Missing the required parameter `attachment_gid` when calling `get_attachment`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'attachment_gid' in params: + path_params['attachment_gid'] = params['attachment_gid'] # noqa: E501 + + query_params = [] + if 'opt_fields' in params: + query_params.append(('opt_fields', params['opt_fields'])) # noqa: E501 + collection_formats['opt_fields'] = 'csv' # noqa: E501 + + header_params = kwargs.get("header_params", {}) + + form_params = [] + local_var_files = {} + + body_params = None + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['application/json; charset=UTF-8']) # noqa: E501 + + # Authentication setting + auth_settings = ['oauth2'] # noqa: E501 + + return self.api_client.call_api( + '/attachments/{attachment_gid}', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='AttachmentResponseData', # noqa: E501 + auth_settings=auth_settings, + async_req=params.get('async_req'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) + +def get_attachments_for_object(self, parent, **kwargs): # noqa: E501 + """Get attachments from an object # noqa: E501 + + Returns the compact records for all attachments on the object. There are three possible `parent` values for this request: `project`, `project_brief`, and `task`. For a project, an attachment refers to a file uploaded to the \"Key resources\" section in the project Overview. For a project brief, an attachment refers to inline files in the project brief itself. For a task, an attachment refers to a file directly associated to that task. Note that within the Asana app, inline images in the task description do not appear in the index of image thumbnails nor as stories in the task. However, requests made to `GET /attachments` for a task will return all of the images in the task, including inline images. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.get_attachments_for_object(parent, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str parent: Globally unique identifier for object to fetch statuses from. Must be a GID for a `project`, `project_brief`, or `task`. (required) + :param int limit: Results per page. The number of objects to return per page. The value must be between 1 and 100. + :param str offset: 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 list[str] opt_fields: This endpoint returns a compact resource, which excludes some properties by default. To include those optional properties, set this query parameter to a comma-separated list of the properties you wish to include. + :return: AttachmentResponseArray + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = kwargs.get("_return_http_data_only", True) + if kwargs.get('async_req'): + return self.get_attachments_for_object_with_http_info(parent, **kwargs) # noqa: E501 + else: + (data) = self.get_attachments_for_object_with_http_info(parent, **kwargs) # noqa: E501 + return data + +def get_attachments_for_object_with_http_info(self, parent, **kwargs): # noqa: E501 + """Get attachments from an object # noqa: E501 + + Returns the compact records for all attachments on the object. There are three possible `parent` values for this request: `project`, `project_brief`, and `task`. For a project, an attachment refers to a file uploaded to the \"Key resources\" section in the project Overview. For a project brief, an attachment refers to inline files in the project brief itself. For a task, an attachment refers to a file directly associated to that task. Note that within the Asana app, inline images in the task description do not appear in the index of image thumbnails nor as stories in the task. However, requests made to `GET /attachments` for a task will return all of the images in the task, including inline images. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.get_attachments_for_object_with_http_info(parent, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str parent: Globally unique identifier for object to fetch statuses from. Must be a GID for a `project`, `project_brief`, or `task`. (required) + :param int limit: Results per page. The number of objects to return per page. The value must be between 1 and 100. + :param str offset: 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 list[str] opt_fields: This endpoint returns a compact resource, which excludes some properties by default. To include those optional properties, set this query parameter to a comma-separated list of the properties you wish to include. + :return: AttachmentResponseArray + If the method is called asynchronously, + returns the request thread. """ - def __init__(self, api_client=None): - if api_client is None: - api_client = ApiClient() - self.api_client = api_client - - def create_attachment_for_object(self, **kwargs): # noqa: E501 - """Upload an attachment # noqa: E501 - - Upload an attachment. This method uploads an attachment on an object and returns the compact record for the created attachment object. This is possible by either: - Providing the URL of the external resource being attached, or - Downloading the file content first and then uploading it as any other attachment. Note that it is not possible to attach files from third party services such as Dropbox, Box, Vimeo & Google Drive via the API The 100MB size limit on attachments in Asana is enforced on this endpoint. This endpoint expects a multipart/form-data encoded request containing the full contents of the file to be uploaded. Requests made should follow the HTTP/1.1 specification that line terminators are of the form `CRLF` or `\\r\\n` outlined [here](http://www.w3.org/Protocols/HTTP/1.1/draft-ietf-http-v11-spec-01#Basic-Rules) in order for the server to reliably and properly handle the request. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.create_attachment_for_object(async_req=True) - >>> result = thread.get() - - :param async_req bool - :param str resource_subtype: - :param str file: - :param str parent: - :param str url: - :param str name: - :param bool connect_to_app: - :param list[str] opt_fields: This endpoint returns a compact resource, which excludes some properties by default. To include those optional properties, set this query parameter to a comma-separated list of the properties you wish to include. - :return: AttachmentResponseData - If the method is called asynchronously, - returns the request thread. - """ - kwargs['_return_http_data_only'] = True - if kwargs.get('async_req'): - return self.create_attachment_for_object_with_http_info(**kwargs) # noqa: E501 - else: - (data) = self.create_attachment_for_object_with_http_info(**kwargs) # noqa: E501 - return data - - def create_attachment_for_object_with_http_info(self, **kwargs): # noqa: E501 - """Upload an attachment # noqa: E501 - - Upload an attachment. This method uploads an attachment on an object and returns the compact record for the created attachment object. This is possible by either: - Providing the URL of the external resource being attached, or - Downloading the file content first and then uploading it as any other attachment. Note that it is not possible to attach files from third party services such as Dropbox, Box, Vimeo & Google Drive via the API The 100MB size limit on attachments in Asana is enforced on this endpoint. This endpoint expects a multipart/form-data encoded request containing the full contents of the file to be uploaded. Requests made should follow the HTTP/1.1 specification that line terminators are of the form `CRLF` or `\\r\\n` outlined [here](http://www.w3.org/Protocols/HTTP/1.1/draft-ietf-http-v11-spec-01#Basic-Rules) in order for the server to reliably and properly handle the request. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.create_attachment_for_object_with_http_info(async_req=True) - >>> result = thread.get() - - :param async_req bool - :param str resource_subtype: - :param str file: - :param str parent: - :param str url: - :param str name: - :param bool connect_to_app: - :param list[str] opt_fields: This endpoint returns a compact resource, which excludes some properties by default. To include those optional properties, set this query parameter to a comma-separated list of the properties you wish to include. - :return: AttachmentResponseData - If the method is called asynchronously, - returns the request thread. - """ - - all_params = ['resource_subtype', 'file', 'parent', 'url', 'name', 'connect_to_app', 'opt_fields'] # noqa: E501 - all_params.append('async_req') - all_params.append('_return_http_data_only') - all_params.append('_preload_content') - all_params.append('_request_timeout') - - params = locals() - for key, val in six.iteritems(params['kwargs']): - if key not in all_params: - raise TypeError( - "Got an unexpected keyword argument '%s'" - " to method create_attachment_for_object" % key - ) - params[key] = val - del params['kwargs'] - - collection_formats = {} - - path_params = {} - - query_params = [] - if 'opt_fields' in params: - query_params.append(('opt_fields', params['opt_fields'])) # noqa: E501 - collection_formats['opt_fields'] = 'csv' # noqa: E501 - - header_params = {} - - form_params = [] - local_var_files = {} - if 'resource_subtype' in params: - form_params.append(('resource_subtype', params['resource_subtype'])) # noqa: E501 - if 'file' in params: - local_var_files['file'] = params['file'] # noqa: E501 - if 'parent' in params: - form_params.append(('parent', params['parent'])) # noqa: E501 - if 'url' in params: - form_params.append(('url', params['url'])) # noqa: E501 - if 'name' in params: - form_params.append(('name', params['name'])) # noqa: E501 - if 'connect_to_app' in params: - form_params.append(('connect_to_app', params['connect_to_app'])) # noqa: E501 - - body_params = None - # HTTP header `Accept` - header_params['Accept'] = self.api_client.select_header_accept( - ['application/json; charset=UTF-8']) # noqa: E501 - - # HTTP header `Content-Type` - header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 - ['multipart/form-data']) # noqa: E501 - - # Authentication setting - auth_settings = ['oauth2'] # noqa: E501 - - return self.api_client.call_api( - '/attachments', 'POST', - path_params, - query_params, - header_params, - body=body_params, - post_params=form_params, - files=local_var_files, - response_type='AttachmentResponseData', # noqa: E501 - auth_settings=auth_settings, - async_req=params.get('async_req'), - _return_http_data_only=params.get('_return_http_data_only'), - _preload_content=params.get('_preload_content', True), - _request_timeout=params.get('_request_timeout'), - collection_formats=collection_formats) - - def delete_attachment(self, attachment_gid, **kwargs): # noqa: E501 - """Delete an attachment # noqa: E501 - - Deletes a specific, existing attachment. Returns an empty data record. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.delete_attachment(attachment_gid, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param str attachment_gid: Globally unique identifier for the attachment. (required) - :return: EmptyResponseData - If the method is called asynchronously, - returns the request thread. - """ - kwargs['_return_http_data_only'] = True - if kwargs.get('async_req'): - return self.delete_attachment_with_http_info(attachment_gid, **kwargs) # noqa: E501 - else: - (data) = self.delete_attachment_with_http_info(attachment_gid, **kwargs) # noqa: E501 - return data - - def delete_attachment_with_http_info(self, attachment_gid, **kwargs): # noqa: E501 - """Delete an attachment # noqa: E501 - - Deletes a specific, existing attachment. Returns an empty data record. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.delete_attachment_with_http_info(attachment_gid, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param str attachment_gid: Globally unique identifier for the attachment. (required) - :return: EmptyResponseData - If the method is called asynchronously, - returns the request thread. - """ - - all_params = ['attachment_gid'] # noqa: E501 - all_params.append('async_req') - all_params.append('_return_http_data_only') - all_params.append('_preload_content') - all_params.append('_request_timeout') - - params = locals() - for key, val in six.iteritems(params['kwargs']): - if key not in all_params: - raise TypeError( - "Got an unexpected keyword argument '%s'" - " to method delete_attachment" % key - ) - params[key] = val - del params['kwargs'] - # verify the required parameter 'attachment_gid' is set - if ('attachment_gid' not in params or - params['attachment_gid'] is None): - raise ValueError("Missing the required parameter `attachment_gid` when calling `delete_attachment`") # noqa: E501 - - collection_formats = {} - - path_params = {} - if 'attachment_gid' in params: - path_params['attachment_gid'] = params['attachment_gid'] # noqa: E501 - - query_params = [] - - header_params = {} - - form_params = [] - local_var_files = {} - - body_params = None - # HTTP header `Accept` - header_params['Accept'] = self.api_client.select_header_accept( - ['application/json; charset=UTF-8']) # noqa: E501 - - # Authentication setting - auth_settings = ['oauth2'] # noqa: E501 - - return self.api_client.call_api( - '/attachments/{attachment_gid}', 'DELETE', - path_params, - query_params, - header_params, - body=body_params, - post_params=form_params, - files=local_var_files, - response_type='EmptyResponseData', # noqa: E501 - auth_settings=auth_settings, - async_req=params.get('async_req'), - _return_http_data_only=params.get('_return_http_data_only'), - _preload_content=params.get('_preload_content', True), - _request_timeout=params.get('_request_timeout'), - collection_formats=collection_formats) - - def get_attachment(self, attachment_gid, **kwargs): # noqa: E501 - """Get an attachment # noqa: E501 - - Get the full record for a single attachment. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.get_attachment(attachment_gid, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param str attachment_gid: Globally unique identifier for the attachment. (required) - :param list[str] opt_fields: This endpoint returns a compact resource, which excludes some properties by default. To include those optional properties, set this query parameter to a comma-separated list of the properties you wish to include. - :return: AttachmentResponseData - If the method is called asynchronously, - returns the request thread. - """ - kwargs['_return_http_data_only'] = True - if kwargs.get('async_req'): - return self.get_attachment_with_http_info(attachment_gid, **kwargs) # noqa: E501 - else: - (data) = self.get_attachment_with_http_info(attachment_gid, **kwargs) # noqa: E501 - return data - - def get_attachment_with_http_info(self, attachment_gid, **kwargs): # noqa: E501 - """Get an attachment # noqa: E501 - - Get the full record for a single attachment. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.get_attachment_with_http_info(attachment_gid, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param str attachment_gid: Globally unique identifier for the attachment. (required) - :param list[str] opt_fields: This endpoint returns a compact resource, which excludes some properties by default. To include those optional properties, set this query parameter to a comma-separated list of the properties you wish to include. - :return: AttachmentResponseData - If the method is called asynchronously, - returns the request thread. - """ - - all_params = ['attachment_gid', 'opt_fields'] # noqa: E501 - all_params.append('async_req') - all_params.append('_return_http_data_only') - all_params.append('_preload_content') - all_params.append('_request_timeout') - - params = locals() - for key, val in six.iteritems(params['kwargs']): - if key not in all_params: - raise TypeError( - "Got an unexpected keyword argument '%s'" - " to method get_attachment" % key - ) - params[key] = val - del params['kwargs'] - # verify the required parameter 'attachment_gid' is set - if ('attachment_gid' not in params or - params['attachment_gid'] is None): - raise ValueError("Missing the required parameter `attachment_gid` when calling `get_attachment`") # noqa: E501 - - collection_formats = {} - - path_params = {} - if 'attachment_gid' in params: - path_params['attachment_gid'] = params['attachment_gid'] # noqa: E501 - - query_params = [] - if 'opt_fields' in params: - query_params.append(('opt_fields', params['opt_fields'])) # noqa: E501 - collection_formats['opt_fields'] = 'csv' # noqa: E501 - - header_params = {} - - form_params = [] - local_var_files = {} - - body_params = None - # HTTP header `Accept` - header_params['Accept'] = self.api_client.select_header_accept( - ['application/json; charset=UTF-8']) # noqa: E501 - - # Authentication setting - auth_settings = ['oauth2'] # noqa: E501 - - return self.api_client.call_api( - '/attachments/{attachment_gid}', 'GET', - path_params, - query_params, - header_params, - body=body_params, - post_params=form_params, - files=local_var_files, - response_type='AttachmentResponseData', # noqa: E501 - auth_settings=auth_settings, - async_req=params.get('async_req'), - _return_http_data_only=params.get('_return_http_data_only'), - _preload_content=params.get('_preload_content', True), - _request_timeout=params.get('_request_timeout'), - collection_formats=collection_formats) - - def get_attachments_for_object(self, parent, **kwargs): # noqa: E501 - """Get attachments from an object # noqa: E501 - - Returns the compact records for all attachments on the object. There are three possible `parent` values for this request: `project`, `project_brief`, and `task`. For a project, an attachment refers to a file uploaded to the \"Key resources\" section in the project Overview. For a project brief, an attachment refers to inline files in the project brief itself. For a task, an attachment refers to a file directly associated to that task. Note that within the Asana app, inline images in the task description do not appear in the index of image thumbnails nor as stories in the task. However, requests made to `GET /attachments` for a task will return all of the images in the task, including inline images. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.get_attachments_for_object(parent, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param str parent: Globally unique identifier for object to fetch statuses from. Must be a GID for a `project`, `project_brief`, or `task`. (required) - :param int limit: Results per page. The number of objects to return per page. The value must be between 1 and 100. - :param str offset: 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 list[str] opt_fields: This endpoint returns a compact resource, which excludes some properties by default. To include those optional properties, set this query parameter to a comma-separated list of the properties you wish to include. - :return: AttachmentResponseArray - If the method is called asynchronously, - returns the request thread. - """ - kwargs['_return_http_data_only'] = True - if kwargs.get('async_req'): - return self.get_attachments_for_object_with_http_info(parent, **kwargs) # noqa: E501 - else: - (data) = self.get_attachments_for_object_with_http_info(parent, **kwargs) # noqa: E501 - return data - - def get_attachments_for_object_with_http_info(self, parent, **kwargs): # noqa: E501 - """Get attachments from an object # noqa: E501 - - Returns the compact records for all attachments on the object. There are three possible `parent` values for this request: `project`, `project_brief`, and `task`. For a project, an attachment refers to a file uploaded to the \"Key resources\" section in the project Overview. For a project brief, an attachment refers to inline files in the project brief itself. For a task, an attachment refers to a file directly associated to that task. Note that within the Asana app, inline images in the task description do not appear in the index of image thumbnails nor as stories in the task. However, requests made to `GET /attachments` for a task will return all of the images in the task, including inline images. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.get_attachments_for_object_with_http_info(parent, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param str parent: Globally unique identifier for object to fetch statuses from. Must be a GID for a `project`, `project_brief`, or `task`. (required) - :param int limit: Results per page. The number of objects to return per page. The value must be between 1 and 100. - :param str offset: 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 list[str] opt_fields: This endpoint returns a compact resource, which excludes some properties by default. To include those optional properties, set this query parameter to a comma-separated list of the properties you wish to include. - :return: AttachmentResponseArray - If the method is called asynchronously, - returns the request thread. - """ - - all_params = ['parent', 'limit', 'offset', 'opt_fields'] # noqa: E501 - all_params.append('async_req') - all_params.append('_return_http_data_only') - all_params.append('_preload_content') - all_params.append('_request_timeout') - - params = locals() - for key, val in six.iteritems(params['kwargs']): - if key not in all_params: - raise TypeError( - "Got an unexpected keyword argument '%s'" - " to method get_attachments_for_object" % key - ) - params[key] = val - del params['kwargs'] - # verify the required parameter 'parent' is set - if ('parent' not in params or - params['parent'] is None): - raise ValueError("Missing the required parameter `parent` when calling `get_attachments_for_object`") # noqa: E501 - - collection_formats = {} - - path_params = {} - - query_params = [] - if 'limit' in params: - query_params.append(('limit', params['limit'])) # noqa: E501 - if 'offset' in params: - query_params.append(('offset', params['offset'])) # noqa: E501 - if 'parent' in params: - query_params.append(('parent', params['parent'])) # noqa: E501 - if 'opt_fields' in params: - query_params.append(('opt_fields', params['opt_fields'])) # noqa: E501 - collection_formats['opt_fields'] = 'csv' # noqa: E501 - - header_params = {} - - form_params = [] - local_var_files = {} - - body_params = None - # HTTP header `Accept` - header_params['Accept'] = self.api_client.select_header_accept( - ['application/json; charset=UTF-8']) # noqa: E501 - - # Authentication setting - auth_settings = ['oauth2'] # noqa: E501 - - return self.api_client.call_api( - '/attachments', 'GET', - path_params, - query_params, - header_params, - body=body_params, - post_params=form_params, - files=local_var_files, - response_type='AttachmentResponseArray', # noqa: E501 - auth_settings=auth_settings, - async_req=params.get('async_req'), - _return_http_data_only=params.get('_return_http_data_only'), - _preload_content=params.get('_preload_content', True), - _request_timeout=params.get('_request_timeout'), - collection_formats=collection_formats) + all_params = ['parent', 'limit', 'offset', 'opt_fields'] # noqa: E501 + all_params.append('async_req') + all_params.append('header_params') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + params = locals() + for key, val in six.iteritems(params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method get_attachments_for_object" % key + ) + params[key] = val + del params['kwargs'] + # verify the required parameter 'parent' is set + if ('parent' not in params or + params['parent'] is None): + raise ValueError("Missing the required parameter `parent` when calling `get_attachments_for_object`") # noqa: E501 + + collection_formats = {} + + path_params = {} + + query_params = [] + if 'limit' in params: + query_params.append(('limit', params['limit'])) # noqa: E501 + if 'offset' in params: + query_params.append(('offset', params['offset'])) # noqa: E501 + if 'parent' in params: + query_params.append(('parent', params['parent'])) # noqa: E501 + if 'opt_fields' in params: + query_params.append(('opt_fields', params['opt_fields'])) # noqa: E501 + collection_formats['opt_fields'] = 'csv' # noqa: E501 + + header_params = kwargs.get("header_params", {}) + + form_params = [] + local_var_files = {} + + body_params = None + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['application/json; charset=UTF-8']) # noqa: E501 + + # Authentication setting + auth_settings = ['oauth2'] # noqa: E501 + + return self.api_client.call_api( + '/attachments', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='AttachmentResponseArray', # noqa: E501 + auth_settings=auth_settings, + async_req=params.get('async_req'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) diff --git a/asana/api/audit_log_api_api.py b/asana/api/audit_log_api_api.py index fc30fc75..56a0b730 100644 --- a/asana/api/audit_log_api_api.py +++ b/asana/api/audit_log_api_api.py @@ -21,140 +21,141 @@ class AuditLogAPIApi(object): - """NOTE: This class is auto generated by the swagger code generator program. +"""NOTE: This class is auto generated by the swagger code generator program. - Do not edit the class manually. - Ref: https://github.com/swagger-api/swagger-codegen +Do not edit the class manually. +Ref: https://github.com/swagger-api/swagger-codegen +""" + +def __init__(self, api_client=None): + if api_client is None: + api_client = ApiClient() + self.api_client = api_client + +def get_audit_log_events(self, workspace_gid, **kwargs): # noqa: E501 + """Get audit log events # noqa: E501 + + Retrieve the audit log events that have been captured in your domain. This endpoint will return a list of [AuditLogEvent](/reference/audit-log-api) objects, sorted by creation time in ascending order. Note that the Audit Log API captures events from October 8th, 2021 and later. Queries for events before this date will not return results. There are a number of query parameters (below) that can be used to filter the set of [AuditLogEvent](/reference/audit-log-api) objects that are returned in the response. Any combination of query parameters is valid. When no filters are provided, all of the events that have been captured in your domain will match. The list of events will always be [paginated](/docs/pagination). The default limit is 1000 events. The next set of events can be retrieved using the `offset` from the previous response. If there are no events that match the provided filters in your domain, the endpoint will return `null` for the `next_page` field. Querying again with the same filters may return new events if they were captured after the last request. Once a response includes a `next_page` with an `offset`, subsequent requests can be made with the latest `offset` to poll for new events that match the provided filters. *Note: If the filters you provided match events in your domain and `next_page` is present in the response, we will continue to send `next_page` on subsequent requests even when there are no more events that match the filters. This was put in place so that you can implement an audit log stream that will return future events that match these filters. If you are not interested in future events that match the filters you have defined, you can rely on checking empty `data` response for the end of current events that match your filters.* When no `offset` is provided, the response will begin with the oldest events that match the provided filters. It is important to note that [AuditLogEvent](/reference/audit-log-api) objects will be permanently deleted from our systems after 90 days. If you wish to keep a permanent record of these events, we recommend using a SIEM tool to ingest and store these logs. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.get_audit_log_events(workspace_gid, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str workspace_gid: Globally unique identifier for the workspace or organization. (required) + :param datetime start_at: Filter to events created after this time (inclusive). + :param datetime end_at: Filter to events created before this time (exclusive). + :param str event_type: Filter to events of this type. Refer to the [supported audit log events](/docs/audit-log-events#supported-audit-log-events) for a full list of values. + :param str actor_type: 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. + :param str actor_gid: Filter to events triggered by the actor with this ID. + :param str resource_gid: Filter to events with this resource ID. + :param int limit: Results per page. The number of objects to return per page. The value must be between 1 and 100. + :param str offset: 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.' + :return: AuditLogEventArray + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = kwargs.get("_return_http_data_only", True) + if kwargs.get('async_req'): + return self.get_audit_log_events_with_http_info(workspace_gid, **kwargs) # noqa: E501 + else: + (data) = self.get_audit_log_events_with_http_info(workspace_gid, **kwargs) # noqa: E501 + return data + +def get_audit_log_events_with_http_info(self, workspace_gid, **kwargs): # noqa: E501 + """Get audit log events # noqa: E501 + + Retrieve the audit log events that have been captured in your domain. This endpoint will return a list of [AuditLogEvent](/reference/audit-log-api) objects, sorted by creation time in ascending order. Note that the Audit Log API captures events from October 8th, 2021 and later. Queries for events before this date will not return results. There are a number of query parameters (below) that can be used to filter the set of [AuditLogEvent](/reference/audit-log-api) objects that are returned in the response. Any combination of query parameters is valid. When no filters are provided, all of the events that have been captured in your domain will match. The list of events will always be [paginated](/docs/pagination). The default limit is 1000 events. The next set of events can be retrieved using the `offset` from the previous response. If there are no events that match the provided filters in your domain, the endpoint will return `null` for the `next_page` field. Querying again with the same filters may return new events if they were captured after the last request. Once a response includes a `next_page` with an `offset`, subsequent requests can be made with the latest `offset` to poll for new events that match the provided filters. *Note: If the filters you provided match events in your domain and `next_page` is present in the response, we will continue to send `next_page` on subsequent requests even when there are no more events that match the filters. This was put in place so that you can implement an audit log stream that will return future events that match these filters. If you are not interested in future events that match the filters you have defined, you can rely on checking empty `data` response for the end of current events that match your filters.* When no `offset` is provided, the response will begin with the oldest events that match the provided filters. It is important to note that [AuditLogEvent](/reference/audit-log-api) objects will be permanently deleted from our systems after 90 days. If you wish to keep a permanent record of these events, we recommend using a SIEM tool to ingest and store these logs. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.get_audit_log_events_with_http_info(workspace_gid, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str workspace_gid: Globally unique identifier for the workspace or organization. (required) + :param datetime start_at: Filter to events created after this time (inclusive). + :param datetime end_at: Filter to events created before this time (exclusive). + :param str event_type: Filter to events of this type. Refer to the [supported audit log events](/docs/audit-log-events#supported-audit-log-events) for a full list of values. + :param str actor_type: 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. + :param str actor_gid: Filter to events triggered by the actor with this ID. + :param str resource_gid: Filter to events with this resource ID. + :param int limit: Results per page. The number of objects to return per page. The value must be between 1 and 100. + :param str offset: 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.' + :return: AuditLogEventArray + If the method is called asynchronously, + returns the request thread. """ - def __init__(self, api_client=None): - if api_client is None: - api_client = ApiClient() - self.api_client = api_client - - def get_audit_log_events(self, workspace_gid, **kwargs): # noqa: E501 - """Get audit log events # noqa: E501 - - Retrieve the audit log events that have been captured in your domain. This endpoint will return a list of [AuditLogEvent](/reference/audit-log-api) objects, sorted by creation time in ascending order. Note that the Audit Log API captures events from October 8th, 2021 and later. Queries for events before this date will not return results. There are a number of query parameters (below) that can be used to filter the set of [AuditLogEvent](/reference/audit-log-api) objects that are returned in the response. Any combination of query parameters is valid. When no filters are provided, all of the events that have been captured in your domain will match. The list of events will always be [paginated](/docs/pagination). The default limit is 1000 events. The next set of events can be retrieved using the `offset` from the previous response. If there are no events that match the provided filters in your domain, the endpoint will return `null` for the `next_page` field. Querying again with the same filters may return new events if they were captured after the last request. Once a response includes a `next_page` with an `offset`, subsequent requests can be made with the latest `offset` to poll for new events that match the provided filters. *Note: If the filters you provided match events in your domain and `next_page` is present in the response, we will continue to send `next_page` on subsequent requests even when there are no more events that match the filters. This was put in place so that you can implement an audit log stream that will return future events that match these filters. If you are not interested in future events that match the filters you have defined, you can rely on checking empty `data` response for the end of current events that match your filters.* When no `offset` is provided, the response will begin with the oldest events that match the provided filters. It is important to note that [AuditLogEvent](/reference/audit-log-api) objects will be permanently deleted from our systems after 90 days. If you wish to keep a permanent record of these events, we recommend using a SIEM tool to ingest and store these logs. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.get_audit_log_events(workspace_gid, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param str workspace_gid: Globally unique identifier for the workspace or organization. (required) - :param datetime start_at: Filter to events created after this time (inclusive). - :param datetime end_at: Filter to events created before this time (exclusive). - :param str event_type: Filter to events of this type. Refer to the [supported audit log events](/docs/audit-log-events#supported-audit-log-events) for a full list of values. - :param str actor_type: 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. - :param str actor_gid: Filter to events triggered by the actor with this ID. - :param str resource_gid: Filter to events with this resource ID. - :param int limit: Results per page. The number of objects to return per page. The value must be between 1 and 100. - :param str offset: 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.' - :return: AuditLogEventArray - If the method is called asynchronously, - returns the request thread. - """ - kwargs['_return_http_data_only'] = True - if kwargs.get('async_req'): - return self.get_audit_log_events_with_http_info(workspace_gid, **kwargs) # noqa: E501 - else: - (data) = self.get_audit_log_events_with_http_info(workspace_gid, **kwargs) # noqa: E501 - return data - - def get_audit_log_events_with_http_info(self, workspace_gid, **kwargs): # noqa: E501 - """Get audit log events # noqa: E501 - - Retrieve the audit log events that have been captured in your domain. This endpoint will return a list of [AuditLogEvent](/reference/audit-log-api) objects, sorted by creation time in ascending order. Note that the Audit Log API captures events from October 8th, 2021 and later. Queries for events before this date will not return results. There are a number of query parameters (below) that can be used to filter the set of [AuditLogEvent](/reference/audit-log-api) objects that are returned in the response. Any combination of query parameters is valid. When no filters are provided, all of the events that have been captured in your domain will match. The list of events will always be [paginated](/docs/pagination). The default limit is 1000 events. The next set of events can be retrieved using the `offset` from the previous response. If there are no events that match the provided filters in your domain, the endpoint will return `null` for the `next_page` field. Querying again with the same filters may return new events if they were captured after the last request. Once a response includes a `next_page` with an `offset`, subsequent requests can be made with the latest `offset` to poll for new events that match the provided filters. *Note: If the filters you provided match events in your domain and `next_page` is present in the response, we will continue to send `next_page` on subsequent requests even when there are no more events that match the filters. This was put in place so that you can implement an audit log stream that will return future events that match these filters. If you are not interested in future events that match the filters you have defined, you can rely on checking empty `data` response for the end of current events that match your filters.* When no `offset` is provided, the response will begin with the oldest events that match the provided filters. It is important to note that [AuditLogEvent](/reference/audit-log-api) objects will be permanently deleted from our systems after 90 days. If you wish to keep a permanent record of these events, we recommend using a SIEM tool to ingest and store these logs. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.get_audit_log_events_with_http_info(workspace_gid, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param str workspace_gid: Globally unique identifier for the workspace or organization. (required) - :param datetime start_at: Filter to events created after this time (inclusive). - :param datetime end_at: Filter to events created before this time (exclusive). - :param str event_type: Filter to events of this type. Refer to the [supported audit log events](/docs/audit-log-events#supported-audit-log-events) for a full list of values. - :param str actor_type: 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. - :param str actor_gid: Filter to events triggered by the actor with this ID. - :param str resource_gid: Filter to events with this resource ID. - :param int limit: Results per page. The number of objects to return per page. The value must be between 1 and 100. - :param str offset: 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.' - :return: AuditLogEventArray - If the method is called asynchronously, - returns the request thread. - """ - - all_params = ['workspace_gid', 'start_at', 'end_at', 'event_type', 'actor_type', 'actor_gid', 'resource_gid', 'limit', 'offset'] # noqa: E501 - all_params.append('async_req') - all_params.append('_return_http_data_only') - all_params.append('_preload_content') - all_params.append('_request_timeout') - - params = locals() - for key, val in six.iteritems(params['kwargs']): - if key not in all_params: - raise TypeError( - "Got an unexpected keyword argument '%s'" - " to method get_audit_log_events" % key - ) - params[key] = val - del params['kwargs'] - # verify the required parameter 'workspace_gid' is set - if ('workspace_gid' not in params or - params['workspace_gid'] is None): - raise ValueError("Missing the required parameter `workspace_gid` when calling `get_audit_log_events`") # noqa: E501 - - collection_formats = {} - - path_params = {} - if 'workspace_gid' in params: - path_params['workspace_gid'] = params['workspace_gid'] # noqa: E501 - - query_params = [] - if 'start_at' in params: - query_params.append(('start_at', params['start_at'])) # noqa: E501 - if 'end_at' in params: - query_params.append(('end_at', params['end_at'])) # noqa: E501 - if 'event_type' in params: - query_params.append(('event_type', params['event_type'])) # noqa: E501 - if 'actor_type' in params: - query_params.append(('actor_type', params['actor_type'])) # noqa: E501 - if 'actor_gid' in params: - query_params.append(('actor_gid', params['actor_gid'])) # noqa: E501 - if 'resource_gid' in params: - query_params.append(('resource_gid', params['resource_gid'])) # noqa: E501 - if 'limit' in params: - query_params.append(('limit', params['limit'])) # noqa: E501 - if 'offset' in params: - query_params.append(('offset', params['offset'])) # noqa: E501 - - header_params = {} - - form_params = [] - local_var_files = {} - - body_params = None - # HTTP header `Accept` - header_params['Accept'] = self.api_client.select_header_accept( - ['application/json; charset=UTF-8']) # noqa: E501 - - # Authentication setting - auth_settings = ['oauth2'] # noqa: E501 - - return self.api_client.call_api( - '/workspaces/{workspace_gid}/audit_log_events', 'GET', - path_params, - query_params, - header_params, - body=body_params, - post_params=form_params, - files=local_var_files, - response_type='AuditLogEventArray', # noqa: E501 - auth_settings=auth_settings, - async_req=params.get('async_req'), - _return_http_data_only=params.get('_return_http_data_only'), - _preload_content=params.get('_preload_content', True), - _request_timeout=params.get('_request_timeout'), - collection_formats=collection_formats) + all_params = ['workspace_gid', 'start_at', 'end_at', 'event_type', 'actor_type', 'actor_gid', 'resource_gid', 'limit', 'offset'] # noqa: E501 + all_params.append('async_req') + all_params.append('header_params') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + params = locals() + for key, val in six.iteritems(params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method get_audit_log_events" % key + ) + params[key] = val + del params['kwargs'] + # verify the required parameter 'workspace_gid' is set + if ('workspace_gid' not in params or + params['workspace_gid'] is None): + raise ValueError("Missing the required parameter `workspace_gid` when calling `get_audit_log_events`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'workspace_gid' in params: + path_params['workspace_gid'] = params['workspace_gid'] # noqa: E501 + + query_params = [] + if 'start_at' in params: + query_params.append(('start_at', params['start_at'])) # noqa: E501 + if 'end_at' in params: + query_params.append(('end_at', params['end_at'])) # noqa: E501 + if 'event_type' in params: + query_params.append(('event_type', params['event_type'])) # noqa: E501 + if 'actor_type' in params: + query_params.append(('actor_type', params['actor_type'])) # noqa: E501 + if 'actor_gid' in params: + query_params.append(('actor_gid', params['actor_gid'])) # noqa: E501 + if 'resource_gid' in params: + query_params.append(('resource_gid', params['resource_gid'])) # noqa: E501 + if 'limit' in params: + query_params.append(('limit', params['limit'])) # noqa: E501 + if 'offset' in params: + query_params.append(('offset', params['offset'])) # noqa: E501 + + header_params = kwargs.get("header_params", {}) + + form_params = [] + local_var_files = {} + + body_params = None + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['application/json; charset=UTF-8']) # noqa: E501 + + # Authentication setting + auth_settings = ['oauth2'] # noqa: E501 + + return self.api_client.call_api( + '/workspaces/{workspace_gid}/audit_log_events', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='AuditLogEventArray', # noqa: E501 + auth_settings=auth_settings, + async_req=params.get('async_req'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) diff --git a/asana/api/batch_api_api.py b/asana/api/batch_api_api.py index fd9759e9..ef0a9797 100644 --- a/asana/api/batch_api_api.py +++ b/asana/api/batch_api_api.py @@ -21,117 +21,118 @@ class BatchAPIApi(object): - """NOTE: This class is auto generated by the swagger code generator program. +"""NOTE: This class is auto generated by the swagger code generator program. - Do not edit the class manually. - Ref: https://github.com/swagger-api/swagger-codegen +Do not edit the class manually. +Ref: https://github.com/swagger-api/swagger-codegen +""" + +def __init__(self, api_client=None): + if api_client is None: + api_client = ApiClient() + self.api_client = api_client + +def create_batch_request(self, body, **kwargs): # noqa: E501 + """Submit parallel requests # noqa: E501 + + Make multiple requests in parallel to Asana's API. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.create_batch_request(body, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param BatchBody body: The requests to batch together via the Batch API. (required) + :param list[str] opt_fields: This endpoint returns a compact resource, which excludes some properties by default. To include those optional properties, set this query parameter to a comma-separated list of the properties you wish to include. + :return: BatchResponseArray + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = kwargs.get("_return_http_data_only", True) + if kwargs.get('async_req'): + return self.create_batch_request_with_http_info(body, **kwargs) # noqa: E501 + else: + (data) = self.create_batch_request_with_http_info(body, **kwargs) # noqa: E501 + return data + +def create_batch_request_with_http_info(self, body, **kwargs): # noqa: E501 + """Submit parallel requests # noqa: E501 + + Make multiple requests in parallel to Asana's API. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.create_batch_request_with_http_info(body, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param BatchBody body: The requests to batch together via the Batch API. (required) + :param list[str] opt_fields: This endpoint returns a compact resource, which excludes some properties by default. To include those optional properties, set this query parameter to a comma-separated list of the properties you wish to include. + :return: BatchResponseArray + If the method is called asynchronously, + returns the request thread. """ - def __init__(self, api_client=None): - if api_client is None: - api_client = ApiClient() - self.api_client = api_client - - def create_batch_request(self, body, **kwargs): # noqa: E501 - """Submit parallel requests # noqa: E501 - - Make multiple requests in parallel to Asana's API. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.create_batch_request(body, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param BatchBody body: The requests to batch together via the Batch API. (required) - :param list[str] opt_fields: This endpoint returns a compact resource, which excludes some properties by default. To include those optional properties, set this query parameter to a comma-separated list of the properties you wish to include. - :return: BatchResponseArray - If the method is called asynchronously, - returns the request thread. - """ - kwargs['_return_http_data_only'] = True - if kwargs.get('async_req'): - return self.create_batch_request_with_http_info(body, **kwargs) # noqa: E501 - else: - (data) = self.create_batch_request_with_http_info(body, **kwargs) # noqa: E501 - return data - - def create_batch_request_with_http_info(self, body, **kwargs): # noqa: E501 - """Submit parallel requests # noqa: E501 - - Make multiple requests in parallel to Asana's API. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.create_batch_request_with_http_info(body, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param BatchBody body: The requests to batch together via the Batch API. (required) - :param list[str] opt_fields: This endpoint returns a compact resource, which excludes some properties by default. To include those optional properties, set this query parameter to a comma-separated list of the properties you wish to include. - :return: BatchResponseArray - If the method is called asynchronously, - returns the request thread. - """ - - all_params = ['body', 'opt_fields'] # noqa: E501 - all_params.append('async_req') - all_params.append('_return_http_data_only') - all_params.append('_preload_content') - all_params.append('_request_timeout') - - params = locals() - for key, val in six.iteritems(params['kwargs']): - if key not in all_params: - raise TypeError( - "Got an unexpected keyword argument '%s'" - " to method create_batch_request" % key - ) - params[key] = val - del params['kwargs'] - # verify the required parameter 'body' is set - if ('body' not in params or - params['body'] is None): - raise ValueError("Missing the required parameter `body` when calling `create_batch_request`") # noqa: E501 - - collection_formats = {} - - path_params = {} - - query_params = [] - if 'opt_fields' in params: - query_params.append(('opt_fields', params['opt_fields'])) # noqa: E501 - collection_formats['opt_fields'] = 'csv' # noqa: E501 - - header_params = {} - - form_params = [] - local_var_files = {} - - body_params = None - if 'body' in params: - body_params = params['body'] - # HTTP header `Accept` - header_params['Accept'] = self.api_client.select_header_accept( - ['application/json; charset=UTF-8']) # noqa: E501 - - # HTTP header `Content-Type` - header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 - ['application/json; charset=UTF-8']) # noqa: E501 - - # Authentication setting - auth_settings = ['oauth2'] # noqa: E501 - - return self.api_client.call_api( - '/batch', 'POST', - path_params, - query_params, - header_params, - body=body_params, - post_params=form_params, - files=local_var_files, - response_type='BatchResponseArray', # noqa: E501 - auth_settings=auth_settings, - async_req=params.get('async_req'), - _return_http_data_only=params.get('_return_http_data_only'), - _preload_content=params.get('_preload_content', True), - _request_timeout=params.get('_request_timeout'), - collection_formats=collection_formats) + all_params = ['body', 'opt_fields'] # noqa: E501 + all_params.append('async_req') + all_params.append('header_params') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + params = locals() + for key, val in six.iteritems(params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method create_batch_request" % key + ) + params[key] = val + del params['kwargs'] + # verify the required parameter 'body' is set + if ('body' not in params or + params['body'] is None): + raise ValueError("Missing the required parameter `body` when calling `create_batch_request`") # noqa: E501 + + collection_formats = {} + + path_params = {} + + query_params = [] + if 'opt_fields' in params: + query_params.append(('opt_fields', params['opt_fields'])) # noqa: E501 + collection_formats['opt_fields'] = 'csv' # noqa: E501 + + header_params = kwargs.get("header_params", {}) + + form_params = [] + local_var_files = {} + + body_params = None + if 'body' in params: + body_params = params['body'] + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['application/json; charset=UTF-8']) # noqa: E501 + + # HTTP header `Content-Type` + header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 + ['application/json; charset=UTF-8']) # noqa: E501 + + # Authentication setting + auth_settings = ['oauth2'] # noqa: E501 + + return self.api_client.call_api( + '/batch', 'POST', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='BatchResponseArray', # noqa: E501 + auth_settings=auth_settings, + async_req=params.get('async_req'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) diff --git a/asana/api/custom_field_settings_api.py b/asana/api/custom_field_settings_api.py index 15b08670..10a1409e 100644 --- a/asana/api/custom_field_settings_api.py +++ b/asana/api/custom_field_settings_api.py @@ -21,229 +21,231 @@ class CustomFieldSettingsApi(object): - """NOTE: This class is auto generated by the swagger code generator program. +"""NOTE: This class is auto generated by the swagger code generator program. - Do not edit the class manually. - Ref: https://github.com/swagger-api/swagger-codegen +Do not edit the class manually. +Ref: https://github.com/swagger-api/swagger-codegen +""" + +def __init__(self, api_client=None): + if api_client is None: + api_client = ApiClient() + self.api_client = api_client + +def get_custom_field_settings_for_portfolio(self, portfolio_gid, **kwargs): # noqa: E501 + """Get a portfolio's custom fields # noqa: E501 + + Returns a list of all of the custom fields settings on a portfolio, in compact form. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.get_custom_field_settings_for_portfolio(portfolio_gid, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str portfolio_gid: Globally unique identifier for the portfolio. (required) + :param int limit: Results per page. The number of objects to return per page. The value must be between 1 and 100. + :param str offset: 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 list[str] opt_fields: This endpoint returns a compact resource, which excludes some properties by default. To include those optional properties, set this query parameter to a comma-separated list of the properties you wish to include. + :return: CustomFieldSettingResponseArray + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = kwargs.get("_return_http_data_only", True) + if kwargs.get('async_req'): + return self.get_custom_field_settings_for_portfolio_with_http_info(portfolio_gid, **kwargs) # noqa: E501 + else: + (data) = self.get_custom_field_settings_for_portfolio_with_http_info(portfolio_gid, **kwargs) # noqa: E501 + return data + +def get_custom_field_settings_for_portfolio_with_http_info(self, portfolio_gid, **kwargs): # noqa: E501 + """Get a portfolio's custom fields # noqa: E501 + + Returns a list of all of the custom fields settings on a portfolio, in compact form. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.get_custom_field_settings_for_portfolio_with_http_info(portfolio_gid, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str portfolio_gid: Globally unique identifier for the portfolio. (required) + :param int limit: Results per page. The number of objects to return per page. The value must be between 1 and 100. + :param str offset: 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 list[str] opt_fields: This endpoint returns a compact resource, which excludes some properties by default. To include those optional properties, set this query parameter to a comma-separated list of the properties you wish to include. + :return: CustomFieldSettingResponseArray + If the method is called asynchronously, + returns the request thread. + """ + + all_params = ['portfolio_gid', 'limit', 'offset', 'opt_fields'] # noqa: E501 + all_params.append('async_req') + all_params.append('header_params') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + params = locals() + for key, val in six.iteritems(params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method get_custom_field_settings_for_portfolio" % key + ) + params[key] = val + del params['kwargs'] + # verify the required parameter 'portfolio_gid' is set + if ('portfolio_gid' not in params or + params['portfolio_gid'] is None): + raise ValueError("Missing the required parameter `portfolio_gid` when calling `get_custom_field_settings_for_portfolio`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'portfolio_gid' in params: + path_params['portfolio_gid'] = params['portfolio_gid'] # noqa: E501 + + query_params = [] + if 'limit' in params: + query_params.append(('limit', params['limit'])) # noqa: E501 + if 'offset' in params: + query_params.append(('offset', params['offset'])) # noqa: E501 + if 'opt_fields' in params: + query_params.append(('opt_fields', params['opt_fields'])) # noqa: E501 + collection_formats['opt_fields'] = 'csv' # noqa: E501 + + header_params = kwargs.get("header_params", {}) + + form_params = [] + local_var_files = {} + + body_params = None + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['application/json; charset=UTF-8']) # noqa: E501 + + # Authentication setting + auth_settings = ['oauth2'] # noqa: E501 + + return self.api_client.call_api( + '/portfolios/{portfolio_gid}/custom_field_settings', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='CustomFieldSettingResponseArray', # noqa: E501 + auth_settings=auth_settings, + async_req=params.get('async_req'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) + +def get_custom_field_settings_for_project(self, project_gid, **kwargs): # noqa: E501 + """Get a project's custom fields # noqa: E501 + + Returns a list of all of the custom fields settings on a project, in compact form. Note that, as in all queries to collections which return compact representation, `opt_fields` can be used to include more data than is returned in the compact representation. See the [documentation for input/output options](https://developers.asana.com/docs/inputoutput-options) for more information. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.get_custom_field_settings_for_project(project_gid, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str project_gid: Globally unique identifier for the project. (required) + :param int limit: Results per page. The number of objects to return per page. The value must be between 1 and 100. + :param str offset: 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 list[str] opt_fields: This endpoint returns a compact resource, which excludes some properties by default. To include those optional properties, set this query parameter to a comma-separated list of the properties you wish to include. + :return: CustomFieldSettingResponseArray + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = kwargs.get("_return_http_data_only", True) + if kwargs.get('async_req'): + return self.get_custom_field_settings_for_project_with_http_info(project_gid, **kwargs) # noqa: E501 + else: + (data) = self.get_custom_field_settings_for_project_with_http_info(project_gid, **kwargs) # noqa: E501 + return data + +def get_custom_field_settings_for_project_with_http_info(self, project_gid, **kwargs): # noqa: E501 + """Get a project's custom fields # noqa: E501 + + Returns a list of all of the custom fields settings on a project, in compact form. Note that, as in all queries to collections which return compact representation, `opt_fields` can be used to include more data than is returned in the compact representation. See the [documentation for input/output options](https://developers.asana.com/docs/inputoutput-options) for more information. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.get_custom_field_settings_for_project_with_http_info(project_gid, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str project_gid: Globally unique identifier for the project. (required) + :param int limit: Results per page. The number of objects to return per page. The value must be between 1 and 100. + :param str offset: 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 list[str] opt_fields: This endpoint returns a compact resource, which excludes some properties by default. To include those optional properties, set this query parameter to a comma-separated list of the properties you wish to include. + :return: CustomFieldSettingResponseArray + If the method is called asynchronously, + returns the request thread. """ - def __init__(self, api_client=None): - if api_client is None: - api_client = ApiClient() - self.api_client = api_client - - def get_custom_field_settings_for_portfolio(self, portfolio_gid, **kwargs): # noqa: E501 - """Get a portfolio's custom fields # noqa: E501 - - Returns a list of all of the custom fields settings on a portfolio, in compact form. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.get_custom_field_settings_for_portfolio(portfolio_gid, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param str portfolio_gid: Globally unique identifier for the portfolio. (required) - :param int limit: Results per page. The number of objects to return per page. The value must be between 1 and 100. - :param str offset: 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 list[str] opt_fields: This endpoint returns a compact resource, which excludes some properties by default. To include those optional properties, set this query parameter to a comma-separated list of the properties you wish to include. - :return: CustomFieldSettingResponseArray - If the method is called asynchronously, - returns the request thread. - """ - kwargs['_return_http_data_only'] = True - if kwargs.get('async_req'): - return self.get_custom_field_settings_for_portfolio_with_http_info(portfolio_gid, **kwargs) # noqa: E501 - else: - (data) = self.get_custom_field_settings_for_portfolio_with_http_info(portfolio_gid, **kwargs) # noqa: E501 - return data - - def get_custom_field_settings_for_portfolio_with_http_info(self, portfolio_gid, **kwargs): # noqa: E501 - """Get a portfolio's custom fields # noqa: E501 - - Returns a list of all of the custom fields settings on a portfolio, in compact form. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.get_custom_field_settings_for_portfolio_with_http_info(portfolio_gid, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param str portfolio_gid: Globally unique identifier for the portfolio. (required) - :param int limit: Results per page. The number of objects to return per page. The value must be between 1 and 100. - :param str offset: 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 list[str] opt_fields: This endpoint returns a compact resource, which excludes some properties by default. To include those optional properties, set this query parameter to a comma-separated list of the properties you wish to include. - :return: CustomFieldSettingResponseArray - If the method is called asynchronously, - returns the request thread. - """ - - all_params = ['portfolio_gid', 'limit', 'offset', 'opt_fields'] # noqa: E501 - all_params.append('async_req') - all_params.append('_return_http_data_only') - all_params.append('_preload_content') - all_params.append('_request_timeout') - - params = locals() - for key, val in six.iteritems(params['kwargs']): - if key not in all_params: - raise TypeError( - "Got an unexpected keyword argument '%s'" - " to method get_custom_field_settings_for_portfolio" % key - ) - params[key] = val - del params['kwargs'] - # verify the required parameter 'portfolio_gid' is set - if ('portfolio_gid' not in params or - params['portfolio_gid'] is None): - raise ValueError("Missing the required parameter `portfolio_gid` when calling `get_custom_field_settings_for_portfolio`") # noqa: E501 - - collection_formats = {} - - path_params = {} - if 'portfolio_gid' in params: - path_params['portfolio_gid'] = params['portfolio_gid'] # noqa: E501 - - query_params = [] - if 'limit' in params: - query_params.append(('limit', params['limit'])) # noqa: E501 - if 'offset' in params: - query_params.append(('offset', params['offset'])) # noqa: E501 - if 'opt_fields' in params: - query_params.append(('opt_fields', params['opt_fields'])) # noqa: E501 - collection_formats['opt_fields'] = 'csv' # noqa: E501 - - header_params = {} - - form_params = [] - local_var_files = {} - - body_params = None - # HTTP header `Accept` - header_params['Accept'] = self.api_client.select_header_accept( - ['application/json; charset=UTF-8']) # noqa: E501 - - # Authentication setting - auth_settings = ['oauth2'] # noqa: E501 - - return self.api_client.call_api( - '/portfolios/{portfolio_gid}/custom_field_settings', 'GET', - path_params, - query_params, - header_params, - body=body_params, - post_params=form_params, - files=local_var_files, - response_type='CustomFieldSettingResponseArray', # noqa: E501 - auth_settings=auth_settings, - async_req=params.get('async_req'), - _return_http_data_only=params.get('_return_http_data_only'), - _preload_content=params.get('_preload_content', True), - _request_timeout=params.get('_request_timeout'), - collection_formats=collection_formats) - - def get_custom_field_settings_for_project(self, project_gid, **kwargs): # noqa: E501 - """Get a project's custom fields # noqa: E501 - - Returns a list of all of the custom fields settings on a project, in compact form. Note that, as in all queries to collections which return compact representation, `opt_fields` can be used to include more data than is returned in the compact representation. See the [documentation for input/output options](https://developers.asana.com/docs/inputoutput-options) for more information. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.get_custom_field_settings_for_project(project_gid, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param str project_gid: Globally unique identifier for the project. (required) - :param int limit: Results per page. The number of objects to return per page. The value must be between 1 and 100. - :param str offset: 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 list[str] opt_fields: This endpoint returns a compact resource, which excludes some properties by default. To include those optional properties, set this query parameter to a comma-separated list of the properties you wish to include. - :return: CustomFieldSettingResponseArray - If the method is called asynchronously, - returns the request thread. - """ - kwargs['_return_http_data_only'] = True - if kwargs.get('async_req'): - return self.get_custom_field_settings_for_project_with_http_info(project_gid, **kwargs) # noqa: E501 - else: - (data) = self.get_custom_field_settings_for_project_with_http_info(project_gid, **kwargs) # noqa: E501 - return data - - def get_custom_field_settings_for_project_with_http_info(self, project_gid, **kwargs): # noqa: E501 - """Get a project's custom fields # noqa: E501 - - Returns a list of all of the custom fields settings on a project, in compact form. Note that, as in all queries to collections which return compact representation, `opt_fields` can be used to include more data than is returned in the compact representation. See the [documentation for input/output options](https://developers.asana.com/docs/inputoutput-options) for more information. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.get_custom_field_settings_for_project_with_http_info(project_gid, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param str project_gid: Globally unique identifier for the project. (required) - :param int limit: Results per page. The number of objects to return per page. The value must be between 1 and 100. - :param str offset: 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 list[str] opt_fields: This endpoint returns a compact resource, which excludes some properties by default. To include those optional properties, set this query parameter to a comma-separated list of the properties you wish to include. - :return: CustomFieldSettingResponseArray - If the method is called asynchronously, - returns the request thread. - """ - - all_params = ['project_gid', 'limit', 'offset', 'opt_fields'] # noqa: E501 - all_params.append('async_req') - all_params.append('_return_http_data_only') - all_params.append('_preload_content') - all_params.append('_request_timeout') - - params = locals() - for key, val in six.iteritems(params['kwargs']): - if key not in all_params: - raise TypeError( - "Got an unexpected keyword argument '%s'" - " to method get_custom_field_settings_for_project" % key - ) - params[key] = val - del params['kwargs'] - # verify the required parameter 'project_gid' is set - if ('project_gid' not in params or - params['project_gid'] is None): - raise ValueError("Missing the required parameter `project_gid` when calling `get_custom_field_settings_for_project`") # noqa: E501 - - collection_formats = {} - - path_params = {} - if 'project_gid' in params: - path_params['project_gid'] = params['project_gid'] # noqa: E501 - - query_params = [] - if 'limit' in params: - query_params.append(('limit', params['limit'])) # noqa: E501 - if 'offset' in params: - query_params.append(('offset', params['offset'])) # noqa: E501 - if 'opt_fields' in params: - query_params.append(('opt_fields', params['opt_fields'])) # noqa: E501 - collection_formats['opt_fields'] = 'csv' # noqa: E501 - - header_params = {} - - form_params = [] - local_var_files = {} - - body_params = None - # HTTP header `Accept` - header_params['Accept'] = self.api_client.select_header_accept( - ['application/json; charset=UTF-8']) # noqa: E501 - - # Authentication setting - auth_settings = ['oauth2'] # noqa: E501 - - return self.api_client.call_api( - '/projects/{project_gid}/custom_field_settings', 'GET', - path_params, - query_params, - header_params, - body=body_params, - post_params=form_params, - files=local_var_files, - response_type='CustomFieldSettingResponseArray', # noqa: E501 - auth_settings=auth_settings, - async_req=params.get('async_req'), - _return_http_data_only=params.get('_return_http_data_only'), - _preload_content=params.get('_preload_content', True), - _request_timeout=params.get('_request_timeout'), - collection_formats=collection_formats) + all_params = ['project_gid', 'limit', 'offset', 'opt_fields'] # noqa: E501 + all_params.append('async_req') + all_params.append('header_params') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + params = locals() + for key, val in six.iteritems(params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method get_custom_field_settings_for_project" % key + ) + params[key] = val + del params['kwargs'] + # verify the required parameter 'project_gid' is set + if ('project_gid' not in params or + params['project_gid'] is None): + raise ValueError("Missing the required parameter `project_gid` when calling `get_custom_field_settings_for_project`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'project_gid' in params: + path_params['project_gid'] = params['project_gid'] # noqa: E501 + + query_params = [] + if 'limit' in params: + query_params.append(('limit', params['limit'])) # noqa: E501 + if 'offset' in params: + query_params.append(('offset', params['offset'])) # noqa: E501 + if 'opt_fields' in params: + query_params.append(('opt_fields', params['opt_fields'])) # noqa: E501 + collection_formats['opt_fields'] = 'csv' # noqa: E501 + + header_params = kwargs.get("header_params", {}) + + form_params = [] + local_var_files = {} + + body_params = None + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['application/json; charset=UTF-8']) # noqa: E501 + + # Authentication setting + auth_settings = ['oauth2'] # noqa: E501 + + return self.api_client.call_api( + '/projects/{project_gid}/custom_field_settings', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='CustomFieldSettingResponseArray', # noqa: E501 + auth_settings=auth_settings, + async_req=params.get('async_req'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) diff --git a/asana/api/custom_fields_api.py b/asana/api/custom_fields_api.py index fa32695f..5f886fa6 100644 --- a/asana/api/custom_fields_api.py +++ b/asana/api/custom_fields_api.py @@ -21,852 +21,860 @@ class CustomFieldsApi(object): - """NOTE: This class is auto generated by the swagger code generator program. +"""NOTE: This class is auto generated by the swagger code generator program. - Do not edit the class manually. - Ref: https://github.com/swagger-api/swagger-codegen +Do not edit the class manually. +Ref: https://github.com/swagger-api/swagger-codegen +""" + +def __init__(self, api_client=None): + if api_client is None: + api_client = ApiClient() + self.api_client = api_client + +def create_custom_field(self, body, **kwargs): # noqa: E501 + """Create a custom field # noqa: E501 + + Creates a new custom field in a workspace. Every custom field is required to be created in a specific workspace, and this workspace cannot be changed once set. A custom field’s name must be unique within a workspace and not conflict with names of existing task properties such as `Due Date` or `Assignee`. A custom field’s type must be one of `text`, `enum`, `multi_enum`, `number`, `date`, or `people`. Returns the full record of the newly created custom field. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.create_custom_field(body, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param CustomFieldsBody body: The custom field object to create. (required) + :param list[str] opt_fields: This endpoint returns a compact resource, which excludes some properties by default. To include those optional properties, set this query parameter to a comma-separated list of the properties you wish to include. + :return: CustomFieldResponseData + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = kwargs.get("_return_http_data_only", True) + if kwargs.get('async_req'): + return self.create_custom_field_with_http_info(body, **kwargs) # noqa: E501 + else: + (data) = self.create_custom_field_with_http_info(body, **kwargs) # noqa: E501 + return data + +def create_custom_field_with_http_info(self, body, **kwargs): # noqa: E501 + """Create a custom field # noqa: E501 + + Creates a new custom field in a workspace. Every custom field is required to be created in a specific workspace, and this workspace cannot be changed once set. A custom field’s name must be unique within a workspace and not conflict with names of existing task properties such as `Due Date` or `Assignee`. A custom field’s type must be one of `text`, `enum`, `multi_enum`, `number`, `date`, or `people`. Returns the full record of the newly created custom field. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.create_custom_field_with_http_info(body, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param CustomFieldsBody body: The custom field object to create. (required) + :param list[str] opt_fields: This endpoint returns a compact resource, which excludes some properties by default. To include those optional properties, set this query parameter to a comma-separated list of the properties you wish to include. + :return: CustomFieldResponseData + If the method is called asynchronously, + returns the request thread. + """ + + all_params = ['body', 'opt_fields'] # noqa: E501 + all_params.append('async_req') + all_params.append('header_params') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + params = locals() + for key, val in six.iteritems(params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method create_custom_field" % key + ) + params[key] = val + del params['kwargs'] + # verify the required parameter 'body' is set + if ('body' not in params or + params['body'] is None): + raise ValueError("Missing the required parameter `body` when calling `create_custom_field`") # noqa: E501 + + collection_formats = {} + + path_params = {} + + query_params = [] + if 'opt_fields' in params: + query_params.append(('opt_fields', params['opt_fields'])) # noqa: E501 + collection_formats['opt_fields'] = 'csv' # noqa: E501 + + header_params = kwargs.get("header_params", {}) + + form_params = [] + local_var_files = {} + + body_params = None + if 'body' in params: + body_params = params['body'] + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['application/json; charset=UTF-8']) # noqa: E501 + + # HTTP header `Content-Type` + header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 + ['application/json; charset=UTF-8']) # noqa: E501 + + # Authentication setting + auth_settings = ['oauth2'] # noqa: E501 + + return self.api_client.call_api( + '/custom_fields', 'POST', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='CustomFieldResponseData', # noqa: E501 + auth_settings=auth_settings, + async_req=params.get('async_req'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) + +def create_enum_option_for_custom_field(self, custom_field_gid, **kwargs): # noqa: E501 + """Create an enum option # noqa: E501 + + Creates an enum option and adds it to this custom field’s list of enum options. A custom field can have at most 500 enum options (including disabled options). By default new enum options are inserted at the end of a custom field’s list. Locked custom fields can only have enum options added by the user who locked the field. Returns the full record of the newly created enum option. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.create_enum_option_for_custom_field(custom_field_gid, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str custom_field_gid: Globally unique identifier for the custom field. (required) + :param CustomFieldGidEnumOptionsBody body: The enum option object to create. + :param list[str] opt_fields: This endpoint returns a compact resource, which excludes some properties by default. To include those optional properties, set this query parameter to a comma-separated list of the properties you wish to include. + :return: EnumOptionData + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = kwargs.get("_return_http_data_only", True) + if kwargs.get('async_req'): + return self.create_enum_option_for_custom_field_with_http_info(custom_field_gid, **kwargs) # noqa: E501 + else: + (data) = self.create_enum_option_for_custom_field_with_http_info(custom_field_gid, **kwargs) # noqa: E501 + return data + +def create_enum_option_for_custom_field_with_http_info(self, custom_field_gid, **kwargs): # noqa: E501 + """Create an enum option # noqa: E501 + + Creates an enum option and adds it to this custom field’s list of enum options. A custom field can have at most 500 enum options (including disabled options). By default new enum options are inserted at the end of a custom field’s list. Locked custom fields can only have enum options added by the user who locked the field. Returns the full record of the newly created enum option. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.create_enum_option_for_custom_field_with_http_info(custom_field_gid, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str custom_field_gid: Globally unique identifier for the custom field. (required) + :param CustomFieldGidEnumOptionsBody body: The enum option object to create. + :param list[str] opt_fields: This endpoint returns a compact resource, which excludes some properties by default. To include those optional properties, set this query parameter to a comma-separated list of the properties you wish to include. + :return: EnumOptionData + If the method is called asynchronously, + returns the request thread. + """ + + all_params = ['custom_field_gid', 'body', 'opt_fields'] # noqa: E501 + all_params.append('async_req') + all_params.append('header_params') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + params = locals() + for key, val in six.iteritems(params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method create_enum_option_for_custom_field" % key + ) + params[key] = val + del params['kwargs'] + # verify the required parameter 'custom_field_gid' is set + if ('custom_field_gid' not in params or + params['custom_field_gid'] is None): + raise ValueError("Missing the required parameter `custom_field_gid` when calling `create_enum_option_for_custom_field`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'custom_field_gid' in params: + path_params['custom_field_gid'] = params['custom_field_gid'] # noqa: E501 + + query_params = [] + if 'opt_fields' in params: + query_params.append(('opt_fields', params['opt_fields'])) # noqa: E501 + collection_formats['opt_fields'] = 'csv' # noqa: E501 + + header_params = kwargs.get("header_params", {}) + + form_params = [] + local_var_files = {} + + body_params = None + if 'body' in params: + body_params = params['body'] + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['application/json; charset=UTF-8']) # noqa: E501 + + # HTTP header `Content-Type` + header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 + ['application/json; charset=UTF-8']) # noqa: E501 + + # Authentication setting + auth_settings = ['oauth2'] # noqa: E501 + + return self.api_client.call_api( + '/custom_fields/{custom_field_gid}/enum_options', 'POST', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='EnumOptionData', # noqa: E501 + auth_settings=auth_settings, + async_req=params.get('async_req'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) + +def delete_custom_field(self, custom_field_gid, **kwargs): # noqa: E501 + """Delete a custom field # noqa: E501 + + A specific, existing custom field can be deleted by making a DELETE request on the URL for that custom field. Locked custom fields can only be deleted by the user who locked the field. Returns an empty data record. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.delete_custom_field(custom_field_gid, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str custom_field_gid: Globally unique identifier for the custom field. (required) + :return: EmptyResponseData + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = kwargs.get("_return_http_data_only", True) + if kwargs.get('async_req'): + return self.delete_custom_field_with_http_info(custom_field_gid, **kwargs) # noqa: E501 + else: + (data) = self.delete_custom_field_with_http_info(custom_field_gid, **kwargs) # noqa: E501 + return data + +def delete_custom_field_with_http_info(self, custom_field_gid, **kwargs): # noqa: E501 + """Delete a custom field # noqa: E501 + + A specific, existing custom field can be deleted by making a DELETE request on the URL for that custom field. Locked custom fields can only be deleted by the user who locked the field. Returns an empty data record. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.delete_custom_field_with_http_info(custom_field_gid, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str custom_field_gid: Globally unique identifier for the custom field. (required) + :return: EmptyResponseData + If the method is called asynchronously, + returns the request thread. + """ + + all_params = ['custom_field_gid'] # noqa: E501 + all_params.append('async_req') + all_params.append('header_params') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + params = locals() + for key, val in six.iteritems(params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method delete_custom_field" % key + ) + params[key] = val + del params['kwargs'] + # verify the required parameter 'custom_field_gid' is set + if ('custom_field_gid' not in params or + params['custom_field_gid'] is None): + raise ValueError("Missing the required parameter `custom_field_gid` when calling `delete_custom_field`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'custom_field_gid' in params: + path_params['custom_field_gid'] = params['custom_field_gid'] # noqa: E501 + + query_params = [] + + header_params = kwargs.get("header_params", {}) + + form_params = [] + local_var_files = {} + + body_params = None + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['application/json; charset=UTF-8']) # noqa: E501 + + # Authentication setting + auth_settings = ['oauth2'] # noqa: E501 + + return self.api_client.call_api( + '/custom_fields/{custom_field_gid}', 'DELETE', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='EmptyResponseData', # noqa: E501 + auth_settings=auth_settings, + async_req=params.get('async_req'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) + +def get_custom_field(self, custom_field_gid, **kwargs): # noqa: E501 + """Get a custom field # noqa: E501 + + Get the complete definition of a custom field’s metadata. Since custom fields can be defined for one of a number of types, and these types have different data and behaviors, there are fields that are relevant to a particular type. For instance, as noted above, enum_options is only relevant for the enum type and defines the set of choices that the enum could represent. The examples below show some of these type-specific custom field definitions. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.get_custom_field(custom_field_gid, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str custom_field_gid: Globally unique identifier for the custom field. (required) + :param list[str] opt_fields: This endpoint returns a compact resource, which excludes some properties by default. To include those optional properties, set this query parameter to a comma-separated list of the properties you wish to include. + :return: CustomFieldResponseData + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = kwargs.get("_return_http_data_only", True) + if kwargs.get('async_req'): + return self.get_custom_field_with_http_info(custom_field_gid, **kwargs) # noqa: E501 + else: + (data) = self.get_custom_field_with_http_info(custom_field_gid, **kwargs) # noqa: E501 + return data + +def get_custom_field_with_http_info(self, custom_field_gid, **kwargs): # noqa: E501 + """Get a custom field # noqa: E501 + + Get the complete definition of a custom field’s metadata. Since custom fields can be defined for one of a number of types, and these types have different data and behaviors, there are fields that are relevant to a particular type. For instance, as noted above, enum_options is only relevant for the enum type and defines the set of choices that the enum could represent. The examples below show some of these type-specific custom field definitions. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.get_custom_field_with_http_info(custom_field_gid, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str custom_field_gid: Globally unique identifier for the custom field. (required) + :param list[str] opt_fields: This endpoint returns a compact resource, which excludes some properties by default. To include those optional properties, set this query parameter to a comma-separated list of the properties you wish to include. + :return: CustomFieldResponseData + If the method is called asynchronously, + returns the request thread. + """ + + all_params = ['custom_field_gid', 'opt_fields'] # noqa: E501 + all_params.append('async_req') + all_params.append('header_params') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + params = locals() + for key, val in six.iteritems(params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method get_custom_field" % key + ) + params[key] = val + del params['kwargs'] + # verify the required parameter 'custom_field_gid' is set + if ('custom_field_gid' not in params or + params['custom_field_gid'] is None): + raise ValueError("Missing the required parameter `custom_field_gid` when calling `get_custom_field`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'custom_field_gid' in params: + path_params['custom_field_gid'] = params['custom_field_gid'] # noqa: E501 + + query_params = [] + if 'opt_fields' in params: + query_params.append(('opt_fields', params['opt_fields'])) # noqa: E501 + collection_formats['opt_fields'] = 'csv' # noqa: E501 + + header_params = kwargs.get("header_params", {}) + + form_params = [] + local_var_files = {} + + body_params = None + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['application/json; charset=UTF-8']) # noqa: E501 + + # Authentication setting + auth_settings = ['oauth2'] # noqa: E501 + + return self.api_client.call_api( + '/custom_fields/{custom_field_gid}', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='CustomFieldResponseData', # noqa: E501 + auth_settings=auth_settings, + async_req=params.get('async_req'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) + +def get_custom_fields_for_workspace(self, workspace_gid, **kwargs): # noqa: E501 + """Get a workspace's custom fields # noqa: E501 + + Returns a list of the compact representation of all of the custom fields in a workspace. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.get_custom_fields_for_workspace(workspace_gid, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str workspace_gid: Globally unique identifier for the workspace or organization. (required) + :param int limit: Results per page. The number of objects to return per page. The value must be between 1 and 100. + :param str offset: 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 list[str] opt_fields: This endpoint returns a compact resource, which excludes some properties by default. To include those optional properties, set this query parameter to a comma-separated list of the properties you wish to include. + :return: CustomFieldResponseArray + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = kwargs.get("_return_http_data_only", True) + if kwargs.get('async_req'): + return self.get_custom_fields_for_workspace_with_http_info(workspace_gid, **kwargs) # noqa: E501 + else: + (data) = self.get_custom_fields_for_workspace_with_http_info(workspace_gid, **kwargs) # noqa: E501 + return data + +def get_custom_fields_for_workspace_with_http_info(self, workspace_gid, **kwargs): # noqa: E501 + """Get a workspace's custom fields # noqa: E501 + + Returns a list of the compact representation of all of the custom fields in a workspace. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.get_custom_fields_for_workspace_with_http_info(workspace_gid, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str workspace_gid: Globally unique identifier for the workspace or organization. (required) + :param int limit: Results per page. The number of objects to return per page. The value must be between 1 and 100. + :param str offset: 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 list[str] opt_fields: This endpoint returns a compact resource, which excludes some properties by default. To include those optional properties, set this query parameter to a comma-separated list of the properties you wish to include. + :return: CustomFieldResponseArray + If the method is called asynchronously, + returns the request thread. + """ + + all_params = ['workspace_gid', 'limit', 'offset', 'opt_fields'] # noqa: E501 + all_params.append('async_req') + all_params.append('header_params') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + params = locals() + for key, val in six.iteritems(params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method get_custom_fields_for_workspace" % key + ) + params[key] = val + del params['kwargs'] + # verify the required parameter 'workspace_gid' is set + if ('workspace_gid' not in params or + params['workspace_gid'] is None): + raise ValueError("Missing the required parameter `workspace_gid` when calling `get_custom_fields_for_workspace`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'workspace_gid' in params: + path_params['workspace_gid'] = params['workspace_gid'] # noqa: E501 + + query_params = [] + if 'limit' in params: + query_params.append(('limit', params['limit'])) # noqa: E501 + if 'offset' in params: + query_params.append(('offset', params['offset'])) # noqa: E501 + if 'opt_fields' in params: + query_params.append(('opt_fields', params['opt_fields'])) # noqa: E501 + collection_formats['opt_fields'] = 'csv' # noqa: E501 + + header_params = kwargs.get("header_params", {}) + + form_params = [] + local_var_files = {} + + body_params = None + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['application/json; charset=UTF-8']) # noqa: E501 + + # Authentication setting + auth_settings = ['oauth2'] # noqa: E501 + + return self.api_client.call_api( + '/workspaces/{workspace_gid}/custom_fields', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='CustomFieldResponseArray', # noqa: E501 + auth_settings=auth_settings, + async_req=params.get('async_req'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) + +def insert_enum_option_for_custom_field(self, custom_field_gid, **kwargs): # noqa: E501 + """Reorder a custom field's enum # noqa: E501 + + Moves a particular enum option to be either before or after another specified enum option in the custom field. Locked custom fields can only be reordered by the user who locked the field. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.insert_enum_option_for_custom_field(custom_field_gid, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str custom_field_gid: Globally unique identifier for the custom field. (required) + :param EnumOptionsInsertBody body: The enum option object to create. + :param list[str] opt_fields: This endpoint returns a compact resource, which excludes some properties by default. To include those optional properties, set this query parameter to a comma-separated list of the properties you wish to include. + :return: EnumOptionData + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = kwargs.get("_return_http_data_only", True) + if kwargs.get('async_req'): + return self.insert_enum_option_for_custom_field_with_http_info(custom_field_gid, **kwargs) # noqa: E501 + else: + (data) = self.insert_enum_option_for_custom_field_with_http_info(custom_field_gid, **kwargs) # noqa: E501 + return data + +def insert_enum_option_for_custom_field_with_http_info(self, custom_field_gid, **kwargs): # noqa: E501 + """Reorder a custom field's enum # noqa: E501 + + Moves a particular enum option to be either before or after another specified enum option in the custom field. Locked custom fields can only be reordered by the user who locked the field. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.insert_enum_option_for_custom_field_with_http_info(custom_field_gid, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str custom_field_gid: Globally unique identifier for the custom field. (required) + :param EnumOptionsInsertBody body: The enum option object to create. + :param list[str] opt_fields: This endpoint returns a compact resource, which excludes some properties by default. To include those optional properties, set this query parameter to a comma-separated list of the properties you wish to include. + :return: EnumOptionData + If the method is called asynchronously, + returns the request thread. + """ + + all_params = ['custom_field_gid', 'body', 'opt_fields'] # noqa: E501 + all_params.append('async_req') + all_params.append('header_params') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + params = locals() + for key, val in six.iteritems(params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method insert_enum_option_for_custom_field" % key + ) + params[key] = val + del params['kwargs'] + # verify the required parameter 'custom_field_gid' is set + if ('custom_field_gid' not in params or + params['custom_field_gid'] is None): + raise ValueError("Missing the required parameter `custom_field_gid` when calling `insert_enum_option_for_custom_field`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'custom_field_gid' in params: + path_params['custom_field_gid'] = params['custom_field_gid'] # noqa: E501 + + query_params = [] + if 'opt_fields' in params: + query_params.append(('opt_fields', params['opt_fields'])) # noqa: E501 + collection_formats['opt_fields'] = 'csv' # noqa: E501 + + header_params = kwargs.get("header_params", {}) + + form_params = [] + local_var_files = {} + + body_params = None + if 'body' in params: + body_params = params['body'] + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['application/json; charset=UTF-8']) # noqa: E501 + + # HTTP header `Content-Type` + header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 + ['application/json; charset=UTF-8']) # noqa: E501 + + # Authentication setting + auth_settings = ['oauth2'] # noqa: E501 + + return self.api_client.call_api( + '/custom_fields/{custom_field_gid}/enum_options/insert', 'POST', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='EnumOptionData', # noqa: E501 + auth_settings=auth_settings, + async_req=params.get('async_req'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) + +def update_custom_field(self, custom_field_gid, **kwargs): # noqa: E501 + """Update a custom field # noqa: E501 + + A specific, existing custom field can be updated by making a PUT request on the URL for that custom field. Only the fields provided in the `data` block will be updated; any unspecified fields will remain unchanged When using this method, it is best to specify only those fields you wish to change, or else you may overwrite changes made by another user since you last retrieved the custom field. A custom field’s `type` cannot be updated. An enum custom field’s `enum_options` cannot be updated with this endpoint. Instead see “Work With Enum Options” for information on how to update `enum_options`. Locked custom fields can only be updated by the user who locked the field. Returns the complete updated custom field record. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.update_custom_field(custom_field_gid, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str custom_field_gid: Globally unique identifier for the custom field. (required) + :param CustomFieldsCustomFieldGidBody body: The custom field object with all updated properties. + :param list[str] opt_fields: This endpoint returns a compact resource, which excludes some properties by default. To include those optional properties, set this query parameter to a comma-separated list of the properties you wish to include. + :return: CustomFieldResponseData + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = kwargs.get("_return_http_data_only", True) + if kwargs.get('async_req'): + return self.update_custom_field_with_http_info(custom_field_gid, **kwargs) # noqa: E501 + else: + (data) = self.update_custom_field_with_http_info(custom_field_gid, **kwargs) # noqa: E501 + return data + +def update_custom_field_with_http_info(self, custom_field_gid, **kwargs): # noqa: E501 + """Update a custom field # noqa: E501 + + A specific, existing custom field can be updated by making a PUT request on the URL for that custom field. Only the fields provided in the `data` block will be updated; any unspecified fields will remain unchanged When using this method, it is best to specify only those fields you wish to change, or else you may overwrite changes made by another user since you last retrieved the custom field. A custom field’s `type` cannot be updated. An enum custom field’s `enum_options` cannot be updated with this endpoint. Instead see “Work With Enum Options” for information on how to update `enum_options`. Locked custom fields can only be updated by the user who locked the field. Returns the complete updated custom field record. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.update_custom_field_with_http_info(custom_field_gid, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str custom_field_gid: Globally unique identifier for the custom field. (required) + :param CustomFieldsCustomFieldGidBody body: The custom field object with all updated properties. + :param list[str] opt_fields: This endpoint returns a compact resource, which excludes some properties by default. To include those optional properties, set this query parameter to a comma-separated list of the properties you wish to include. + :return: CustomFieldResponseData + If the method is called asynchronously, + returns the request thread. + """ + + all_params = ['custom_field_gid', 'body', 'opt_fields'] # noqa: E501 + all_params.append('async_req') + all_params.append('header_params') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + params = locals() + for key, val in six.iteritems(params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method update_custom_field" % key + ) + params[key] = val + del params['kwargs'] + # verify the required parameter 'custom_field_gid' is set + if ('custom_field_gid' not in params or + params['custom_field_gid'] is None): + raise ValueError("Missing the required parameter `custom_field_gid` when calling `update_custom_field`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'custom_field_gid' in params: + path_params['custom_field_gid'] = params['custom_field_gid'] # noqa: E501 + + query_params = [] + if 'opt_fields' in params: + query_params.append(('opt_fields', params['opt_fields'])) # noqa: E501 + collection_formats['opt_fields'] = 'csv' # noqa: E501 + + header_params = kwargs.get("header_params", {}) + + form_params = [] + local_var_files = {} + + body_params = None + if 'body' in params: + body_params = params['body'] + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['application/json; charset=UTF-8']) # noqa: E501 + + # HTTP header `Content-Type` + header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 + ['application/json; charset=UTF-8']) # noqa: E501 + + # Authentication setting + auth_settings = ['oauth2'] # noqa: E501 + + return self.api_client.call_api( + '/custom_fields/{custom_field_gid}', 'PUT', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='CustomFieldResponseData', # noqa: E501 + auth_settings=auth_settings, + async_req=params.get('async_req'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) + +def update_enum_option(self, enum_option_gid, **kwargs): # noqa: E501 + """Update an enum option # noqa: E501 + + Updates an existing enum option. Enum custom fields require at least one enabled enum option. Locked custom fields can only be updated by the user who locked the field. Returns the full record of the updated enum option. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.update_enum_option(enum_option_gid, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str enum_option_gid: Globally unique identifier for the enum option. (required) + :param EnumOptionsEnumOptionGidBody body: The enum option object to update + :param list[str] opt_fields: This endpoint returns a compact resource, which excludes some properties by default. To include those optional properties, set this query parameter to a comma-separated list of the properties you wish to include. + :return: EnumOptionData + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = kwargs.get("_return_http_data_only", True) + if kwargs.get('async_req'): + return self.update_enum_option_with_http_info(enum_option_gid, **kwargs) # noqa: E501 + else: + (data) = self.update_enum_option_with_http_info(enum_option_gid, **kwargs) # noqa: E501 + return data + +def update_enum_option_with_http_info(self, enum_option_gid, **kwargs): # noqa: E501 + """Update an enum option # noqa: E501 + + Updates an existing enum option. Enum custom fields require at least one enabled enum option. Locked custom fields can only be updated by the user who locked the field. Returns the full record of the updated enum option. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.update_enum_option_with_http_info(enum_option_gid, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str enum_option_gid: Globally unique identifier for the enum option. (required) + :param EnumOptionsEnumOptionGidBody body: The enum option object to update + :param list[str] opt_fields: This endpoint returns a compact resource, which excludes some properties by default. To include those optional properties, set this query parameter to a comma-separated list of the properties you wish to include. + :return: EnumOptionData + If the method is called asynchronously, + returns the request thread. """ - def __init__(self, api_client=None): - if api_client is None: - api_client = ApiClient() - self.api_client = api_client - - def create_custom_field(self, body, **kwargs): # noqa: E501 - """Create a custom field # noqa: E501 - - Creates a new custom field in a workspace. Every custom field is required to be created in a specific workspace, and this workspace cannot be changed once set. A custom field’s name must be unique within a workspace and not conflict with names of existing task properties such as `Due Date` or `Assignee`. A custom field’s type must be one of `text`, `enum`, `multi_enum`, `number`, `date`, or `people`. Returns the full record of the newly created custom field. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.create_custom_field(body, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param CustomFieldsBody body: The custom field object to create. (required) - :param list[str] opt_fields: This endpoint returns a compact resource, which excludes some properties by default. To include those optional properties, set this query parameter to a comma-separated list of the properties you wish to include. - :return: CustomFieldResponseData - If the method is called asynchronously, - returns the request thread. - """ - kwargs['_return_http_data_only'] = True - if kwargs.get('async_req'): - return self.create_custom_field_with_http_info(body, **kwargs) # noqa: E501 - else: - (data) = self.create_custom_field_with_http_info(body, **kwargs) # noqa: E501 - return data - - def create_custom_field_with_http_info(self, body, **kwargs): # noqa: E501 - """Create a custom field # noqa: E501 - - Creates a new custom field in a workspace. Every custom field is required to be created in a specific workspace, and this workspace cannot be changed once set. A custom field’s name must be unique within a workspace and not conflict with names of existing task properties such as `Due Date` or `Assignee`. A custom field’s type must be one of `text`, `enum`, `multi_enum`, `number`, `date`, or `people`. Returns the full record of the newly created custom field. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.create_custom_field_with_http_info(body, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param CustomFieldsBody body: The custom field object to create. (required) - :param list[str] opt_fields: This endpoint returns a compact resource, which excludes some properties by default. To include those optional properties, set this query parameter to a comma-separated list of the properties you wish to include. - :return: CustomFieldResponseData - If the method is called asynchronously, - returns the request thread. - """ - - all_params = ['body', 'opt_fields'] # noqa: E501 - all_params.append('async_req') - all_params.append('_return_http_data_only') - all_params.append('_preload_content') - all_params.append('_request_timeout') - - params = locals() - for key, val in six.iteritems(params['kwargs']): - if key not in all_params: - raise TypeError( - "Got an unexpected keyword argument '%s'" - " to method create_custom_field" % key - ) - params[key] = val - del params['kwargs'] - # verify the required parameter 'body' is set - if ('body' not in params or - params['body'] is None): - raise ValueError("Missing the required parameter `body` when calling `create_custom_field`") # noqa: E501 - - collection_formats = {} - - path_params = {} - - query_params = [] - if 'opt_fields' in params: - query_params.append(('opt_fields', params['opt_fields'])) # noqa: E501 - collection_formats['opt_fields'] = 'csv' # noqa: E501 - - header_params = {} - - form_params = [] - local_var_files = {} - - body_params = None - if 'body' in params: - body_params = params['body'] - # HTTP header `Accept` - header_params['Accept'] = self.api_client.select_header_accept( - ['application/json; charset=UTF-8']) # noqa: E501 - - # HTTP header `Content-Type` - header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 - ['application/json; charset=UTF-8']) # noqa: E501 - - # Authentication setting - auth_settings = ['oauth2'] # noqa: E501 - - return self.api_client.call_api( - '/custom_fields', 'POST', - path_params, - query_params, - header_params, - body=body_params, - post_params=form_params, - files=local_var_files, - response_type='CustomFieldResponseData', # noqa: E501 - auth_settings=auth_settings, - async_req=params.get('async_req'), - _return_http_data_only=params.get('_return_http_data_only'), - _preload_content=params.get('_preload_content', True), - _request_timeout=params.get('_request_timeout'), - collection_formats=collection_formats) - - def create_enum_option_for_custom_field(self, custom_field_gid, **kwargs): # noqa: E501 - """Create an enum option # noqa: E501 - - Creates an enum option and adds it to this custom field’s list of enum options. A custom field can have at most 500 enum options (including disabled options). By default new enum options are inserted at the end of a custom field’s list. Locked custom fields can only have enum options added by the user who locked the field. Returns the full record of the newly created enum option. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.create_enum_option_for_custom_field(custom_field_gid, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param str custom_field_gid: Globally unique identifier for the custom field. (required) - :param CustomFieldGidEnumOptionsBody body: The enum option object to create. - :param list[str] opt_fields: This endpoint returns a compact resource, which excludes some properties by default. To include those optional properties, set this query parameter to a comma-separated list of the properties you wish to include. - :return: EnumOptionData - If the method is called asynchronously, - returns the request thread. - """ - kwargs['_return_http_data_only'] = True - if kwargs.get('async_req'): - return self.create_enum_option_for_custom_field_with_http_info(custom_field_gid, **kwargs) # noqa: E501 - else: - (data) = self.create_enum_option_for_custom_field_with_http_info(custom_field_gid, **kwargs) # noqa: E501 - return data - - def create_enum_option_for_custom_field_with_http_info(self, custom_field_gid, **kwargs): # noqa: E501 - """Create an enum option # noqa: E501 - - Creates an enum option and adds it to this custom field’s list of enum options. A custom field can have at most 500 enum options (including disabled options). By default new enum options are inserted at the end of a custom field’s list. Locked custom fields can only have enum options added by the user who locked the field. Returns the full record of the newly created enum option. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.create_enum_option_for_custom_field_with_http_info(custom_field_gid, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param str custom_field_gid: Globally unique identifier for the custom field. (required) - :param CustomFieldGidEnumOptionsBody body: The enum option object to create. - :param list[str] opt_fields: This endpoint returns a compact resource, which excludes some properties by default. To include those optional properties, set this query parameter to a comma-separated list of the properties you wish to include. - :return: EnumOptionData - If the method is called asynchronously, - returns the request thread. - """ - - all_params = ['custom_field_gid', 'body', 'opt_fields'] # noqa: E501 - all_params.append('async_req') - all_params.append('_return_http_data_only') - all_params.append('_preload_content') - all_params.append('_request_timeout') - - params = locals() - for key, val in six.iteritems(params['kwargs']): - if key not in all_params: - raise TypeError( - "Got an unexpected keyword argument '%s'" - " to method create_enum_option_for_custom_field" % key - ) - params[key] = val - del params['kwargs'] - # verify the required parameter 'custom_field_gid' is set - if ('custom_field_gid' not in params or - params['custom_field_gid'] is None): - raise ValueError("Missing the required parameter `custom_field_gid` when calling `create_enum_option_for_custom_field`") # noqa: E501 - - collection_formats = {} - - path_params = {} - if 'custom_field_gid' in params: - path_params['custom_field_gid'] = params['custom_field_gid'] # noqa: E501 - - query_params = [] - if 'opt_fields' in params: - query_params.append(('opt_fields', params['opt_fields'])) # noqa: E501 - collection_formats['opt_fields'] = 'csv' # noqa: E501 - - header_params = {} - - form_params = [] - local_var_files = {} - - body_params = None - if 'body' in params: - body_params = params['body'] - # HTTP header `Accept` - header_params['Accept'] = self.api_client.select_header_accept( - ['application/json; charset=UTF-8']) # noqa: E501 - - # HTTP header `Content-Type` - header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 - ['application/json; charset=UTF-8']) # noqa: E501 - - # Authentication setting - auth_settings = ['oauth2'] # noqa: E501 - - return self.api_client.call_api( - '/custom_fields/{custom_field_gid}/enum_options', 'POST', - path_params, - query_params, - header_params, - body=body_params, - post_params=form_params, - files=local_var_files, - response_type='EnumOptionData', # noqa: E501 - auth_settings=auth_settings, - async_req=params.get('async_req'), - _return_http_data_only=params.get('_return_http_data_only'), - _preload_content=params.get('_preload_content', True), - _request_timeout=params.get('_request_timeout'), - collection_formats=collection_formats) - - def delete_custom_field(self, custom_field_gid, **kwargs): # noqa: E501 - """Delete a custom field # noqa: E501 - - A specific, existing custom field can be deleted by making a DELETE request on the URL for that custom field. Locked custom fields can only be deleted by the user who locked the field. Returns an empty data record. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.delete_custom_field(custom_field_gid, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param str custom_field_gid: Globally unique identifier for the custom field. (required) - :return: EmptyResponseData - If the method is called asynchronously, - returns the request thread. - """ - kwargs['_return_http_data_only'] = True - if kwargs.get('async_req'): - return self.delete_custom_field_with_http_info(custom_field_gid, **kwargs) # noqa: E501 - else: - (data) = self.delete_custom_field_with_http_info(custom_field_gid, **kwargs) # noqa: E501 - return data - - def delete_custom_field_with_http_info(self, custom_field_gid, **kwargs): # noqa: E501 - """Delete a custom field # noqa: E501 - - A specific, existing custom field can be deleted by making a DELETE request on the URL for that custom field. Locked custom fields can only be deleted by the user who locked the field. Returns an empty data record. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.delete_custom_field_with_http_info(custom_field_gid, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param str custom_field_gid: Globally unique identifier for the custom field. (required) - :return: EmptyResponseData - If the method is called asynchronously, - returns the request thread. - """ - - all_params = ['custom_field_gid'] # noqa: E501 - all_params.append('async_req') - all_params.append('_return_http_data_only') - all_params.append('_preload_content') - all_params.append('_request_timeout') - - params = locals() - for key, val in six.iteritems(params['kwargs']): - if key not in all_params: - raise TypeError( - "Got an unexpected keyword argument '%s'" - " to method delete_custom_field" % key - ) - params[key] = val - del params['kwargs'] - # verify the required parameter 'custom_field_gid' is set - if ('custom_field_gid' not in params or - params['custom_field_gid'] is None): - raise ValueError("Missing the required parameter `custom_field_gid` when calling `delete_custom_field`") # noqa: E501 - - collection_formats = {} - - path_params = {} - if 'custom_field_gid' in params: - path_params['custom_field_gid'] = params['custom_field_gid'] # noqa: E501 - - query_params = [] - - header_params = {} - - form_params = [] - local_var_files = {} - - body_params = None - # HTTP header `Accept` - header_params['Accept'] = self.api_client.select_header_accept( - ['application/json; charset=UTF-8']) # noqa: E501 - - # Authentication setting - auth_settings = ['oauth2'] # noqa: E501 - - return self.api_client.call_api( - '/custom_fields/{custom_field_gid}', 'DELETE', - path_params, - query_params, - header_params, - body=body_params, - post_params=form_params, - files=local_var_files, - response_type='EmptyResponseData', # noqa: E501 - auth_settings=auth_settings, - async_req=params.get('async_req'), - _return_http_data_only=params.get('_return_http_data_only'), - _preload_content=params.get('_preload_content', True), - _request_timeout=params.get('_request_timeout'), - collection_formats=collection_formats) - - def get_custom_field(self, custom_field_gid, **kwargs): # noqa: E501 - """Get a custom field # noqa: E501 - - Get the complete definition of a custom field’s metadata. Since custom fields can be defined for one of a number of types, and these types have different data and behaviors, there are fields that are relevant to a particular type. For instance, as noted above, enum_options is only relevant for the enum type and defines the set of choices that the enum could represent. The examples below show some of these type-specific custom field definitions. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.get_custom_field(custom_field_gid, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param str custom_field_gid: Globally unique identifier for the custom field. (required) - :param list[str] opt_fields: This endpoint returns a compact resource, which excludes some properties by default. To include those optional properties, set this query parameter to a comma-separated list of the properties you wish to include. - :return: CustomFieldResponseData - If the method is called asynchronously, - returns the request thread. - """ - kwargs['_return_http_data_only'] = True - if kwargs.get('async_req'): - return self.get_custom_field_with_http_info(custom_field_gid, **kwargs) # noqa: E501 - else: - (data) = self.get_custom_field_with_http_info(custom_field_gid, **kwargs) # noqa: E501 - return data - - def get_custom_field_with_http_info(self, custom_field_gid, **kwargs): # noqa: E501 - """Get a custom field # noqa: E501 - - Get the complete definition of a custom field’s metadata. Since custom fields can be defined for one of a number of types, and these types have different data and behaviors, there are fields that are relevant to a particular type. For instance, as noted above, enum_options is only relevant for the enum type and defines the set of choices that the enum could represent. The examples below show some of these type-specific custom field definitions. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.get_custom_field_with_http_info(custom_field_gid, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param str custom_field_gid: Globally unique identifier for the custom field. (required) - :param list[str] opt_fields: This endpoint returns a compact resource, which excludes some properties by default. To include those optional properties, set this query parameter to a comma-separated list of the properties you wish to include. - :return: CustomFieldResponseData - If the method is called asynchronously, - returns the request thread. - """ - - all_params = ['custom_field_gid', 'opt_fields'] # noqa: E501 - all_params.append('async_req') - all_params.append('_return_http_data_only') - all_params.append('_preload_content') - all_params.append('_request_timeout') - - params = locals() - for key, val in six.iteritems(params['kwargs']): - if key not in all_params: - raise TypeError( - "Got an unexpected keyword argument '%s'" - " to method get_custom_field" % key - ) - params[key] = val - del params['kwargs'] - # verify the required parameter 'custom_field_gid' is set - if ('custom_field_gid' not in params or - params['custom_field_gid'] is None): - raise ValueError("Missing the required parameter `custom_field_gid` when calling `get_custom_field`") # noqa: E501 - - collection_formats = {} - - path_params = {} - if 'custom_field_gid' in params: - path_params['custom_field_gid'] = params['custom_field_gid'] # noqa: E501 - - query_params = [] - if 'opt_fields' in params: - query_params.append(('opt_fields', params['opt_fields'])) # noqa: E501 - collection_formats['opt_fields'] = 'csv' # noqa: E501 - - header_params = {} - - form_params = [] - local_var_files = {} - - body_params = None - # HTTP header `Accept` - header_params['Accept'] = self.api_client.select_header_accept( - ['application/json; charset=UTF-8']) # noqa: E501 - - # Authentication setting - auth_settings = ['oauth2'] # noqa: E501 - - return self.api_client.call_api( - '/custom_fields/{custom_field_gid}', 'GET', - path_params, - query_params, - header_params, - body=body_params, - post_params=form_params, - files=local_var_files, - response_type='CustomFieldResponseData', # noqa: E501 - auth_settings=auth_settings, - async_req=params.get('async_req'), - _return_http_data_only=params.get('_return_http_data_only'), - _preload_content=params.get('_preload_content', True), - _request_timeout=params.get('_request_timeout'), - collection_formats=collection_formats) - - def get_custom_fields_for_workspace(self, workspace_gid, **kwargs): # noqa: E501 - """Get a workspace's custom fields # noqa: E501 - - Returns a list of the compact representation of all of the custom fields in a workspace. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.get_custom_fields_for_workspace(workspace_gid, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param str workspace_gid: Globally unique identifier for the workspace or organization. (required) - :param int limit: Results per page. The number of objects to return per page. The value must be between 1 and 100. - :param str offset: 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 list[str] opt_fields: This endpoint returns a compact resource, which excludes some properties by default. To include those optional properties, set this query parameter to a comma-separated list of the properties you wish to include. - :return: CustomFieldResponseArray - If the method is called asynchronously, - returns the request thread. - """ - kwargs['_return_http_data_only'] = True - if kwargs.get('async_req'): - return self.get_custom_fields_for_workspace_with_http_info(workspace_gid, **kwargs) # noqa: E501 - else: - (data) = self.get_custom_fields_for_workspace_with_http_info(workspace_gid, **kwargs) # noqa: E501 - return data - - def get_custom_fields_for_workspace_with_http_info(self, workspace_gid, **kwargs): # noqa: E501 - """Get a workspace's custom fields # noqa: E501 - - Returns a list of the compact representation of all of the custom fields in a workspace. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.get_custom_fields_for_workspace_with_http_info(workspace_gid, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param str workspace_gid: Globally unique identifier for the workspace or organization. (required) - :param int limit: Results per page. The number of objects to return per page. The value must be between 1 and 100. - :param str offset: 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 list[str] opt_fields: This endpoint returns a compact resource, which excludes some properties by default. To include those optional properties, set this query parameter to a comma-separated list of the properties you wish to include. - :return: CustomFieldResponseArray - If the method is called asynchronously, - returns the request thread. - """ - - all_params = ['workspace_gid', 'limit', 'offset', 'opt_fields'] # noqa: E501 - all_params.append('async_req') - all_params.append('_return_http_data_only') - all_params.append('_preload_content') - all_params.append('_request_timeout') - - params = locals() - for key, val in six.iteritems(params['kwargs']): - if key not in all_params: - raise TypeError( - "Got an unexpected keyword argument '%s'" - " to method get_custom_fields_for_workspace" % key - ) - params[key] = val - del params['kwargs'] - # verify the required parameter 'workspace_gid' is set - if ('workspace_gid' not in params or - params['workspace_gid'] is None): - raise ValueError("Missing the required parameter `workspace_gid` when calling `get_custom_fields_for_workspace`") # noqa: E501 - - collection_formats = {} - - path_params = {} - if 'workspace_gid' in params: - path_params['workspace_gid'] = params['workspace_gid'] # noqa: E501 - - query_params = [] - if 'limit' in params: - query_params.append(('limit', params['limit'])) # noqa: E501 - if 'offset' in params: - query_params.append(('offset', params['offset'])) # noqa: E501 - if 'opt_fields' in params: - query_params.append(('opt_fields', params['opt_fields'])) # noqa: E501 - collection_formats['opt_fields'] = 'csv' # noqa: E501 - - header_params = {} - - form_params = [] - local_var_files = {} - - body_params = None - # HTTP header `Accept` - header_params['Accept'] = self.api_client.select_header_accept( - ['application/json; charset=UTF-8']) # noqa: E501 - - # Authentication setting - auth_settings = ['oauth2'] # noqa: E501 - - return self.api_client.call_api( - '/workspaces/{workspace_gid}/custom_fields', 'GET', - path_params, - query_params, - header_params, - body=body_params, - post_params=form_params, - files=local_var_files, - response_type='CustomFieldResponseArray', # noqa: E501 - auth_settings=auth_settings, - async_req=params.get('async_req'), - _return_http_data_only=params.get('_return_http_data_only'), - _preload_content=params.get('_preload_content', True), - _request_timeout=params.get('_request_timeout'), - collection_formats=collection_formats) - - def insert_enum_option_for_custom_field(self, custom_field_gid, **kwargs): # noqa: E501 - """Reorder a custom field's enum # noqa: E501 - - Moves a particular enum option to be either before or after another specified enum option in the custom field. Locked custom fields can only be reordered by the user who locked the field. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.insert_enum_option_for_custom_field(custom_field_gid, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param str custom_field_gid: Globally unique identifier for the custom field. (required) - :param EnumOptionsInsertBody body: The enum option object to create. - :param list[str] opt_fields: This endpoint returns a compact resource, which excludes some properties by default. To include those optional properties, set this query parameter to a comma-separated list of the properties you wish to include. - :return: EnumOptionData - If the method is called asynchronously, - returns the request thread. - """ - kwargs['_return_http_data_only'] = True - if kwargs.get('async_req'): - return self.insert_enum_option_for_custom_field_with_http_info(custom_field_gid, **kwargs) # noqa: E501 - else: - (data) = self.insert_enum_option_for_custom_field_with_http_info(custom_field_gid, **kwargs) # noqa: E501 - return data - - def insert_enum_option_for_custom_field_with_http_info(self, custom_field_gid, **kwargs): # noqa: E501 - """Reorder a custom field's enum # noqa: E501 - - Moves a particular enum option to be either before or after another specified enum option in the custom field. Locked custom fields can only be reordered by the user who locked the field. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.insert_enum_option_for_custom_field_with_http_info(custom_field_gid, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param str custom_field_gid: Globally unique identifier for the custom field. (required) - :param EnumOptionsInsertBody body: The enum option object to create. - :param list[str] opt_fields: This endpoint returns a compact resource, which excludes some properties by default. To include those optional properties, set this query parameter to a comma-separated list of the properties you wish to include. - :return: EnumOptionData - If the method is called asynchronously, - returns the request thread. - """ - - all_params = ['custom_field_gid', 'body', 'opt_fields'] # noqa: E501 - all_params.append('async_req') - all_params.append('_return_http_data_only') - all_params.append('_preload_content') - all_params.append('_request_timeout') - - params = locals() - for key, val in six.iteritems(params['kwargs']): - if key not in all_params: - raise TypeError( - "Got an unexpected keyword argument '%s'" - " to method insert_enum_option_for_custom_field" % key - ) - params[key] = val - del params['kwargs'] - # verify the required parameter 'custom_field_gid' is set - if ('custom_field_gid' not in params or - params['custom_field_gid'] is None): - raise ValueError("Missing the required parameter `custom_field_gid` when calling `insert_enum_option_for_custom_field`") # noqa: E501 - - collection_formats = {} - - path_params = {} - if 'custom_field_gid' in params: - path_params['custom_field_gid'] = params['custom_field_gid'] # noqa: E501 - - query_params = [] - if 'opt_fields' in params: - query_params.append(('opt_fields', params['opt_fields'])) # noqa: E501 - collection_formats['opt_fields'] = 'csv' # noqa: E501 - - header_params = {} - - form_params = [] - local_var_files = {} - - body_params = None - if 'body' in params: - body_params = params['body'] - # HTTP header `Accept` - header_params['Accept'] = self.api_client.select_header_accept( - ['application/json; charset=UTF-8']) # noqa: E501 - - # HTTP header `Content-Type` - header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 - ['application/json; charset=UTF-8']) # noqa: E501 - - # Authentication setting - auth_settings = ['oauth2'] # noqa: E501 - - return self.api_client.call_api( - '/custom_fields/{custom_field_gid}/enum_options/insert', 'POST', - path_params, - query_params, - header_params, - body=body_params, - post_params=form_params, - files=local_var_files, - response_type='EnumOptionData', # noqa: E501 - auth_settings=auth_settings, - async_req=params.get('async_req'), - _return_http_data_only=params.get('_return_http_data_only'), - _preload_content=params.get('_preload_content', True), - _request_timeout=params.get('_request_timeout'), - collection_formats=collection_formats) - - def update_custom_field(self, custom_field_gid, **kwargs): # noqa: E501 - """Update a custom field # noqa: E501 - - A specific, existing custom field can be updated by making a PUT request on the URL for that custom field. Only the fields provided in the `data` block will be updated; any unspecified fields will remain unchanged When using this method, it is best to specify only those fields you wish to change, or else you may overwrite changes made by another user since you last retrieved the custom field. A custom field’s `type` cannot be updated. An enum custom field’s `enum_options` cannot be updated with this endpoint. Instead see “Work With Enum Options” for information on how to update `enum_options`. Locked custom fields can only be updated by the user who locked the field. Returns the complete updated custom field record. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.update_custom_field(custom_field_gid, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param str custom_field_gid: Globally unique identifier for the custom field. (required) - :param CustomFieldsCustomFieldGidBody body: The custom field object with all updated properties. - :param list[str] opt_fields: This endpoint returns a compact resource, which excludes some properties by default. To include those optional properties, set this query parameter to a comma-separated list of the properties you wish to include. - :return: CustomFieldResponseData - If the method is called asynchronously, - returns the request thread. - """ - kwargs['_return_http_data_only'] = True - if kwargs.get('async_req'): - return self.update_custom_field_with_http_info(custom_field_gid, **kwargs) # noqa: E501 - else: - (data) = self.update_custom_field_with_http_info(custom_field_gid, **kwargs) # noqa: E501 - return data - - def update_custom_field_with_http_info(self, custom_field_gid, **kwargs): # noqa: E501 - """Update a custom field # noqa: E501 - - A specific, existing custom field can be updated by making a PUT request on the URL for that custom field. Only the fields provided in the `data` block will be updated; any unspecified fields will remain unchanged When using this method, it is best to specify only those fields you wish to change, or else you may overwrite changes made by another user since you last retrieved the custom field. A custom field’s `type` cannot be updated. An enum custom field’s `enum_options` cannot be updated with this endpoint. Instead see “Work With Enum Options” for information on how to update `enum_options`. Locked custom fields can only be updated by the user who locked the field. Returns the complete updated custom field record. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.update_custom_field_with_http_info(custom_field_gid, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param str custom_field_gid: Globally unique identifier for the custom field. (required) - :param CustomFieldsCustomFieldGidBody body: The custom field object with all updated properties. - :param list[str] opt_fields: This endpoint returns a compact resource, which excludes some properties by default. To include those optional properties, set this query parameter to a comma-separated list of the properties you wish to include. - :return: CustomFieldResponseData - If the method is called asynchronously, - returns the request thread. - """ - - all_params = ['custom_field_gid', 'body', 'opt_fields'] # noqa: E501 - all_params.append('async_req') - all_params.append('_return_http_data_only') - all_params.append('_preload_content') - all_params.append('_request_timeout') - - params = locals() - for key, val in six.iteritems(params['kwargs']): - if key not in all_params: - raise TypeError( - "Got an unexpected keyword argument '%s'" - " to method update_custom_field" % key - ) - params[key] = val - del params['kwargs'] - # verify the required parameter 'custom_field_gid' is set - if ('custom_field_gid' not in params or - params['custom_field_gid'] is None): - raise ValueError("Missing the required parameter `custom_field_gid` when calling `update_custom_field`") # noqa: E501 - - collection_formats = {} - - path_params = {} - if 'custom_field_gid' in params: - path_params['custom_field_gid'] = params['custom_field_gid'] # noqa: E501 - - query_params = [] - if 'opt_fields' in params: - query_params.append(('opt_fields', params['opt_fields'])) # noqa: E501 - collection_formats['opt_fields'] = 'csv' # noqa: E501 - - header_params = {} - - form_params = [] - local_var_files = {} - - body_params = None - if 'body' in params: - body_params = params['body'] - # HTTP header `Accept` - header_params['Accept'] = self.api_client.select_header_accept( - ['application/json; charset=UTF-8']) # noqa: E501 - - # HTTP header `Content-Type` - header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 - ['application/json; charset=UTF-8']) # noqa: E501 - - # Authentication setting - auth_settings = ['oauth2'] # noqa: E501 - - return self.api_client.call_api( - '/custom_fields/{custom_field_gid}', 'PUT', - path_params, - query_params, - header_params, - body=body_params, - post_params=form_params, - files=local_var_files, - response_type='CustomFieldResponseData', # noqa: E501 - auth_settings=auth_settings, - async_req=params.get('async_req'), - _return_http_data_only=params.get('_return_http_data_only'), - _preload_content=params.get('_preload_content', True), - _request_timeout=params.get('_request_timeout'), - collection_formats=collection_formats) - - def update_enum_option(self, enum_option_gid, **kwargs): # noqa: E501 - """Update an enum option # noqa: E501 - - Updates an existing enum option. Enum custom fields require at least one enabled enum option. Locked custom fields can only be updated by the user who locked the field. Returns the full record of the updated enum option. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.update_enum_option(enum_option_gid, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param str enum_option_gid: Globally unique identifier for the enum option. (required) - :param EnumOptionsEnumOptionGidBody body: The enum option object to update - :param list[str] opt_fields: This endpoint returns a compact resource, which excludes some properties by default. To include those optional properties, set this query parameter to a comma-separated list of the properties you wish to include. - :return: EnumOptionData - If the method is called asynchronously, - returns the request thread. - """ - kwargs['_return_http_data_only'] = True - if kwargs.get('async_req'): - return self.update_enum_option_with_http_info(enum_option_gid, **kwargs) # noqa: E501 - else: - (data) = self.update_enum_option_with_http_info(enum_option_gid, **kwargs) # noqa: E501 - return data - - def update_enum_option_with_http_info(self, enum_option_gid, **kwargs): # noqa: E501 - """Update an enum option # noqa: E501 - - Updates an existing enum option. Enum custom fields require at least one enabled enum option. Locked custom fields can only be updated by the user who locked the field. Returns the full record of the updated enum option. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.update_enum_option_with_http_info(enum_option_gid, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param str enum_option_gid: Globally unique identifier for the enum option. (required) - :param EnumOptionsEnumOptionGidBody body: The enum option object to update - :param list[str] opt_fields: This endpoint returns a compact resource, which excludes some properties by default. To include those optional properties, set this query parameter to a comma-separated list of the properties you wish to include. - :return: EnumOptionData - If the method is called asynchronously, - returns the request thread. - """ - - all_params = ['enum_option_gid', 'body', 'opt_fields'] # noqa: E501 - all_params.append('async_req') - all_params.append('_return_http_data_only') - all_params.append('_preload_content') - all_params.append('_request_timeout') - - params = locals() - for key, val in six.iteritems(params['kwargs']): - if key not in all_params: - raise TypeError( - "Got an unexpected keyword argument '%s'" - " to method update_enum_option" % key - ) - params[key] = val - del params['kwargs'] - # verify the required parameter 'enum_option_gid' is set - if ('enum_option_gid' not in params or - params['enum_option_gid'] is None): - raise ValueError("Missing the required parameter `enum_option_gid` when calling `update_enum_option`") # noqa: E501 - - collection_formats = {} - - path_params = {} - if 'enum_option_gid' in params: - path_params['enum_option_gid'] = params['enum_option_gid'] # noqa: E501 - - query_params = [] - if 'opt_fields' in params: - query_params.append(('opt_fields', params['opt_fields'])) # noqa: E501 - collection_formats['opt_fields'] = 'csv' # noqa: E501 - - header_params = {} - - form_params = [] - local_var_files = {} - - body_params = None - if 'body' in params: - body_params = params['body'] - # HTTP header `Accept` - header_params['Accept'] = self.api_client.select_header_accept( - ['application/json; charset=UTF-8']) # noqa: E501 - - # HTTP header `Content-Type` - header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 - ['application/json; charset=UTF-8']) # noqa: E501 - - # Authentication setting - auth_settings = ['oauth2'] # noqa: E501 - - return self.api_client.call_api( - '/enum_options/{enum_option_gid}', 'PUT', - path_params, - query_params, - header_params, - body=body_params, - post_params=form_params, - files=local_var_files, - response_type='EnumOptionData', # noqa: E501 - auth_settings=auth_settings, - async_req=params.get('async_req'), - _return_http_data_only=params.get('_return_http_data_only'), - _preload_content=params.get('_preload_content', True), - _request_timeout=params.get('_request_timeout'), - collection_formats=collection_formats) + all_params = ['enum_option_gid', 'body', 'opt_fields'] # noqa: E501 + all_params.append('async_req') + all_params.append('header_params') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + params = locals() + for key, val in six.iteritems(params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method update_enum_option" % key + ) + params[key] = val + del params['kwargs'] + # verify the required parameter 'enum_option_gid' is set + if ('enum_option_gid' not in params or + params['enum_option_gid'] is None): + raise ValueError("Missing the required parameter `enum_option_gid` when calling `update_enum_option`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'enum_option_gid' in params: + path_params['enum_option_gid'] = params['enum_option_gid'] # noqa: E501 + + query_params = [] + if 'opt_fields' in params: + query_params.append(('opt_fields', params['opt_fields'])) # noqa: E501 + collection_formats['opt_fields'] = 'csv' # noqa: E501 + + header_params = kwargs.get("header_params", {}) + + form_params = [] + local_var_files = {} + + body_params = None + if 'body' in params: + body_params = params['body'] + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['application/json; charset=UTF-8']) # noqa: E501 + + # HTTP header `Content-Type` + header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 + ['application/json; charset=UTF-8']) # noqa: E501 + + # Authentication setting + auth_settings = ['oauth2'] # noqa: E501 + + return self.api_client.call_api( + '/enum_options/{enum_option_gid}', 'PUT', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='EnumOptionData', # noqa: E501 + auth_settings=auth_settings, + async_req=params.get('async_req'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) diff --git a/asana/api/events_api.py b/asana/api/events_api.py index 197fe1ef..3c986e48 100644 --- a/asana/api/events_api.py +++ b/asana/api/events_api.py @@ -21,117 +21,118 @@ class EventsApi(object): - """NOTE: This class is auto generated by the swagger code generator program. +"""NOTE: This class is auto generated by the swagger code generator program. - Do not edit the class manually. - Ref: https://github.com/swagger-api/swagger-codegen +Do not edit the class manually. +Ref: https://github.com/swagger-api/swagger-codegen +""" + +def __init__(self, api_client=None): + if api_client is None: + api_client = ApiClient() + self.api_client = api_client + +def get_events(self, resource, **kwargs): # noqa: E501 + """Get events on a resource # noqa: E501 + + Returns the full record for all events that have occurred since the sync token was created. A `GET` request to the endpoint `/[path_to_resource]/events` can be made in lieu of including the resource ID in the data for the request. Asana limits a single sync token to 100 events. If more than 100 events exist for a given resource, `has_more: true` will be returned in the response, indicating that there are more events to pull. *Note: The resource returned will be the resource that triggered the event. This may be different from the one that the events were requested for. For example, a subscription to a project will contain events for tasks contained within the project.* # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.get_events(resource, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str resource: A resource ID to subscribe to. The resource can be a task or project. (required) + :param str sync: 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.* + :param list[str] opt_fields: This endpoint returns a compact resource, which excludes some properties by default. To include those optional properties, set this query parameter to a comma-separated list of the properties you wish to include. + :return: EventResponseArray + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = kwargs.get("_return_http_data_only", True) + if kwargs.get('async_req'): + return self.get_events_with_http_info(resource, **kwargs) # noqa: E501 + else: + (data) = self.get_events_with_http_info(resource, **kwargs) # noqa: E501 + return data + +def get_events_with_http_info(self, resource, **kwargs): # noqa: E501 + """Get events on a resource # noqa: E501 + + Returns the full record for all events that have occurred since the sync token was created. A `GET` request to the endpoint `/[path_to_resource]/events` can be made in lieu of including the resource ID in the data for the request. Asana limits a single sync token to 100 events. If more than 100 events exist for a given resource, `has_more: true` will be returned in the response, indicating that there are more events to pull. *Note: The resource returned will be the resource that triggered the event. This may be different from the one that the events were requested for. For example, a subscription to a project will contain events for tasks contained within the project.* # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.get_events_with_http_info(resource, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str resource: A resource ID to subscribe to. The resource can be a task or project. (required) + :param str sync: 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.* + :param list[str] opt_fields: This endpoint returns a compact resource, which excludes some properties by default. To include those optional properties, set this query parameter to a comma-separated list of the properties you wish to include. + :return: EventResponseArray + If the method is called asynchronously, + returns the request thread. """ - def __init__(self, api_client=None): - if api_client is None: - api_client = ApiClient() - self.api_client = api_client - - def get_events(self, resource, **kwargs): # noqa: E501 - """Get events on a resource # noqa: E501 - - Returns the full record for all events that have occurred since the sync token was created. A `GET` request to the endpoint `/[path_to_resource]/events` can be made in lieu of including the resource ID in the data for the request. Asana limits a single sync token to 100 events. If more than 100 events exist for a given resource, `has_more: true` will be returned in the response, indicating that there are more events to pull. *Note: The resource returned will be the resource that triggered the event. This may be different from the one that the events were requested for. For example, a subscription to a project will contain events for tasks contained within the project.* # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.get_events(resource, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param str resource: A resource ID to subscribe to. The resource can be a task or project. (required) - :param str sync: 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.* - :param list[str] opt_fields: This endpoint returns a compact resource, which excludes some properties by default. To include those optional properties, set this query parameter to a comma-separated list of the properties you wish to include. - :return: EventResponseArray - If the method is called asynchronously, - returns the request thread. - """ - kwargs['_return_http_data_only'] = True - if kwargs.get('async_req'): - return self.get_events_with_http_info(resource, **kwargs) # noqa: E501 - else: - (data) = self.get_events_with_http_info(resource, **kwargs) # noqa: E501 - return data - - def get_events_with_http_info(self, resource, **kwargs): # noqa: E501 - """Get events on a resource # noqa: E501 - - Returns the full record for all events that have occurred since the sync token was created. A `GET` request to the endpoint `/[path_to_resource]/events` can be made in lieu of including the resource ID in the data for the request. Asana limits a single sync token to 100 events. If more than 100 events exist for a given resource, `has_more: true` will be returned in the response, indicating that there are more events to pull. *Note: The resource returned will be the resource that triggered the event. This may be different from the one that the events were requested for. For example, a subscription to a project will contain events for tasks contained within the project.* # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.get_events_with_http_info(resource, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param str resource: A resource ID to subscribe to. The resource can be a task or project. (required) - :param str sync: 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.* - :param list[str] opt_fields: This endpoint returns a compact resource, which excludes some properties by default. To include those optional properties, set this query parameter to a comma-separated list of the properties you wish to include. - :return: EventResponseArray - If the method is called asynchronously, - returns the request thread. - """ - - all_params = ['resource', 'sync', 'opt_fields'] # noqa: E501 - all_params.append('async_req') - all_params.append('_return_http_data_only') - all_params.append('_preload_content') - all_params.append('_request_timeout') - - params = locals() - for key, val in six.iteritems(params['kwargs']): - if key not in all_params: - raise TypeError( - "Got an unexpected keyword argument '%s'" - " to method get_events" % key - ) - params[key] = val - del params['kwargs'] - # verify the required parameter 'resource' is set - if ('resource' not in params or - params['resource'] is None): - raise ValueError("Missing the required parameter `resource` when calling `get_events`") # noqa: E501 - - collection_formats = {} - - path_params = {} - - query_params = [] - if 'resource' in params: - query_params.append(('resource', params['resource'])) # noqa: E501 - if 'sync' in params: - query_params.append(('sync', params['sync'])) # noqa: E501 - if 'opt_fields' in params: - query_params.append(('opt_fields', params['opt_fields'])) # noqa: E501 - collection_formats['opt_fields'] = 'csv' # noqa: E501 - - header_params = {} - - form_params = [] - local_var_files = {} - - body_params = None - # HTTP header `Accept` - header_params['Accept'] = self.api_client.select_header_accept( - ['application/json; charset=UTF-8']) # noqa: E501 - - # Authentication setting - auth_settings = ['oauth2'] # noqa: E501 - - return self.api_client.call_api( - '/events', 'GET', - path_params, - query_params, - header_params, - body=body_params, - post_params=form_params, - files=local_var_files, - response_type='EventResponseArray', # noqa: E501 - auth_settings=auth_settings, - async_req=params.get('async_req'), - _return_http_data_only=params.get('_return_http_data_only'), - _preload_content=params.get('_preload_content', True), - _request_timeout=params.get('_request_timeout'), - collection_formats=collection_formats) + all_params = ['resource', 'sync', 'opt_fields'] # noqa: E501 + all_params.append('async_req') + all_params.append('header_params') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + params = locals() + for key, val in six.iteritems(params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method get_events" % key + ) + params[key] = val + del params['kwargs'] + # verify the required parameter 'resource' is set + if ('resource' not in params or + params['resource'] is None): + raise ValueError("Missing the required parameter `resource` when calling `get_events`") # noqa: E501 + + collection_formats = {} + + path_params = {} + + query_params = [] + if 'resource' in params: + query_params.append(('resource', params['resource'])) # noqa: E501 + if 'sync' in params: + query_params.append(('sync', params['sync'])) # noqa: E501 + if 'opt_fields' in params: + query_params.append(('opt_fields', params['opt_fields'])) # noqa: E501 + collection_formats['opt_fields'] = 'csv' # noqa: E501 + + header_params = kwargs.get("header_params", {}) + + form_params = [] + local_var_files = {} + + body_params = None + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['application/json; charset=UTF-8']) # noqa: E501 + + # Authentication setting + auth_settings = ['oauth2'] # noqa: E501 + + return self.api_client.call_api( + '/events', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='EventResponseArray', # noqa: E501 + auth_settings=auth_settings, + async_req=params.get('async_req'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) diff --git a/asana/api/goal_relationships_api.py b/asana/api/goal_relationships_api.py index e6b24878..9ab83063 100644 --- a/asana/api/goal_relationships_api.py +++ b/asana/api/goal_relationships_api.py @@ -21,556 +21,561 @@ class GoalRelationshipsApi(object): - """NOTE: This class is auto generated by the swagger code generator program. +"""NOTE: This class is auto generated by the swagger code generator program. - Do not edit the class manually. - Ref: https://github.com/swagger-api/swagger-codegen +Do not edit the class manually. +Ref: https://github.com/swagger-api/swagger-codegen +""" + +def __init__(self, api_client=None): + if api_client is None: + api_client = ApiClient() + self.api_client = api_client + +def add_supporting_relationship(self, body, goal_gid, **kwargs): # noqa: E501 + """Add a supporting goal relationship # noqa: E501 + + Creates a goal relationship by adding a supporting resource to a given goal. Returns the newly created goal relationship record. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.add_supporting_relationship(body, goal_gid, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param GoalGidAddSupportingRelationshipBody body: The supporting resource to be added to the goal (required) + :param str goal_gid: Globally unique identifier for the goal. (required) + :param list[str] opt_fields: This endpoint returns a compact resource, which excludes some properties by default. To include those optional properties, set this query parameter to a comma-separated list of the properties you wish to include. + :return: GoalRelationshipResponseData + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = kwargs.get("_return_http_data_only", True) + if kwargs.get('async_req'): + return self.add_supporting_relationship_with_http_info(body, goal_gid, **kwargs) # noqa: E501 + else: + (data) = self.add_supporting_relationship_with_http_info(body, goal_gid, **kwargs) # noqa: E501 + return data + +def add_supporting_relationship_with_http_info(self, body, goal_gid, **kwargs): # noqa: E501 + """Add a supporting goal relationship # noqa: E501 + + Creates a goal relationship by adding a supporting resource to a given goal. Returns the newly created goal relationship record. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.add_supporting_relationship_with_http_info(body, goal_gid, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param GoalGidAddSupportingRelationshipBody body: The supporting resource to be added to the goal (required) + :param str goal_gid: Globally unique identifier for the goal. (required) + :param list[str] opt_fields: This endpoint returns a compact resource, which excludes some properties by default. To include those optional properties, set this query parameter to a comma-separated list of the properties you wish to include. + :return: GoalRelationshipResponseData + If the method is called asynchronously, + returns the request thread. + """ + + all_params = ['body', 'goal_gid', 'opt_fields'] # noqa: E501 + all_params.append('async_req') + all_params.append('header_params') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + params = locals() + for key, val in six.iteritems(params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method add_supporting_relationship" % key + ) + params[key] = val + del params['kwargs'] + # verify the required parameter 'body' is set + if ('body' not in params or + params['body'] is None): + raise ValueError("Missing the required parameter `body` when calling `add_supporting_relationship`") # noqa: E501 + # verify the required parameter 'goal_gid' is set + if ('goal_gid' not in params or + params['goal_gid'] is None): + raise ValueError("Missing the required parameter `goal_gid` when calling `add_supporting_relationship`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'goal_gid' in params: + path_params['goal_gid'] = params['goal_gid'] # noqa: E501 + + query_params = [] + if 'opt_fields' in params: + query_params.append(('opt_fields', params['opt_fields'])) # noqa: E501 + collection_formats['opt_fields'] = 'csv' # noqa: E501 + + header_params = kwargs.get("header_params", {}) + + form_params = [] + local_var_files = {} + + body_params = None + if 'body' in params: + body_params = params['body'] + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['application/json; charset=UTF-8']) # noqa: E501 + + # HTTP header `Content-Type` + header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 + ['application/json; charset=UTF-8']) # noqa: E501 + + # Authentication setting + auth_settings = ['oauth2'] # noqa: E501 + + return self.api_client.call_api( + '/goals/{goal_gid}/addSupportingRelationship', 'POST', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='GoalRelationshipResponseData', # noqa: E501 + auth_settings=auth_settings, + async_req=params.get('async_req'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) + +def get_goal_relationship(self, goal_relationship_gid, **kwargs): # noqa: E501 + """Get a goal relationship # noqa: E501 + + Returns the complete updated goal relationship record for a single goal relationship. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.get_goal_relationship(goal_relationship_gid, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str goal_relationship_gid: Globally unique identifier for the goal relationship. (required) + :param list[str] opt_fields: This endpoint returns a compact resource, which excludes some properties by default. To include those optional properties, set this query parameter to a comma-separated list of the properties you wish to include. + :return: GoalRelationshipResponseData + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = kwargs.get("_return_http_data_only", True) + if kwargs.get('async_req'): + return self.get_goal_relationship_with_http_info(goal_relationship_gid, **kwargs) # noqa: E501 + else: + (data) = self.get_goal_relationship_with_http_info(goal_relationship_gid, **kwargs) # noqa: E501 + return data + +def get_goal_relationship_with_http_info(self, goal_relationship_gid, **kwargs): # noqa: E501 + """Get a goal relationship # noqa: E501 + + Returns the complete updated goal relationship record for a single goal relationship. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.get_goal_relationship_with_http_info(goal_relationship_gid, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str goal_relationship_gid: Globally unique identifier for the goal relationship. (required) + :param list[str] opt_fields: This endpoint returns a compact resource, which excludes some properties by default. To include those optional properties, set this query parameter to a comma-separated list of the properties you wish to include. + :return: GoalRelationshipResponseData + If the method is called asynchronously, + returns the request thread. + """ + + all_params = ['goal_relationship_gid', 'opt_fields'] # noqa: E501 + all_params.append('async_req') + all_params.append('header_params') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + params = locals() + for key, val in six.iteritems(params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method get_goal_relationship" % key + ) + params[key] = val + del params['kwargs'] + # verify the required parameter 'goal_relationship_gid' is set + if ('goal_relationship_gid' not in params or + params['goal_relationship_gid'] is None): + raise ValueError("Missing the required parameter `goal_relationship_gid` when calling `get_goal_relationship`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'goal_relationship_gid' in params: + path_params['goal_relationship_gid'] = params['goal_relationship_gid'] # noqa: E501 + + query_params = [] + if 'opt_fields' in params: + query_params.append(('opt_fields', params['opt_fields'])) # noqa: E501 + collection_formats['opt_fields'] = 'csv' # noqa: E501 + + header_params = kwargs.get("header_params", {}) + + form_params = [] + local_var_files = {} + + body_params = None + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['application/json; charset=UTF-8']) # noqa: E501 + + # Authentication setting + auth_settings = ['oauth2'] # noqa: E501 + + return self.api_client.call_api( + '/goal_relationships/{goal_relationship_gid}', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='GoalRelationshipResponseData', # noqa: E501 + auth_settings=auth_settings, + async_req=params.get('async_req'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) + +def get_goal_relationships(self, supported_goal, **kwargs): # noqa: E501 + """Get goal relationships # noqa: E501 + + Returns compact goal relationship records. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.get_goal_relationships(supported_goal, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str supported_goal: Globally unique identifier for the supported goal in the goal relationship. (required) + :param int limit: Results per page. The number of objects to return per page. The value must be between 1 and 100. + :param str offset: 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 str resource_subtype: If provided, filter to goal relationships with a given resource_subtype. + :param list[str] opt_fields: This endpoint returns a compact resource, which excludes some properties by default. To include those optional properties, set this query parameter to a comma-separated list of the properties you wish to include. + :return: GoalRelationshipResponseArray + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = kwargs.get("_return_http_data_only", True) + if kwargs.get('async_req'): + return self.get_goal_relationships_with_http_info(supported_goal, **kwargs) # noqa: E501 + else: + (data) = self.get_goal_relationships_with_http_info(supported_goal, **kwargs) # noqa: E501 + return data + +def get_goal_relationships_with_http_info(self, supported_goal, **kwargs): # noqa: E501 + """Get goal relationships # noqa: E501 + + Returns compact goal relationship records. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.get_goal_relationships_with_http_info(supported_goal, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str supported_goal: Globally unique identifier for the supported goal in the goal relationship. (required) + :param int limit: Results per page. The number of objects to return per page. The value must be between 1 and 100. + :param str offset: 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 str resource_subtype: If provided, filter to goal relationships with a given resource_subtype. + :param list[str] opt_fields: This endpoint returns a compact resource, which excludes some properties by default. To include those optional properties, set this query parameter to a comma-separated list of the properties you wish to include. + :return: GoalRelationshipResponseArray + If the method is called asynchronously, + returns the request thread. + """ + + all_params = ['supported_goal', 'limit', 'offset', 'resource_subtype', 'opt_fields'] # noqa: E501 + all_params.append('async_req') + all_params.append('header_params') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + params = locals() + for key, val in six.iteritems(params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method get_goal_relationships" % key + ) + params[key] = val + del params['kwargs'] + # verify the required parameter 'supported_goal' is set + if ('supported_goal' not in params or + params['supported_goal'] is None): + raise ValueError("Missing the required parameter `supported_goal` when calling `get_goal_relationships`") # noqa: E501 + + collection_formats = {} + + path_params = {} + + query_params = [] + if 'limit' in params: + query_params.append(('limit', params['limit'])) # noqa: E501 + if 'offset' in params: + query_params.append(('offset', params['offset'])) # noqa: E501 + if 'supported_goal' in params: + query_params.append(('supported_goal', params['supported_goal'])) # noqa: E501 + if 'resource_subtype' in params: + query_params.append(('resource_subtype', params['resource_subtype'])) # noqa: E501 + if 'opt_fields' in params: + query_params.append(('opt_fields', params['opt_fields'])) # noqa: E501 + collection_formats['opt_fields'] = 'csv' # noqa: E501 + + header_params = kwargs.get("header_params", {}) + + form_params = [] + local_var_files = {} + + body_params = None + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['application/json; charset=UTF-8']) # noqa: E501 + + # Authentication setting + auth_settings = ['oauth2'] # noqa: E501 + + return self.api_client.call_api( + '/goal_relationships', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='GoalRelationshipResponseArray', # noqa: E501 + auth_settings=auth_settings, + async_req=params.get('async_req'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) + +def remove_supporting_relationship(self, body, goal_gid, **kwargs): # noqa: E501 + """Removes a supporting goal relationship # noqa: E501 + + Removes a goal relationship for a given parent goal. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.remove_supporting_relationship(body, goal_gid, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param GoalGidRemoveSupportingRelationshipBody body: The supporting resource to be removed from the goal (required) + :param str goal_gid: Globally unique identifier for the goal. (required) + :return: EmptyResponseData + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = kwargs.get("_return_http_data_only", True) + if kwargs.get('async_req'): + return self.remove_supporting_relationship_with_http_info(body, goal_gid, **kwargs) # noqa: E501 + else: + (data) = self.remove_supporting_relationship_with_http_info(body, goal_gid, **kwargs) # noqa: E501 + return data + +def remove_supporting_relationship_with_http_info(self, body, goal_gid, **kwargs): # noqa: E501 + """Removes a supporting goal relationship # noqa: E501 + + Removes a goal relationship for a given parent goal. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.remove_supporting_relationship_with_http_info(body, goal_gid, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param GoalGidRemoveSupportingRelationshipBody body: The supporting resource to be removed from the goal (required) + :param str goal_gid: Globally unique identifier for the goal. (required) + :return: EmptyResponseData + If the method is called asynchronously, + returns the request thread. + """ + + all_params = ['body', 'goal_gid'] # noqa: E501 + all_params.append('async_req') + all_params.append('header_params') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + params = locals() + for key, val in six.iteritems(params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method remove_supporting_relationship" % key + ) + params[key] = val + del params['kwargs'] + # verify the required parameter 'body' is set + if ('body' not in params or + params['body'] is None): + raise ValueError("Missing the required parameter `body` when calling `remove_supporting_relationship`") # noqa: E501 + # verify the required parameter 'goal_gid' is set + if ('goal_gid' not in params or + params['goal_gid'] is None): + raise ValueError("Missing the required parameter `goal_gid` when calling `remove_supporting_relationship`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'goal_gid' in params: + path_params['goal_gid'] = params['goal_gid'] # noqa: E501 + + query_params = [] + + header_params = kwargs.get("header_params", {}) + + form_params = [] + local_var_files = {} + + body_params = None + if 'body' in params: + body_params = params['body'] + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['application/json; charset=UTF-8']) # noqa: E501 + + # HTTP header `Content-Type` + header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 + ['application/json; charset=UTF-8']) # noqa: E501 + + # Authentication setting + auth_settings = ['oauth2'] # noqa: E501 + + return self.api_client.call_api( + '/goals/{goal_gid}/removeSupportingRelationship', 'POST', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='EmptyResponseData', # noqa: E501 + auth_settings=auth_settings, + async_req=params.get('async_req'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) + +def update_goal_relationship(self, body, goal_relationship_gid, **kwargs): # noqa: E501 + """Update a goal relationship # noqa: E501 + + An existing goal relationship can be updated by making a PUT request on the URL for that goal relationship. Only the fields provided in the `data` block will be updated; any unspecified fields will remain unchanged. Returns the complete updated goal relationship record. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.update_goal_relationship(body, goal_relationship_gid, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param GoalRelationshipsGoalRelationshipGidBody body: The updated fields for the goal relationship. (required) + :param str goal_relationship_gid: Globally unique identifier for the goal relationship. (required) + :param list[str] opt_fields: This endpoint returns a compact resource, which excludes some properties by default. To include those optional properties, set this query parameter to a comma-separated list of the properties you wish to include. + :return: GoalRelationshipResponseData + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = kwargs.get("_return_http_data_only", True) + if kwargs.get('async_req'): + return self.update_goal_relationship_with_http_info(body, goal_relationship_gid, **kwargs) # noqa: E501 + else: + (data) = self.update_goal_relationship_with_http_info(body, goal_relationship_gid, **kwargs) # noqa: E501 + return data + +def update_goal_relationship_with_http_info(self, body, goal_relationship_gid, **kwargs): # noqa: E501 + """Update a goal relationship # noqa: E501 + + An existing goal relationship can be updated by making a PUT request on the URL for that goal relationship. Only the fields provided in the `data` block will be updated; any unspecified fields will remain unchanged. Returns the complete updated goal relationship record. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.update_goal_relationship_with_http_info(body, goal_relationship_gid, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param GoalRelationshipsGoalRelationshipGidBody body: The updated fields for the goal relationship. (required) + :param str goal_relationship_gid: Globally unique identifier for the goal relationship. (required) + :param list[str] opt_fields: This endpoint returns a compact resource, which excludes some properties by default. To include those optional properties, set this query parameter to a comma-separated list of the properties you wish to include. + :return: GoalRelationshipResponseData + If the method is called asynchronously, + returns the request thread. """ - def __init__(self, api_client=None): - if api_client is None: - api_client = ApiClient() - self.api_client = api_client - - def add_supporting_relationship(self, body, goal_gid, **kwargs): # noqa: E501 - """Add a supporting goal relationship # noqa: E501 - - Creates a goal relationship by adding a supporting resource to a given goal. Returns the newly created goal relationship record. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.add_supporting_relationship(body, goal_gid, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param GoalGidAddSupportingRelationshipBody body: The supporting resource to be added to the goal (required) - :param str goal_gid: Globally unique identifier for the goal. (required) - :param list[str] opt_fields: This endpoint returns a compact resource, which excludes some properties by default. To include those optional properties, set this query parameter to a comma-separated list of the properties you wish to include. - :return: GoalRelationshipResponseData - If the method is called asynchronously, - returns the request thread. - """ - kwargs['_return_http_data_only'] = True - if kwargs.get('async_req'): - return self.add_supporting_relationship_with_http_info(body, goal_gid, **kwargs) # noqa: E501 - else: - (data) = self.add_supporting_relationship_with_http_info(body, goal_gid, **kwargs) # noqa: E501 - return data - - def add_supporting_relationship_with_http_info(self, body, goal_gid, **kwargs): # noqa: E501 - """Add a supporting goal relationship # noqa: E501 - - Creates a goal relationship by adding a supporting resource to a given goal. Returns the newly created goal relationship record. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.add_supporting_relationship_with_http_info(body, goal_gid, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param GoalGidAddSupportingRelationshipBody body: The supporting resource to be added to the goal (required) - :param str goal_gid: Globally unique identifier for the goal. (required) - :param list[str] opt_fields: This endpoint returns a compact resource, which excludes some properties by default. To include those optional properties, set this query parameter to a comma-separated list of the properties you wish to include. - :return: GoalRelationshipResponseData - If the method is called asynchronously, - returns the request thread. - """ - - all_params = ['body', 'goal_gid', 'opt_fields'] # noqa: E501 - all_params.append('async_req') - all_params.append('_return_http_data_only') - all_params.append('_preload_content') - all_params.append('_request_timeout') - - params = locals() - for key, val in six.iteritems(params['kwargs']): - if key not in all_params: - raise TypeError( - "Got an unexpected keyword argument '%s'" - " to method add_supporting_relationship" % key - ) - params[key] = val - del params['kwargs'] - # verify the required parameter 'body' is set - if ('body' not in params or - params['body'] is None): - raise ValueError("Missing the required parameter `body` when calling `add_supporting_relationship`") # noqa: E501 - # verify the required parameter 'goal_gid' is set - if ('goal_gid' not in params or - params['goal_gid'] is None): - raise ValueError("Missing the required parameter `goal_gid` when calling `add_supporting_relationship`") # noqa: E501 - - collection_formats = {} - - path_params = {} - if 'goal_gid' in params: - path_params['goal_gid'] = params['goal_gid'] # noqa: E501 - - query_params = [] - if 'opt_fields' in params: - query_params.append(('opt_fields', params['opt_fields'])) # noqa: E501 - collection_formats['opt_fields'] = 'csv' # noqa: E501 - - header_params = {} - - form_params = [] - local_var_files = {} - - body_params = None - if 'body' in params: - body_params = params['body'] - # HTTP header `Accept` - header_params['Accept'] = self.api_client.select_header_accept( - ['application/json; charset=UTF-8']) # noqa: E501 - - # HTTP header `Content-Type` - header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 - ['application/json; charset=UTF-8']) # noqa: E501 - - # Authentication setting - auth_settings = ['oauth2'] # noqa: E501 - - return self.api_client.call_api( - '/goals/{goal_gid}/addSupportingRelationship', 'POST', - path_params, - query_params, - header_params, - body=body_params, - post_params=form_params, - files=local_var_files, - response_type='GoalRelationshipResponseData', # noqa: E501 - auth_settings=auth_settings, - async_req=params.get('async_req'), - _return_http_data_only=params.get('_return_http_data_only'), - _preload_content=params.get('_preload_content', True), - _request_timeout=params.get('_request_timeout'), - collection_formats=collection_formats) - - def get_goal_relationship(self, goal_relationship_gid, **kwargs): # noqa: E501 - """Get a goal relationship # noqa: E501 - - Returns the complete updated goal relationship record for a single goal relationship. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.get_goal_relationship(goal_relationship_gid, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param str goal_relationship_gid: Globally unique identifier for the goal relationship. (required) - :param list[str] opt_fields: This endpoint returns a compact resource, which excludes some properties by default. To include those optional properties, set this query parameter to a comma-separated list of the properties you wish to include. - :return: GoalRelationshipResponseData - If the method is called asynchronously, - returns the request thread. - """ - kwargs['_return_http_data_only'] = True - if kwargs.get('async_req'): - return self.get_goal_relationship_with_http_info(goal_relationship_gid, **kwargs) # noqa: E501 - else: - (data) = self.get_goal_relationship_with_http_info(goal_relationship_gid, **kwargs) # noqa: E501 - return data - - def get_goal_relationship_with_http_info(self, goal_relationship_gid, **kwargs): # noqa: E501 - """Get a goal relationship # noqa: E501 - - Returns the complete updated goal relationship record for a single goal relationship. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.get_goal_relationship_with_http_info(goal_relationship_gid, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param str goal_relationship_gid: Globally unique identifier for the goal relationship. (required) - :param list[str] opt_fields: This endpoint returns a compact resource, which excludes some properties by default. To include those optional properties, set this query parameter to a comma-separated list of the properties you wish to include. - :return: GoalRelationshipResponseData - If the method is called asynchronously, - returns the request thread. - """ - - all_params = ['goal_relationship_gid', 'opt_fields'] # noqa: E501 - all_params.append('async_req') - all_params.append('_return_http_data_only') - all_params.append('_preload_content') - all_params.append('_request_timeout') - - params = locals() - for key, val in six.iteritems(params['kwargs']): - if key not in all_params: - raise TypeError( - "Got an unexpected keyword argument '%s'" - " to method get_goal_relationship" % key - ) - params[key] = val - del params['kwargs'] - # verify the required parameter 'goal_relationship_gid' is set - if ('goal_relationship_gid' not in params or - params['goal_relationship_gid'] is None): - raise ValueError("Missing the required parameter `goal_relationship_gid` when calling `get_goal_relationship`") # noqa: E501 - - collection_formats = {} - - path_params = {} - if 'goal_relationship_gid' in params: - path_params['goal_relationship_gid'] = params['goal_relationship_gid'] # noqa: E501 - - query_params = [] - if 'opt_fields' in params: - query_params.append(('opt_fields', params['opt_fields'])) # noqa: E501 - collection_formats['opt_fields'] = 'csv' # noqa: E501 - - header_params = {} - - form_params = [] - local_var_files = {} - - body_params = None - # HTTP header `Accept` - header_params['Accept'] = self.api_client.select_header_accept( - ['application/json; charset=UTF-8']) # noqa: E501 - - # Authentication setting - auth_settings = ['oauth2'] # noqa: E501 - - return self.api_client.call_api( - '/goal_relationships/{goal_relationship_gid}', 'GET', - path_params, - query_params, - header_params, - body=body_params, - post_params=form_params, - files=local_var_files, - response_type='GoalRelationshipResponseData', # noqa: E501 - auth_settings=auth_settings, - async_req=params.get('async_req'), - _return_http_data_only=params.get('_return_http_data_only'), - _preload_content=params.get('_preload_content', True), - _request_timeout=params.get('_request_timeout'), - collection_formats=collection_formats) - - def get_goal_relationships(self, supported_goal, **kwargs): # noqa: E501 - """Get goal relationships # noqa: E501 - - Returns compact goal relationship records. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.get_goal_relationships(supported_goal, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param str supported_goal: Globally unique identifier for the supported goal in the goal relationship. (required) - :param int limit: Results per page. The number of objects to return per page. The value must be between 1 and 100. - :param str offset: 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 str resource_subtype: If provided, filter to goal relationships with a given resource_subtype. - :param list[str] opt_fields: This endpoint returns a compact resource, which excludes some properties by default. To include those optional properties, set this query parameter to a comma-separated list of the properties you wish to include. - :return: GoalRelationshipResponseArray - If the method is called asynchronously, - returns the request thread. - """ - kwargs['_return_http_data_only'] = True - if kwargs.get('async_req'): - return self.get_goal_relationships_with_http_info(supported_goal, **kwargs) # noqa: E501 - else: - (data) = self.get_goal_relationships_with_http_info(supported_goal, **kwargs) # noqa: E501 - return data - - def get_goal_relationships_with_http_info(self, supported_goal, **kwargs): # noqa: E501 - """Get goal relationships # noqa: E501 - - Returns compact goal relationship records. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.get_goal_relationships_with_http_info(supported_goal, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param str supported_goal: Globally unique identifier for the supported goal in the goal relationship. (required) - :param int limit: Results per page. The number of objects to return per page. The value must be between 1 and 100. - :param str offset: 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 str resource_subtype: If provided, filter to goal relationships with a given resource_subtype. - :param list[str] opt_fields: This endpoint returns a compact resource, which excludes some properties by default. To include those optional properties, set this query parameter to a comma-separated list of the properties you wish to include. - :return: GoalRelationshipResponseArray - If the method is called asynchronously, - returns the request thread. - """ - - all_params = ['supported_goal', 'limit', 'offset', 'resource_subtype', 'opt_fields'] # noqa: E501 - all_params.append('async_req') - all_params.append('_return_http_data_only') - all_params.append('_preload_content') - all_params.append('_request_timeout') - - params = locals() - for key, val in six.iteritems(params['kwargs']): - if key not in all_params: - raise TypeError( - "Got an unexpected keyword argument '%s'" - " to method get_goal_relationships" % key - ) - params[key] = val - del params['kwargs'] - # verify the required parameter 'supported_goal' is set - if ('supported_goal' not in params or - params['supported_goal'] is None): - raise ValueError("Missing the required parameter `supported_goal` when calling `get_goal_relationships`") # noqa: E501 - - collection_formats = {} - - path_params = {} - - query_params = [] - if 'limit' in params: - query_params.append(('limit', params['limit'])) # noqa: E501 - if 'offset' in params: - query_params.append(('offset', params['offset'])) # noqa: E501 - if 'supported_goal' in params: - query_params.append(('supported_goal', params['supported_goal'])) # noqa: E501 - if 'resource_subtype' in params: - query_params.append(('resource_subtype', params['resource_subtype'])) # noqa: E501 - if 'opt_fields' in params: - query_params.append(('opt_fields', params['opt_fields'])) # noqa: E501 - collection_formats['opt_fields'] = 'csv' # noqa: E501 - - header_params = {} - - form_params = [] - local_var_files = {} - - body_params = None - # HTTP header `Accept` - header_params['Accept'] = self.api_client.select_header_accept( - ['application/json; charset=UTF-8']) # noqa: E501 - - # Authentication setting - auth_settings = ['oauth2'] # noqa: E501 - - return self.api_client.call_api( - '/goal_relationships', 'GET', - path_params, - query_params, - header_params, - body=body_params, - post_params=form_params, - files=local_var_files, - response_type='GoalRelationshipResponseArray', # noqa: E501 - auth_settings=auth_settings, - async_req=params.get('async_req'), - _return_http_data_only=params.get('_return_http_data_only'), - _preload_content=params.get('_preload_content', True), - _request_timeout=params.get('_request_timeout'), - collection_formats=collection_formats) - - def remove_supporting_relationship(self, body, goal_gid, **kwargs): # noqa: E501 - """Removes a supporting goal relationship # noqa: E501 - - Removes a goal relationship for a given parent goal. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.remove_supporting_relationship(body, goal_gid, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param GoalGidRemoveSupportingRelationshipBody body: The supporting resource to be removed from the goal (required) - :param str goal_gid: Globally unique identifier for the goal. (required) - :return: EmptyResponseData - If the method is called asynchronously, - returns the request thread. - """ - kwargs['_return_http_data_only'] = True - if kwargs.get('async_req'): - return self.remove_supporting_relationship_with_http_info(body, goal_gid, **kwargs) # noqa: E501 - else: - (data) = self.remove_supporting_relationship_with_http_info(body, goal_gid, **kwargs) # noqa: E501 - return data - - def remove_supporting_relationship_with_http_info(self, body, goal_gid, **kwargs): # noqa: E501 - """Removes a supporting goal relationship # noqa: E501 - - Removes a goal relationship for a given parent goal. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.remove_supporting_relationship_with_http_info(body, goal_gid, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param GoalGidRemoveSupportingRelationshipBody body: The supporting resource to be removed from the goal (required) - :param str goal_gid: Globally unique identifier for the goal. (required) - :return: EmptyResponseData - If the method is called asynchronously, - returns the request thread. - """ - - all_params = ['body', 'goal_gid'] # noqa: E501 - all_params.append('async_req') - all_params.append('_return_http_data_only') - all_params.append('_preload_content') - all_params.append('_request_timeout') - - params = locals() - for key, val in six.iteritems(params['kwargs']): - if key not in all_params: - raise TypeError( - "Got an unexpected keyword argument '%s'" - " to method remove_supporting_relationship" % key - ) - params[key] = val - del params['kwargs'] - # verify the required parameter 'body' is set - if ('body' not in params or - params['body'] is None): - raise ValueError("Missing the required parameter `body` when calling `remove_supporting_relationship`") # noqa: E501 - # verify the required parameter 'goal_gid' is set - if ('goal_gid' not in params or - params['goal_gid'] is None): - raise ValueError("Missing the required parameter `goal_gid` when calling `remove_supporting_relationship`") # noqa: E501 - - collection_formats = {} - - path_params = {} - if 'goal_gid' in params: - path_params['goal_gid'] = params['goal_gid'] # noqa: E501 - - query_params = [] - - header_params = {} - - form_params = [] - local_var_files = {} - - body_params = None - if 'body' in params: - body_params = params['body'] - # HTTP header `Accept` - header_params['Accept'] = self.api_client.select_header_accept( - ['application/json; charset=UTF-8']) # noqa: E501 - - # HTTP header `Content-Type` - header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 - ['application/json; charset=UTF-8']) # noqa: E501 - - # Authentication setting - auth_settings = ['oauth2'] # noqa: E501 - - return self.api_client.call_api( - '/goals/{goal_gid}/removeSupportingRelationship', 'POST', - path_params, - query_params, - header_params, - body=body_params, - post_params=form_params, - files=local_var_files, - response_type='EmptyResponseData', # noqa: E501 - auth_settings=auth_settings, - async_req=params.get('async_req'), - _return_http_data_only=params.get('_return_http_data_only'), - _preload_content=params.get('_preload_content', True), - _request_timeout=params.get('_request_timeout'), - collection_formats=collection_formats) - - def update_goal_relationship(self, body, goal_relationship_gid, **kwargs): # noqa: E501 - """Update a goal relationship # noqa: E501 - - An existing goal relationship can be updated by making a PUT request on the URL for that goal relationship. Only the fields provided in the `data` block will be updated; any unspecified fields will remain unchanged. Returns the complete updated goal relationship record. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.update_goal_relationship(body, goal_relationship_gid, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param GoalRelationshipsGoalRelationshipGidBody body: The updated fields for the goal relationship. (required) - :param str goal_relationship_gid: Globally unique identifier for the goal relationship. (required) - :param list[str] opt_fields: This endpoint returns a compact resource, which excludes some properties by default. To include those optional properties, set this query parameter to a comma-separated list of the properties you wish to include. - :return: GoalRelationshipResponseData - If the method is called asynchronously, - returns the request thread. - """ - kwargs['_return_http_data_only'] = True - if kwargs.get('async_req'): - return self.update_goal_relationship_with_http_info(body, goal_relationship_gid, **kwargs) # noqa: E501 - else: - (data) = self.update_goal_relationship_with_http_info(body, goal_relationship_gid, **kwargs) # noqa: E501 - return data - - def update_goal_relationship_with_http_info(self, body, goal_relationship_gid, **kwargs): # noqa: E501 - """Update a goal relationship # noqa: E501 - - An existing goal relationship can be updated by making a PUT request on the URL for that goal relationship. Only the fields provided in the `data` block will be updated; any unspecified fields will remain unchanged. Returns the complete updated goal relationship record. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.update_goal_relationship_with_http_info(body, goal_relationship_gid, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param GoalRelationshipsGoalRelationshipGidBody body: The updated fields for the goal relationship. (required) - :param str goal_relationship_gid: Globally unique identifier for the goal relationship. (required) - :param list[str] opt_fields: This endpoint returns a compact resource, which excludes some properties by default. To include those optional properties, set this query parameter to a comma-separated list of the properties you wish to include. - :return: GoalRelationshipResponseData - If the method is called asynchronously, - returns the request thread. - """ - - all_params = ['body', 'goal_relationship_gid', 'opt_fields'] # noqa: E501 - all_params.append('async_req') - all_params.append('_return_http_data_only') - all_params.append('_preload_content') - all_params.append('_request_timeout') - - params = locals() - for key, val in six.iteritems(params['kwargs']): - if key not in all_params: - raise TypeError( - "Got an unexpected keyword argument '%s'" - " to method update_goal_relationship" % key - ) - params[key] = val - del params['kwargs'] - # verify the required parameter 'body' is set - if ('body' not in params or - params['body'] is None): - raise ValueError("Missing the required parameter `body` when calling `update_goal_relationship`") # noqa: E501 - # verify the required parameter 'goal_relationship_gid' is set - if ('goal_relationship_gid' not in params or - params['goal_relationship_gid'] is None): - raise ValueError("Missing the required parameter `goal_relationship_gid` when calling `update_goal_relationship`") # noqa: E501 - - collection_formats = {} - - path_params = {} - if 'goal_relationship_gid' in params: - path_params['goal_relationship_gid'] = params['goal_relationship_gid'] # noqa: E501 - - query_params = [] - if 'opt_fields' in params: - query_params.append(('opt_fields', params['opt_fields'])) # noqa: E501 - collection_formats['opt_fields'] = 'csv' # noqa: E501 - - header_params = {} - - form_params = [] - local_var_files = {} - - body_params = None - if 'body' in params: - body_params = params['body'] - # HTTP header `Accept` - header_params['Accept'] = self.api_client.select_header_accept( - ['application/json; charset=UTF-8']) # noqa: E501 - - # HTTP header `Content-Type` - header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 - ['application/json; charset=UTF-8']) # noqa: E501 - - # Authentication setting - auth_settings = ['oauth2'] # noqa: E501 - - return self.api_client.call_api( - '/goal_relationships/{goal_relationship_gid}', 'PUT', - path_params, - query_params, - header_params, - body=body_params, - post_params=form_params, - files=local_var_files, - response_type='GoalRelationshipResponseData', # noqa: E501 - auth_settings=auth_settings, - async_req=params.get('async_req'), - _return_http_data_only=params.get('_return_http_data_only'), - _preload_content=params.get('_preload_content', True), - _request_timeout=params.get('_request_timeout'), - collection_formats=collection_formats) + all_params = ['body', 'goal_relationship_gid', 'opt_fields'] # noqa: E501 + all_params.append('async_req') + all_params.append('header_params') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + params = locals() + for key, val in six.iteritems(params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method update_goal_relationship" % key + ) + params[key] = val + del params['kwargs'] + # verify the required parameter 'body' is set + if ('body' not in params or + params['body'] is None): + raise ValueError("Missing the required parameter `body` when calling `update_goal_relationship`") # noqa: E501 + # verify the required parameter 'goal_relationship_gid' is set + if ('goal_relationship_gid' not in params or + params['goal_relationship_gid'] is None): + raise ValueError("Missing the required parameter `goal_relationship_gid` when calling `update_goal_relationship`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'goal_relationship_gid' in params: + path_params['goal_relationship_gid'] = params['goal_relationship_gid'] # noqa: E501 + + query_params = [] + if 'opt_fields' in params: + query_params.append(('opt_fields', params['opt_fields'])) # noqa: E501 + collection_formats['opt_fields'] = 'csv' # noqa: E501 + + header_params = kwargs.get("header_params", {}) + + form_params = [] + local_var_files = {} + + body_params = None + if 'body' in params: + body_params = params['body'] + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['application/json; charset=UTF-8']) # noqa: E501 + + # HTTP header `Content-Type` + header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 + ['application/json; charset=UTF-8']) # noqa: E501 + + # Authentication setting + auth_settings = ['oauth2'] # noqa: E501 + + return self.api_client.call_api( + '/goal_relationships/{goal_relationship_gid}', 'PUT', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='GoalRelationshipResponseData', # noqa: E501 + auth_settings=auth_settings, + async_req=params.get('async_req'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) diff --git a/asana/api/goals_api.py b/asana/api/goals_api.py index 97aa14a3..13c3b6ed 100644 --- a/asana/api/goals_api.py +++ b/asana/api/goals_api.py @@ -21,1097 +21,1107 @@ class GoalsApi(object): - """NOTE: This class is auto generated by the swagger code generator program. +"""NOTE: This class is auto generated by the swagger code generator program. - Do not edit the class manually. - Ref: https://github.com/swagger-api/swagger-codegen +Do not edit the class manually. +Ref: https://github.com/swagger-api/swagger-codegen +""" + +def __init__(self, api_client=None): + if api_client is None: + api_client = ApiClient() + self.api_client = api_client + +def add_followers(self, body, goal_gid, **kwargs): # noqa: E501 + """Add a collaborator to a goal # noqa: E501 + + Adds followers to a goal. Returns the goal the followers were added to. Each goal can be associated with zero or more followers in the system. Requests to add/remove followers, if successful, will return the complete updated goal record, described above. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.add_followers(body, goal_gid, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param GoalGidAddFollowersBody body: The followers to be added as collaborators (required) + :param str goal_gid: Globally unique identifier for the goal. (required) + :param list[str] opt_fields: This endpoint returns a compact resource, which excludes some properties by default. To include those optional properties, set this query parameter to a comma-separated list of the properties you wish to include. + :return: GoalResponseData + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = kwargs.get("_return_http_data_only", True) + if kwargs.get('async_req'): + return self.add_followers_with_http_info(body, goal_gid, **kwargs) # noqa: E501 + else: + (data) = self.add_followers_with_http_info(body, goal_gid, **kwargs) # noqa: E501 + return data + +def add_followers_with_http_info(self, body, goal_gid, **kwargs): # noqa: E501 + """Add a collaborator to a goal # noqa: E501 + + Adds followers to a goal. Returns the goal the followers were added to. Each goal can be associated with zero or more followers in the system. Requests to add/remove followers, if successful, will return the complete updated goal record, described above. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.add_followers_with_http_info(body, goal_gid, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param GoalGidAddFollowersBody body: The followers to be added as collaborators (required) + :param str goal_gid: Globally unique identifier for the goal. (required) + :param list[str] opt_fields: This endpoint returns a compact resource, which excludes some properties by default. To include those optional properties, set this query parameter to a comma-separated list of the properties you wish to include. + :return: GoalResponseData + If the method is called asynchronously, + returns the request thread. + """ + + all_params = ['body', 'goal_gid', 'opt_fields'] # noqa: E501 + all_params.append('async_req') + all_params.append('header_params') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + params = locals() + for key, val in six.iteritems(params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method add_followers" % key + ) + params[key] = val + del params['kwargs'] + # verify the required parameter 'body' is set + if ('body' not in params or + params['body'] is None): + raise ValueError("Missing the required parameter `body` when calling `add_followers`") # noqa: E501 + # verify the required parameter 'goal_gid' is set + if ('goal_gid' not in params or + params['goal_gid'] is None): + raise ValueError("Missing the required parameter `goal_gid` when calling `add_followers`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'goal_gid' in params: + path_params['goal_gid'] = params['goal_gid'] # noqa: E501 + + query_params = [] + if 'opt_fields' in params: + query_params.append(('opt_fields', params['opt_fields'])) # noqa: E501 + collection_formats['opt_fields'] = 'csv' # noqa: E501 + + header_params = kwargs.get("header_params", {}) + + form_params = [] + local_var_files = {} + + body_params = None + if 'body' in params: + body_params = params['body'] + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['application/json; charset=UTF-8']) # noqa: E501 + + # HTTP header `Content-Type` + header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 + ['application/json; charset=UTF-8']) # noqa: E501 + + # Authentication setting + auth_settings = ['oauth2'] # noqa: E501 + + return self.api_client.call_api( + '/goals/{goal_gid}/addFollowers', 'POST', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='GoalResponseData', # noqa: E501 + auth_settings=auth_settings, + async_req=params.get('async_req'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) + +def create_goal(self, body, **kwargs): # noqa: E501 + """Create a goal # noqa: E501 + + Creates a new goal in a workspace or team. Returns the full record of the newly created goal. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.create_goal(body, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param GoalsBody body: The goal to create. (required) + :param list[str] opt_fields: This endpoint returns a compact resource, which excludes some properties by default. To include those optional properties, set this query parameter to a comma-separated list of the properties you wish to include. + :return: GoalResponseData + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = kwargs.get("_return_http_data_only", True) + if kwargs.get('async_req'): + return self.create_goal_with_http_info(body, **kwargs) # noqa: E501 + else: + (data) = self.create_goal_with_http_info(body, **kwargs) # noqa: E501 + return data + +def create_goal_with_http_info(self, body, **kwargs): # noqa: E501 + """Create a goal # noqa: E501 + + Creates a new goal in a workspace or team. Returns the full record of the newly created goal. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.create_goal_with_http_info(body, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param GoalsBody body: The goal to create. (required) + :param list[str] opt_fields: This endpoint returns a compact resource, which excludes some properties by default. To include those optional properties, set this query parameter to a comma-separated list of the properties you wish to include. + :return: GoalResponseData + If the method is called asynchronously, + returns the request thread. + """ + + all_params = ['body', 'opt_fields'] # noqa: E501 + all_params.append('async_req') + all_params.append('header_params') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + params = locals() + for key, val in six.iteritems(params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method create_goal" % key + ) + params[key] = val + del params['kwargs'] + # verify the required parameter 'body' is set + if ('body' not in params or + params['body'] is None): + raise ValueError("Missing the required parameter `body` when calling `create_goal`") # noqa: E501 + + collection_formats = {} + + path_params = {} + + query_params = [] + if 'opt_fields' in params: + query_params.append(('opt_fields', params['opt_fields'])) # noqa: E501 + collection_formats['opt_fields'] = 'csv' # noqa: E501 + + header_params = kwargs.get("header_params", {}) + + form_params = [] + local_var_files = {} + + body_params = None + if 'body' in params: + body_params = params['body'] + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['application/json; charset=UTF-8']) # noqa: E501 + + # HTTP header `Content-Type` + header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 + ['application/json; charset=UTF-8']) # noqa: E501 + + # Authentication setting + auth_settings = ['oauth2'] # noqa: E501 + + return self.api_client.call_api( + '/goals', 'POST', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='GoalResponseData', # noqa: E501 + auth_settings=auth_settings, + async_req=params.get('async_req'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) + +def create_goal_metric(self, body, goal_gid, **kwargs): # noqa: E501 + """Create a goal metric # noqa: E501 + + Creates and adds a goal metric to a specified goal. Note that this replaces an existing goal metric if one already exists. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.create_goal_metric(body, goal_gid, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param GoalGidSetMetricBody body: The goal metric to create. (required) + :param str goal_gid: Globally unique identifier for the goal. (required) + :param list[str] opt_fields: This endpoint returns a compact resource, which excludes some properties by default. To include those optional properties, set this query parameter to a comma-separated list of the properties you wish to include. + :return: GoalResponseData + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = kwargs.get("_return_http_data_only", True) + if kwargs.get('async_req'): + return self.create_goal_metric_with_http_info(body, goal_gid, **kwargs) # noqa: E501 + else: + (data) = self.create_goal_metric_with_http_info(body, goal_gid, **kwargs) # noqa: E501 + return data + +def create_goal_metric_with_http_info(self, body, goal_gid, **kwargs): # noqa: E501 + """Create a goal metric # noqa: E501 + + Creates and adds a goal metric to a specified goal. Note that this replaces an existing goal metric if one already exists. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.create_goal_metric_with_http_info(body, goal_gid, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param GoalGidSetMetricBody body: The goal metric to create. (required) + :param str goal_gid: Globally unique identifier for the goal. (required) + :param list[str] opt_fields: This endpoint returns a compact resource, which excludes some properties by default. To include those optional properties, set this query parameter to a comma-separated list of the properties you wish to include. + :return: GoalResponseData + If the method is called asynchronously, + returns the request thread. + """ + + all_params = ['body', 'goal_gid', 'opt_fields'] # noqa: E501 + all_params.append('async_req') + all_params.append('header_params') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + params = locals() + for key, val in six.iteritems(params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method create_goal_metric" % key + ) + params[key] = val + del params['kwargs'] + # verify the required parameter 'body' is set + if ('body' not in params or + params['body'] is None): + raise ValueError("Missing the required parameter `body` when calling `create_goal_metric`") # noqa: E501 + # verify the required parameter 'goal_gid' is set + if ('goal_gid' not in params or + params['goal_gid'] is None): + raise ValueError("Missing the required parameter `goal_gid` when calling `create_goal_metric`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'goal_gid' in params: + path_params['goal_gid'] = params['goal_gid'] # noqa: E501 + + query_params = [] + if 'opt_fields' in params: + query_params.append(('opt_fields', params['opt_fields'])) # noqa: E501 + collection_formats['opt_fields'] = 'csv' # noqa: E501 + + header_params = kwargs.get("header_params", {}) + + form_params = [] + local_var_files = {} + + body_params = None + if 'body' in params: + body_params = params['body'] + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['application/json; charset=UTF-8']) # noqa: E501 + + # HTTP header `Content-Type` + header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 + ['application/json; charset=UTF-8']) # noqa: E501 + + # Authentication setting + auth_settings = ['oauth2'] # noqa: E501 + + return self.api_client.call_api( + '/goals/{goal_gid}/setMetric', 'POST', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='GoalResponseData', # noqa: E501 + auth_settings=auth_settings, + async_req=params.get('async_req'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) + +def delete_goal(self, goal_gid, **kwargs): # noqa: E501 + """Delete a goal # noqa: E501 + + A specific, existing goal can be deleted by making a DELETE request on the URL for that goal. Returns an empty data record. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.delete_goal(goal_gid, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str goal_gid: Globally unique identifier for the goal. (required) + :return: EmptyResponseData + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = kwargs.get("_return_http_data_only", True) + if kwargs.get('async_req'): + return self.delete_goal_with_http_info(goal_gid, **kwargs) # noqa: E501 + else: + (data) = self.delete_goal_with_http_info(goal_gid, **kwargs) # noqa: E501 + return data + +def delete_goal_with_http_info(self, goal_gid, **kwargs): # noqa: E501 + """Delete a goal # noqa: E501 + + A specific, existing goal can be deleted by making a DELETE request on the URL for that goal. Returns an empty data record. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.delete_goal_with_http_info(goal_gid, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str goal_gid: Globally unique identifier for the goal. (required) + :return: EmptyResponseData + If the method is called asynchronously, + returns the request thread. + """ + + all_params = ['goal_gid'] # noqa: E501 + all_params.append('async_req') + all_params.append('header_params') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + params = locals() + for key, val in six.iteritems(params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method delete_goal" % key + ) + params[key] = val + del params['kwargs'] + # verify the required parameter 'goal_gid' is set + if ('goal_gid' not in params or + params['goal_gid'] is None): + raise ValueError("Missing the required parameter `goal_gid` when calling `delete_goal`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'goal_gid' in params: + path_params['goal_gid'] = params['goal_gid'] # noqa: E501 + + query_params = [] + + header_params = kwargs.get("header_params", {}) + + form_params = [] + local_var_files = {} + + body_params = None + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['application/json; charset=UTF-8']) # noqa: E501 + + # Authentication setting + auth_settings = ['oauth2'] # noqa: E501 + + return self.api_client.call_api( + '/goals/{goal_gid}', 'DELETE', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='EmptyResponseData', # noqa: E501 + auth_settings=auth_settings, + async_req=params.get('async_req'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) + +def get_goal(self, goal_gid, **kwargs): # noqa: E501 + """Get a goal # noqa: E501 + + Returns the complete goal record for a single goal. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.get_goal(goal_gid, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str goal_gid: Globally unique identifier for the goal. (required) + :param list[str] opt_fields: This endpoint returns a compact resource, which excludes some properties by default. To include those optional properties, set this query parameter to a comma-separated list of the properties you wish to include. + :return: GoalResponseData + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = kwargs.get("_return_http_data_only", True) + if kwargs.get('async_req'): + return self.get_goal_with_http_info(goal_gid, **kwargs) # noqa: E501 + else: + (data) = self.get_goal_with_http_info(goal_gid, **kwargs) # noqa: E501 + return data + +def get_goal_with_http_info(self, goal_gid, **kwargs): # noqa: E501 + """Get a goal # noqa: E501 + + Returns the complete goal record for a single goal. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.get_goal_with_http_info(goal_gid, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str goal_gid: Globally unique identifier for the goal. (required) + :param list[str] opt_fields: This endpoint returns a compact resource, which excludes some properties by default. To include those optional properties, set this query parameter to a comma-separated list of the properties you wish to include. + :return: GoalResponseData + If the method is called asynchronously, + returns the request thread. + """ + + all_params = ['goal_gid', 'opt_fields'] # noqa: E501 + all_params.append('async_req') + all_params.append('header_params') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + params = locals() + for key, val in six.iteritems(params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method get_goal" % key + ) + params[key] = val + del params['kwargs'] + # verify the required parameter 'goal_gid' is set + if ('goal_gid' not in params or + params['goal_gid'] is None): + raise ValueError("Missing the required parameter `goal_gid` when calling `get_goal`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'goal_gid' in params: + path_params['goal_gid'] = params['goal_gid'] # noqa: E501 + + query_params = [] + if 'opt_fields' in params: + query_params.append(('opt_fields', params['opt_fields'])) # noqa: E501 + collection_formats['opt_fields'] = 'csv' # noqa: E501 + + header_params = kwargs.get("header_params", {}) + + form_params = [] + local_var_files = {} + + body_params = None + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['application/json; charset=UTF-8']) # noqa: E501 + + # Authentication setting + auth_settings = ['oauth2'] # noqa: E501 + + return self.api_client.call_api( + '/goals/{goal_gid}', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='GoalResponseData', # noqa: E501 + auth_settings=auth_settings, + async_req=params.get('async_req'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) + +def get_goals(self, **kwargs): # noqa: E501 + """Get goals # noqa: E501 + + Returns compact goal records. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.get_goals(async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str portfolio: Globally unique identifier for supporting portfolio. + :param str project: Globally unique identifier for supporting project. + :param bool is_workspace_level: Filter to goals with is_workspace_level set to query value. Must be used with the workspace parameter. + :param str team: Globally unique identifier for the team. + :param str workspace: Globally unique identifier for the workspace. + :param list[str] time_periods: Globally unique identifiers for the time periods. + :param int limit: Results per page. The number of objects to return per page. The value must be between 1 and 100. + :param str offset: 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 list[str] opt_fields: This endpoint returns a compact resource, which excludes some properties by default. To include those optional properties, set this query parameter to a comma-separated list of the properties you wish to include. + :return: GoalResponseArray + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = kwargs.get("_return_http_data_only", True) + if kwargs.get('async_req'): + return self.get_goals_with_http_info(**kwargs) # noqa: E501 + else: + (data) = self.get_goals_with_http_info(**kwargs) # noqa: E501 + return data + +def get_goals_with_http_info(self, **kwargs): # noqa: E501 + """Get goals # noqa: E501 + + Returns compact goal records. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.get_goals_with_http_info(async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str portfolio: Globally unique identifier for supporting portfolio. + :param str project: Globally unique identifier for supporting project. + :param bool is_workspace_level: Filter to goals with is_workspace_level set to query value. Must be used with the workspace parameter. + :param str team: Globally unique identifier for the team. + :param str workspace: Globally unique identifier for the workspace. + :param list[str] time_periods: Globally unique identifiers for the time periods. + :param int limit: Results per page. The number of objects to return per page. The value must be between 1 and 100. + :param str offset: 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 list[str] opt_fields: This endpoint returns a compact resource, which excludes some properties by default. To include those optional properties, set this query parameter to a comma-separated list of the properties you wish to include. + :return: GoalResponseArray + If the method is called asynchronously, + returns the request thread. + """ + + all_params = ['portfolio', 'project', 'is_workspace_level', 'team', 'workspace', 'time_periods', 'limit', 'offset', 'opt_fields'] # noqa: E501 + all_params.append('async_req') + all_params.append('header_params') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + params = locals() + for key, val in six.iteritems(params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method get_goals" % key + ) + params[key] = val + del params['kwargs'] + + collection_formats = {} + + path_params = {} + + query_params = [] + if 'portfolio' in params: + query_params.append(('portfolio', params['portfolio'])) # noqa: E501 + if 'project' in params: + query_params.append(('project', params['project'])) # noqa: E501 + if 'is_workspace_level' in params: + query_params.append(('is_workspace_level', params['is_workspace_level'])) # noqa: E501 + if 'team' in params: + query_params.append(('team', params['team'])) # noqa: E501 + if 'workspace' in params: + query_params.append(('workspace', params['workspace'])) # noqa: E501 + if 'time_periods' in params: + query_params.append(('time_periods', params['time_periods'])) # noqa: E501 + collection_formats['time_periods'] = 'multi' # noqa: E501 + if 'limit' in params: + query_params.append(('limit', params['limit'])) # noqa: E501 + if 'offset' in params: + query_params.append(('offset', params['offset'])) # noqa: E501 + if 'opt_fields' in params: + query_params.append(('opt_fields', params['opt_fields'])) # noqa: E501 + collection_formats['opt_fields'] = 'csv' # noqa: E501 + + header_params = kwargs.get("header_params", {}) + + form_params = [] + local_var_files = {} + + body_params = None + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['application/json; charset=UTF-8']) # noqa: E501 + + # Authentication setting + auth_settings = ['oauth2'] # noqa: E501 + + return self.api_client.call_api( + '/goals', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='GoalResponseArray', # noqa: E501 + auth_settings=auth_settings, + async_req=params.get('async_req'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) + +def get_parent_goals_for_goal(self, goal_gid, **kwargs): # noqa: E501 + """Get parent goals from a goal # noqa: E501 + + Returns a compact representation of all of the parent goals of a goal. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.get_parent_goals_for_goal(goal_gid, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str goal_gid: Globally unique identifier for the goal. (required) + :param list[str] opt_fields: This endpoint returns a compact resource, which excludes some properties by default. To include those optional properties, set this query parameter to a comma-separated list of the properties you wish to include. + :return: GoalResponseArray + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = kwargs.get("_return_http_data_only", True) + if kwargs.get('async_req'): + return self.get_parent_goals_for_goal_with_http_info(goal_gid, **kwargs) # noqa: E501 + else: + (data) = self.get_parent_goals_for_goal_with_http_info(goal_gid, **kwargs) # noqa: E501 + return data + +def get_parent_goals_for_goal_with_http_info(self, goal_gid, **kwargs): # noqa: E501 + """Get parent goals from a goal # noqa: E501 + + Returns a compact representation of all of the parent goals of a goal. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.get_parent_goals_for_goal_with_http_info(goal_gid, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str goal_gid: Globally unique identifier for the goal. (required) + :param list[str] opt_fields: This endpoint returns a compact resource, which excludes some properties by default. To include those optional properties, set this query parameter to a comma-separated list of the properties you wish to include. + :return: GoalResponseArray + If the method is called asynchronously, + returns the request thread. + """ + + all_params = ['goal_gid', 'opt_fields'] # noqa: E501 + all_params.append('async_req') + all_params.append('header_params') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + params = locals() + for key, val in six.iteritems(params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method get_parent_goals_for_goal" % key + ) + params[key] = val + del params['kwargs'] + # verify the required parameter 'goal_gid' is set + if ('goal_gid' not in params or + params['goal_gid'] is None): + raise ValueError("Missing the required parameter `goal_gid` when calling `get_parent_goals_for_goal`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'goal_gid' in params: + path_params['goal_gid'] = params['goal_gid'] # noqa: E501 + + query_params = [] + if 'opt_fields' in params: + query_params.append(('opt_fields', params['opt_fields'])) # noqa: E501 + collection_formats['opt_fields'] = 'csv' # noqa: E501 + + header_params = kwargs.get("header_params", {}) + + form_params = [] + local_var_files = {} + + body_params = None + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['application/json; charset=UTF-8']) # noqa: E501 + + # Authentication setting + auth_settings = ['oauth2'] # noqa: E501 + + return self.api_client.call_api( + '/goals/{goal_gid}/parentGoals', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='GoalResponseArray', # noqa: E501 + auth_settings=auth_settings, + async_req=params.get('async_req'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) + +def remove_followers(self, body, goal_gid, **kwargs): # noqa: E501 + """Remove a collaborator from a goal # noqa: E501 + + Removes followers from a goal. Returns the goal the followers were removed from. Each goal can be associated with zero or more followers in the system. Requests to add/remove followers, if successful, will return the complete updated goal record, described above. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.remove_followers(body, goal_gid, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param GoalGidRemoveFollowersBody body: The followers to be removed as collaborators (required) + :param str goal_gid: Globally unique identifier for the goal. (required) + :param list[str] opt_fields: This endpoint returns a compact resource, which excludes some properties by default. To include those optional properties, set this query parameter to a comma-separated list of the properties you wish to include. + :return: GoalResponseData + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = kwargs.get("_return_http_data_only", True) + if kwargs.get('async_req'): + return self.remove_followers_with_http_info(body, goal_gid, **kwargs) # noqa: E501 + else: + (data) = self.remove_followers_with_http_info(body, goal_gid, **kwargs) # noqa: E501 + return data + +def remove_followers_with_http_info(self, body, goal_gid, **kwargs): # noqa: E501 + """Remove a collaborator from a goal # noqa: E501 + + Removes followers from a goal. Returns the goal the followers were removed from. Each goal can be associated with zero or more followers in the system. Requests to add/remove followers, if successful, will return the complete updated goal record, described above. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.remove_followers_with_http_info(body, goal_gid, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param GoalGidRemoveFollowersBody body: The followers to be removed as collaborators (required) + :param str goal_gid: Globally unique identifier for the goal. (required) + :param list[str] opt_fields: This endpoint returns a compact resource, which excludes some properties by default. To include those optional properties, set this query parameter to a comma-separated list of the properties you wish to include. + :return: GoalResponseData + If the method is called asynchronously, + returns the request thread. + """ + + all_params = ['body', 'goal_gid', 'opt_fields'] # noqa: E501 + all_params.append('async_req') + all_params.append('header_params') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + params = locals() + for key, val in six.iteritems(params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method remove_followers" % key + ) + params[key] = val + del params['kwargs'] + # verify the required parameter 'body' is set + if ('body' not in params or + params['body'] is None): + raise ValueError("Missing the required parameter `body` when calling `remove_followers`") # noqa: E501 + # verify the required parameter 'goal_gid' is set + if ('goal_gid' not in params or + params['goal_gid'] is None): + raise ValueError("Missing the required parameter `goal_gid` when calling `remove_followers`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'goal_gid' in params: + path_params['goal_gid'] = params['goal_gid'] # noqa: E501 + + query_params = [] + if 'opt_fields' in params: + query_params.append(('opt_fields', params['opt_fields'])) # noqa: E501 + collection_formats['opt_fields'] = 'csv' # noqa: E501 + + header_params = kwargs.get("header_params", {}) + + form_params = [] + local_var_files = {} + + body_params = None + if 'body' in params: + body_params = params['body'] + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['application/json; charset=UTF-8']) # noqa: E501 + + # HTTP header `Content-Type` + header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 + ['application/json; charset=UTF-8']) # noqa: E501 + + # Authentication setting + auth_settings = ['oauth2'] # noqa: E501 + + return self.api_client.call_api( + '/goals/{goal_gid}/removeFollowers', 'POST', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='GoalResponseData', # noqa: E501 + auth_settings=auth_settings, + async_req=params.get('async_req'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) + +def update_goal(self, body, goal_gid, **kwargs): # noqa: E501 + """Update a goal # noqa: E501 + + An existing goal can be updated by making a PUT request on the URL for that goal. Only the fields provided in the `data` block will be updated; any unspecified fields will remain unchanged. Returns the complete updated goal record. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.update_goal(body, goal_gid, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param GoalsGoalGidBody body: The updated fields for the goal. (required) + :param str goal_gid: Globally unique identifier for the goal. (required) + :param list[str] opt_fields: This endpoint returns a compact resource, which excludes some properties by default. To include those optional properties, set this query parameter to a comma-separated list of the properties you wish to include. + :return: GoalResponseData + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = kwargs.get("_return_http_data_only", True) + if kwargs.get('async_req'): + return self.update_goal_with_http_info(body, goal_gid, **kwargs) # noqa: E501 + else: + (data) = self.update_goal_with_http_info(body, goal_gid, **kwargs) # noqa: E501 + return data + +def update_goal_with_http_info(self, body, goal_gid, **kwargs): # noqa: E501 + """Update a goal # noqa: E501 + + An existing goal can be updated by making a PUT request on the URL for that goal. Only the fields provided in the `data` block will be updated; any unspecified fields will remain unchanged. Returns the complete updated goal record. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.update_goal_with_http_info(body, goal_gid, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param GoalsGoalGidBody body: The updated fields for the goal. (required) + :param str goal_gid: Globally unique identifier for the goal. (required) + :param list[str] opt_fields: This endpoint returns a compact resource, which excludes some properties by default. To include those optional properties, set this query parameter to a comma-separated list of the properties you wish to include. + :return: GoalResponseData + If the method is called asynchronously, + returns the request thread. + """ + + all_params = ['body', 'goal_gid', 'opt_fields'] # noqa: E501 + all_params.append('async_req') + all_params.append('header_params') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + params = locals() + for key, val in six.iteritems(params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method update_goal" % key + ) + params[key] = val + del params['kwargs'] + # verify the required parameter 'body' is set + if ('body' not in params or + params['body'] is None): + raise ValueError("Missing the required parameter `body` when calling `update_goal`") # noqa: E501 + # verify the required parameter 'goal_gid' is set + if ('goal_gid' not in params or + params['goal_gid'] is None): + raise ValueError("Missing the required parameter `goal_gid` when calling `update_goal`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'goal_gid' in params: + path_params['goal_gid'] = params['goal_gid'] # noqa: E501 + + query_params = [] + if 'opt_fields' in params: + query_params.append(('opt_fields', params['opt_fields'])) # noqa: E501 + collection_formats['opt_fields'] = 'csv' # noqa: E501 + + header_params = kwargs.get("header_params", {}) + + form_params = [] + local_var_files = {} + + body_params = None + if 'body' in params: + body_params = params['body'] + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['application/json; charset=UTF-8']) # noqa: E501 + + # HTTP header `Content-Type` + header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 + ['application/json; charset=UTF-8']) # noqa: E501 + + # Authentication setting + auth_settings = ['oauth2'] # noqa: E501 + + return self.api_client.call_api( + '/goals/{goal_gid}', 'PUT', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='GoalResponseData', # noqa: E501 + auth_settings=auth_settings, + async_req=params.get('async_req'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) + +def update_goal_metric(self, body, goal_gid, **kwargs): # noqa: E501 + """Update a goal metric # noqa: E501 + + Updates a goal's existing metric's `current_number_value` if one exists, otherwise responds with a 400 status code. Returns the complete updated goal metric record. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.update_goal_metric(body, goal_gid, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param GoalGidSetMetricCurrentValueBody body: The updated fields for the goal metric. (required) + :param str goal_gid: Globally unique identifier for the goal. (required) + :param list[str] opt_fields: This endpoint returns a compact resource, which excludes some properties by default. To include those optional properties, set this query parameter to a comma-separated list of the properties you wish to include. + :return: GoalResponseData + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = kwargs.get("_return_http_data_only", True) + if kwargs.get('async_req'): + return self.update_goal_metric_with_http_info(body, goal_gid, **kwargs) # noqa: E501 + else: + (data) = self.update_goal_metric_with_http_info(body, goal_gid, **kwargs) # noqa: E501 + return data + +def update_goal_metric_with_http_info(self, body, goal_gid, **kwargs): # noqa: E501 + """Update a goal metric # noqa: E501 + + Updates a goal's existing metric's `current_number_value` if one exists, otherwise responds with a 400 status code. Returns the complete updated goal metric record. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.update_goal_metric_with_http_info(body, goal_gid, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param GoalGidSetMetricCurrentValueBody body: The updated fields for the goal metric. (required) + :param str goal_gid: Globally unique identifier for the goal. (required) + :param list[str] opt_fields: This endpoint returns a compact resource, which excludes some properties by default. To include those optional properties, set this query parameter to a comma-separated list of the properties you wish to include. + :return: GoalResponseData + If the method is called asynchronously, + returns the request thread. """ - def __init__(self, api_client=None): - if api_client is None: - api_client = ApiClient() - self.api_client = api_client - - def add_followers(self, body, goal_gid, **kwargs): # noqa: E501 - """Add a collaborator to a goal # noqa: E501 - - Adds followers to a goal. Returns the goal the followers were added to. Each goal can be associated with zero or more followers in the system. Requests to add/remove followers, if successful, will return the complete updated goal record, described above. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.add_followers(body, goal_gid, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param GoalGidAddFollowersBody body: The followers to be added as collaborators (required) - :param str goal_gid: Globally unique identifier for the goal. (required) - :param list[str] opt_fields: This endpoint returns a compact resource, which excludes some properties by default. To include those optional properties, set this query parameter to a comma-separated list of the properties you wish to include. - :return: GoalResponseData - If the method is called asynchronously, - returns the request thread. - """ - kwargs['_return_http_data_only'] = True - if kwargs.get('async_req'): - return self.add_followers_with_http_info(body, goal_gid, **kwargs) # noqa: E501 - else: - (data) = self.add_followers_with_http_info(body, goal_gid, **kwargs) # noqa: E501 - return data - - def add_followers_with_http_info(self, body, goal_gid, **kwargs): # noqa: E501 - """Add a collaborator to a goal # noqa: E501 - - Adds followers to a goal. Returns the goal the followers were added to. Each goal can be associated with zero or more followers in the system. Requests to add/remove followers, if successful, will return the complete updated goal record, described above. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.add_followers_with_http_info(body, goal_gid, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param GoalGidAddFollowersBody body: The followers to be added as collaborators (required) - :param str goal_gid: Globally unique identifier for the goal. (required) - :param list[str] opt_fields: This endpoint returns a compact resource, which excludes some properties by default. To include those optional properties, set this query parameter to a comma-separated list of the properties you wish to include. - :return: GoalResponseData - If the method is called asynchronously, - returns the request thread. - """ - - all_params = ['body', 'goal_gid', 'opt_fields'] # noqa: E501 - all_params.append('async_req') - all_params.append('_return_http_data_only') - all_params.append('_preload_content') - all_params.append('_request_timeout') - - params = locals() - for key, val in six.iteritems(params['kwargs']): - if key not in all_params: - raise TypeError( - "Got an unexpected keyword argument '%s'" - " to method add_followers" % key - ) - params[key] = val - del params['kwargs'] - # verify the required parameter 'body' is set - if ('body' not in params or - params['body'] is None): - raise ValueError("Missing the required parameter `body` when calling `add_followers`") # noqa: E501 - # verify the required parameter 'goal_gid' is set - if ('goal_gid' not in params or - params['goal_gid'] is None): - raise ValueError("Missing the required parameter `goal_gid` when calling `add_followers`") # noqa: E501 - - collection_formats = {} - - path_params = {} - if 'goal_gid' in params: - path_params['goal_gid'] = params['goal_gid'] # noqa: E501 - - query_params = [] - if 'opt_fields' in params: - query_params.append(('opt_fields', params['opt_fields'])) # noqa: E501 - collection_formats['opt_fields'] = 'csv' # noqa: E501 - - header_params = {} - - form_params = [] - local_var_files = {} - - body_params = None - if 'body' in params: - body_params = params['body'] - # HTTP header `Accept` - header_params['Accept'] = self.api_client.select_header_accept( - ['application/json; charset=UTF-8']) # noqa: E501 - - # HTTP header `Content-Type` - header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 - ['application/json; charset=UTF-8']) # noqa: E501 - - # Authentication setting - auth_settings = ['oauth2'] # noqa: E501 - - return self.api_client.call_api( - '/goals/{goal_gid}/addFollowers', 'POST', - path_params, - query_params, - header_params, - body=body_params, - post_params=form_params, - files=local_var_files, - response_type='GoalResponseData', # noqa: E501 - auth_settings=auth_settings, - async_req=params.get('async_req'), - _return_http_data_only=params.get('_return_http_data_only'), - _preload_content=params.get('_preload_content', True), - _request_timeout=params.get('_request_timeout'), - collection_formats=collection_formats) - - def create_goal(self, body, **kwargs): # noqa: E501 - """Create a goal # noqa: E501 - - Creates a new goal in a workspace or team. Returns the full record of the newly created goal. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.create_goal(body, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param GoalsBody body: The goal to create. (required) - :param list[str] opt_fields: This endpoint returns a compact resource, which excludes some properties by default. To include those optional properties, set this query parameter to a comma-separated list of the properties you wish to include. - :return: GoalResponseData - If the method is called asynchronously, - returns the request thread. - """ - kwargs['_return_http_data_only'] = True - if kwargs.get('async_req'): - return self.create_goal_with_http_info(body, **kwargs) # noqa: E501 - else: - (data) = self.create_goal_with_http_info(body, **kwargs) # noqa: E501 - return data - - def create_goal_with_http_info(self, body, **kwargs): # noqa: E501 - """Create a goal # noqa: E501 - - Creates a new goal in a workspace or team. Returns the full record of the newly created goal. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.create_goal_with_http_info(body, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param GoalsBody body: The goal to create. (required) - :param list[str] opt_fields: This endpoint returns a compact resource, which excludes some properties by default. To include those optional properties, set this query parameter to a comma-separated list of the properties you wish to include. - :return: GoalResponseData - If the method is called asynchronously, - returns the request thread. - """ - - all_params = ['body', 'opt_fields'] # noqa: E501 - all_params.append('async_req') - all_params.append('_return_http_data_only') - all_params.append('_preload_content') - all_params.append('_request_timeout') - - params = locals() - for key, val in six.iteritems(params['kwargs']): - if key not in all_params: - raise TypeError( - "Got an unexpected keyword argument '%s'" - " to method create_goal" % key - ) - params[key] = val - del params['kwargs'] - # verify the required parameter 'body' is set - if ('body' not in params or - params['body'] is None): - raise ValueError("Missing the required parameter `body` when calling `create_goal`") # noqa: E501 - - collection_formats = {} - - path_params = {} - - query_params = [] - if 'opt_fields' in params: - query_params.append(('opt_fields', params['opt_fields'])) # noqa: E501 - collection_formats['opt_fields'] = 'csv' # noqa: E501 - - header_params = {} - - form_params = [] - local_var_files = {} - - body_params = None - if 'body' in params: - body_params = params['body'] - # HTTP header `Accept` - header_params['Accept'] = self.api_client.select_header_accept( - ['application/json; charset=UTF-8']) # noqa: E501 - - # HTTP header `Content-Type` - header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 - ['application/json; charset=UTF-8']) # noqa: E501 - - # Authentication setting - auth_settings = ['oauth2'] # noqa: E501 - - return self.api_client.call_api( - '/goals', 'POST', - path_params, - query_params, - header_params, - body=body_params, - post_params=form_params, - files=local_var_files, - response_type='GoalResponseData', # noqa: E501 - auth_settings=auth_settings, - async_req=params.get('async_req'), - _return_http_data_only=params.get('_return_http_data_only'), - _preload_content=params.get('_preload_content', True), - _request_timeout=params.get('_request_timeout'), - collection_formats=collection_formats) - - def create_goal_metric(self, body, goal_gid, **kwargs): # noqa: E501 - """Create a goal metric # noqa: E501 - - Creates and adds a goal metric to a specified goal. Note that this replaces an existing goal metric if one already exists. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.create_goal_metric(body, goal_gid, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param GoalGidSetMetricBody body: The goal metric to create. (required) - :param str goal_gid: Globally unique identifier for the goal. (required) - :param list[str] opt_fields: This endpoint returns a compact resource, which excludes some properties by default. To include those optional properties, set this query parameter to a comma-separated list of the properties you wish to include. - :return: GoalResponseData - If the method is called asynchronously, - returns the request thread. - """ - kwargs['_return_http_data_only'] = True - if kwargs.get('async_req'): - return self.create_goal_metric_with_http_info(body, goal_gid, **kwargs) # noqa: E501 - else: - (data) = self.create_goal_metric_with_http_info(body, goal_gid, **kwargs) # noqa: E501 - return data - - def create_goal_metric_with_http_info(self, body, goal_gid, **kwargs): # noqa: E501 - """Create a goal metric # noqa: E501 - - Creates and adds a goal metric to a specified goal. Note that this replaces an existing goal metric if one already exists. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.create_goal_metric_with_http_info(body, goal_gid, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param GoalGidSetMetricBody body: The goal metric to create. (required) - :param str goal_gid: Globally unique identifier for the goal. (required) - :param list[str] opt_fields: This endpoint returns a compact resource, which excludes some properties by default. To include those optional properties, set this query parameter to a comma-separated list of the properties you wish to include. - :return: GoalResponseData - If the method is called asynchronously, - returns the request thread. - """ - - all_params = ['body', 'goal_gid', 'opt_fields'] # noqa: E501 - all_params.append('async_req') - all_params.append('_return_http_data_only') - all_params.append('_preload_content') - all_params.append('_request_timeout') - - params = locals() - for key, val in six.iteritems(params['kwargs']): - if key not in all_params: - raise TypeError( - "Got an unexpected keyword argument '%s'" - " to method create_goal_metric" % key - ) - params[key] = val - del params['kwargs'] - # verify the required parameter 'body' is set - if ('body' not in params or - params['body'] is None): - raise ValueError("Missing the required parameter `body` when calling `create_goal_metric`") # noqa: E501 - # verify the required parameter 'goal_gid' is set - if ('goal_gid' not in params or - params['goal_gid'] is None): - raise ValueError("Missing the required parameter `goal_gid` when calling `create_goal_metric`") # noqa: E501 - - collection_formats = {} - - path_params = {} - if 'goal_gid' in params: - path_params['goal_gid'] = params['goal_gid'] # noqa: E501 - - query_params = [] - if 'opt_fields' in params: - query_params.append(('opt_fields', params['opt_fields'])) # noqa: E501 - collection_formats['opt_fields'] = 'csv' # noqa: E501 - - header_params = {} - - form_params = [] - local_var_files = {} - - body_params = None - if 'body' in params: - body_params = params['body'] - # HTTP header `Accept` - header_params['Accept'] = self.api_client.select_header_accept( - ['application/json; charset=UTF-8']) # noqa: E501 - - # HTTP header `Content-Type` - header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 - ['application/json; charset=UTF-8']) # noqa: E501 - - # Authentication setting - auth_settings = ['oauth2'] # noqa: E501 - - return self.api_client.call_api( - '/goals/{goal_gid}/setMetric', 'POST', - path_params, - query_params, - header_params, - body=body_params, - post_params=form_params, - files=local_var_files, - response_type='GoalResponseData', # noqa: E501 - auth_settings=auth_settings, - async_req=params.get('async_req'), - _return_http_data_only=params.get('_return_http_data_only'), - _preload_content=params.get('_preload_content', True), - _request_timeout=params.get('_request_timeout'), - collection_formats=collection_formats) - - def delete_goal(self, goal_gid, **kwargs): # noqa: E501 - """Delete a goal # noqa: E501 - - A specific, existing goal can be deleted by making a DELETE request on the URL for that goal. Returns an empty data record. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.delete_goal(goal_gid, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param str goal_gid: Globally unique identifier for the goal. (required) - :return: EmptyResponseData - If the method is called asynchronously, - returns the request thread. - """ - kwargs['_return_http_data_only'] = True - if kwargs.get('async_req'): - return self.delete_goal_with_http_info(goal_gid, **kwargs) # noqa: E501 - else: - (data) = self.delete_goal_with_http_info(goal_gid, **kwargs) # noqa: E501 - return data - - def delete_goal_with_http_info(self, goal_gid, **kwargs): # noqa: E501 - """Delete a goal # noqa: E501 - - A specific, existing goal can be deleted by making a DELETE request on the URL for that goal. Returns an empty data record. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.delete_goal_with_http_info(goal_gid, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param str goal_gid: Globally unique identifier for the goal. (required) - :return: EmptyResponseData - If the method is called asynchronously, - returns the request thread. - """ - - all_params = ['goal_gid'] # noqa: E501 - all_params.append('async_req') - all_params.append('_return_http_data_only') - all_params.append('_preload_content') - all_params.append('_request_timeout') - - params = locals() - for key, val in six.iteritems(params['kwargs']): - if key not in all_params: - raise TypeError( - "Got an unexpected keyword argument '%s'" - " to method delete_goal" % key - ) - params[key] = val - del params['kwargs'] - # verify the required parameter 'goal_gid' is set - if ('goal_gid' not in params or - params['goal_gid'] is None): - raise ValueError("Missing the required parameter `goal_gid` when calling `delete_goal`") # noqa: E501 - - collection_formats = {} - - path_params = {} - if 'goal_gid' in params: - path_params['goal_gid'] = params['goal_gid'] # noqa: E501 - - query_params = [] - - header_params = {} - - form_params = [] - local_var_files = {} - - body_params = None - # HTTP header `Accept` - header_params['Accept'] = self.api_client.select_header_accept( - ['application/json; charset=UTF-8']) # noqa: E501 - - # Authentication setting - auth_settings = ['oauth2'] # noqa: E501 - - return self.api_client.call_api( - '/goals/{goal_gid}', 'DELETE', - path_params, - query_params, - header_params, - body=body_params, - post_params=form_params, - files=local_var_files, - response_type='EmptyResponseData', # noqa: E501 - auth_settings=auth_settings, - async_req=params.get('async_req'), - _return_http_data_only=params.get('_return_http_data_only'), - _preload_content=params.get('_preload_content', True), - _request_timeout=params.get('_request_timeout'), - collection_formats=collection_formats) - - def get_goal(self, goal_gid, **kwargs): # noqa: E501 - """Get a goal # noqa: E501 - - Returns the complete goal record for a single goal. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.get_goal(goal_gid, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param str goal_gid: Globally unique identifier for the goal. (required) - :param list[str] opt_fields: This endpoint returns a compact resource, which excludes some properties by default. To include those optional properties, set this query parameter to a comma-separated list of the properties you wish to include. - :return: GoalResponseData - If the method is called asynchronously, - returns the request thread. - """ - kwargs['_return_http_data_only'] = True - if kwargs.get('async_req'): - return self.get_goal_with_http_info(goal_gid, **kwargs) # noqa: E501 - else: - (data) = self.get_goal_with_http_info(goal_gid, **kwargs) # noqa: E501 - return data - - def get_goal_with_http_info(self, goal_gid, **kwargs): # noqa: E501 - """Get a goal # noqa: E501 - - Returns the complete goal record for a single goal. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.get_goal_with_http_info(goal_gid, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param str goal_gid: Globally unique identifier for the goal. (required) - :param list[str] opt_fields: This endpoint returns a compact resource, which excludes some properties by default. To include those optional properties, set this query parameter to a comma-separated list of the properties you wish to include. - :return: GoalResponseData - If the method is called asynchronously, - returns the request thread. - """ - - all_params = ['goal_gid', 'opt_fields'] # noqa: E501 - all_params.append('async_req') - all_params.append('_return_http_data_only') - all_params.append('_preload_content') - all_params.append('_request_timeout') - - params = locals() - for key, val in six.iteritems(params['kwargs']): - if key not in all_params: - raise TypeError( - "Got an unexpected keyword argument '%s'" - " to method get_goal" % key - ) - params[key] = val - del params['kwargs'] - # verify the required parameter 'goal_gid' is set - if ('goal_gid' not in params or - params['goal_gid'] is None): - raise ValueError("Missing the required parameter `goal_gid` when calling `get_goal`") # noqa: E501 - - collection_formats = {} - - path_params = {} - if 'goal_gid' in params: - path_params['goal_gid'] = params['goal_gid'] # noqa: E501 - - query_params = [] - if 'opt_fields' in params: - query_params.append(('opt_fields', params['opt_fields'])) # noqa: E501 - collection_formats['opt_fields'] = 'csv' # noqa: E501 - - header_params = {} - - form_params = [] - local_var_files = {} - - body_params = None - # HTTP header `Accept` - header_params['Accept'] = self.api_client.select_header_accept( - ['application/json; charset=UTF-8']) # noqa: E501 - - # Authentication setting - auth_settings = ['oauth2'] # noqa: E501 - - return self.api_client.call_api( - '/goals/{goal_gid}', 'GET', - path_params, - query_params, - header_params, - body=body_params, - post_params=form_params, - files=local_var_files, - response_type='GoalResponseData', # noqa: E501 - auth_settings=auth_settings, - async_req=params.get('async_req'), - _return_http_data_only=params.get('_return_http_data_only'), - _preload_content=params.get('_preload_content', True), - _request_timeout=params.get('_request_timeout'), - collection_formats=collection_formats) - - def get_goals(self, **kwargs): # noqa: E501 - """Get goals # noqa: E501 - - Returns compact goal records. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.get_goals(async_req=True) - >>> result = thread.get() - - :param async_req bool - :param str portfolio: Globally unique identifier for supporting portfolio. - :param str project: Globally unique identifier for supporting project. - :param bool is_workspace_level: Filter to goals with is_workspace_level set to query value. Must be used with the workspace parameter. - :param str team: Globally unique identifier for the team. - :param str workspace: Globally unique identifier for the workspace. - :param list[str] time_periods: Globally unique identifiers for the time periods. - :param int limit: Results per page. The number of objects to return per page. The value must be between 1 and 100. - :param str offset: 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 list[str] opt_fields: This endpoint returns a compact resource, which excludes some properties by default. To include those optional properties, set this query parameter to a comma-separated list of the properties you wish to include. - :return: GoalResponseArray - If the method is called asynchronously, - returns the request thread. - """ - kwargs['_return_http_data_only'] = True - if kwargs.get('async_req'): - return self.get_goals_with_http_info(**kwargs) # noqa: E501 - else: - (data) = self.get_goals_with_http_info(**kwargs) # noqa: E501 - return data - - def get_goals_with_http_info(self, **kwargs): # noqa: E501 - """Get goals # noqa: E501 - - Returns compact goal records. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.get_goals_with_http_info(async_req=True) - >>> result = thread.get() - - :param async_req bool - :param str portfolio: Globally unique identifier for supporting portfolio. - :param str project: Globally unique identifier for supporting project. - :param bool is_workspace_level: Filter to goals with is_workspace_level set to query value. Must be used with the workspace parameter. - :param str team: Globally unique identifier for the team. - :param str workspace: Globally unique identifier for the workspace. - :param list[str] time_periods: Globally unique identifiers for the time periods. - :param int limit: Results per page. The number of objects to return per page. The value must be between 1 and 100. - :param str offset: 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 list[str] opt_fields: This endpoint returns a compact resource, which excludes some properties by default. To include those optional properties, set this query parameter to a comma-separated list of the properties you wish to include. - :return: GoalResponseArray - If the method is called asynchronously, - returns the request thread. - """ - - all_params = ['portfolio', 'project', 'is_workspace_level', 'team', 'workspace', 'time_periods', 'limit', 'offset', 'opt_fields'] # noqa: E501 - all_params.append('async_req') - all_params.append('_return_http_data_only') - all_params.append('_preload_content') - all_params.append('_request_timeout') - - params = locals() - for key, val in six.iteritems(params['kwargs']): - if key not in all_params: - raise TypeError( - "Got an unexpected keyword argument '%s'" - " to method get_goals" % key - ) - params[key] = val - del params['kwargs'] - - collection_formats = {} - - path_params = {} - - query_params = [] - if 'portfolio' in params: - query_params.append(('portfolio', params['portfolio'])) # noqa: E501 - if 'project' in params: - query_params.append(('project', params['project'])) # noqa: E501 - if 'is_workspace_level' in params: - query_params.append(('is_workspace_level', params['is_workspace_level'])) # noqa: E501 - if 'team' in params: - query_params.append(('team', params['team'])) # noqa: E501 - if 'workspace' in params: - query_params.append(('workspace', params['workspace'])) # noqa: E501 - if 'time_periods' in params: - query_params.append(('time_periods', params['time_periods'])) # noqa: E501 - collection_formats['time_periods'] = 'multi' # noqa: E501 - if 'limit' in params: - query_params.append(('limit', params['limit'])) # noqa: E501 - if 'offset' in params: - query_params.append(('offset', params['offset'])) # noqa: E501 - if 'opt_fields' in params: - query_params.append(('opt_fields', params['opt_fields'])) # noqa: E501 - collection_formats['opt_fields'] = 'csv' # noqa: E501 - - header_params = {} - - form_params = [] - local_var_files = {} - - body_params = None - # HTTP header `Accept` - header_params['Accept'] = self.api_client.select_header_accept( - ['application/json; charset=UTF-8']) # noqa: E501 - - # Authentication setting - auth_settings = ['oauth2'] # noqa: E501 - - return self.api_client.call_api( - '/goals', 'GET', - path_params, - query_params, - header_params, - body=body_params, - post_params=form_params, - files=local_var_files, - response_type='GoalResponseArray', # noqa: E501 - auth_settings=auth_settings, - async_req=params.get('async_req'), - _return_http_data_only=params.get('_return_http_data_only'), - _preload_content=params.get('_preload_content', True), - _request_timeout=params.get('_request_timeout'), - collection_formats=collection_formats) - - def get_parent_goals_for_goal(self, goal_gid, **kwargs): # noqa: E501 - """Get parent goals from a goal # noqa: E501 - - Returns a compact representation of all of the parent goals of a goal. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.get_parent_goals_for_goal(goal_gid, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param str goal_gid: Globally unique identifier for the goal. (required) - :param list[str] opt_fields: This endpoint returns a compact resource, which excludes some properties by default. To include those optional properties, set this query parameter to a comma-separated list of the properties you wish to include. - :return: GoalResponseArray - If the method is called asynchronously, - returns the request thread. - """ - kwargs['_return_http_data_only'] = True - if kwargs.get('async_req'): - return self.get_parent_goals_for_goal_with_http_info(goal_gid, **kwargs) # noqa: E501 - else: - (data) = self.get_parent_goals_for_goal_with_http_info(goal_gid, **kwargs) # noqa: E501 - return data - - def get_parent_goals_for_goal_with_http_info(self, goal_gid, **kwargs): # noqa: E501 - """Get parent goals from a goal # noqa: E501 - - Returns a compact representation of all of the parent goals of a goal. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.get_parent_goals_for_goal_with_http_info(goal_gid, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param str goal_gid: Globally unique identifier for the goal. (required) - :param list[str] opt_fields: This endpoint returns a compact resource, which excludes some properties by default. To include those optional properties, set this query parameter to a comma-separated list of the properties you wish to include. - :return: GoalResponseArray - If the method is called asynchronously, - returns the request thread. - """ - - all_params = ['goal_gid', 'opt_fields'] # noqa: E501 - all_params.append('async_req') - all_params.append('_return_http_data_only') - all_params.append('_preload_content') - all_params.append('_request_timeout') - - params = locals() - for key, val in six.iteritems(params['kwargs']): - if key not in all_params: - raise TypeError( - "Got an unexpected keyword argument '%s'" - " to method get_parent_goals_for_goal" % key - ) - params[key] = val - del params['kwargs'] - # verify the required parameter 'goal_gid' is set - if ('goal_gid' not in params or - params['goal_gid'] is None): - raise ValueError("Missing the required parameter `goal_gid` when calling `get_parent_goals_for_goal`") # noqa: E501 - - collection_formats = {} - - path_params = {} - if 'goal_gid' in params: - path_params['goal_gid'] = params['goal_gid'] # noqa: E501 - - query_params = [] - if 'opt_fields' in params: - query_params.append(('opt_fields', params['opt_fields'])) # noqa: E501 - collection_formats['opt_fields'] = 'csv' # noqa: E501 - - header_params = {} - - form_params = [] - local_var_files = {} - - body_params = None - # HTTP header `Accept` - header_params['Accept'] = self.api_client.select_header_accept( - ['application/json; charset=UTF-8']) # noqa: E501 - - # Authentication setting - auth_settings = ['oauth2'] # noqa: E501 - - return self.api_client.call_api( - '/goals/{goal_gid}/parentGoals', 'GET', - path_params, - query_params, - header_params, - body=body_params, - post_params=form_params, - files=local_var_files, - response_type='GoalResponseArray', # noqa: E501 - auth_settings=auth_settings, - async_req=params.get('async_req'), - _return_http_data_only=params.get('_return_http_data_only'), - _preload_content=params.get('_preload_content', True), - _request_timeout=params.get('_request_timeout'), - collection_formats=collection_formats) - - def remove_followers(self, body, goal_gid, **kwargs): # noqa: E501 - """Remove a collaborator from a goal # noqa: E501 - - Removes followers from a goal. Returns the goal the followers were removed from. Each goal can be associated with zero or more followers in the system. Requests to add/remove followers, if successful, will return the complete updated goal record, described above. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.remove_followers(body, goal_gid, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param GoalGidRemoveFollowersBody body: The followers to be removed as collaborators (required) - :param str goal_gid: Globally unique identifier for the goal. (required) - :param list[str] opt_fields: This endpoint returns a compact resource, which excludes some properties by default. To include those optional properties, set this query parameter to a comma-separated list of the properties you wish to include. - :return: GoalResponseData - If the method is called asynchronously, - returns the request thread. - """ - kwargs['_return_http_data_only'] = True - if kwargs.get('async_req'): - return self.remove_followers_with_http_info(body, goal_gid, **kwargs) # noqa: E501 - else: - (data) = self.remove_followers_with_http_info(body, goal_gid, **kwargs) # noqa: E501 - return data - - def remove_followers_with_http_info(self, body, goal_gid, **kwargs): # noqa: E501 - """Remove a collaborator from a goal # noqa: E501 - - Removes followers from a goal. Returns the goal the followers were removed from. Each goal can be associated with zero or more followers in the system. Requests to add/remove followers, if successful, will return the complete updated goal record, described above. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.remove_followers_with_http_info(body, goal_gid, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param GoalGidRemoveFollowersBody body: The followers to be removed as collaborators (required) - :param str goal_gid: Globally unique identifier for the goal. (required) - :param list[str] opt_fields: This endpoint returns a compact resource, which excludes some properties by default. To include those optional properties, set this query parameter to a comma-separated list of the properties you wish to include. - :return: GoalResponseData - If the method is called asynchronously, - returns the request thread. - """ - - all_params = ['body', 'goal_gid', 'opt_fields'] # noqa: E501 - all_params.append('async_req') - all_params.append('_return_http_data_only') - all_params.append('_preload_content') - all_params.append('_request_timeout') - - params = locals() - for key, val in six.iteritems(params['kwargs']): - if key not in all_params: - raise TypeError( - "Got an unexpected keyword argument '%s'" - " to method remove_followers" % key - ) - params[key] = val - del params['kwargs'] - # verify the required parameter 'body' is set - if ('body' not in params or - params['body'] is None): - raise ValueError("Missing the required parameter `body` when calling `remove_followers`") # noqa: E501 - # verify the required parameter 'goal_gid' is set - if ('goal_gid' not in params or - params['goal_gid'] is None): - raise ValueError("Missing the required parameter `goal_gid` when calling `remove_followers`") # noqa: E501 - - collection_formats = {} - - path_params = {} - if 'goal_gid' in params: - path_params['goal_gid'] = params['goal_gid'] # noqa: E501 - - query_params = [] - if 'opt_fields' in params: - query_params.append(('opt_fields', params['opt_fields'])) # noqa: E501 - collection_formats['opt_fields'] = 'csv' # noqa: E501 - - header_params = {} - - form_params = [] - local_var_files = {} - - body_params = None - if 'body' in params: - body_params = params['body'] - # HTTP header `Accept` - header_params['Accept'] = self.api_client.select_header_accept( - ['application/json; charset=UTF-8']) # noqa: E501 - - # HTTP header `Content-Type` - header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 - ['application/json; charset=UTF-8']) # noqa: E501 - - # Authentication setting - auth_settings = ['oauth2'] # noqa: E501 - - return self.api_client.call_api( - '/goals/{goal_gid}/removeFollowers', 'POST', - path_params, - query_params, - header_params, - body=body_params, - post_params=form_params, - files=local_var_files, - response_type='GoalResponseData', # noqa: E501 - auth_settings=auth_settings, - async_req=params.get('async_req'), - _return_http_data_only=params.get('_return_http_data_only'), - _preload_content=params.get('_preload_content', True), - _request_timeout=params.get('_request_timeout'), - collection_formats=collection_formats) - - def update_goal(self, body, goal_gid, **kwargs): # noqa: E501 - """Update a goal # noqa: E501 - - An existing goal can be updated by making a PUT request on the URL for that goal. Only the fields provided in the `data` block will be updated; any unspecified fields will remain unchanged. Returns the complete updated goal record. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.update_goal(body, goal_gid, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param GoalsGoalGidBody body: The updated fields for the goal. (required) - :param str goal_gid: Globally unique identifier for the goal. (required) - :param list[str] opt_fields: This endpoint returns a compact resource, which excludes some properties by default. To include those optional properties, set this query parameter to a comma-separated list of the properties you wish to include. - :return: GoalResponseData - If the method is called asynchronously, - returns the request thread. - """ - kwargs['_return_http_data_only'] = True - if kwargs.get('async_req'): - return self.update_goal_with_http_info(body, goal_gid, **kwargs) # noqa: E501 - else: - (data) = self.update_goal_with_http_info(body, goal_gid, **kwargs) # noqa: E501 - return data - - def update_goal_with_http_info(self, body, goal_gid, **kwargs): # noqa: E501 - """Update a goal # noqa: E501 - - An existing goal can be updated by making a PUT request on the URL for that goal. Only the fields provided in the `data` block will be updated; any unspecified fields will remain unchanged. Returns the complete updated goal record. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.update_goal_with_http_info(body, goal_gid, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param GoalsGoalGidBody body: The updated fields for the goal. (required) - :param str goal_gid: Globally unique identifier for the goal. (required) - :param list[str] opt_fields: This endpoint returns a compact resource, which excludes some properties by default. To include those optional properties, set this query parameter to a comma-separated list of the properties you wish to include. - :return: GoalResponseData - If the method is called asynchronously, - returns the request thread. - """ - - all_params = ['body', 'goal_gid', 'opt_fields'] # noqa: E501 - all_params.append('async_req') - all_params.append('_return_http_data_only') - all_params.append('_preload_content') - all_params.append('_request_timeout') - - params = locals() - for key, val in six.iteritems(params['kwargs']): - if key not in all_params: - raise TypeError( - "Got an unexpected keyword argument '%s'" - " to method update_goal" % key - ) - params[key] = val - del params['kwargs'] - # verify the required parameter 'body' is set - if ('body' not in params or - params['body'] is None): - raise ValueError("Missing the required parameter `body` when calling `update_goal`") # noqa: E501 - # verify the required parameter 'goal_gid' is set - if ('goal_gid' not in params or - params['goal_gid'] is None): - raise ValueError("Missing the required parameter `goal_gid` when calling `update_goal`") # noqa: E501 - - collection_formats = {} - - path_params = {} - if 'goal_gid' in params: - path_params['goal_gid'] = params['goal_gid'] # noqa: E501 - - query_params = [] - if 'opt_fields' in params: - query_params.append(('opt_fields', params['opt_fields'])) # noqa: E501 - collection_formats['opt_fields'] = 'csv' # noqa: E501 - - header_params = {} - - form_params = [] - local_var_files = {} - - body_params = None - if 'body' in params: - body_params = params['body'] - # HTTP header `Accept` - header_params['Accept'] = self.api_client.select_header_accept( - ['application/json; charset=UTF-8']) # noqa: E501 - - # HTTP header `Content-Type` - header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 - ['application/json; charset=UTF-8']) # noqa: E501 - - # Authentication setting - auth_settings = ['oauth2'] # noqa: E501 - - return self.api_client.call_api( - '/goals/{goal_gid}', 'PUT', - path_params, - query_params, - header_params, - body=body_params, - post_params=form_params, - files=local_var_files, - response_type='GoalResponseData', # noqa: E501 - auth_settings=auth_settings, - async_req=params.get('async_req'), - _return_http_data_only=params.get('_return_http_data_only'), - _preload_content=params.get('_preload_content', True), - _request_timeout=params.get('_request_timeout'), - collection_formats=collection_formats) - - def update_goal_metric(self, body, goal_gid, **kwargs): # noqa: E501 - """Update a goal metric # noqa: E501 - - Updates a goal's existing metric's `current_number_value` if one exists, otherwise responds with a 400 status code. Returns the complete updated goal metric record. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.update_goal_metric(body, goal_gid, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param GoalGidSetMetricCurrentValueBody body: The updated fields for the goal metric. (required) - :param str goal_gid: Globally unique identifier for the goal. (required) - :param list[str] opt_fields: This endpoint returns a compact resource, which excludes some properties by default. To include those optional properties, set this query parameter to a comma-separated list of the properties you wish to include. - :return: GoalResponseData - If the method is called asynchronously, - returns the request thread. - """ - kwargs['_return_http_data_only'] = True - if kwargs.get('async_req'): - return self.update_goal_metric_with_http_info(body, goal_gid, **kwargs) # noqa: E501 - else: - (data) = self.update_goal_metric_with_http_info(body, goal_gid, **kwargs) # noqa: E501 - return data - - def update_goal_metric_with_http_info(self, body, goal_gid, **kwargs): # noqa: E501 - """Update a goal metric # noqa: E501 - - Updates a goal's existing metric's `current_number_value` if one exists, otherwise responds with a 400 status code. Returns the complete updated goal metric record. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.update_goal_metric_with_http_info(body, goal_gid, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param GoalGidSetMetricCurrentValueBody body: The updated fields for the goal metric. (required) - :param str goal_gid: Globally unique identifier for the goal. (required) - :param list[str] opt_fields: This endpoint returns a compact resource, which excludes some properties by default. To include those optional properties, set this query parameter to a comma-separated list of the properties you wish to include. - :return: GoalResponseData - If the method is called asynchronously, - returns the request thread. - """ - - all_params = ['body', 'goal_gid', 'opt_fields'] # noqa: E501 - all_params.append('async_req') - all_params.append('_return_http_data_only') - all_params.append('_preload_content') - all_params.append('_request_timeout') - - params = locals() - for key, val in six.iteritems(params['kwargs']): - if key not in all_params: - raise TypeError( - "Got an unexpected keyword argument '%s'" - " to method update_goal_metric" % key - ) - params[key] = val - del params['kwargs'] - # verify the required parameter 'body' is set - if ('body' not in params or - params['body'] is None): - raise ValueError("Missing the required parameter `body` when calling `update_goal_metric`") # noqa: E501 - # verify the required parameter 'goal_gid' is set - if ('goal_gid' not in params or - params['goal_gid'] is None): - raise ValueError("Missing the required parameter `goal_gid` when calling `update_goal_metric`") # noqa: E501 - - collection_formats = {} - - path_params = {} - if 'goal_gid' in params: - path_params['goal_gid'] = params['goal_gid'] # noqa: E501 - - query_params = [] - if 'opt_fields' in params: - query_params.append(('opt_fields', params['opt_fields'])) # noqa: E501 - collection_formats['opt_fields'] = 'csv' # noqa: E501 - - header_params = {} - - form_params = [] - local_var_files = {} - - body_params = None - if 'body' in params: - body_params = params['body'] - # HTTP header `Accept` - header_params['Accept'] = self.api_client.select_header_accept( - ['application/json; charset=UTF-8']) # noqa: E501 - - # HTTP header `Content-Type` - header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 - ['application/json; charset=UTF-8']) # noqa: E501 - - # Authentication setting - auth_settings = ['oauth2'] # noqa: E501 - - return self.api_client.call_api( - '/goals/{goal_gid}/setMetricCurrentValue', 'POST', - path_params, - query_params, - header_params, - body=body_params, - post_params=form_params, - files=local_var_files, - response_type='GoalResponseData', # noqa: E501 - auth_settings=auth_settings, - async_req=params.get('async_req'), - _return_http_data_only=params.get('_return_http_data_only'), - _preload_content=params.get('_preload_content', True), - _request_timeout=params.get('_request_timeout'), - collection_formats=collection_formats) + all_params = ['body', 'goal_gid', 'opt_fields'] # noqa: E501 + all_params.append('async_req') + all_params.append('header_params') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + params = locals() + for key, val in six.iteritems(params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method update_goal_metric" % key + ) + params[key] = val + del params['kwargs'] + # verify the required parameter 'body' is set + if ('body' not in params or + params['body'] is None): + raise ValueError("Missing the required parameter `body` when calling `update_goal_metric`") # noqa: E501 + # verify the required parameter 'goal_gid' is set + if ('goal_gid' not in params or + params['goal_gid'] is None): + raise ValueError("Missing the required parameter `goal_gid` when calling `update_goal_metric`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'goal_gid' in params: + path_params['goal_gid'] = params['goal_gid'] # noqa: E501 + + query_params = [] + if 'opt_fields' in params: + query_params.append(('opt_fields', params['opt_fields'])) # noqa: E501 + collection_formats['opt_fields'] = 'csv' # noqa: E501 + + header_params = kwargs.get("header_params", {}) + + form_params = [] + local_var_files = {} + + body_params = None + if 'body' in params: + body_params = params['body'] + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['application/json; charset=UTF-8']) # noqa: E501 + + # HTTP header `Content-Type` + header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 + ['application/json; charset=UTF-8']) # noqa: E501 + + # Authentication setting + auth_settings = ['oauth2'] # noqa: E501 + + return self.api_client.call_api( + '/goals/{goal_gid}/setMetricCurrentValue', 'POST', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='GoalResponseData', # noqa: E501 + auth_settings=auth_settings, + async_req=params.get('async_req'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) diff --git a/asana/api/jobs_api.py b/asana/api/jobs_api.py index cb74f4db..099356a9 100644 --- a/asana/api/jobs_api.py +++ b/asana/api/jobs_api.py @@ -21,113 +21,114 @@ class JobsApi(object): - """NOTE: This class is auto generated by the swagger code generator program. +"""NOTE: This class is auto generated by the swagger code generator program. - Do not edit the class manually. - Ref: https://github.com/swagger-api/swagger-codegen +Do not edit the class manually. +Ref: https://github.com/swagger-api/swagger-codegen +""" + +def __init__(self, api_client=None): + if api_client is None: + api_client = ApiClient() + self.api_client = api_client + +def get_job(self, job_gid, **kwargs): # noqa: E501 + """Get a job by id # noqa: E501 + + Returns the full record for a job. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.get_job(job_gid, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str job_gid: Globally unique identifier for the job. (required) + :param list[str] opt_fields: This endpoint returns a compact resource, which excludes some properties by default. To include those optional properties, set this query parameter to a comma-separated list of the properties you wish to include. + :return: JobResponseData + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = kwargs.get("_return_http_data_only", True) + if kwargs.get('async_req'): + return self.get_job_with_http_info(job_gid, **kwargs) # noqa: E501 + else: + (data) = self.get_job_with_http_info(job_gid, **kwargs) # noqa: E501 + return data + +def get_job_with_http_info(self, job_gid, **kwargs): # noqa: E501 + """Get a job by id # noqa: E501 + + Returns the full record for a job. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.get_job_with_http_info(job_gid, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str job_gid: Globally unique identifier for the job. (required) + :param list[str] opt_fields: This endpoint returns a compact resource, which excludes some properties by default. To include those optional properties, set this query parameter to a comma-separated list of the properties you wish to include. + :return: JobResponseData + If the method is called asynchronously, + returns the request thread. """ - def __init__(self, api_client=None): - if api_client is None: - api_client = ApiClient() - self.api_client = api_client - - def get_job(self, job_gid, **kwargs): # noqa: E501 - """Get a job by id # noqa: E501 - - Returns the full record for a job. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.get_job(job_gid, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param str job_gid: Globally unique identifier for the job. (required) - :param list[str] opt_fields: This endpoint returns a compact resource, which excludes some properties by default. To include those optional properties, set this query parameter to a comma-separated list of the properties you wish to include. - :return: JobResponseData - If the method is called asynchronously, - returns the request thread. - """ - kwargs['_return_http_data_only'] = True - if kwargs.get('async_req'): - return self.get_job_with_http_info(job_gid, **kwargs) # noqa: E501 - else: - (data) = self.get_job_with_http_info(job_gid, **kwargs) # noqa: E501 - return data - - def get_job_with_http_info(self, job_gid, **kwargs): # noqa: E501 - """Get a job by id # noqa: E501 - - Returns the full record for a job. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.get_job_with_http_info(job_gid, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param str job_gid: Globally unique identifier for the job. (required) - :param list[str] opt_fields: This endpoint returns a compact resource, which excludes some properties by default. To include those optional properties, set this query parameter to a comma-separated list of the properties you wish to include. - :return: JobResponseData - If the method is called asynchronously, - returns the request thread. - """ - - all_params = ['job_gid', 'opt_fields'] # noqa: E501 - all_params.append('async_req') - all_params.append('_return_http_data_only') - all_params.append('_preload_content') - all_params.append('_request_timeout') - - params = locals() - for key, val in six.iteritems(params['kwargs']): - if key not in all_params: - raise TypeError( - "Got an unexpected keyword argument '%s'" - " to method get_job" % key - ) - params[key] = val - del params['kwargs'] - # verify the required parameter 'job_gid' is set - if ('job_gid' not in params or - params['job_gid'] is None): - raise ValueError("Missing the required parameter `job_gid` when calling `get_job`") # noqa: E501 - - collection_formats = {} - - path_params = {} - if 'job_gid' in params: - path_params['job_gid'] = params['job_gid'] # noqa: E501 - - query_params = [] - if 'opt_fields' in params: - query_params.append(('opt_fields', params['opt_fields'])) # noqa: E501 - collection_formats['opt_fields'] = 'csv' # noqa: E501 - - header_params = {} - - form_params = [] - local_var_files = {} - - body_params = None - # HTTP header `Accept` - header_params['Accept'] = self.api_client.select_header_accept( - ['application/json; charset=UTF-8']) # noqa: E501 - - # Authentication setting - auth_settings = ['oauth2'] # noqa: E501 - - return self.api_client.call_api( - '/jobs/{job_gid}', 'GET', - path_params, - query_params, - header_params, - body=body_params, - post_params=form_params, - files=local_var_files, - response_type='JobResponseData', # noqa: E501 - auth_settings=auth_settings, - async_req=params.get('async_req'), - _return_http_data_only=params.get('_return_http_data_only'), - _preload_content=params.get('_preload_content', True), - _request_timeout=params.get('_request_timeout'), - collection_formats=collection_formats) + all_params = ['job_gid', 'opt_fields'] # noqa: E501 + all_params.append('async_req') + all_params.append('header_params') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + params = locals() + for key, val in six.iteritems(params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method get_job" % key + ) + params[key] = val + del params['kwargs'] + # verify the required parameter 'job_gid' is set + if ('job_gid' not in params or + params['job_gid'] is None): + raise ValueError("Missing the required parameter `job_gid` when calling `get_job`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'job_gid' in params: + path_params['job_gid'] = params['job_gid'] # noqa: E501 + + query_params = [] + if 'opt_fields' in params: + query_params.append(('opt_fields', params['opt_fields'])) # noqa: E501 + collection_formats['opt_fields'] = 'csv' # noqa: E501 + + header_params = kwargs.get("header_params", {}) + + form_params = [] + local_var_files = {} + + body_params = None + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['application/json; charset=UTF-8']) # noqa: E501 + + # Authentication setting + auth_settings = ['oauth2'] # noqa: E501 + + return self.api_client.call_api( + '/jobs/{job_gid}', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='JobResponseData', # noqa: E501 + auth_settings=auth_settings, + async_req=params.get('async_req'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) diff --git a/asana/api/memberships_api.py b/asana/api/memberships_api.py index 757c4011..9e4edc16 100644 --- a/asana/api/memberships_api.py +++ b/asana/api/memberships_api.py @@ -21,311 +21,314 @@ class MembershipsApi(object): - """NOTE: This class is auto generated by the swagger code generator program. +"""NOTE: This class is auto generated by the swagger code generator program. - Do not edit the class manually. - Ref: https://github.com/swagger-api/swagger-codegen +Do not edit the class manually. +Ref: https://github.com/swagger-api/swagger-codegen +""" + +def __init__(self, api_client=None): + if api_client is None: + api_client = ApiClient() + self.api_client = api_client + +def create_membership(self, **kwargs): # noqa: E501 + """Create a membership # noqa: E501 + + Creates a new membership in a `goal`. `Teams` or `users` can be a member of `goals`. Returns the full record of the newly created membership. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.create_membership(async_req=True) + >>> result = thread.get() + + :param async_req bool + :param MembershipsBody body: The updated fields for the membership. + :return: MembershipResponseData + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = kwargs.get("_return_http_data_only", True) + if kwargs.get('async_req'): + return self.create_membership_with_http_info(**kwargs) # noqa: E501 + else: + (data) = self.create_membership_with_http_info(**kwargs) # noqa: E501 + return data + +def create_membership_with_http_info(self, **kwargs): # noqa: E501 + """Create a membership # noqa: E501 + + Creates a new membership in a `goal`. `Teams` or `users` can be a member of `goals`. Returns the full record of the newly created membership. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.create_membership_with_http_info(async_req=True) + >>> result = thread.get() + + :param async_req bool + :param MembershipsBody body: The updated fields for the membership. + :return: MembershipResponseData + If the method is called asynchronously, + returns the request thread. + """ + + all_params = ['body'] # noqa: E501 + all_params.append('async_req') + all_params.append('header_params') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + params = locals() + for key, val in six.iteritems(params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method create_membership" % key + ) + params[key] = val + del params['kwargs'] + + collection_formats = {} + + path_params = {} + + query_params = [] + + header_params = kwargs.get("header_params", {}) + + form_params = [] + local_var_files = {} + + body_params = None + if 'body' in params: + body_params = params['body'] + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['application/json; charset=UTF-8']) # noqa: E501 + + # HTTP header `Content-Type` + header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 + ['application/json; charset=UTF-8']) # noqa: E501 + + # Authentication setting + auth_settings = ['oauth2'] # noqa: E501 + + return self.api_client.call_api( + '/memberships', 'POST', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='MembershipResponseData', # noqa: E501 + auth_settings=auth_settings, + async_req=params.get('async_req'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) + +def delete_membership(self, membership_gid, **kwargs): # noqa: E501 + """Delete a membership # noqa: E501 + + A specific, existing membership can be deleted by making a `DELETE` request on the URL for that membership. Returns an empty data record. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.delete_membership(membership_gid, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str membership_gid: Globally unique identifier for the membership. (required) + :return: EmptyResponseData + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = kwargs.get("_return_http_data_only", True) + if kwargs.get('async_req'): + return self.delete_membership_with_http_info(membership_gid, **kwargs) # noqa: E501 + else: + (data) = self.delete_membership_with_http_info(membership_gid, **kwargs) # noqa: E501 + return data + +def delete_membership_with_http_info(self, membership_gid, **kwargs): # noqa: E501 + """Delete a membership # noqa: E501 + + A specific, existing membership can be deleted by making a `DELETE` request on the URL for that membership. Returns an empty data record. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.delete_membership_with_http_info(membership_gid, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str membership_gid: Globally unique identifier for the membership. (required) + :return: EmptyResponseData + If the method is called asynchronously, + returns the request thread. + """ + + all_params = ['membership_gid'] # noqa: E501 + all_params.append('async_req') + all_params.append('header_params') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + params = locals() + for key, val in six.iteritems(params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method delete_membership" % key + ) + params[key] = val + del params['kwargs'] + # verify the required parameter 'membership_gid' is set + if ('membership_gid' not in params or + params['membership_gid'] is None): + raise ValueError("Missing the required parameter `membership_gid` when calling `delete_membership`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'membership_gid' in params: + path_params['membership_gid'] = params['membership_gid'] # noqa: E501 + + query_params = [] + + header_params = kwargs.get("header_params", {}) + + form_params = [] + local_var_files = {} + + body_params = None + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['application/json; charset=UTF-8']) # noqa: E501 + + # Authentication setting + auth_settings = ['oauth2'] # noqa: E501 + + return self.api_client.call_api( + '/memberships/{membership_gid}', 'DELETE', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='EmptyResponseData', # noqa: E501 + auth_settings=auth_settings, + async_req=params.get('async_req'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) + +def get_memberships(self, **kwargs): # noqa: E501 + """Get multiple memberships # noqa: E501 + + Returns compact `goal_membership` or `project_membership` records. The possible types for `parent` in this request are `goal` or `project`. An additional member (user GID or team GID) can be passed in to filter to a specific membership. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.get_memberships(async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str parent: Globally unique identifier for `goal` or `project`. + :param str member: Globally unique identifier for `team` or `user`. + :param int limit: Results per page. The number of objects to return per page. The value must be between 1 and 100. + :param str offset: 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 list[str] opt_fields: This endpoint returns a compact resource, which excludes some properties by default. To include those optional properties, set this query parameter to a comma-separated list of the properties you wish to include. + :return: MembershipResponseArray + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = kwargs.get("_return_http_data_only", True) + if kwargs.get('async_req'): + return self.get_memberships_with_http_info(**kwargs) # noqa: E501 + else: + (data) = self.get_memberships_with_http_info(**kwargs) # noqa: E501 + return data + +def get_memberships_with_http_info(self, **kwargs): # noqa: E501 + """Get multiple memberships # noqa: E501 + + Returns compact `goal_membership` or `project_membership` records. The possible types for `parent` in this request are `goal` or `project`. An additional member (user GID or team GID) can be passed in to filter to a specific membership. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.get_memberships_with_http_info(async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str parent: Globally unique identifier for `goal` or `project`. + :param str member: Globally unique identifier for `team` or `user`. + :param int limit: Results per page. The number of objects to return per page. The value must be between 1 and 100. + :param str offset: 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 list[str] opt_fields: This endpoint returns a compact resource, which excludes some properties by default. To include those optional properties, set this query parameter to a comma-separated list of the properties you wish to include. + :return: MembershipResponseArray + If the method is called asynchronously, + returns the request thread. """ - def __init__(self, api_client=None): - if api_client is None: - api_client = ApiClient() - self.api_client = api_client - - def create_membership(self, **kwargs): # noqa: E501 - """Create a membership # noqa: E501 - - Creates a new membership in a `goal`. `Teams` or `users` can be a member of `goals`. Returns the full record of the newly created membership. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.create_membership(async_req=True) - >>> result = thread.get() - - :param async_req bool - :param MembershipsBody body: The updated fields for the membership. - :return: MembershipResponseData - If the method is called asynchronously, - returns the request thread. - """ - kwargs['_return_http_data_only'] = True - if kwargs.get('async_req'): - return self.create_membership_with_http_info(**kwargs) # noqa: E501 - else: - (data) = self.create_membership_with_http_info(**kwargs) # noqa: E501 - return data - - def create_membership_with_http_info(self, **kwargs): # noqa: E501 - """Create a membership # noqa: E501 - - Creates a new membership in a `goal`. `Teams` or `users` can be a member of `goals`. Returns the full record of the newly created membership. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.create_membership_with_http_info(async_req=True) - >>> result = thread.get() - - :param async_req bool - :param MembershipsBody body: The updated fields for the membership. - :return: MembershipResponseData - If the method is called asynchronously, - returns the request thread. - """ - - all_params = ['body'] # noqa: E501 - all_params.append('async_req') - all_params.append('_return_http_data_only') - all_params.append('_preload_content') - all_params.append('_request_timeout') - - params = locals() - for key, val in six.iteritems(params['kwargs']): - if key not in all_params: - raise TypeError( - "Got an unexpected keyword argument '%s'" - " to method create_membership" % key - ) - params[key] = val - del params['kwargs'] - - collection_formats = {} - - path_params = {} - - query_params = [] - - header_params = {} - - form_params = [] - local_var_files = {} - - body_params = None - if 'body' in params: - body_params = params['body'] - # HTTP header `Accept` - header_params['Accept'] = self.api_client.select_header_accept( - ['application/json; charset=UTF-8']) # noqa: E501 - - # HTTP header `Content-Type` - header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 - ['application/json; charset=UTF-8']) # noqa: E501 - - # Authentication setting - auth_settings = ['oauth2'] # noqa: E501 - - return self.api_client.call_api( - '/memberships', 'POST', - path_params, - query_params, - header_params, - body=body_params, - post_params=form_params, - files=local_var_files, - response_type='MembershipResponseData', # noqa: E501 - auth_settings=auth_settings, - async_req=params.get('async_req'), - _return_http_data_only=params.get('_return_http_data_only'), - _preload_content=params.get('_preload_content', True), - _request_timeout=params.get('_request_timeout'), - collection_formats=collection_formats) - - def delete_membership(self, membership_gid, **kwargs): # noqa: E501 - """Delete a membership # noqa: E501 - - A specific, existing membership can be deleted by making a `DELETE` request on the URL for that membership. Returns an empty data record. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.delete_membership(membership_gid, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param str membership_gid: Globally unique identifier for the membership. (required) - :return: EmptyResponseData - If the method is called asynchronously, - returns the request thread. - """ - kwargs['_return_http_data_only'] = True - if kwargs.get('async_req'): - return self.delete_membership_with_http_info(membership_gid, **kwargs) # noqa: E501 - else: - (data) = self.delete_membership_with_http_info(membership_gid, **kwargs) # noqa: E501 - return data - - def delete_membership_with_http_info(self, membership_gid, **kwargs): # noqa: E501 - """Delete a membership # noqa: E501 - - A specific, existing membership can be deleted by making a `DELETE` request on the URL for that membership. Returns an empty data record. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.delete_membership_with_http_info(membership_gid, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param str membership_gid: Globally unique identifier for the membership. (required) - :return: EmptyResponseData - If the method is called asynchronously, - returns the request thread. - """ - - all_params = ['membership_gid'] # noqa: E501 - all_params.append('async_req') - all_params.append('_return_http_data_only') - all_params.append('_preload_content') - all_params.append('_request_timeout') - - params = locals() - for key, val in six.iteritems(params['kwargs']): - if key not in all_params: - raise TypeError( - "Got an unexpected keyword argument '%s'" - " to method delete_membership" % key - ) - params[key] = val - del params['kwargs'] - # verify the required parameter 'membership_gid' is set - if ('membership_gid' not in params or - params['membership_gid'] is None): - raise ValueError("Missing the required parameter `membership_gid` when calling `delete_membership`") # noqa: E501 - - collection_formats = {} - - path_params = {} - if 'membership_gid' in params: - path_params['membership_gid'] = params['membership_gid'] # noqa: E501 - - query_params = [] - - header_params = {} - - form_params = [] - local_var_files = {} - - body_params = None - # HTTP header `Accept` - header_params['Accept'] = self.api_client.select_header_accept( - ['application/json; charset=UTF-8']) # noqa: E501 - - # Authentication setting - auth_settings = ['oauth2'] # noqa: E501 - - return self.api_client.call_api( - '/memberships/{membership_gid}', 'DELETE', - path_params, - query_params, - header_params, - body=body_params, - post_params=form_params, - files=local_var_files, - response_type='EmptyResponseData', # noqa: E501 - auth_settings=auth_settings, - async_req=params.get('async_req'), - _return_http_data_only=params.get('_return_http_data_only'), - _preload_content=params.get('_preload_content', True), - _request_timeout=params.get('_request_timeout'), - collection_formats=collection_formats) - - def get_memberships(self, **kwargs): # noqa: E501 - """Get multiple memberships # noqa: E501 - - Returns compact `goal_membership` records. The possible types for `parent` in this request are `goal`. An additional member (user GID or team GID) can be passed in to filter to a specific membership. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.get_memberships(async_req=True) - >>> result = thread.get() - - :param async_req bool - :param str parent: Globally unique identifier for `goal`. - :param str member: Globally unique identifier for `team` or `user`. - :param int limit: Results per page. The number of objects to return per page. The value must be between 1 and 100. - :param str offset: 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 list[str] opt_fields: This endpoint returns a compact resource, which excludes some properties by default. To include those optional properties, set this query parameter to a comma-separated list of the properties you wish to include. - :return: MembershipResponseArray - If the method is called asynchronously, - returns the request thread. - """ - kwargs['_return_http_data_only'] = True - if kwargs.get('async_req'): - return self.get_memberships_with_http_info(**kwargs) # noqa: E501 - else: - (data) = self.get_memberships_with_http_info(**kwargs) # noqa: E501 - return data - - def get_memberships_with_http_info(self, **kwargs): # noqa: E501 - """Get multiple memberships # noqa: E501 - - Returns compact `goal_membership` records. The possible types for `parent` in this request are `goal`. An additional member (user GID or team GID) can be passed in to filter to a specific membership. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.get_memberships_with_http_info(async_req=True) - >>> result = thread.get() - - :param async_req bool - :param str parent: Globally unique identifier for `goal`. - :param str member: Globally unique identifier for `team` or `user`. - :param int limit: Results per page. The number of objects to return per page. The value must be between 1 and 100. - :param str offset: 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 list[str] opt_fields: This endpoint returns a compact resource, which excludes some properties by default. To include those optional properties, set this query parameter to a comma-separated list of the properties you wish to include. - :return: MembershipResponseArray - If the method is called asynchronously, - returns the request thread. - """ - - all_params = ['parent', 'member', 'limit', 'offset', 'opt_fields'] # noqa: E501 - all_params.append('async_req') - all_params.append('_return_http_data_only') - all_params.append('_preload_content') - all_params.append('_request_timeout') - - params = locals() - for key, val in six.iteritems(params['kwargs']): - if key not in all_params: - raise TypeError( - "Got an unexpected keyword argument '%s'" - " to method get_memberships" % key - ) - params[key] = val - del params['kwargs'] - - collection_formats = {} - - path_params = {} - - query_params = [] - if 'parent' in params: - query_params.append(('parent', params['parent'])) # noqa: E501 - if 'member' in params: - query_params.append(('member', params['member'])) # noqa: E501 - if 'limit' in params: - query_params.append(('limit', params['limit'])) # noqa: E501 - if 'offset' in params: - query_params.append(('offset', params['offset'])) # noqa: E501 - if 'opt_fields' in params: - query_params.append(('opt_fields', params['opt_fields'])) # noqa: E501 - collection_formats['opt_fields'] = 'csv' # noqa: E501 - - header_params = {} - - form_params = [] - local_var_files = {} - - body_params = None - # HTTP header `Accept` - header_params['Accept'] = self.api_client.select_header_accept( - ['application/json; charset=UTF-8']) # noqa: E501 - - # Authentication setting - auth_settings = ['oauth2'] # noqa: E501 - - return self.api_client.call_api( - '/memberships', 'GET', - path_params, - query_params, - header_params, - body=body_params, - post_params=form_params, - files=local_var_files, - response_type='MembershipResponseArray', # noqa: E501 - auth_settings=auth_settings, - async_req=params.get('async_req'), - _return_http_data_only=params.get('_return_http_data_only'), - _preload_content=params.get('_preload_content', True), - _request_timeout=params.get('_request_timeout'), - collection_formats=collection_formats) + all_params = ['parent', 'member', 'limit', 'offset', 'opt_fields'] # noqa: E501 + all_params.append('async_req') + all_params.append('header_params') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + params = locals() + for key, val in six.iteritems(params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method get_memberships" % key + ) + params[key] = val + del params['kwargs'] + + collection_formats = {} + + path_params = {} + + query_params = [] + if 'parent' in params: + query_params.append(('parent', params['parent'])) # noqa: E501 + if 'member' in params: + query_params.append(('member', params['member'])) # noqa: E501 + if 'limit' in params: + query_params.append(('limit', params['limit'])) # noqa: E501 + if 'offset' in params: + query_params.append(('offset', params['offset'])) # noqa: E501 + if 'opt_fields' in params: + query_params.append(('opt_fields', params['opt_fields'])) # noqa: E501 + collection_formats['opt_fields'] = 'csv' # noqa: E501 + + header_params = kwargs.get("header_params", {}) + + form_params = [] + local_var_files = {} + + body_params = None + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['application/json; charset=UTF-8']) # noqa: E501 + + # Authentication setting + auth_settings = ['oauth2'] # noqa: E501 + + return self.api_client.call_api( + '/memberships', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='MembershipResponseArray', # noqa: E501 + auth_settings=auth_settings, + async_req=params.get('async_req'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) diff --git a/asana/api/organization_exports_api.py b/asana/api/organization_exports_api.py index ef2c47be..a84375d7 100644 --- a/asana/api/organization_exports_api.py +++ b/asana/api/organization_exports_api.py @@ -21,217 +21,219 @@ class OrganizationExportsApi(object): - """NOTE: This class is auto generated by the swagger code generator program. +"""NOTE: This class is auto generated by the swagger code generator program. - Do not edit the class manually. - Ref: https://github.com/swagger-api/swagger-codegen +Do not edit the class manually. +Ref: https://github.com/swagger-api/swagger-codegen +""" + +def __init__(self, api_client=None): + if api_client is None: + api_client = ApiClient() + self.api_client = api_client + +def create_organization_export(self, body, **kwargs): # noqa: E501 + """Create an organization export request # noqa: E501 + + This method creates a request to export an Organization. Asana will complete the export at some point after you create the request. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.create_organization_export(body, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param OrganizationExportsBody body: The organization to export. (required) + :param list[str] opt_fields: This endpoint returns a compact resource, which excludes some properties by default. To include those optional properties, set this query parameter to a comma-separated list of the properties you wish to include. + :return: OrganizationExportResponseData + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = kwargs.get("_return_http_data_only", True) + if kwargs.get('async_req'): + return self.create_organization_export_with_http_info(body, **kwargs) # noqa: E501 + else: + (data) = self.create_organization_export_with_http_info(body, **kwargs) # noqa: E501 + return data + +def create_organization_export_with_http_info(self, body, **kwargs): # noqa: E501 + """Create an organization export request # noqa: E501 + + This method creates a request to export an Organization. Asana will complete the export at some point after you create the request. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.create_organization_export_with_http_info(body, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param OrganizationExportsBody body: The organization to export. (required) + :param list[str] opt_fields: This endpoint returns a compact resource, which excludes some properties by default. To include those optional properties, set this query parameter to a comma-separated list of the properties you wish to include. + :return: OrganizationExportResponseData + If the method is called asynchronously, + returns the request thread. + """ + + all_params = ['body', 'opt_fields'] # noqa: E501 + all_params.append('async_req') + all_params.append('header_params') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + params = locals() + for key, val in six.iteritems(params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method create_organization_export" % key + ) + params[key] = val + del params['kwargs'] + # verify the required parameter 'body' is set + if ('body' not in params or + params['body'] is None): + raise ValueError("Missing the required parameter `body` when calling `create_organization_export`") # noqa: E501 + + collection_formats = {} + + path_params = {} + + query_params = [] + if 'opt_fields' in params: + query_params.append(('opt_fields', params['opt_fields'])) # noqa: E501 + collection_formats['opt_fields'] = 'csv' # noqa: E501 + + header_params = kwargs.get("header_params", {}) + + form_params = [] + local_var_files = {} + + body_params = None + if 'body' in params: + body_params = params['body'] + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['application/json; charset=UTF-8']) # noqa: E501 + + # HTTP header `Content-Type` + header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 + ['application/json; charset=UTF-8']) # noqa: E501 + + # Authentication setting + auth_settings = ['oauth2'] # noqa: E501 + + return self.api_client.call_api( + '/organization_exports', 'POST', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='OrganizationExportResponseData', # noqa: E501 + auth_settings=auth_settings, + async_req=params.get('async_req'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) + +def get_organization_export(self, organization_export_gid, **kwargs): # noqa: E501 + """Get details on an org export request # noqa: E501 + + Returns details of a previously-requested Organization export. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.get_organization_export(organization_export_gid, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str organization_export_gid: Globally unique identifier for the organization export. (required) + :param list[str] opt_fields: This endpoint returns a compact resource, which excludes some properties by default. To include those optional properties, set this query parameter to a comma-separated list of the properties you wish to include. + :return: OrganizationExportResponseData + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = kwargs.get("_return_http_data_only", True) + if kwargs.get('async_req'): + return self.get_organization_export_with_http_info(organization_export_gid, **kwargs) # noqa: E501 + else: + (data) = self.get_organization_export_with_http_info(organization_export_gid, **kwargs) # noqa: E501 + return data + +def get_organization_export_with_http_info(self, organization_export_gid, **kwargs): # noqa: E501 + """Get details on an org export request # noqa: E501 + + Returns details of a previously-requested Organization export. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.get_organization_export_with_http_info(organization_export_gid, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str organization_export_gid: Globally unique identifier for the organization export. (required) + :param list[str] opt_fields: This endpoint returns a compact resource, which excludes some properties by default. To include those optional properties, set this query parameter to a comma-separated list of the properties you wish to include. + :return: OrganizationExportResponseData + If the method is called asynchronously, + returns the request thread. """ - def __init__(self, api_client=None): - if api_client is None: - api_client = ApiClient() - self.api_client = api_client - - def create_organization_export(self, body, **kwargs): # noqa: E501 - """Create an organization export request # noqa: E501 - - This method creates a request to export an Organization. Asana will complete the export at some point after you create the request. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.create_organization_export(body, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param OrganizationExportsBody body: The organization to export. (required) - :param list[str] opt_fields: This endpoint returns a compact resource, which excludes some properties by default. To include those optional properties, set this query parameter to a comma-separated list of the properties you wish to include. - :return: OrganizationExportResponseData - If the method is called asynchronously, - returns the request thread. - """ - kwargs['_return_http_data_only'] = True - if kwargs.get('async_req'): - return self.create_organization_export_with_http_info(body, **kwargs) # noqa: E501 - else: - (data) = self.create_organization_export_with_http_info(body, **kwargs) # noqa: E501 - return data - - def create_organization_export_with_http_info(self, body, **kwargs): # noqa: E501 - """Create an organization export request # noqa: E501 - - This method creates a request to export an Organization. Asana will complete the export at some point after you create the request. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.create_organization_export_with_http_info(body, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param OrganizationExportsBody body: The organization to export. (required) - :param list[str] opt_fields: This endpoint returns a compact resource, which excludes some properties by default. To include those optional properties, set this query parameter to a comma-separated list of the properties you wish to include. - :return: OrganizationExportResponseData - If the method is called asynchronously, - returns the request thread. - """ - - all_params = ['body', 'opt_fields'] # noqa: E501 - all_params.append('async_req') - all_params.append('_return_http_data_only') - all_params.append('_preload_content') - all_params.append('_request_timeout') - - params = locals() - for key, val in six.iteritems(params['kwargs']): - if key not in all_params: - raise TypeError( - "Got an unexpected keyword argument '%s'" - " to method create_organization_export" % key - ) - params[key] = val - del params['kwargs'] - # verify the required parameter 'body' is set - if ('body' not in params or - params['body'] is None): - raise ValueError("Missing the required parameter `body` when calling `create_organization_export`") # noqa: E501 - - collection_formats = {} - - path_params = {} - - query_params = [] - if 'opt_fields' in params: - query_params.append(('opt_fields', params['opt_fields'])) # noqa: E501 - collection_formats['opt_fields'] = 'csv' # noqa: E501 - - header_params = {} - - form_params = [] - local_var_files = {} - - body_params = None - if 'body' in params: - body_params = params['body'] - # HTTP header `Accept` - header_params['Accept'] = self.api_client.select_header_accept( - ['application/json; charset=UTF-8']) # noqa: E501 - - # HTTP header `Content-Type` - header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 - ['application/json; charset=UTF-8']) # noqa: E501 - - # Authentication setting - auth_settings = ['oauth2'] # noqa: E501 - - return self.api_client.call_api( - '/organization_exports', 'POST', - path_params, - query_params, - header_params, - body=body_params, - post_params=form_params, - files=local_var_files, - response_type='OrganizationExportResponseData', # noqa: E501 - auth_settings=auth_settings, - async_req=params.get('async_req'), - _return_http_data_only=params.get('_return_http_data_only'), - _preload_content=params.get('_preload_content', True), - _request_timeout=params.get('_request_timeout'), - collection_formats=collection_formats) - - def get_organization_export(self, organization_export_gid, **kwargs): # noqa: E501 - """Get details on an org export request # noqa: E501 - - Returns details of a previously-requested Organization export. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.get_organization_export(organization_export_gid, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param str organization_export_gid: Globally unique identifier for the organization export. (required) - :param list[str] opt_fields: This endpoint returns a compact resource, which excludes some properties by default. To include those optional properties, set this query parameter to a comma-separated list of the properties you wish to include. - :return: OrganizationExportResponseData - If the method is called asynchronously, - returns the request thread. - """ - kwargs['_return_http_data_only'] = True - if kwargs.get('async_req'): - return self.get_organization_export_with_http_info(organization_export_gid, **kwargs) # noqa: E501 - else: - (data) = self.get_organization_export_with_http_info(organization_export_gid, **kwargs) # noqa: E501 - return data - - def get_organization_export_with_http_info(self, organization_export_gid, **kwargs): # noqa: E501 - """Get details on an org export request # noqa: E501 - - Returns details of a previously-requested Organization export. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.get_organization_export_with_http_info(organization_export_gid, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param str organization_export_gid: Globally unique identifier for the organization export. (required) - :param list[str] opt_fields: This endpoint returns a compact resource, which excludes some properties by default. To include those optional properties, set this query parameter to a comma-separated list of the properties you wish to include. - :return: OrganizationExportResponseData - If the method is called asynchronously, - returns the request thread. - """ - - all_params = ['organization_export_gid', 'opt_fields'] # noqa: E501 - all_params.append('async_req') - all_params.append('_return_http_data_only') - all_params.append('_preload_content') - all_params.append('_request_timeout') - - params = locals() - for key, val in six.iteritems(params['kwargs']): - if key not in all_params: - raise TypeError( - "Got an unexpected keyword argument '%s'" - " to method get_organization_export" % key - ) - params[key] = val - del params['kwargs'] - # verify the required parameter 'organization_export_gid' is set - if ('organization_export_gid' not in params or - params['organization_export_gid'] is None): - raise ValueError("Missing the required parameter `organization_export_gid` when calling `get_organization_export`") # noqa: E501 - - collection_formats = {} - - path_params = {} - if 'organization_export_gid' in params: - path_params['organization_export_gid'] = params['organization_export_gid'] # noqa: E501 - - query_params = [] - if 'opt_fields' in params: - query_params.append(('opt_fields', params['opt_fields'])) # noqa: E501 - collection_formats['opt_fields'] = 'csv' # noqa: E501 - - header_params = {} - - form_params = [] - local_var_files = {} - - body_params = None - # HTTP header `Accept` - header_params['Accept'] = self.api_client.select_header_accept( - ['application/json; charset=UTF-8']) # noqa: E501 - - # Authentication setting - auth_settings = ['oauth2'] # noqa: E501 - - return self.api_client.call_api( - '/organization_exports/{organization_export_gid}', 'GET', - path_params, - query_params, - header_params, - body=body_params, - post_params=form_params, - files=local_var_files, - response_type='OrganizationExportResponseData', # noqa: E501 - auth_settings=auth_settings, - async_req=params.get('async_req'), - _return_http_data_only=params.get('_return_http_data_only'), - _preload_content=params.get('_preload_content', True), - _request_timeout=params.get('_request_timeout'), - collection_formats=collection_formats) + all_params = ['organization_export_gid', 'opt_fields'] # noqa: E501 + all_params.append('async_req') + all_params.append('header_params') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + params = locals() + for key, val in six.iteritems(params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method get_organization_export" % key + ) + params[key] = val + del params['kwargs'] + # verify the required parameter 'organization_export_gid' is set + if ('organization_export_gid' not in params or + params['organization_export_gid'] is None): + raise ValueError("Missing the required parameter `organization_export_gid` when calling `get_organization_export`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'organization_export_gid' in params: + path_params['organization_export_gid'] = params['organization_export_gid'] # noqa: E501 + + query_params = [] + if 'opt_fields' in params: + query_params.append(('opt_fields', params['opt_fields'])) # noqa: E501 + collection_formats['opt_fields'] = 'csv' # noqa: E501 + + header_params = kwargs.get("header_params", {}) + + form_params = [] + local_var_files = {} + + body_params = None + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['application/json; charset=UTF-8']) # noqa: E501 + + # Authentication setting + auth_settings = ['oauth2'] # noqa: E501 + + return self.api_client.call_api( + '/organization_exports/{organization_export_gid}', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='OrganizationExportResponseData', # noqa: E501 + auth_settings=auth_settings, + async_req=params.get('async_req'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) diff --git a/asana/api/portfolio_memberships_api.py b/asana/api/portfolio_memberships_api.py index 165304ff..c89aa905 100644 --- a/asana/api/portfolio_memberships_api.py +++ b/asana/api/portfolio_memberships_api.py @@ -21,337 +21,340 @@ class PortfolioMembershipsApi(object): - """NOTE: This class is auto generated by the swagger code generator program. +"""NOTE: This class is auto generated by the swagger code generator program. - Do not edit the class manually. - Ref: https://github.com/swagger-api/swagger-codegen +Do not edit the class manually. +Ref: https://github.com/swagger-api/swagger-codegen +""" + +def __init__(self, api_client=None): + if api_client is None: + api_client = ApiClient() + self.api_client = api_client + +def get_portfolio_membership(self, portfolio_membership_gid, **kwargs): # noqa: E501 + """Get a portfolio membership # noqa: E501 + + Returns the complete portfolio record for a single portfolio membership. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.get_portfolio_membership(portfolio_membership_gid, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str portfolio_membership_gid: (required) + :param list[str] opt_fields: This endpoint returns a compact resource, which excludes some properties by default. To include those optional properties, set this query parameter to a comma-separated list of the properties you wish to include. + :return: PortfolioMembershipResponseData + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = kwargs.get("_return_http_data_only", True) + if kwargs.get('async_req'): + return self.get_portfolio_membership_with_http_info(portfolio_membership_gid, **kwargs) # noqa: E501 + else: + (data) = self.get_portfolio_membership_with_http_info(portfolio_membership_gid, **kwargs) # noqa: E501 + return data + +def get_portfolio_membership_with_http_info(self, portfolio_membership_gid, **kwargs): # noqa: E501 + """Get a portfolio membership # noqa: E501 + + Returns the complete portfolio record for a single portfolio membership. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.get_portfolio_membership_with_http_info(portfolio_membership_gid, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str portfolio_membership_gid: (required) + :param list[str] opt_fields: This endpoint returns a compact resource, which excludes some properties by default. To include those optional properties, set this query parameter to a comma-separated list of the properties you wish to include. + :return: PortfolioMembershipResponseData + If the method is called asynchronously, + returns the request thread. + """ + + all_params = ['portfolio_membership_gid', 'opt_fields'] # noqa: E501 + all_params.append('async_req') + all_params.append('header_params') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + params = locals() + for key, val in six.iteritems(params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method get_portfolio_membership" % key + ) + params[key] = val + del params['kwargs'] + # verify the required parameter 'portfolio_membership_gid' is set + if ('portfolio_membership_gid' not in params or + params['portfolio_membership_gid'] is None): + raise ValueError("Missing the required parameter `portfolio_membership_gid` when calling `get_portfolio_membership`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'portfolio_membership_gid' in params: + path_params['portfolio_membership_gid'] = params['portfolio_membership_gid'] # noqa: E501 + + query_params = [] + if 'opt_fields' in params: + query_params.append(('opt_fields', params['opt_fields'])) # noqa: E501 + collection_formats['opt_fields'] = 'csv' # noqa: E501 + + header_params = kwargs.get("header_params", {}) + + form_params = [] + local_var_files = {} + + body_params = None + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['application/json; charset=UTF-8']) # noqa: E501 + + # Authentication setting + auth_settings = ['oauth2'] # noqa: E501 + + return self.api_client.call_api( + '/portfolio_memberships/{portfolio_membership_gid}', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='PortfolioMembershipResponseData', # noqa: E501 + auth_settings=auth_settings, + async_req=params.get('async_req'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) + +def get_portfolio_memberships(self, **kwargs): # noqa: E501 + """Get multiple portfolio memberships # noqa: E501 + + Returns a list of portfolio memberships in compact representation. You must specify `portfolio`, `portfolio` and `user`, or `workspace` and `user`. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.get_portfolio_memberships(async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str portfolio: The portfolio to filter results on. + :param str workspace: The workspace to filter results on. + :param str user: A string identifying a user. This can either be the string \"me\", an email, or the gid of a user. + :param int limit: Results per page. The number of objects to return per page. The value must be between 1 and 100. + :param str offset: 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 list[str] opt_fields: This endpoint returns a compact resource, which excludes some properties by default. To include those optional properties, set this query parameter to a comma-separated list of the properties you wish to include. + :return: PortfolioMembershipResponseArray + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = kwargs.get("_return_http_data_only", True) + if kwargs.get('async_req'): + return self.get_portfolio_memberships_with_http_info(**kwargs) # noqa: E501 + else: + (data) = self.get_portfolio_memberships_with_http_info(**kwargs) # noqa: E501 + return data + +def get_portfolio_memberships_with_http_info(self, **kwargs): # noqa: E501 + """Get multiple portfolio memberships # noqa: E501 + + Returns a list of portfolio memberships in compact representation. You must specify `portfolio`, `portfolio` and `user`, or `workspace` and `user`. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.get_portfolio_memberships_with_http_info(async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str portfolio: The portfolio to filter results on. + :param str workspace: The workspace to filter results on. + :param str user: A string identifying a user. This can either be the string \"me\", an email, or the gid of a user. + :param int limit: Results per page. The number of objects to return per page. The value must be between 1 and 100. + :param str offset: 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 list[str] opt_fields: This endpoint returns a compact resource, which excludes some properties by default. To include those optional properties, set this query parameter to a comma-separated list of the properties you wish to include. + :return: PortfolioMembershipResponseArray + If the method is called asynchronously, + returns the request thread. + """ + + all_params = ['portfolio', 'workspace', 'user', 'limit', 'offset', 'opt_fields'] # noqa: E501 + all_params.append('async_req') + all_params.append('header_params') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + params = locals() + for key, val in six.iteritems(params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method get_portfolio_memberships" % key + ) + params[key] = val + del params['kwargs'] + + collection_formats = {} + + path_params = {} + + query_params = [] + if 'portfolio' in params: + query_params.append(('portfolio', params['portfolio'])) # noqa: E501 + if 'workspace' in params: + query_params.append(('workspace', params['workspace'])) # noqa: E501 + if 'user' in params: + query_params.append(('user', params['user'])) # noqa: E501 + if 'limit' in params: + query_params.append(('limit', params['limit'])) # noqa: E501 + if 'offset' in params: + query_params.append(('offset', params['offset'])) # noqa: E501 + if 'opt_fields' in params: + query_params.append(('opt_fields', params['opt_fields'])) # noqa: E501 + collection_formats['opt_fields'] = 'csv' # noqa: E501 + + header_params = kwargs.get("header_params", {}) + + form_params = [] + local_var_files = {} + + body_params = None + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['application/json; charset=UTF-8']) # noqa: E501 + + # Authentication setting + auth_settings = ['oauth2'] # noqa: E501 + + return self.api_client.call_api( + '/portfolio_memberships', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='PortfolioMembershipResponseArray', # noqa: E501 + auth_settings=auth_settings, + async_req=params.get('async_req'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) + +def get_portfolio_memberships_for_portfolio(self, portfolio_gid, **kwargs): # noqa: E501 + """Get memberships from a portfolio # noqa: E501 + + Returns the compact portfolio membership records for the portfolio. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.get_portfolio_memberships_for_portfolio(portfolio_gid, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str portfolio_gid: Globally unique identifier for the portfolio. (required) + :param str user: A string identifying a user. This can either be the string \"me\", an email, or the gid of a user. + :param int limit: Results per page. The number of objects to return per page. The value must be between 1 and 100. + :param str offset: 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 list[str] opt_fields: This endpoint returns a compact resource, which excludes some properties by default. To include those optional properties, set this query parameter to a comma-separated list of the properties you wish to include. + :return: PortfolioMembershipResponseArray + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = kwargs.get("_return_http_data_only", True) + if kwargs.get('async_req'): + return self.get_portfolio_memberships_for_portfolio_with_http_info(portfolio_gid, **kwargs) # noqa: E501 + else: + (data) = self.get_portfolio_memberships_for_portfolio_with_http_info(portfolio_gid, **kwargs) # noqa: E501 + return data + +def get_portfolio_memberships_for_portfolio_with_http_info(self, portfolio_gid, **kwargs): # noqa: E501 + """Get memberships from a portfolio # noqa: E501 + + Returns the compact portfolio membership records for the portfolio. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.get_portfolio_memberships_for_portfolio_with_http_info(portfolio_gid, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str portfolio_gid: Globally unique identifier for the portfolio. (required) + :param str user: A string identifying a user. This can either be the string \"me\", an email, or the gid of a user. + :param int limit: Results per page. The number of objects to return per page. The value must be between 1 and 100. + :param str offset: 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 list[str] opt_fields: This endpoint returns a compact resource, which excludes some properties by default. To include those optional properties, set this query parameter to a comma-separated list of the properties you wish to include. + :return: PortfolioMembershipResponseArray + If the method is called asynchronously, + returns the request thread. """ - def __init__(self, api_client=None): - if api_client is None: - api_client = ApiClient() - self.api_client = api_client - - def get_portfolio_membership(self, portfolio_membership_gid, **kwargs): # noqa: E501 - """Get a portfolio membership # noqa: E501 - - Returns the complete portfolio record for a single portfolio membership. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.get_portfolio_membership(portfolio_membership_gid, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param str portfolio_membership_gid: (required) - :param list[str] opt_fields: This endpoint returns a compact resource, which excludes some properties by default. To include those optional properties, set this query parameter to a comma-separated list of the properties you wish to include. - :return: PortfolioMembershipResponseData - If the method is called asynchronously, - returns the request thread. - """ - kwargs['_return_http_data_only'] = True - if kwargs.get('async_req'): - return self.get_portfolio_membership_with_http_info(portfolio_membership_gid, **kwargs) # noqa: E501 - else: - (data) = self.get_portfolio_membership_with_http_info(portfolio_membership_gid, **kwargs) # noqa: E501 - return data - - def get_portfolio_membership_with_http_info(self, portfolio_membership_gid, **kwargs): # noqa: E501 - """Get a portfolio membership # noqa: E501 - - Returns the complete portfolio record for a single portfolio membership. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.get_portfolio_membership_with_http_info(portfolio_membership_gid, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param str portfolio_membership_gid: (required) - :param list[str] opt_fields: This endpoint returns a compact resource, which excludes some properties by default. To include those optional properties, set this query parameter to a comma-separated list of the properties you wish to include. - :return: PortfolioMembershipResponseData - If the method is called asynchronously, - returns the request thread. - """ - - all_params = ['portfolio_membership_gid', 'opt_fields'] # noqa: E501 - all_params.append('async_req') - all_params.append('_return_http_data_only') - all_params.append('_preload_content') - all_params.append('_request_timeout') - - params = locals() - for key, val in six.iteritems(params['kwargs']): - if key not in all_params: - raise TypeError( - "Got an unexpected keyword argument '%s'" - " to method get_portfolio_membership" % key - ) - params[key] = val - del params['kwargs'] - # verify the required parameter 'portfolio_membership_gid' is set - if ('portfolio_membership_gid' not in params or - params['portfolio_membership_gid'] is None): - raise ValueError("Missing the required parameter `portfolio_membership_gid` when calling `get_portfolio_membership`") # noqa: E501 - - collection_formats = {} - - path_params = {} - if 'portfolio_membership_gid' in params: - path_params['portfolio_membership_gid'] = params['portfolio_membership_gid'] # noqa: E501 - - query_params = [] - if 'opt_fields' in params: - query_params.append(('opt_fields', params['opt_fields'])) # noqa: E501 - collection_formats['opt_fields'] = 'csv' # noqa: E501 - - header_params = {} - - form_params = [] - local_var_files = {} - - body_params = None - # HTTP header `Accept` - header_params['Accept'] = self.api_client.select_header_accept( - ['application/json; charset=UTF-8']) # noqa: E501 - - # Authentication setting - auth_settings = ['oauth2'] # noqa: E501 - - return self.api_client.call_api( - '/portfolio_memberships/{portfolio_membership_gid}', 'GET', - path_params, - query_params, - header_params, - body=body_params, - post_params=form_params, - files=local_var_files, - response_type='PortfolioMembershipResponseData', # noqa: E501 - auth_settings=auth_settings, - async_req=params.get('async_req'), - _return_http_data_only=params.get('_return_http_data_only'), - _preload_content=params.get('_preload_content', True), - _request_timeout=params.get('_request_timeout'), - collection_formats=collection_formats) - - def get_portfolio_memberships(self, **kwargs): # noqa: E501 - """Get multiple portfolio memberships # noqa: E501 - - Returns a list of portfolio memberships in compact representation. You must specify `portfolio`, `portfolio` and `user`, or `workspace` and `user`. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.get_portfolio_memberships(async_req=True) - >>> result = thread.get() - - :param async_req bool - :param str portfolio: The portfolio to filter results on. - :param str workspace: The workspace to filter results on. - :param str user: A string identifying a user. This can either be the string \"me\", an email, or the gid of a user. - :param int limit: Results per page. The number of objects to return per page. The value must be between 1 and 100. - :param str offset: 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 list[str] opt_fields: This endpoint returns a compact resource, which excludes some properties by default. To include those optional properties, set this query parameter to a comma-separated list of the properties you wish to include. - :return: PortfolioMembershipResponseArray - If the method is called asynchronously, - returns the request thread. - """ - kwargs['_return_http_data_only'] = True - if kwargs.get('async_req'): - return self.get_portfolio_memberships_with_http_info(**kwargs) # noqa: E501 - else: - (data) = self.get_portfolio_memberships_with_http_info(**kwargs) # noqa: E501 - return data - - def get_portfolio_memberships_with_http_info(self, **kwargs): # noqa: E501 - """Get multiple portfolio memberships # noqa: E501 - - Returns a list of portfolio memberships in compact representation. You must specify `portfolio`, `portfolio` and `user`, or `workspace` and `user`. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.get_portfolio_memberships_with_http_info(async_req=True) - >>> result = thread.get() - - :param async_req bool - :param str portfolio: The portfolio to filter results on. - :param str workspace: The workspace to filter results on. - :param str user: A string identifying a user. This can either be the string \"me\", an email, or the gid of a user. - :param int limit: Results per page. The number of objects to return per page. The value must be between 1 and 100. - :param str offset: 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 list[str] opt_fields: This endpoint returns a compact resource, which excludes some properties by default. To include those optional properties, set this query parameter to a comma-separated list of the properties you wish to include. - :return: PortfolioMembershipResponseArray - If the method is called asynchronously, - returns the request thread. - """ - - all_params = ['portfolio', 'workspace', 'user', 'limit', 'offset', 'opt_fields'] # noqa: E501 - all_params.append('async_req') - all_params.append('_return_http_data_only') - all_params.append('_preload_content') - all_params.append('_request_timeout') - - params = locals() - for key, val in six.iteritems(params['kwargs']): - if key not in all_params: - raise TypeError( - "Got an unexpected keyword argument '%s'" - " to method get_portfolio_memberships" % key - ) - params[key] = val - del params['kwargs'] - - collection_formats = {} - - path_params = {} - - query_params = [] - if 'portfolio' in params: - query_params.append(('portfolio', params['portfolio'])) # noqa: E501 - if 'workspace' in params: - query_params.append(('workspace', params['workspace'])) # noqa: E501 - if 'user' in params: - query_params.append(('user', params['user'])) # noqa: E501 - if 'limit' in params: - query_params.append(('limit', params['limit'])) # noqa: E501 - if 'offset' in params: - query_params.append(('offset', params['offset'])) # noqa: E501 - if 'opt_fields' in params: - query_params.append(('opt_fields', params['opt_fields'])) # noqa: E501 - collection_formats['opt_fields'] = 'csv' # noqa: E501 - - header_params = {} - - form_params = [] - local_var_files = {} - - body_params = None - # HTTP header `Accept` - header_params['Accept'] = self.api_client.select_header_accept( - ['application/json; charset=UTF-8']) # noqa: E501 - - # Authentication setting - auth_settings = ['oauth2'] # noqa: E501 - - return self.api_client.call_api( - '/portfolio_memberships', 'GET', - path_params, - query_params, - header_params, - body=body_params, - post_params=form_params, - files=local_var_files, - response_type='PortfolioMembershipResponseArray', # noqa: E501 - auth_settings=auth_settings, - async_req=params.get('async_req'), - _return_http_data_only=params.get('_return_http_data_only'), - _preload_content=params.get('_preload_content', True), - _request_timeout=params.get('_request_timeout'), - collection_formats=collection_formats) - - def get_portfolio_memberships_for_portfolio(self, portfolio_gid, **kwargs): # noqa: E501 - """Get memberships from a portfolio # noqa: E501 - - Returns the compact portfolio membership records for the portfolio. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.get_portfolio_memberships_for_portfolio(portfolio_gid, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param str portfolio_gid: Globally unique identifier for the portfolio. (required) - :param str user: A string identifying a user. This can either be the string \"me\", an email, or the gid of a user. - :param int limit: Results per page. The number of objects to return per page. The value must be between 1 and 100. - :param str offset: 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 list[str] opt_fields: This endpoint returns a compact resource, which excludes some properties by default. To include those optional properties, set this query parameter to a comma-separated list of the properties you wish to include. - :return: PortfolioMembershipResponseArray - If the method is called asynchronously, - returns the request thread. - """ - kwargs['_return_http_data_only'] = True - if kwargs.get('async_req'): - return self.get_portfolio_memberships_for_portfolio_with_http_info(portfolio_gid, **kwargs) # noqa: E501 - else: - (data) = self.get_portfolio_memberships_for_portfolio_with_http_info(portfolio_gid, **kwargs) # noqa: E501 - return data - - def get_portfolio_memberships_for_portfolio_with_http_info(self, portfolio_gid, **kwargs): # noqa: E501 - """Get memberships from a portfolio # noqa: E501 - - Returns the compact portfolio membership records for the portfolio. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.get_portfolio_memberships_for_portfolio_with_http_info(portfolio_gid, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param str portfolio_gid: Globally unique identifier for the portfolio. (required) - :param str user: A string identifying a user. This can either be the string \"me\", an email, or the gid of a user. - :param int limit: Results per page. The number of objects to return per page. The value must be between 1 and 100. - :param str offset: 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 list[str] opt_fields: This endpoint returns a compact resource, which excludes some properties by default. To include those optional properties, set this query parameter to a comma-separated list of the properties you wish to include. - :return: PortfolioMembershipResponseArray - If the method is called asynchronously, - returns the request thread. - """ - - all_params = ['portfolio_gid', 'user', 'limit', 'offset', 'opt_fields'] # noqa: E501 - all_params.append('async_req') - all_params.append('_return_http_data_only') - all_params.append('_preload_content') - all_params.append('_request_timeout') - - params = locals() - for key, val in six.iteritems(params['kwargs']): - if key not in all_params: - raise TypeError( - "Got an unexpected keyword argument '%s'" - " to method get_portfolio_memberships_for_portfolio" % key - ) - params[key] = val - del params['kwargs'] - # verify the required parameter 'portfolio_gid' is set - if ('portfolio_gid' not in params or - params['portfolio_gid'] is None): - raise ValueError("Missing the required parameter `portfolio_gid` when calling `get_portfolio_memberships_for_portfolio`") # noqa: E501 - - collection_formats = {} - - path_params = {} - if 'portfolio_gid' in params: - path_params['portfolio_gid'] = params['portfolio_gid'] # noqa: E501 - - query_params = [] - if 'user' in params: - query_params.append(('user', params['user'])) # noqa: E501 - if 'limit' in params: - query_params.append(('limit', params['limit'])) # noqa: E501 - if 'offset' in params: - query_params.append(('offset', params['offset'])) # noqa: E501 - if 'opt_fields' in params: - query_params.append(('opt_fields', params['opt_fields'])) # noqa: E501 - collection_formats['opt_fields'] = 'csv' # noqa: E501 - - header_params = {} - - form_params = [] - local_var_files = {} - - body_params = None - # HTTP header `Accept` - header_params['Accept'] = self.api_client.select_header_accept( - ['application/json; charset=UTF-8']) # noqa: E501 - - # Authentication setting - auth_settings = ['oauth2'] # noqa: E501 - - return self.api_client.call_api( - '/portfolios/{portfolio_gid}/portfolio_memberships', 'GET', - path_params, - query_params, - header_params, - body=body_params, - post_params=form_params, - files=local_var_files, - response_type='PortfolioMembershipResponseArray', # noqa: E501 - auth_settings=auth_settings, - async_req=params.get('async_req'), - _return_http_data_only=params.get('_return_http_data_only'), - _preload_content=params.get('_preload_content', True), - _request_timeout=params.get('_request_timeout'), - collection_formats=collection_formats) + all_params = ['portfolio_gid', 'user', 'limit', 'offset', 'opt_fields'] # noqa: E501 + all_params.append('async_req') + all_params.append('header_params') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + params = locals() + for key, val in six.iteritems(params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method get_portfolio_memberships_for_portfolio" % key + ) + params[key] = val + del params['kwargs'] + # verify the required parameter 'portfolio_gid' is set + if ('portfolio_gid' not in params or + params['portfolio_gid'] is None): + raise ValueError("Missing the required parameter `portfolio_gid` when calling `get_portfolio_memberships_for_portfolio`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'portfolio_gid' in params: + path_params['portfolio_gid'] = params['portfolio_gid'] # noqa: E501 + + query_params = [] + if 'user' in params: + query_params.append(('user', params['user'])) # noqa: E501 + if 'limit' in params: + query_params.append(('limit', params['limit'])) # noqa: E501 + if 'offset' in params: + query_params.append(('offset', params['offset'])) # noqa: E501 + if 'opt_fields' in params: + query_params.append(('opt_fields', params['opt_fields'])) # noqa: E501 + collection_formats['opt_fields'] = 'csv' # noqa: E501 + + header_params = kwargs.get("header_params", {}) + + form_params = [] + local_var_files = {} + + body_params = None + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['application/json; charset=UTF-8']) # noqa: E501 + + # Authentication setting + auth_settings = ['oauth2'] # noqa: E501 + + return self.api_client.call_api( + '/portfolios/{portfolio_gid}/portfolio_memberships', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='PortfolioMembershipResponseArray', # noqa: E501 + auth_settings=auth_settings, + async_req=params.get('async_req'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) diff --git a/asana/api/portfolios_api.py b/asana/api/portfolios_api.py index 0a38e21f..62d0acd7 100644 --- a/asana/api/portfolios_api.py +++ b/asana/api/portfolios_api.py @@ -21,1296 +21,1308 @@ class PortfoliosApi(object): - """NOTE: This class is auto generated by the swagger code generator program. +"""NOTE: This class is auto generated by the swagger code generator program. - Do not edit the class manually. - Ref: https://github.com/swagger-api/swagger-codegen +Do not edit the class manually. +Ref: https://github.com/swagger-api/swagger-codegen +""" + +def __init__(self, api_client=None): + if api_client is None: + api_client = ApiClient() + self.api_client = api_client + +def add_custom_field_setting_for_portfolio(self, body, portfolio_gid, **kwargs): # noqa: E501 + """Add a custom field to a portfolio # noqa: E501 + + Custom fields are associated with portfolios by way of custom field settings. This method creates a setting for the portfolio. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.add_custom_field_setting_for_portfolio(body, portfolio_gid, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param PortfolioGidAddCustomFieldSettingBody body: Information about the custom field setting. (required) + :param str portfolio_gid: Globally unique identifier for the portfolio. (required) + :return: CustomFieldSettingResponseData + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = kwargs.get("_return_http_data_only", True) + if kwargs.get('async_req'): + return self.add_custom_field_setting_for_portfolio_with_http_info(body, portfolio_gid, **kwargs) # noqa: E501 + else: + (data) = self.add_custom_field_setting_for_portfolio_with_http_info(body, portfolio_gid, **kwargs) # noqa: E501 + return data + +def add_custom_field_setting_for_portfolio_with_http_info(self, body, portfolio_gid, **kwargs): # noqa: E501 + """Add a custom field to a portfolio # noqa: E501 + + Custom fields are associated with portfolios by way of custom field settings. This method creates a setting for the portfolio. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.add_custom_field_setting_for_portfolio_with_http_info(body, portfolio_gid, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param PortfolioGidAddCustomFieldSettingBody body: Information about the custom field setting. (required) + :param str portfolio_gid: Globally unique identifier for the portfolio. (required) + :return: CustomFieldSettingResponseData + If the method is called asynchronously, + returns the request thread. + """ + + all_params = ['body', 'portfolio_gid'] # noqa: E501 + all_params.append('async_req') + all_params.append('header_params') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + params = locals() + for key, val in six.iteritems(params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method add_custom_field_setting_for_portfolio" % key + ) + params[key] = val + del params['kwargs'] + # verify the required parameter 'body' is set + if ('body' not in params or + params['body'] is None): + raise ValueError("Missing the required parameter `body` when calling `add_custom_field_setting_for_portfolio`") # noqa: E501 + # verify the required parameter 'portfolio_gid' is set + if ('portfolio_gid' not in params or + params['portfolio_gid'] is None): + raise ValueError("Missing the required parameter `portfolio_gid` when calling `add_custom_field_setting_for_portfolio`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'portfolio_gid' in params: + path_params['portfolio_gid'] = params['portfolio_gid'] # noqa: E501 + + query_params = [] + + header_params = kwargs.get("header_params", {}) + + form_params = [] + local_var_files = {} + + body_params = None + if 'body' in params: + body_params = params['body'] + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['application/json; charset=UTF-8']) # noqa: E501 + + # HTTP header `Content-Type` + header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 + ['application/json; charset=UTF-8']) # noqa: E501 + + # Authentication setting + auth_settings = ['oauth2'] # noqa: E501 + + return self.api_client.call_api( + '/portfolios/{portfolio_gid}/addCustomFieldSetting', 'POST', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='CustomFieldSettingResponseData', # noqa: E501 + auth_settings=auth_settings, + async_req=params.get('async_req'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) + +def add_item_for_portfolio(self, body, portfolio_gid, **kwargs): # noqa: E501 + """Add a portfolio item # noqa: E501 + + Add an item to a portfolio. Returns an empty data block. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.add_item_for_portfolio(body, portfolio_gid, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param PortfolioGidAddItemBody body: Information about the item being inserted. (required) + :param str portfolio_gid: Globally unique identifier for the portfolio. (required) + :return: EmptyResponseData + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = kwargs.get("_return_http_data_only", True) + if kwargs.get('async_req'): + return self.add_item_for_portfolio_with_http_info(body, portfolio_gid, **kwargs) # noqa: E501 + else: + (data) = self.add_item_for_portfolio_with_http_info(body, portfolio_gid, **kwargs) # noqa: E501 + return data + +def add_item_for_portfolio_with_http_info(self, body, portfolio_gid, **kwargs): # noqa: E501 + """Add a portfolio item # noqa: E501 + + Add an item to a portfolio. Returns an empty data block. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.add_item_for_portfolio_with_http_info(body, portfolio_gid, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param PortfolioGidAddItemBody body: Information about the item being inserted. (required) + :param str portfolio_gid: Globally unique identifier for the portfolio. (required) + :return: EmptyResponseData + If the method is called asynchronously, + returns the request thread. + """ + + all_params = ['body', 'portfolio_gid'] # noqa: E501 + all_params.append('async_req') + all_params.append('header_params') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + params = locals() + for key, val in six.iteritems(params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method add_item_for_portfolio" % key + ) + params[key] = val + del params['kwargs'] + # verify the required parameter 'body' is set + if ('body' not in params or + params['body'] is None): + raise ValueError("Missing the required parameter `body` when calling `add_item_for_portfolio`") # noqa: E501 + # verify the required parameter 'portfolio_gid' is set + if ('portfolio_gid' not in params or + params['portfolio_gid'] is None): + raise ValueError("Missing the required parameter `portfolio_gid` when calling `add_item_for_portfolio`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'portfolio_gid' in params: + path_params['portfolio_gid'] = params['portfolio_gid'] # noqa: E501 + + query_params = [] + + header_params = kwargs.get("header_params", {}) + + form_params = [] + local_var_files = {} + + body_params = None + if 'body' in params: + body_params = params['body'] + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['application/json; charset=UTF-8']) # noqa: E501 + + # HTTP header `Content-Type` + header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 + ['application/json; charset=UTF-8']) # noqa: E501 + + # Authentication setting + auth_settings = ['oauth2'] # noqa: E501 + + return self.api_client.call_api( + '/portfolios/{portfolio_gid}/addItem', 'POST', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='EmptyResponseData', # noqa: E501 + auth_settings=auth_settings, + async_req=params.get('async_req'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) + +def add_members_for_portfolio(self, body, portfolio_gid, **kwargs): # noqa: E501 + """Add users to a portfolio # noqa: E501 + + Adds the specified list of users as members of the portfolio. Returns the updated portfolio record. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.add_members_for_portfolio(body, portfolio_gid, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param PortfolioGidAddMembersBody body: Information about the members being added. (required) + :param str portfolio_gid: Globally unique identifier for the portfolio. (required) + :param list[str] opt_fields: This endpoint returns a compact resource, which excludes some properties by default. To include those optional properties, set this query parameter to a comma-separated list of the properties you wish to include. + :return: PortfolioResponseData + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = kwargs.get("_return_http_data_only", True) + if kwargs.get('async_req'): + return self.add_members_for_portfolio_with_http_info(body, portfolio_gid, **kwargs) # noqa: E501 + else: + (data) = self.add_members_for_portfolio_with_http_info(body, portfolio_gid, **kwargs) # noqa: E501 + return data + +def add_members_for_portfolio_with_http_info(self, body, portfolio_gid, **kwargs): # noqa: E501 + """Add users to a portfolio # noqa: E501 + + Adds the specified list of users as members of the portfolio. Returns the updated portfolio record. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.add_members_for_portfolio_with_http_info(body, portfolio_gid, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param PortfolioGidAddMembersBody body: Information about the members being added. (required) + :param str portfolio_gid: Globally unique identifier for the portfolio. (required) + :param list[str] opt_fields: This endpoint returns a compact resource, which excludes some properties by default. To include those optional properties, set this query parameter to a comma-separated list of the properties you wish to include. + :return: PortfolioResponseData + If the method is called asynchronously, + returns the request thread. + """ + + all_params = ['body', 'portfolio_gid', 'opt_fields'] # noqa: E501 + all_params.append('async_req') + all_params.append('header_params') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + params = locals() + for key, val in six.iteritems(params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method add_members_for_portfolio" % key + ) + params[key] = val + del params['kwargs'] + # verify the required parameter 'body' is set + if ('body' not in params or + params['body'] is None): + raise ValueError("Missing the required parameter `body` when calling `add_members_for_portfolio`") # noqa: E501 + # verify the required parameter 'portfolio_gid' is set + if ('portfolio_gid' not in params or + params['portfolio_gid'] is None): + raise ValueError("Missing the required parameter `portfolio_gid` when calling `add_members_for_portfolio`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'portfolio_gid' in params: + path_params['portfolio_gid'] = params['portfolio_gid'] # noqa: E501 + + query_params = [] + if 'opt_fields' in params: + query_params.append(('opt_fields', params['opt_fields'])) # noqa: E501 + collection_formats['opt_fields'] = 'csv' # noqa: E501 + + header_params = kwargs.get("header_params", {}) + + form_params = [] + local_var_files = {} + + body_params = None + if 'body' in params: + body_params = params['body'] + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['application/json; charset=UTF-8']) # noqa: E501 + + # HTTP header `Content-Type` + header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 + ['application/json; charset=UTF-8']) # noqa: E501 + + # Authentication setting + auth_settings = ['oauth2'] # noqa: E501 + + return self.api_client.call_api( + '/portfolios/{portfolio_gid}/addMembers', 'POST', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='PortfolioResponseData', # noqa: E501 + auth_settings=auth_settings, + async_req=params.get('async_req'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) + +def create_portfolio(self, body, **kwargs): # noqa: E501 + """Create a portfolio # noqa: E501 + + Creates a new portfolio in the given workspace with the supplied name. Note that portfolios created in the Asana UI may have some state (like the “Priority” custom field) which is automatically added to the portfolio when it is created. Portfolios created via our API will *not* be created with the same initial state to allow integrations to create their own starting state on a portfolio. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.create_portfolio(body, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param PortfoliosBody body: The portfolio to create. (required) + :param list[str] opt_fields: This endpoint returns a compact resource, which excludes some properties by default. To include those optional properties, set this query parameter to a comma-separated list of the properties you wish to include. + :return: PortfolioResponseData + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = kwargs.get("_return_http_data_only", True) + if kwargs.get('async_req'): + return self.create_portfolio_with_http_info(body, **kwargs) # noqa: E501 + else: + (data) = self.create_portfolio_with_http_info(body, **kwargs) # noqa: E501 + return data + +def create_portfolio_with_http_info(self, body, **kwargs): # noqa: E501 + """Create a portfolio # noqa: E501 + + Creates a new portfolio in the given workspace with the supplied name. Note that portfolios created in the Asana UI may have some state (like the “Priority” custom field) which is automatically added to the portfolio when it is created. Portfolios created via our API will *not* be created with the same initial state to allow integrations to create their own starting state on a portfolio. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.create_portfolio_with_http_info(body, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param PortfoliosBody body: The portfolio to create. (required) + :param list[str] opt_fields: This endpoint returns a compact resource, which excludes some properties by default. To include those optional properties, set this query parameter to a comma-separated list of the properties you wish to include. + :return: PortfolioResponseData + If the method is called asynchronously, + returns the request thread. + """ + + all_params = ['body', 'opt_fields'] # noqa: E501 + all_params.append('async_req') + all_params.append('header_params') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + params = locals() + for key, val in six.iteritems(params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method create_portfolio" % key + ) + params[key] = val + del params['kwargs'] + # verify the required parameter 'body' is set + if ('body' not in params or + params['body'] is None): + raise ValueError("Missing the required parameter `body` when calling `create_portfolio`") # noqa: E501 + + collection_formats = {} + + path_params = {} + + query_params = [] + if 'opt_fields' in params: + query_params.append(('opt_fields', params['opt_fields'])) # noqa: E501 + collection_formats['opt_fields'] = 'csv' # noqa: E501 + + header_params = kwargs.get("header_params", {}) + + form_params = [] + local_var_files = {} + + body_params = None + if 'body' in params: + body_params = params['body'] + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['application/json; charset=UTF-8']) # noqa: E501 + + # HTTP header `Content-Type` + header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 + ['application/json; charset=UTF-8']) # noqa: E501 + + # Authentication setting + auth_settings = ['oauth2'] # noqa: E501 + + return self.api_client.call_api( + '/portfolios', 'POST', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='PortfolioResponseData', # noqa: E501 + auth_settings=auth_settings, + async_req=params.get('async_req'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) + +def delete_portfolio(self, portfolio_gid, **kwargs): # noqa: E501 + """Delete a portfolio # noqa: E501 + + An existing portfolio can be deleted by making a DELETE request on the URL for that portfolio. Returns an empty data record. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.delete_portfolio(portfolio_gid, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str portfolio_gid: Globally unique identifier for the portfolio. (required) + :return: EmptyResponseData + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = kwargs.get("_return_http_data_only", True) + if kwargs.get('async_req'): + return self.delete_portfolio_with_http_info(portfolio_gid, **kwargs) # noqa: E501 + else: + (data) = self.delete_portfolio_with_http_info(portfolio_gid, **kwargs) # noqa: E501 + return data + +def delete_portfolio_with_http_info(self, portfolio_gid, **kwargs): # noqa: E501 + """Delete a portfolio # noqa: E501 + + An existing portfolio can be deleted by making a DELETE request on the URL for that portfolio. Returns an empty data record. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.delete_portfolio_with_http_info(portfolio_gid, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str portfolio_gid: Globally unique identifier for the portfolio. (required) + :return: EmptyResponseData + If the method is called asynchronously, + returns the request thread. + """ + + all_params = ['portfolio_gid'] # noqa: E501 + all_params.append('async_req') + all_params.append('header_params') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + params = locals() + for key, val in six.iteritems(params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method delete_portfolio" % key + ) + params[key] = val + del params['kwargs'] + # verify the required parameter 'portfolio_gid' is set + if ('portfolio_gid' not in params or + params['portfolio_gid'] is None): + raise ValueError("Missing the required parameter `portfolio_gid` when calling `delete_portfolio`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'portfolio_gid' in params: + path_params['portfolio_gid'] = params['portfolio_gid'] # noqa: E501 + + query_params = [] + + header_params = kwargs.get("header_params", {}) + + form_params = [] + local_var_files = {} + + body_params = None + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['application/json; charset=UTF-8']) # noqa: E501 + + # Authentication setting + auth_settings = ['oauth2'] # noqa: E501 + + return self.api_client.call_api( + '/portfolios/{portfolio_gid}', 'DELETE', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='EmptyResponseData', # noqa: E501 + auth_settings=auth_settings, + async_req=params.get('async_req'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) + +def get_items_for_portfolio(self, portfolio_gid, **kwargs): # noqa: E501 + """Get portfolio items # noqa: E501 + + Get a list of the items in compact form in a portfolio. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.get_items_for_portfolio(portfolio_gid, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str portfolio_gid: Globally unique identifier for the portfolio. (required) + :param int limit: Results per page. The number of objects to return per page. The value must be between 1 and 100. + :param str offset: 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 list[str] opt_fields: This endpoint returns a compact resource, which excludes some properties by default. To include those optional properties, set this query parameter to a comma-separated list of the properties you wish to include. + :return: ProjectResponseArray + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = kwargs.get("_return_http_data_only", True) + if kwargs.get('async_req'): + return self.get_items_for_portfolio_with_http_info(portfolio_gid, **kwargs) # noqa: E501 + else: + (data) = self.get_items_for_portfolio_with_http_info(portfolio_gid, **kwargs) # noqa: E501 + return data + +def get_items_for_portfolio_with_http_info(self, portfolio_gid, **kwargs): # noqa: E501 + """Get portfolio items # noqa: E501 + + Get a list of the items in compact form in a portfolio. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.get_items_for_portfolio_with_http_info(portfolio_gid, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str portfolio_gid: Globally unique identifier for the portfolio. (required) + :param int limit: Results per page. The number of objects to return per page. The value must be between 1 and 100. + :param str offset: 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 list[str] opt_fields: This endpoint returns a compact resource, which excludes some properties by default. To include those optional properties, set this query parameter to a comma-separated list of the properties you wish to include. + :return: ProjectResponseArray + If the method is called asynchronously, + returns the request thread. + """ + + all_params = ['portfolio_gid', 'limit', 'offset', 'opt_fields'] # noqa: E501 + all_params.append('async_req') + all_params.append('header_params') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + params = locals() + for key, val in six.iteritems(params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method get_items_for_portfolio" % key + ) + params[key] = val + del params['kwargs'] + # verify the required parameter 'portfolio_gid' is set + if ('portfolio_gid' not in params or + params['portfolio_gid'] is None): + raise ValueError("Missing the required parameter `portfolio_gid` when calling `get_items_for_portfolio`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'portfolio_gid' in params: + path_params['portfolio_gid'] = params['portfolio_gid'] # noqa: E501 + + query_params = [] + if 'limit' in params: + query_params.append(('limit', params['limit'])) # noqa: E501 + if 'offset' in params: + query_params.append(('offset', params['offset'])) # noqa: E501 + if 'opt_fields' in params: + query_params.append(('opt_fields', params['opt_fields'])) # noqa: E501 + collection_formats['opt_fields'] = 'csv' # noqa: E501 + + header_params = kwargs.get("header_params", {}) + + form_params = [] + local_var_files = {} + + body_params = None + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['application/json; charset=UTF-8']) # noqa: E501 + + # Authentication setting + auth_settings = ['oauth2'] # noqa: E501 + + return self.api_client.call_api( + '/portfolios/{portfolio_gid}/items', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='ProjectResponseArray', # noqa: E501 + auth_settings=auth_settings, + async_req=params.get('async_req'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) + +def get_portfolio(self, portfolio_gid, **kwargs): # noqa: E501 + """Get a portfolio # noqa: E501 + + Returns the complete portfolio record for a single portfolio. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.get_portfolio(portfolio_gid, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str portfolio_gid: Globally unique identifier for the portfolio. (required) + :param list[str] opt_fields: This endpoint returns a compact resource, which excludes some properties by default. To include those optional properties, set this query parameter to a comma-separated list of the properties you wish to include. + :return: PortfolioResponseData + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = kwargs.get("_return_http_data_only", True) + if kwargs.get('async_req'): + return self.get_portfolio_with_http_info(portfolio_gid, **kwargs) # noqa: E501 + else: + (data) = self.get_portfolio_with_http_info(portfolio_gid, **kwargs) # noqa: E501 + return data + +def get_portfolio_with_http_info(self, portfolio_gid, **kwargs): # noqa: E501 + """Get a portfolio # noqa: E501 + + Returns the complete portfolio record for a single portfolio. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.get_portfolio_with_http_info(portfolio_gid, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str portfolio_gid: Globally unique identifier for the portfolio. (required) + :param list[str] opt_fields: This endpoint returns a compact resource, which excludes some properties by default. To include those optional properties, set this query parameter to a comma-separated list of the properties you wish to include. + :return: PortfolioResponseData + If the method is called asynchronously, + returns the request thread. + """ + + all_params = ['portfolio_gid', 'opt_fields'] # noqa: E501 + all_params.append('async_req') + all_params.append('header_params') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + params = locals() + for key, val in six.iteritems(params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method get_portfolio" % key + ) + params[key] = val + del params['kwargs'] + # verify the required parameter 'portfolio_gid' is set + if ('portfolio_gid' not in params or + params['portfolio_gid'] is None): + raise ValueError("Missing the required parameter `portfolio_gid` when calling `get_portfolio`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'portfolio_gid' in params: + path_params['portfolio_gid'] = params['portfolio_gid'] # noqa: E501 + + query_params = [] + if 'opt_fields' in params: + query_params.append(('opt_fields', params['opt_fields'])) # noqa: E501 + collection_formats['opt_fields'] = 'csv' # noqa: E501 + + header_params = kwargs.get("header_params", {}) + + form_params = [] + local_var_files = {} + + body_params = None + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['application/json; charset=UTF-8']) # noqa: E501 + + # Authentication setting + auth_settings = ['oauth2'] # noqa: E501 + + return self.api_client.call_api( + '/portfolios/{portfolio_gid}', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='PortfolioResponseData', # noqa: E501 + auth_settings=auth_settings, + async_req=params.get('async_req'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) + +def get_portfolios(self, workspace, **kwargs): # noqa: E501 + """Get multiple portfolios # noqa: E501 + + Returns a list of the portfolios in compact representation that are owned by the current API user. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.get_portfolios(workspace, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str workspace: The workspace or organization to filter portfolios on. (required) + :param int limit: Results per page. The number of objects to return per page. The value must be between 1 and 100. + :param str offset: 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 str owner: The user who owns the portfolio. Currently, API users can only get a list of portfolios that they themselves own, unless the request is made from a Service Account. In the case of a Service Account, if this parameter is specified, then all portfolios owned by this parameter are returned. Otherwise, all portfolios across the workspace are returned. + :param list[str] opt_fields: This endpoint returns a compact resource, which excludes some properties by default. To include those optional properties, set this query parameter to a comma-separated list of the properties you wish to include. + :return: PortfolioResponseArray + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = kwargs.get("_return_http_data_only", True) + if kwargs.get('async_req'): + return self.get_portfolios_with_http_info(workspace, **kwargs) # noqa: E501 + else: + (data) = self.get_portfolios_with_http_info(workspace, **kwargs) # noqa: E501 + return data + +def get_portfolios_with_http_info(self, workspace, **kwargs): # noqa: E501 + """Get multiple portfolios # noqa: E501 + + Returns a list of the portfolios in compact representation that are owned by the current API user. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.get_portfolios_with_http_info(workspace, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str workspace: The workspace or organization to filter portfolios on. (required) + :param int limit: Results per page. The number of objects to return per page. The value must be between 1 and 100. + :param str offset: 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 str owner: The user who owns the portfolio. Currently, API users can only get a list of portfolios that they themselves own, unless the request is made from a Service Account. In the case of a Service Account, if this parameter is specified, then all portfolios owned by this parameter are returned. Otherwise, all portfolios across the workspace are returned. + :param list[str] opt_fields: This endpoint returns a compact resource, which excludes some properties by default. To include those optional properties, set this query parameter to a comma-separated list of the properties you wish to include. + :return: PortfolioResponseArray + If the method is called asynchronously, + returns the request thread. + """ + + all_params = ['workspace', 'limit', 'offset', 'owner', 'opt_fields'] # noqa: E501 + all_params.append('async_req') + all_params.append('header_params') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + params = locals() + for key, val in six.iteritems(params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method get_portfolios" % key + ) + params[key] = val + del params['kwargs'] + # verify the required parameter 'workspace' is set + if ('workspace' not in params or + params['workspace'] is None): + raise ValueError("Missing the required parameter `workspace` when calling `get_portfolios`") # noqa: E501 + + collection_formats = {} + + path_params = {} + + query_params = [] + if 'limit' in params: + query_params.append(('limit', params['limit'])) # noqa: E501 + if 'offset' in params: + query_params.append(('offset', params['offset'])) # noqa: E501 + if 'workspace' in params: + query_params.append(('workspace', params['workspace'])) # noqa: E501 + if 'owner' in params: + query_params.append(('owner', params['owner'])) # noqa: E501 + if 'opt_fields' in params: + query_params.append(('opt_fields', params['opt_fields'])) # noqa: E501 + collection_formats['opt_fields'] = 'csv' # noqa: E501 + + header_params = kwargs.get("header_params", {}) + + form_params = [] + local_var_files = {} + + body_params = None + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['application/json; charset=UTF-8']) # noqa: E501 + + # Authentication setting + auth_settings = ['oauth2'] # noqa: E501 + + return self.api_client.call_api( + '/portfolios', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='PortfolioResponseArray', # noqa: E501 + auth_settings=auth_settings, + async_req=params.get('async_req'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) + +def remove_custom_field_setting_for_portfolio(self, body, portfolio_gid, **kwargs): # noqa: E501 + """Remove a custom field from a portfolio # noqa: E501 + + Removes a custom field setting from a portfolio. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.remove_custom_field_setting_for_portfolio(body, portfolio_gid, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param PortfolioGidRemoveCustomFieldSettingBody body: Information about the custom field setting being removed. (required) + :param str portfolio_gid: Globally unique identifier for the portfolio. (required) + :return: EmptyResponseData + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = kwargs.get("_return_http_data_only", True) + if kwargs.get('async_req'): + return self.remove_custom_field_setting_for_portfolio_with_http_info(body, portfolio_gid, **kwargs) # noqa: E501 + else: + (data) = self.remove_custom_field_setting_for_portfolio_with_http_info(body, portfolio_gid, **kwargs) # noqa: E501 + return data + +def remove_custom_field_setting_for_portfolio_with_http_info(self, body, portfolio_gid, **kwargs): # noqa: E501 + """Remove a custom field from a portfolio # noqa: E501 + + Removes a custom field setting from a portfolio. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.remove_custom_field_setting_for_portfolio_with_http_info(body, portfolio_gid, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param PortfolioGidRemoveCustomFieldSettingBody body: Information about the custom field setting being removed. (required) + :param str portfolio_gid: Globally unique identifier for the portfolio. (required) + :return: EmptyResponseData + If the method is called asynchronously, + returns the request thread. + """ + + all_params = ['body', 'portfolio_gid'] # noqa: E501 + all_params.append('async_req') + all_params.append('header_params') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + params = locals() + for key, val in six.iteritems(params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method remove_custom_field_setting_for_portfolio" % key + ) + params[key] = val + del params['kwargs'] + # verify the required parameter 'body' is set + if ('body' not in params or + params['body'] is None): + raise ValueError("Missing the required parameter `body` when calling `remove_custom_field_setting_for_portfolio`") # noqa: E501 + # verify the required parameter 'portfolio_gid' is set + if ('portfolio_gid' not in params or + params['portfolio_gid'] is None): + raise ValueError("Missing the required parameter `portfolio_gid` when calling `remove_custom_field_setting_for_portfolio`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'portfolio_gid' in params: + path_params['portfolio_gid'] = params['portfolio_gid'] # noqa: E501 + + query_params = [] + + header_params = kwargs.get("header_params", {}) + + form_params = [] + local_var_files = {} + + body_params = None + if 'body' in params: + body_params = params['body'] + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['application/json; charset=UTF-8']) # noqa: E501 + + # HTTP header `Content-Type` + header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 + ['application/json; charset=UTF-8']) # noqa: E501 + + # Authentication setting + auth_settings = ['oauth2'] # noqa: E501 + + return self.api_client.call_api( + '/portfolios/{portfolio_gid}/removeCustomFieldSetting', 'POST', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='EmptyResponseData', # noqa: E501 + auth_settings=auth_settings, + async_req=params.get('async_req'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) + +def remove_item_for_portfolio(self, body, portfolio_gid, **kwargs): # noqa: E501 + """Remove a portfolio item # noqa: E501 + + Remove an item from a portfolio. Returns an empty data block. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.remove_item_for_portfolio(body, portfolio_gid, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param PortfolioGidRemoveItemBody body: Information about the item being removed. (required) + :param str portfolio_gid: Globally unique identifier for the portfolio. (required) + :return: EmptyResponseData + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = kwargs.get("_return_http_data_only", True) + if kwargs.get('async_req'): + return self.remove_item_for_portfolio_with_http_info(body, portfolio_gid, **kwargs) # noqa: E501 + else: + (data) = self.remove_item_for_portfolio_with_http_info(body, portfolio_gid, **kwargs) # noqa: E501 + return data + +def remove_item_for_portfolio_with_http_info(self, body, portfolio_gid, **kwargs): # noqa: E501 + """Remove a portfolio item # noqa: E501 + + Remove an item from a portfolio. Returns an empty data block. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.remove_item_for_portfolio_with_http_info(body, portfolio_gid, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param PortfolioGidRemoveItemBody body: Information about the item being removed. (required) + :param str portfolio_gid: Globally unique identifier for the portfolio. (required) + :return: EmptyResponseData + If the method is called asynchronously, + returns the request thread. + """ + + all_params = ['body', 'portfolio_gid'] # noqa: E501 + all_params.append('async_req') + all_params.append('header_params') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + params = locals() + for key, val in six.iteritems(params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method remove_item_for_portfolio" % key + ) + params[key] = val + del params['kwargs'] + # verify the required parameter 'body' is set + if ('body' not in params or + params['body'] is None): + raise ValueError("Missing the required parameter `body` when calling `remove_item_for_portfolio`") # noqa: E501 + # verify the required parameter 'portfolio_gid' is set + if ('portfolio_gid' not in params or + params['portfolio_gid'] is None): + raise ValueError("Missing the required parameter `portfolio_gid` when calling `remove_item_for_portfolio`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'portfolio_gid' in params: + path_params['portfolio_gid'] = params['portfolio_gid'] # noqa: E501 + + query_params = [] + + header_params = kwargs.get("header_params", {}) + + form_params = [] + local_var_files = {} + + body_params = None + if 'body' in params: + body_params = params['body'] + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['application/json; charset=UTF-8']) # noqa: E501 + + # HTTP header `Content-Type` + header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 + ['application/json; charset=UTF-8']) # noqa: E501 + + # Authentication setting + auth_settings = ['oauth2'] # noqa: E501 + + return self.api_client.call_api( + '/portfolios/{portfolio_gid}/removeItem', 'POST', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='EmptyResponseData', # noqa: E501 + auth_settings=auth_settings, + async_req=params.get('async_req'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) + +def remove_members_for_portfolio(self, body, portfolio_gid, **kwargs): # noqa: E501 + """Remove users from a portfolio # noqa: E501 + + Removes the specified list of users from members of the portfolio. Returns the updated portfolio record. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.remove_members_for_portfolio(body, portfolio_gid, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param PortfolioGidRemoveMembersBody body: Information about the members being removed. (required) + :param str portfolio_gid: Globally unique identifier for the portfolio. (required) + :param list[str] opt_fields: This endpoint returns a compact resource, which excludes some properties by default. To include those optional properties, set this query parameter to a comma-separated list of the properties you wish to include. + :return: PortfolioResponseData + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = kwargs.get("_return_http_data_only", True) + if kwargs.get('async_req'): + return self.remove_members_for_portfolio_with_http_info(body, portfolio_gid, **kwargs) # noqa: E501 + else: + (data) = self.remove_members_for_portfolio_with_http_info(body, portfolio_gid, **kwargs) # noqa: E501 + return data + +def remove_members_for_portfolio_with_http_info(self, body, portfolio_gid, **kwargs): # noqa: E501 + """Remove users from a portfolio # noqa: E501 + + Removes the specified list of users from members of the portfolio. Returns the updated portfolio record. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.remove_members_for_portfolio_with_http_info(body, portfolio_gid, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param PortfolioGidRemoveMembersBody body: Information about the members being removed. (required) + :param str portfolio_gid: Globally unique identifier for the portfolio. (required) + :param list[str] opt_fields: This endpoint returns a compact resource, which excludes some properties by default. To include those optional properties, set this query parameter to a comma-separated list of the properties you wish to include. + :return: PortfolioResponseData + If the method is called asynchronously, + returns the request thread. + """ + + all_params = ['body', 'portfolio_gid', 'opt_fields'] # noqa: E501 + all_params.append('async_req') + all_params.append('header_params') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + params = locals() + for key, val in six.iteritems(params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method remove_members_for_portfolio" % key + ) + params[key] = val + del params['kwargs'] + # verify the required parameter 'body' is set + if ('body' not in params or + params['body'] is None): + raise ValueError("Missing the required parameter `body` when calling `remove_members_for_portfolio`") # noqa: E501 + # verify the required parameter 'portfolio_gid' is set + if ('portfolio_gid' not in params or + params['portfolio_gid'] is None): + raise ValueError("Missing the required parameter `portfolio_gid` when calling `remove_members_for_portfolio`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'portfolio_gid' in params: + path_params['portfolio_gid'] = params['portfolio_gid'] # noqa: E501 + + query_params = [] + if 'opt_fields' in params: + query_params.append(('opt_fields', params['opt_fields'])) # noqa: E501 + collection_formats['opt_fields'] = 'csv' # noqa: E501 + + header_params = kwargs.get("header_params", {}) + + form_params = [] + local_var_files = {} + + body_params = None + if 'body' in params: + body_params = params['body'] + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['application/json; charset=UTF-8']) # noqa: E501 + + # HTTP header `Content-Type` + header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 + ['application/json; charset=UTF-8']) # noqa: E501 + + # Authentication setting + auth_settings = ['oauth2'] # noqa: E501 + + return self.api_client.call_api( + '/portfolios/{portfolio_gid}/removeMembers', 'POST', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='PortfolioResponseData', # noqa: E501 + auth_settings=auth_settings, + async_req=params.get('async_req'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) + +def update_portfolio(self, body, portfolio_gid, **kwargs): # noqa: E501 + """Update a portfolio # noqa: E501 + + An existing portfolio can be updated by making a PUT request on the URL for that portfolio. Only the fields provided in the `data` block will be updated; any unspecified fields will remain unchanged. Returns the complete updated portfolio record. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.update_portfolio(body, portfolio_gid, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param PortfoliosPortfolioGidBody body: The updated fields for the portfolio. (required) + :param str portfolio_gid: Globally unique identifier for the portfolio. (required) + :param list[str] opt_fields: This endpoint returns a compact resource, which excludes some properties by default. To include those optional properties, set this query parameter to a comma-separated list of the properties you wish to include. + :return: PortfolioResponseData + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = kwargs.get("_return_http_data_only", True) + if kwargs.get('async_req'): + return self.update_portfolio_with_http_info(body, portfolio_gid, **kwargs) # noqa: E501 + else: + (data) = self.update_portfolio_with_http_info(body, portfolio_gid, **kwargs) # noqa: E501 + return data + +def update_portfolio_with_http_info(self, body, portfolio_gid, **kwargs): # noqa: E501 + """Update a portfolio # noqa: E501 + + An existing portfolio can be updated by making a PUT request on the URL for that portfolio. Only the fields provided in the `data` block will be updated; any unspecified fields will remain unchanged. Returns the complete updated portfolio record. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.update_portfolio_with_http_info(body, portfolio_gid, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param PortfoliosPortfolioGidBody body: The updated fields for the portfolio. (required) + :param str portfolio_gid: Globally unique identifier for the portfolio. (required) + :param list[str] opt_fields: This endpoint returns a compact resource, which excludes some properties by default. To include those optional properties, set this query parameter to a comma-separated list of the properties you wish to include. + :return: PortfolioResponseData + If the method is called asynchronously, + returns the request thread. """ - def __init__(self, api_client=None): - if api_client is None: - api_client = ApiClient() - self.api_client = api_client - - def add_custom_field_setting_for_portfolio(self, body, portfolio_gid, **kwargs): # noqa: E501 - """Add a custom field to a portfolio # noqa: E501 - - Custom fields are associated with portfolios by way of custom field settings. This method creates a setting for the portfolio. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.add_custom_field_setting_for_portfolio(body, portfolio_gid, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param PortfolioGidAddCustomFieldSettingBody body: Information about the custom field setting. (required) - :param str portfolio_gid: Globally unique identifier for the portfolio. (required) - :return: CustomFieldSettingResponseData - If the method is called asynchronously, - returns the request thread. - """ - kwargs['_return_http_data_only'] = True - if kwargs.get('async_req'): - return self.add_custom_field_setting_for_portfolio_with_http_info(body, portfolio_gid, **kwargs) # noqa: E501 - else: - (data) = self.add_custom_field_setting_for_portfolio_with_http_info(body, portfolio_gid, **kwargs) # noqa: E501 - return data - - def add_custom_field_setting_for_portfolio_with_http_info(self, body, portfolio_gid, **kwargs): # noqa: E501 - """Add a custom field to a portfolio # noqa: E501 - - Custom fields are associated with portfolios by way of custom field settings. This method creates a setting for the portfolio. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.add_custom_field_setting_for_portfolio_with_http_info(body, portfolio_gid, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param PortfolioGidAddCustomFieldSettingBody body: Information about the custom field setting. (required) - :param str portfolio_gid: Globally unique identifier for the portfolio. (required) - :return: CustomFieldSettingResponseData - If the method is called asynchronously, - returns the request thread. - """ - - all_params = ['body', 'portfolio_gid'] # noqa: E501 - all_params.append('async_req') - all_params.append('_return_http_data_only') - all_params.append('_preload_content') - all_params.append('_request_timeout') - - params = locals() - for key, val in six.iteritems(params['kwargs']): - if key not in all_params: - raise TypeError( - "Got an unexpected keyword argument '%s'" - " to method add_custom_field_setting_for_portfolio" % key - ) - params[key] = val - del params['kwargs'] - # verify the required parameter 'body' is set - if ('body' not in params or - params['body'] is None): - raise ValueError("Missing the required parameter `body` when calling `add_custom_field_setting_for_portfolio`") # noqa: E501 - # verify the required parameter 'portfolio_gid' is set - if ('portfolio_gid' not in params or - params['portfolio_gid'] is None): - raise ValueError("Missing the required parameter `portfolio_gid` when calling `add_custom_field_setting_for_portfolio`") # noqa: E501 - - collection_formats = {} - - path_params = {} - if 'portfolio_gid' in params: - path_params['portfolio_gid'] = params['portfolio_gid'] # noqa: E501 - - query_params = [] - - header_params = {} - - form_params = [] - local_var_files = {} - - body_params = None - if 'body' in params: - body_params = params['body'] - # HTTP header `Accept` - header_params['Accept'] = self.api_client.select_header_accept( - ['application/json; charset=UTF-8']) # noqa: E501 - - # HTTP header `Content-Type` - header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 - ['application/json; charset=UTF-8']) # noqa: E501 - - # Authentication setting - auth_settings = ['oauth2'] # noqa: E501 - - return self.api_client.call_api( - '/portfolios/{portfolio_gid}/addCustomFieldSetting', 'POST', - path_params, - query_params, - header_params, - body=body_params, - post_params=form_params, - files=local_var_files, - response_type='CustomFieldSettingResponseData', # noqa: E501 - auth_settings=auth_settings, - async_req=params.get('async_req'), - _return_http_data_only=params.get('_return_http_data_only'), - _preload_content=params.get('_preload_content', True), - _request_timeout=params.get('_request_timeout'), - collection_formats=collection_formats) - - def add_item_for_portfolio(self, body, portfolio_gid, **kwargs): # noqa: E501 - """Add a portfolio item # noqa: E501 - - Add an item to a portfolio. Returns an empty data block. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.add_item_for_portfolio(body, portfolio_gid, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param PortfolioGidAddItemBody body: Information about the item being inserted. (required) - :param str portfolio_gid: Globally unique identifier for the portfolio. (required) - :return: EmptyResponseData - If the method is called asynchronously, - returns the request thread. - """ - kwargs['_return_http_data_only'] = True - if kwargs.get('async_req'): - return self.add_item_for_portfolio_with_http_info(body, portfolio_gid, **kwargs) # noqa: E501 - else: - (data) = self.add_item_for_portfolio_with_http_info(body, portfolio_gid, **kwargs) # noqa: E501 - return data - - def add_item_for_portfolio_with_http_info(self, body, portfolio_gid, **kwargs): # noqa: E501 - """Add a portfolio item # noqa: E501 - - Add an item to a portfolio. Returns an empty data block. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.add_item_for_portfolio_with_http_info(body, portfolio_gid, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param PortfolioGidAddItemBody body: Information about the item being inserted. (required) - :param str portfolio_gid: Globally unique identifier for the portfolio. (required) - :return: EmptyResponseData - If the method is called asynchronously, - returns the request thread. - """ - - all_params = ['body', 'portfolio_gid'] # noqa: E501 - all_params.append('async_req') - all_params.append('_return_http_data_only') - all_params.append('_preload_content') - all_params.append('_request_timeout') - - params = locals() - for key, val in six.iteritems(params['kwargs']): - if key not in all_params: - raise TypeError( - "Got an unexpected keyword argument '%s'" - " to method add_item_for_portfolio" % key - ) - params[key] = val - del params['kwargs'] - # verify the required parameter 'body' is set - if ('body' not in params or - params['body'] is None): - raise ValueError("Missing the required parameter `body` when calling `add_item_for_portfolio`") # noqa: E501 - # verify the required parameter 'portfolio_gid' is set - if ('portfolio_gid' not in params or - params['portfolio_gid'] is None): - raise ValueError("Missing the required parameter `portfolio_gid` when calling `add_item_for_portfolio`") # noqa: E501 - - collection_formats = {} - - path_params = {} - if 'portfolio_gid' in params: - path_params['portfolio_gid'] = params['portfolio_gid'] # noqa: E501 - - query_params = [] - - header_params = {} - - form_params = [] - local_var_files = {} - - body_params = None - if 'body' in params: - body_params = params['body'] - # HTTP header `Accept` - header_params['Accept'] = self.api_client.select_header_accept( - ['application/json; charset=UTF-8']) # noqa: E501 - - # HTTP header `Content-Type` - header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 - ['application/json; charset=UTF-8']) # noqa: E501 - - # Authentication setting - auth_settings = ['oauth2'] # noqa: E501 - - return self.api_client.call_api( - '/portfolios/{portfolio_gid}/addItem', 'POST', - path_params, - query_params, - header_params, - body=body_params, - post_params=form_params, - files=local_var_files, - response_type='EmptyResponseData', # noqa: E501 - auth_settings=auth_settings, - async_req=params.get('async_req'), - _return_http_data_only=params.get('_return_http_data_only'), - _preload_content=params.get('_preload_content', True), - _request_timeout=params.get('_request_timeout'), - collection_formats=collection_formats) - - def add_members_for_portfolio(self, body, portfolio_gid, **kwargs): # noqa: E501 - """Add users to a portfolio # noqa: E501 - - Adds the specified list of users as members of the portfolio. Returns the updated portfolio record. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.add_members_for_portfolio(body, portfolio_gid, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param PortfolioGidAddMembersBody body: Information about the members being added. (required) - :param str portfolio_gid: Globally unique identifier for the portfolio. (required) - :param list[str] opt_fields: This endpoint returns a compact resource, which excludes some properties by default. To include those optional properties, set this query parameter to a comma-separated list of the properties you wish to include. - :return: PortfolioResponseData - If the method is called asynchronously, - returns the request thread. - """ - kwargs['_return_http_data_only'] = True - if kwargs.get('async_req'): - return self.add_members_for_portfolio_with_http_info(body, portfolio_gid, **kwargs) # noqa: E501 - else: - (data) = self.add_members_for_portfolio_with_http_info(body, portfolio_gid, **kwargs) # noqa: E501 - return data - - def add_members_for_portfolio_with_http_info(self, body, portfolio_gid, **kwargs): # noqa: E501 - """Add users to a portfolio # noqa: E501 - - Adds the specified list of users as members of the portfolio. Returns the updated portfolio record. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.add_members_for_portfolio_with_http_info(body, portfolio_gid, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param PortfolioGidAddMembersBody body: Information about the members being added. (required) - :param str portfolio_gid: Globally unique identifier for the portfolio. (required) - :param list[str] opt_fields: This endpoint returns a compact resource, which excludes some properties by default. To include those optional properties, set this query parameter to a comma-separated list of the properties you wish to include. - :return: PortfolioResponseData - If the method is called asynchronously, - returns the request thread. - """ - - all_params = ['body', 'portfolio_gid', 'opt_fields'] # noqa: E501 - all_params.append('async_req') - all_params.append('_return_http_data_only') - all_params.append('_preload_content') - all_params.append('_request_timeout') - - params = locals() - for key, val in six.iteritems(params['kwargs']): - if key not in all_params: - raise TypeError( - "Got an unexpected keyword argument '%s'" - " to method add_members_for_portfolio" % key - ) - params[key] = val - del params['kwargs'] - # verify the required parameter 'body' is set - if ('body' not in params or - params['body'] is None): - raise ValueError("Missing the required parameter `body` when calling `add_members_for_portfolio`") # noqa: E501 - # verify the required parameter 'portfolio_gid' is set - if ('portfolio_gid' not in params or - params['portfolio_gid'] is None): - raise ValueError("Missing the required parameter `portfolio_gid` when calling `add_members_for_portfolio`") # noqa: E501 - - collection_formats = {} - - path_params = {} - if 'portfolio_gid' in params: - path_params['portfolio_gid'] = params['portfolio_gid'] # noqa: E501 - - query_params = [] - if 'opt_fields' in params: - query_params.append(('opt_fields', params['opt_fields'])) # noqa: E501 - collection_formats['opt_fields'] = 'csv' # noqa: E501 - - header_params = {} - - form_params = [] - local_var_files = {} - - body_params = None - if 'body' in params: - body_params = params['body'] - # HTTP header `Accept` - header_params['Accept'] = self.api_client.select_header_accept( - ['application/json; charset=UTF-8']) # noqa: E501 - - # HTTP header `Content-Type` - header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 - ['application/json; charset=UTF-8']) # noqa: E501 - - # Authentication setting - auth_settings = ['oauth2'] # noqa: E501 - - return self.api_client.call_api( - '/portfolios/{portfolio_gid}/addMembers', 'POST', - path_params, - query_params, - header_params, - body=body_params, - post_params=form_params, - files=local_var_files, - response_type='PortfolioResponseData', # noqa: E501 - auth_settings=auth_settings, - async_req=params.get('async_req'), - _return_http_data_only=params.get('_return_http_data_only'), - _preload_content=params.get('_preload_content', True), - _request_timeout=params.get('_request_timeout'), - collection_formats=collection_formats) - - def create_portfolio(self, body, **kwargs): # noqa: E501 - """Create a portfolio # noqa: E501 - - Creates a new portfolio in the given workspace with the supplied name. Note that portfolios created in the Asana UI may have some state (like the “Priority” custom field) which is automatically added to the portfolio when it is created. Portfolios created via our API will *not* be created with the same initial state to allow integrations to create their own starting state on a portfolio. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.create_portfolio(body, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param PortfoliosBody body: The portfolio to create. (required) - :param list[str] opt_fields: This endpoint returns a compact resource, which excludes some properties by default. To include those optional properties, set this query parameter to a comma-separated list of the properties you wish to include. - :return: PortfolioResponseData - If the method is called asynchronously, - returns the request thread. - """ - kwargs['_return_http_data_only'] = True - if kwargs.get('async_req'): - return self.create_portfolio_with_http_info(body, **kwargs) # noqa: E501 - else: - (data) = self.create_portfolio_with_http_info(body, **kwargs) # noqa: E501 - return data - - def create_portfolio_with_http_info(self, body, **kwargs): # noqa: E501 - """Create a portfolio # noqa: E501 - - Creates a new portfolio in the given workspace with the supplied name. Note that portfolios created in the Asana UI may have some state (like the “Priority” custom field) which is automatically added to the portfolio when it is created. Portfolios created via our API will *not* be created with the same initial state to allow integrations to create their own starting state on a portfolio. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.create_portfolio_with_http_info(body, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param PortfoliosBody body: The portfolio to create. (required) - :param list[str] opt_fields: This endpoint returns a compact resource, which excludes some properties by default. To include those optional properties, set this query parameter to a comma-separated list of the properties you wish to include. - :return: PortfolioResponseData - If the method is called asynchronously, - returns the request thread. - """ - - all_params = ['body', 'opt_fields'] # noqa: E501 - all_params.append('async_req') - all_params.append('_return_http_data_only') - all_params.append('_preload_content') - all_params.append('_request_timeout') - - params = locals() - for key, val in six.iteritems(params['kwargs']): - if key not in all_params: - raise TypeError( - "Got an unexpected keyword argument '%s'" - " to method create_portfolio" % key - ) - params[key] = val - del params['kwargs'] - # verify the required parameter 'body' is set - if ('body' not in params or - params['body'] is None): - raise ValueError("Missing the required parameter `body` when calling `create_portfolio`") # noqa: E501 - - collection_formats = {} - - path_params = {} - - query_params = [] - if 'opt_fields' in params: - query_params.append(('opt_fields', params['opt_fields'])) # noqa: E501 - collection_formats['opt_fields'] = 'csv' # noqa: E501 - - header_params = {} - - form_params = [] - local_var_files = {} - - body_params = None - if 'body' in params: - body_params = params['body'] - # HTTP header `Accept` - header_params['Accept'] = self.api_client.select_header_accept( - ['application/json; charset=UTF-8']) # noqa: E501 - - # HTTP header `Content-Type` - header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 - ['application/json; charset=UTF-8']) # noqa: E501 - - # Authentication setting - auth_settings = ['oauth2'] # noqa: E501 - - return self.api_client.call_api( - '/portfolios', 'POST', - path_params, - query_params, - header_params, - body=body_params, - post_params=form_params, - files=local_var_files, - response_type='PortfolioResponseData', # noqa: E501 - auth_settings=auth_settings, - async_req=params.get('async_req'), - _return_http_data_only=params.get('_return_http_data_only'), - _preload_content=params.get('_preload_content', True), - _request_timeout=params.get('_request_timeout'), - collection_formats=collection_formats) - - def delete_portfolio(self, portfolio_gid, **kwargs): # noqa: E501 - """Delete a portfolio # noqa: E501 - - An existing portfolio can be deleted by making a DELETE request on the URL for that portfolio. Returns an empty data record. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.delete_portfolio(portfolio_gid, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param str portfolio_gid: Globally unique identifier for the portfolio. (required) - :return: EmptyResponseData - If the method is called asynchronously, - returns the request thread. - """ - kwargs['_return_http_data_only'] = True - if kwargs.get('async_req'): - return self.delete_portfolio_with_http_info(portfolio_gid, **kwargs) # noqa: E501 - else: - (data) = self.delete_portfolio_with_http_info(portfolio_gid, **kwargs) # noqa: E501 - return data - - def delete_portfolio_with_http_info(self, portfolio_gid, **kwargs): # noqa: E501 - """Delete a portfolio # noqa: E501 - - An existing portfolio can be deleted by making a DELETE request on the URL for that portfolio. Returns an empty data record. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.delete_portfolio_with_http_info(portfolio_gid, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param str portfolio_gid: Globally unique identifier for the portfolio. (required) - :return: EmptyResponseData - If the method is called asynchronously, - returns the request thread. - """ - - all_params = ['portfolio_gid'] # noqa: E501 - all_params.append('async_req') - all_params.append('_return_http_data_only') - all_params.append('_preload_content') - all_params.append('_request_timeout') - - params = locals() - for key, val in six.iteritems(params['kwargs']): - if key not in all_params: - raise TypeError( - "Got an unexpected keyword argument '%s'" - " to method delete_portfolio" % key - ) - params[key] = val - del params['kwargs'] - # verify the required parameter 'portfolio_gid' is set - if ('portfolio_gid' not in params or - params['portfolio_gid'] is None): - raise ValueError("Missing the required parameter `portfolio_gid` when calling `delete_portfolio`") # noqa: E501 - - collection_formats = {} - - path_params = {} - if 'portfolio_gid' in params: - path_params['portfolio_gid'] = params['portfolio_gid'] # noqa: E501 - - query_params = [] - - header_params = {} - - form_params = [] - local_var_files = {} - - body_params = None - # HTTP header `Accept` - header_params['Accept'] = self.api_client.select_header_accept( - ['application/json; charset=UTF-8']) # noqa: E501 - - # Authentication setting - auth_settings = ['oauth2'] # noqa: E501 - - return self.api_client.call_api( - '/portfolios/{portfolio_gid}', 'DELETE', - path_params, - query_params, - header_params, - body=body_params, - post_params=form_params, - files=local_var_files, - response_type='EmptyResponseData', # noqa: E501 - auth_settings=auth_settings, - async_req=params.get('async_req'), - _return_http_data_only=params.get('_return_http_data_only'), - _preload_content=params.get('_preload_content', True), - _request_timeout=params.get('_request_timeout'), - collection_formats=collection_formats) - - def get_items_for_portfolio(self, portfolio_gid, **kwargs): # noqa: E501 - """Get portfolio items # noqa: E501 - - Get a list of the items in compact form in a portfolio. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.get_items_for_portfolio(portfolio_gid, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param str portfolio_gid: Globally unique identifier for the portfolio. (required) - :param int limit: Results per page. The number of objects to return per page. The value must be between 1 and 100. - :param str offset: 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 list[str] opt_fields: This endpoint returns a compact resource, which excludes some properties by default. To include those optional properties, set this query parameter to a comma-separated list of the properties you wish to include. - :return: ProjectResponseArray - If the method is called asynchronously, - returns the request thread. - """ - kwargs['_return_http_data_only'] = True - if kwargs.get('async_req'): - return self.get_items_for_portfolio_with_http_info(portfolio_gid, **kwargs) # noqa: E501 - else: - (data) = self.get_items_for_portfolio_with_http_info(portfolio_gid, **kwargs) # noqa: E501 - return data - - def get_items_for_portfolio_with_http_info(self, portfolio_gid, **kwargs): # noqa: E501 - """Get portfolio items # noqa: E501 - - Get a list of the items in compact form in a portfolio. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.get_items_for_portfolio_with_http_info(portfolio_gid, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param str portfolio_gid: Globally unique identifier for the portfolio. (required) - :param int limit: Results per page. The number of objects to return per page. The value must be between 1 and 100. - :param str offset: 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 list[str] opt_fields: This endpoint returns a compact resource, which excludes some properties by default. To include those optional properties, set this query parameter to a comma-separated list of the properties you wish to include. - :return: ProjectResponseArray - If the method is called asynchronously, - returns the request thread. - """ - - all_params = ['portfolio_gid', 'limit', 'offset', 'opt_fields'] # noqa: E501 - all_params.append('async_req') - all_params.append('_return_http_data_only') - all_params.append('_preload_content') - all_params.append('_request_timeout') - - params = locals() - for key, val in six.iteritems(params['kwargs']): - if key not in all_params: - raise TypeError( - "Got an unexpected keyword argument '%s'" - " to method get_items_for_portfolio" % key - ) - params[key] = val - del params['kwargs'] - # verify the required parameter 'portfolio_gid' is set - if ('portfolio_gid' not in params or - params['portfolio_gid'] is None): - raise ValueError("Missing the required parameter `portfolio_gid` when calling `get_items_for_portfolio`") # noqa: E501 - - collection_formats = {} - - path_params = {} - if 'portfolio_gid' in params: - path_params['portfolio_gid'] = params['portfolio_gid'] # noqa: E501 - - query_params = [] - if 'limit' in params: - query_params.append(('limit', params['limit'])) # noqa: E501 - if 'offset' in params: - query_params.append(('offset', params['offset'])) # noqa: E501 - if 'opt_fields' in params: - query_params.append(('opt_fields', params['opt_fields'])) # noqa: E501 - collection_formats['opt_fields'] = 'csv' # noqa: E501 - - header_params = {} - - form_params = [] - local_var_files = {} - - body_params = None - # HTTP header `Accept` - header_params['Accept'] = self.api_client.select_header_accept( - ['application/json; charset=UTF-8']) # noqa: E501 - - # Authentication setting - auth_settings = ['oauth2'] # noqa: E501 - - return self.api_client.call_api( - '/portfolios/{portfolio_gid}/items', 'GET', - path_params, - query_params, - header_params, - body=body_params, - post_params=form_params, - files=local_var_files, - response_type='ProjectResponseArray', # noqa: E501 - auth_settings=auth_settings, - async_req=params.get('async_req'), - _return_http_data_only=params.get('_return_http_data_only'), - _preload_content=params.get('_preload_content', True), - _request_timeout=params.get('_request_timeout'), - collection_formats=collection_formats) - - def get_portfolio(self, portfolio_gid, **kwargs): # noqa: E501 - """Get a portfolio # noqa: E501 - - Returns the complete portfolio record for a single portfolio. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.get_portfolio(portfolio_gid, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param str portfolio_gid: Globally unique identifier for the portfolio. (required) - :param list[str] opt_fields: This endpoint returns a compact resource, which excludes some properties by default. To include those optional properties, set this query parameter to a comma-separated list of the properties you wish to include. - :return: PortfolioResponseData - If the method is called asynchronously, - returns the request thread. - """ - kwargs['_return_http_data_only'] = True - if kwargs.get('async_req'): - return self.get_portfolio_with_http_info(portfolio_gid, **kwargs) # noqa: E501 - else: - (data) = self.get_portfolio_with_http_info(portfolio_gid, **kwargs) # noqa: E501 - return data - - def get_portfolio_with_http_info(self, portfolio_gid, **kwargs): # noqa: E501 - """Get a portfolio # noqa: E501 - - Returns the complete portfolio record for a single portfolio. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.get_portfolio_with_http_info(portfolio_gid, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param str portfolio_gid: Globally unique identifier for the portfolio. (required) - :param list[str] opt_fields: This endpoint returns a compact resource, which excludes some properties by default. To include those optional properties, set this query parameter to a comma-separated list of the properties you wish to include. - :return: PortfolioResponseData - If the method is called asynchronously, - returns the request thread. - """ - - all_params = ['portfolio_gid', 'opt_fields'] # noqa: E501 - all_params.append('async_req') - all_params.append('_return_http_data_only') - all_params.append('_preload_content') - all_params.append('_request_timeout') - - params = locals() - for key, val in six.iteritems(params['kwargs']): - if key not in all_params: - raise TypeError( - "Got an unexpected keyword argument '%s'" - " to method get_portfolio" % key - ) - params[key] = val - del params['kwargs'] - # verify the required parameter 'portfolio_gid' is set - if ('portfolio_gid' not in params or - params['portfolio_gid'] is None): - raise ValueError("Missing the required parameter `portfolio_gid` when calling `get_portfolio`") # noqa: E501 - - collection_formats = {} - - path_params = {} - if 'portfolio_gid' in params: - path_params['portfolio_gid'] = params['portfolio_gid'] # noqa: E501 - - query_params = [] - if 'opt_fields' in params: - query_params.append(('opt_fields', params['opt_fields'])) # noqa: E501 - collection_formats['opt_fields'] = 'csv' # noqa: E501 - - header_params = {} - - form_params = [] - local_var_files = {} - - body_params = None - # HTTP header `Accept` - header_params['Accept'] = self.api_client.select_header_accept( - ['application/json; charset=UTF-8']) # noqa: E501 - - # Authentication setting - auth_settings = ['oauth2'] # noqa: E501 - - return self.api_client.call_api( - '/portfolios/{portfolio_gid}', 'GET', - path_params, - query_params, - header_params, - body=body_params, - post_params=form_params, - files=local_var_files, - response_type='PortfolioResponseData', # noqa: E501 - auth_settings=auth_settings, - async_req=params.get('async_req'), - _return_http_data_only=params.get('_return_http_data_only'), - _preload_content=params.get('_preload_content', True), - _request_timeout=params.get('_request_timeout'), - collection_formats=collection_formats) - - def get_portfolios(self, workspace, **kwargs): # noqa: E501 - """Get multiple portfolios # noqa: E501 - - Returns a list of the portfolios in compact representation that are owned by the current API user. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.get_portfolios(workspace, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param str workspace: The workspace or organization to filter portfolios on. (required) - :param int limit: Results per page. The number of objects to return per page. The value must be between 1 and 100. - :param str offset: 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 str owner: The user who owns the portfolio. Currently, API users can only get a list of portfolios that they themselves own, unless the request is made from a Service Account. In the case of a Service Account, if this parameter is specified, then all portfolios owned by this parameter are returned. Otherwise, all portfolios across the workspace are returned. - :param list[str] opt_fields: This endpoint returns a compact resource, which excludes some properties by default. To include those optional properties, set this query parameter to a comma-separated list of the properties you wish to include. - :return: PortfolioResponseArray - If the method is called asynchronously, - returns the request thread. - """ - kwargs['_return_http_data_only'] = True - if kwargs.get('async_req'): - return self.get_portfolios_with_http_info(workspace, **kwargs) # noqa: E501 - else: - (data) = self.get_portfolios_with_http_info(workspace, **kwargs) # noqa: E501 - return data - - def get_portfolios_with_http_info(self, workspace, **kwargs): # noqa: E501 - """Get multiple portfolios # noqa: E501 - - Returns a list of the portfolios in compact representation that are owned by the current API user. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.get_portfolios_with_http_info(workspace, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param str workspace: The workspace or organization to filter portfolios on. (required) - :param int limit: Results per page. The number of objects to return per page. The value must be between 1 and 100. - :param str offset: 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 str owner: The user who owns the portfolio. Currently, API users can only get a list of portfolios that they themselves own, unless the request is made from a Service Account. In the case of a Service Account, if this parameter is specified, then all portfolios owned by this parameter are returned. Otherwise, all portfolios across the workspace are returned. - :param list[str] opt_fields: This endpoint returns a compact resource, which excludes some properties by default. To include those optional properties, set this query parameter to a comma-separated list of the properties you wish to include. - :return: PortfolioResponseArray - If the method is called asynchronously, - returns the request thread. - """ - - all_params = ['workspace', 'limit', 'offset', 'owner', 'opt_fields'] # noqa: E501 - all_params.append('async_req') - all_params.append('_return_http_data_only') - all_params.append('_preload_content') - all_params.append('_request_timeout') - - params = locals() - for key, val in six.iteritems(params['kwargs']): - if key not in all_params: - raise TypeError( - "Got an unexpected keyword argument '%s'" - " to method get_portfolios" % key - ) - params[key] = val - del params['kwargs'] - # verify the required parameter 'workspace' is set - if ('workspace' not in params or - params['workspace'] is None): - raise ValueError("Missing the required parameter `workspace` when calling `get_portfolios`") # noqa: E501 - - collection_formats = {} - - path_params = {} - - query_params = [] - if 'limit' in params: - query_params.append(('limit', params['limit'])) # noqa: E501 - if 'offset' in params: - query_params.append(('offset', params['offset'])) # noqa: E501 - if 'workspace' in params: - query_params.append(('workspace', params['workspace'])) # noqa: E501 - if 'owner' in params: - query_params.append(('owner', params['owner'])) # noqa: E501 - if 'opt_fields' in params: - query_params.append(('opt_fields', params['opt_fields'])) # noqa: E501 - collection_formats['opt_fields'] = 'csv' # noqa: E501 - - header_params = {} - - form_params = [] - local_var_files = {} - - body_params = None - # HTTP header `Accept` - header_params['Accept'] = self.api_client.select_header_accept( - ['application/json; charset=UTF-8']) # noqa: E501 - - # Authentication setting - auth_settings = ['oauth2'] # noqa: E501 - - return self.api_client.call_api( - '/portfolios', 'GET', - path_params, - query_params, - header_params, - body=body_params, - post_params=form_params, - files=local_var_files, - response_type='PortfolioResponseArray', # noqa: E501 - auth_settings=auth_settings, - async_req=params.get('async_req'), - _return_http_data_only=params.get('_return_http_data_only'), - _preload_content=params.get('_preload_content', True), - _request_timeout=params.get('_request_timeout'), - collection_formats=collection_formats) - - def remove_custom_field_setting_for_portfolio(self, body, portfolio_gid, **kwargs): # noqa: E501 - """Remove a custom field from a portfolio # noqa: E501 - - Removes a custom field setting from a portfolio. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.remove_custom_field_setting_for_portfolio(body, portfolio_gid, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param PortfolioGidRemoveCustomFieldSettingBody body: Information about the custom field setting being removed. (required) - :param str portfolio_gid: Globally unique identifier for the portfolio. (required) - :return: EmptyResponseData - If the method is called asynchronously, - returns the request thread. - """ - kwargs['_return_http_data_only'] = True - if kwargs.get('async_req'): - return self.remove_custom_field_setting_for_portfolio_with_http_info(body, portfolio_gid, **kwargs) # noqa: E501 - else: - (data) = self.remove_custom_field_setting_for_portfolio_with_http_info(body, portfolio_gid, **kwargs) # noqa: E501 - return data - - def remove_custom_field_setting_for_portfolio_with_http_info(self, body, portfolio_gid, **kwargs): # noqa: E501 - """Remove a custom field from a portfolio # noqa: E501 - - Removes a custom field setting from a portfolio. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.remove_custom_field_setting_for_portfolio_with_http_info(body, portfolio_gid, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param PortfolioGidRemoveCustomFieldSettingBody body: Information about the custom field setting being removed. (required) - :param str portfolio_gid: Globally unique identifier for the portfolio. (required) - :return: EmptyResponseData - If the method is called asynchronously, - returns the request thread. - """ - - all_params = ['body', 'portfolio_gid'] # noqa: E501 - all_params.append('async_req') - all_params.append('_return_http_data_only') - all_params.append('_preload_content') - all_params.append('_request_timeout') - - params = locals() - for key, val in six.iteritems(params['kwargs']): - if key not in all_params: - raise TypeError( - "Got an unexpected keyword argument '%s'" - " to method remove_custom_field_setting_for_portfolio" % key - ) - params[key] = val - del params['kwargs'] - # verify the required parameter 'body' is set - if ('body' not in params or - params['body'] is None): - raise ValueError("Missing the required parameter `body` when calling `remove_custom_field_setting_for_portfolio`") # noqa: E501 - # verify the required parameter 'portfolio_gid' is set - if ('portfolio_gid' not in params or - params['portfolio_gid'] is None): - raise ValueError("Missing the required parameter `portfolio_gid` when calling `remove_custom_field_setting_for_portfolio`") # noqa: E501 - - collection_formats = {} - - path_params = {} - if 'portfolio_gid' in params: - path_params['portfolio_gid'] = params['portfolio_gid'] # noqa: E501 - - query_params = [] - - header_params = {} - - form_params = [] - local_var_files = {} - - body_params = None - if 'body' in params: - body_params = params['body'] - # HTTP header `Accept` - header_params['Accept'] = self.api_client.select_header_accept( - ['application/json; charset=UTF-8']) # noqa: E501 - - # HTTP header `Content-Type` - header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 - ['application/json; charset=UTF-8']) # noqa: E501 - - # Authentication setting - auth_settings = ['oauth2'] # noqa: E501 - - return self.api_client.call_api( - '/portfolios/{portfolio_gid}/removeCustomFieldSetting', 'POST', - path_params, - query_params, - header_params, - body=body_params, - post_params=form_params, - files=local_var_files, - response_type='EmptyResponseData', # noqa: E501 - auth_settings=auth_settings, - async_req=params.get('async_req'), - _return_http_data_only=params.get('_return_http_data_only'), - _preload_content=params.get('_preload_content', True), - _request_timeout=params.get('_request_timeout'), - collection_formats=collection_formats) - - def remove_item_for_portfolio(self, body, portfolio_gid, **kwargs): # noqa: E501 - """Remove a portfolio item # noqa: E501 - - Remove an item from a portfolio. Returns an empty data block. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.remove_item_for_portfolio(body, portfolio_gid, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param PortfolioGidRemoveItemBody body: Information about the item being removed. (required) - :param str portfolio_gid: Globally unique identifier for the portfolio. (required) - :return: EmptyResponseData - If the method is called asynchronously, - returns the request thread. - """ - kwargs['_return_http_data_only'] = True - if kwargs.get('async_req'): - return self.remove_item_for_portfolio_with_http_info(body, portfolio_gid, **kwargs) # noqa: E501 - else: - (data) = self.remove_item_for_portfolio_with_http_info(body, portfolio_gid, **kwargs) # noqa: E501 - return data - - def remove_item_for_portfolio_with_http_info(self, body, portfolio_gid, **kwargs): # noqa: E501 - """Remove a portfolio item # noqa: E501 - - Remove an item from a portfolio. Returns an empty data block. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.remove_item_for_portfolio_with_http_info(body, portfolio_gid, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param PortfolioGidRemoveItemBody body: Information about the item being removed. (required) - :param str portfolio_gid: Globally unique identifier for the portfolio. (required) - :return: EmptyResponseData - If the method is called asynchronously, - returns the request thread. - """ - - all_params = ['body', 'portfolio_gid'] # noqa: E501 - all_params.append('async_req') - all_params.append('_return_http_data_only') - all_params.append('_preload_content') - all_params.append('_request_timeout') - - params = locals() - for key, val in six.iteritems(params['kwargs']): - if key not in all_params: - raise TypeError( - "Got an unexpected keyword argument '%s'" - " to method remove_item_for_portfolio" % key - ) - params[key] = val - del params['kwargs'] - # verify the required parameter 'body' is set - if ('body' not in params or - params['body'] is None): - raise ValueError("Missing the required parameter `body` when calling `remove_item_for_portfolio`") # noqa: E501 - # verify the required parameter 'portfolio_gid' is set - if ('portfolio_gid' not in params or - params['portfolio_gid'] is None): - raise ValueError("Missing the required parameter `portfolio_gid` when calling `remove_item_for_portfolio`") # noqa: E501 - - collection_formats = {} - - path_params = {} - if 'portfolio_gid' in params: - path_params['portfolio_gid'] = params['portfolio_gid'] # noqa: E501 - - query_params = [] - - header_params = {} - - form_params = [] - local_var_files = {} - - body_params = None - if 'body' in params: - body_params = params['body'] - # HTTP header `Accept` - header_params['Accept'] = self.api_client.select_header_accept( - ['application/json; charset=UTF-8']) # noqa: E501 - - # HTTP header `Content-Type` - header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 - ['application/json; charset=UTF-8']) # noqa: E501 - - # Authentication setting - auth_settings = ['oauth2'] # noqa: E501 - - return self.api_client.call_api( - '/portfolios/{portfolio_gid}/removeItem', 'POST', - path_params, - query_params, - header_params, - body=body_params, - post_params=form_params, - files=local_var_files, - response_type='EmptyResponseData', # noqa: E501 - auth_settings=auth_settings, - async_req=params.get('async_req'), - _return_http_data_only=params.get('_return_http_data_only'), - _preload_content=params.get('_preload_content', True), - _request_timeout=params.get('_request_timeout'), - collection_formats=collection_formats) - - def remove_members_for_portfolio(self, body, portfolio_gid, **kwargs): # noqa: E501 - """Remove users from a portfolio # noqa: E501 - - Removes the specified list of users from members of the portfolio. Returns the updated portfolio record. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.remove_members_for_portfolio(body, portfolio_gid, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param PortfolioGidRemoveMembersBody body: Information about the members being removed. (required) - :param str portfolio_gid: Globally unique identifier for the portfolio. (required) - :param list[str] opt_fields: This endpoint returns a compact resource, which excludes some properties by default. To include those optional properties, set this query parameter to a comma-separated list of the properties you wish to include. - :return: PortfolioResponseData - If the method is called asynchronously, - returns the request thread. - """ - kwargs['_return_http_data_only'] = True - if kwargs.get('async_req'): - return self.remove_members_for_portfolio_with_http_info(body, portfolio_gid, **kwargs) # noqa: E501 - else: - (data) = self.remove_members_for_portfolio_with_http_info(body, portfolio_gid, **kwargs) # noqa: E501 - return data - - def remove_members_for_portfolio_with_http_info(self, body, portfolio_gid, **kwargs): # noqa: E501 - """Remove users from a portfolio # noqa: E501 - - Removes the specified list of users from members of the portfolio. Returns the updated portfolio record. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.remove_members_for_portfolio_with_http_info(body, portfolio_gid, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param PortfolioGidRemoveMembersBody body: Information about the members being removed. (required) - :param str portfolio_gid: Globally unique identifier for the portfolio. (required) - :param list[str] opt_fields: This endpoint returns a compact resource, which excludes some properties by default. To include those optional properties, set this query parameter to a comma-separated list of the properties you wish to include. - :return: PortfolioResponseData - If the method is called asynchronously, - returns the request thread. - """ - - all_params = ['body', 'portfolio_gid', 'opt_fields'] # noqa: E501 - all_params.append('async_req') - all_params.append('_return_http_data_only') - all_params.append('_preload_content') - all_params.append('_request_timeout') - - params = locals() - for key, val in six.iteritems(params['kwargs']): - if key not in all_params: - raise TypeError( - "Got an unexpected keyword argument '%s'" - " to method remove_members_for_portfolio" % key - ) - params[key] = val - del params['kwargs'] - # verify the required parameter 'body' is set - if ('body' not in params or - params['body'] is None): - raise ValueError("Missing the required parameter `body` when calling `remove_members_for_portfolio`") # noqa: E501 - # verify the required parameter 'portfolio_gid' is set - if ('portfolio_gid' not in params or - params['portfolio_gid'] is None): - raise ValueError("Missing the required parameter `portfolio_gid` when calling `remove_members_for_portfolio`") # noqa: E501 - - collection_formats = {} - - path_params = {} - if 'portfolio_gid' in params: - path_params['portfolio_gid'] = params['portfolio_gid'] # noqa: E501 - - query_params = [] - if 'opt_fields' in params: - query_params.append(('opt_fields', params['opt_fields'])) # noqa: E501 - collection_formats['opt_fields'] = 'csv' # noqa: E501 - - header_params = {} - - form_params = [] - local_var_files = {} - - body_params = None - if 'body' in params: - body_params = params['body'] - # HTTP header `Accept` - header_params['Accept'] = self.api_client.select_header_accept( - ['application/json; charset=UTF-8']) # noqa: E501 - - # HTTP header `Content-Type` - header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 - ['application/json; charset=UTF-8']) # noqa: E501 - - # Authentication setting - auth_settings = ['oauth2'] # noqa: E501 - - return self.api_client.call_api( - '/portfolios/{portfolio_gid}/removeMembers', 'POST', - path_params, - query_params, - header_params, - body=body_params, - post_params=form_params, - files=local_var_files, - response_type='PortfolioResponseData', # noqa: E501 - auth_settings=auth_settings, - async_req=params.get('async_req'), - _return_http_data_only=params.get('_return_http_data_only'), - _preload_content=params.get('_preload_content', True), - _request_timeout=params.get('_request_timeout'), - collection_formats=collection_formats) - - def update_portfolio(self, body, portfolio_gid, **kwargs): # noqa: E501 - """Update a portfolio # noqa: E501 - - An existing portfolio can be updated by making a PUT request on the URL for that portfolio. Only the fields provided in the `data` block will be updated; any unspecified fields will remain unchanged. Returns the complete updated portfolio record. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.update_portfolio(body, portfolio_gid, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param PortfoliosPortfolioGidBody body: The updated fields for the portfolio. (required) - :param str portfolio_gid: Globally unique identifier for the portfolio. (required) - :param list[str] opt_fields: This endpoint returns a compact resource, which excludes some properties by default. To include those optional properties, set this query parameter to a comma-separated list of the properties you wish to include. - :return: PortfolioResponseData - If the method is called asynchronously, - returns the request thread. - """ - kwargs['_return_http_data_only'] = True - if kwargs.get('async_req'): - return self.update_portfolio_with_http_info(body, portfolio_gid, **kwargs) # noqa: E501 - else: - (data) = self.update_portfolio_with_http_info(body, portfolio_gid, **kwargs) # noqa: E501 - return data - - def update_portfolio_with_http_info(self, body, portfolio_gid, **kwargs): # noqa: E501 - """Update a portfolio # noqa: E501 - - An existing portfolio can be updated by making a PUT request on the URL for that portfolio. Only the fields provided in the `data` block will be updated; any unspecified fields will remain unchanged. Returns the complete updated portfolio record. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.update_portfolio_with_http_info(body, portfolio_gid, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param PortfoliosPortfolioGidBody body: The updated fields for the portfolio. (required) - :param str portfolio_gid: Globally unique identifier for the portfolio. (required) - :param list[str] opt_fields: This endpoint returns a compact resource, which excludes some properties by default. To include those optional properties, set this query parameter to a comma-separated list of the properties you wish to include. - :return: PortfolioResponseData - If the method is called asynchronously, - returns the request thread. - """ - - all_params = ['body', 'portfolio_gid', 'opt_fields'] # noqa: E501 - all_params.append('async_req') - all_params.append('_return_http_data_only') - all_params.append('_preload_content') - all_params.append('_request_timeout') - - params = locals() - for key, val in six.iteritems(params['kwargs']): - if key not in all_params: - raise TypeError( - "Got an unexpected keyword argument '%s'" - " to method update_portfolio" % key - ) - params[key] = val - del params['kwargs'] - # verify the required parameter 'body' is set - if ('body' not in params or - params['body'] is None): - raise ValueError("Missing the required parameter `body` when calling `update_portfolio`") # noqa: E501 - # verify the required parameter 'portfolio_gid' is set - if ('portfolio_gid' not in params or - params['portfolio_gid'] is None): - raise ValueError("Missing the required parameter `portfolio_gid` when calling `update_portfolio`") # noqa: E501 - - collection_formats = {} - - path_params = {} - if 'portfolio_gid' in params: - path_params['portfolio_gid'] = params['portfolio_gid'] # noqa: E501 - - query_params = [] - if 'opt_fields' in params: - query_params.append(('opt_fields', params['opt_fields'])) # noqa: E501 - collection_formats['opt_fields'] = 'csv' # noqa: E501 - - header_params = {} - - form_params = [] - local_var_files = {} - - body_params = None - if 'body' in params: - body_params = params['body'] - # HTTP header `Accept` - header_params['Accept'] = self.api_client.select_header_accept( - ['application/json; charset=UTF-8']) # noqa: E501 - - # HTTP header `Content-Type` - header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 - ['application/json; charset=UTF-8']) # noqa: E501 - - # Authentication setting - auth_settings = ['oauth2'] # noqa: E501 - - return self.api_client.call_api( - '/portfolios/{portfolio_gid}', 'PUT', - path_params, - query_params, - header_params, - body=body_params, - post_params=form_params, - files=local_var_files, - response_type='PortfolioResponseData', # noqa: E501 - auth_settings=auth_settings, - async_req=params.get('async_req'), - _return_http_data_only=params.get('_return_http_data_only'), - _preload_content=params.get('_preload_content', True), - _request_timeout=params.get('_request_timeout'), - collection_formats=collection_formats) + all_params = ['body', 'portfolio_gid', 'opt_fields'] # noqa: E501 + all_params.append('async_req') + all_params.append('header_params') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + params = locals() + for key, val in six.iteritems(params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method update_portfolio" % key + ) + params[key] = val + del params['kwargs'] + # verify the required parameter 'body' is set + if ('body' not in params or + params['body'] is None): + raise ValueError("Missing the required parameter `body` when calling `update_portfolio`") # noqa: E501 + # verify the required parameter 'portfolio_gid' is set + if ('portfolio_gid' not in params or + params['portfolio_gid'] is None): + raise ValueError("Missing the required parameter `portfolio_gid` when calling `update_portfolio`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'portfolio_gid' in params: + path_params['portfolio_gid'] = params['portfolio_gid'] # noqa: E501 + + query_params = [] + if 'opt_fields' in params: + query_params.append(('opt_fields', params['opt_fields'])) # noqa: E501 + collection_formats['opt_fields'] = 'csv' # noqa: E501 + + header_params = kwargs.get("header_params", {}) + + form_params = [] + local_var_files = {} + + body_params = None + if 'body' in params: + body_params = params['body'] + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['application/json; charset=UTF-8']) # noqa: E501 + + # HTTP header `Content-Type` + header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 + ['application/json; charset=UTF-8']) # noqa: E501 + + # Authentication setting + auth_settings = ['oauth2'] # noqa: E501 + + return self.api_client.call_api( + '/portfolios/{portfolio_gid}', 'PUT', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='PortfolioResponseData', # noqa: E501 + auth_settings=auth_settings, + async_req=params.get('async_req'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) diff --git a/asana/api/project_briefs_api.py b/asana/api/project_briefs_api.py index 334b7785..5ac54bb0 100644 --- a/asana/api/project_briefs_api.py +++ b/asana/api/project_briefs_api.py @@ -21,432 +21,436 @@ class ProjectBriefsApi(object): - """NOTE: This class is auto generated by the swagger code generator program. +"""NOTE: This class is auto generated by the swagger code generator program. - Do not edit the class manually. - Ref: https://github.com/swagger-api/swagger-codegen +Do not edit the class manually. +Ref: https://github.com/swagger-api/swagger-codegen +""" + +def __init__(self, api_client=None): + if api_client is None: + api_client = ApiClient() + self.api_client = api_client + +def create_project_brief(self, body, project_gid, **kwargs): # noqa: E501 + """Create a project brief # noqa: E501 + + Creates a new project brief. Returns the full record of the newly created project brief. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.create_project_brief(body, project_gid, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param ProjectGidProjectBriefsBody body: The project brief to create. (required) + :param str project_gid: Globally unique identifier for the project. (required) + :param list[str] opt_fields: This endpoint returns a compact resource, which excludes some properties by default. To include those optional properties, set this query parameter to a comma-separated list of the properties you wish to include. + :return: ProjectBriefResponseData + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = kwargs.get("_return_http_data_only", True) + if kwargs.get('async_req'): + return self.create_project_brief_with_http_info(body, project_gid, **kwargs) # noqa: E501 + else: + (data) = self.create_project_brief_with_http_info(body, project_gid, **kwargs) # noqa: E501 + return data + +def create_project_brief_with_http_info(self, body, project_gid, **kwargs): # noqa: E501 + """Create a project brief # noqa: E501 + + Creates a new project brief. Returns the full record of the newly created project brief. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.create_project_brief_with_http_info(body, project_gid, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param ProjectGidProjectBriefsBody body: The project brief to create. (required) + :param str project_gid: Globally unique identifier for the project. (required) + :param list[str] opt_fields: This endpoint returns a compact resource, which excludes some properties by default. To include those optional properties, set this query parameter to a comma-separated list of the properties you wish to include. + :return: ProjectBriefResponseData + If the method is called asynchronously, + returns the request thread. + """ + + all_params = ['body', 'project_gid', 'opt_fields'] # noqa: E501 + all_params.append('async_req') + all_params.append('header_params') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + params = locals() + for key, val in six.iteritems(params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method create_project_brief" % key + ) + params[key] = val + del params['kwargs'] + # verify the required parameter 'body' is set + if ('body' not in params or + params['body'] is None): + raise ValueError("Missing the required parameter `body` when calling `create_project_brief`") # noqa: E501 + # verify the required parameter 'project_gid' is set + if ('project_gid' not in params or + params['project_gid'] is None): + raise ValueError("Missing the required parameter `project_gid` when calling `create_project_brief`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'project_gid' in params: + path_params['project_gid'] = params['project_gid'] # noqa: E501 + + query_params = [] + if 'opt_fields' in params: + query_params.append(('opt_fields', params['opt_fields'])) # noqa: E501 + collection_formats['opt_fields'] = 'csv' # noqa: E501 + + header_params = kwargs.get("header_params", {}) + + form_params = [] + local_var_files = {} + + body_params = None + if 'body' in params: + body_params = params['body'] + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['application/json; charset=UTF-8']) # noqa: E501 + + # HTTP header `Content-Type` + header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 + ['application/json; charset=UTF-8']) # noqa: E501 + + # Authentication setting + auth_settings = ['oauth2'] # noqa: E501 + + return self.api_client.call_api( + '/projects/{project_gid}/project_briefs', 'POST', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='ProjectBriefResponseData', # noqa: E501 + auth_settings=auth_settings, + async_req=params.get('async_req'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) + +def delete_project_brief(self, project_brief_gid, **kwargs): # noqa: E501 + """Delete a project brief # noqa: E501 + + Deletes a specific, existing project brief. Returns an empty data record. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.delete_project_brief(project_brief_gid, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str project_brief_gid: Globally unique identifier for the project brief. (required) + :return: EmptyResponseData + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = kwargs.get("_return_http_data_only", True) + if kwargs.get('async_req'): + return self.delete_project_brief_with_http_info(project_brief_gid, **kwargs) # noqa: E501 + else: + (data) = self.delete_project_brief_with_http_info(project_brief_gid, **kwargs) # noqa: E501 + return data + +def delete_project_brief_with_http_info(self, project_brief_gid, **kwargs): # noqa: E501 + """Delete a project brief # noqa: E501 + + Deletes a specific, existing project brief. Returns an empty data record. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.delete_project_brief_with_http_info(project_brief_gid, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str project_brief_gid: Globally unique identifier for the project brief. (required) + :return: EmptyResponseData + If the method is called asynchronously, + returns the request thread. + """ + + all_params = ['project_brief_gid'] # noqa: E501 + all_params.append('async_req') + all_params.append('header_params') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + params = locals() + for key, val in six.iteritems(params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method delete_project_brief" % key + ) + params[key] = val + del params['kwargs'] + # verify the required parameter 'project_brief_gid' is set + if ('project_brief_gid' not in params or + params['project_brief_gid'] is None): + raise ValueError("Missing the required parameter `project_brief_gid` when calling `delete_project_brief`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'project_brief_gid' in params: + path_params['project_brief_gid'] = params['project_brief_gid'] # noqa: E501 + + query_params = [] + + header_params = kwargs.get("header_params", {}) + + form_params = [] + local_var_files = {} + + body_params = None + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['application/json; charset=UTF-8']) # noqa: E501 + + # Authentication setting + auth_settings = ['oauth2'] # noqa: E501 + + return self.api_client.call_api( + '/project_briefs/{project_brief_gid}', 'DELETE', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='EmptyResponseData', # noqa: E501 + auth_settings=auth_settings, + async_req=params.get('async_req'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) + +def get_project_brief(self, project_brief_gid, **kwargs): # noqa: E501 + """Get a project brief # noqa: E501 + + Get the full record for a project brief. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.get_project_brief(project_brief_gid, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str project_brief_gid: Globally unique identifier for the project brief. (required) + :param list[str] opt_fields: This endpoint returns a compact resource, which excludes some properties by default. To include those optional properties, set this query parameter to a comma-separated list of the properties you wish to include. + :return: ProjectBriefResponseData + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = kwargs.get("_return_http_data_only", True) + if kwargs.get('async_req'): + return self.get_project_brief_with_http_info(project_brief_gid, **kwargs) # noqa: E501 + else: + (data) = self.get_project_brief_with_http_info(project_brief_gid, **kwargs) # noqa: E501 + return data + +def get_project_brief_with_http_info(self, project_brief_gid, **kwargs): # noqa: E501 + """Get a project brief # noqa: E501 + + Get the full record for a project brief. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.get_project_brief_with_http_info(project_brief_gid, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str project_brief_gid: Globally unique identifier for the project brief. (required) + :param list[str] opt_fields: This endpoint returns a compact resource, which excludes some properties by default. To include those optional properties, set this query parameter to a comma-separated list of the properties you wish to include. + :return: ProjectBriefResponseData + If the method is called asynchronously, + returns the request thread. + """ + + all_params = ['project_brief_gid', 'opt_fields'] # noqa: E501 + all_params.append('async_req') + all_params.append('header_params') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + params = locals() + for key, val in six.iteritems(params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method get_project_brief" % key + ) + params[key] = val + del params['kwargs'] + # verify the required parameter 'project_brief_gid' is set + if ('project_brief_gid' not in params or + params['project_brief_gid'] is None): + raise ValueError("Missing the required parameter `project_brief_gid` when calling `get_project_brief`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'project_brief_gid' in params: + path_params['project_brief_gid'] = params['project_brief_gid'] # noqa: E501 + + query_params = [] + if 'opt_fields' in params: + query_params.append(('opt_fields', params['opt_fields'])) # noqa: E501 + collection_formats['opt_fields'] = 'csv' # noqa: E501 + + header_params = kwargs.get("header_params", {}) + + form_params = [] + local_var_files = {} + + body_params = None + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['application/json; charset=UTF-8']) # noqa: E501 + + # Authentication setting + auth_settings = ['oauth2'] # noqa: E501 + + return self.api_client.call_api( + '/project_briefs/{project_brief_gid}', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='ProjectBriefResponseData', # noqa: E501 + auth_settings=auth_settings, + async_req=params.get('async_req'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) + +def update_project_brief(self, body, project_brief_gid, **kwargs): # noqa: E501 + """Update a project brief # noqa: E501 + + An existing project brief can be updated by making a PUT request on the URL for that project brief. Only the fields provided in the `data` block will be updated; any unspecified fields will remain unchanged. Returns the complete updated project brief record. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.update_project_brief(body, project_brief_gid, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param ProjectBriefsProjectBriefGidBody body: The updated fields for the project brief. (required) + :param str project_brief_gid: Globally unique identifier for the project brief. (required) + :param list[str] opt_fields: This endpoint returns a compact resource, which excludes some properties by default. To include those optional properties, set this query parameter to a comma-separated list of the properties you wish to include. + :return: ProjectBriefResponseData + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = kwargs.get("_return_http_data_only", True) + if kwargs.get('async_req'): + return self.update_project_brief_with_http_info(body, project_brief_gid, **kwargs) # noqa: E501 + else: + (data) = self.update_project_brief_with_http_info(body, project_brief_gid, **kwargs) # noqa: E501 + return data + +def update_project_brief_with_http_info(self, body, project_brief_gid, **kwargs): # noqa: E501 + """Update a project brief # noqa: E501 + + An existing project brief can be updated by making a PUT request on the URL for that project brief. Only the fields provided in the `data` block will be updated; any unspecified fields will remain unchanged. Returns the complete updated project brief record. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.update_project_brief_with_http_info(body, project_brief_gid, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param ProjectBriefsProjectBriefGidBody body: The updated fields for the project brief. (required) + :param str project_brief_gid: Globally unique identifier for the project brief. (required) + :param list[str] opt_fields: This endpoint returns a compact resource, which excludes some properties by default. To include those optional properties, set this query parameter to a comma-separated list of the properties you wish to include. + :return: ProjectBriefResponseData + If the method is called asynchronously, + returns the request thread. """ - def __init__(self, api_client=None): - if api_client is None: - api_client = ApiClient() - self.api_client = api_client - - def create_project_brief(self, body, project_gid, **kwargs): # noqa: E501 - """Create a project brief # noqa: E501 - - Creates a new project brief. Returns the full record of the newly created project brief. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.create_project_brief(body, project_gid, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param ProjectGidProjectBriefsBody body: The project brief to create. (required) - :param str project_gid: Globally unique identifier for the project. (required) - :param list[str] opt_fields: This endpoint returns a compact resource, which excludes some properties by default. To include those optional properties, set this query parameter to a comma-separated list of the properties you wish to include. - :return: ProjectBriefResponseData - If the method is called asynchronously, - returns the request thread. - """ - kwargs['_return_http_data_only'] = True - if kwargs.get('async_req'): - return self.create_project_brief_with_http_info(body, project_gid, **kwargs) # noqa: E501 - else: - (data) = self.create_project_brief_with_http_info(body, project_gid, **kwargs) # noqa: E501 - return data - - def create_project_brief_with_http_info(self, body, project_gid, **kwargs): # noqa: E501 - """Create a project brief # noqa: E501 - - Creates a new project brief. Returns the full record of the newly created project brief. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.create_project_brief_with_http_info(body, project_gid, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param ProjectGidProjectBriefsBody body: The project brief to create. (required) - :param str project_gid: Globally unique identifier for the project. (required) - :param list[str] opt_fields: This endpoint returns a compact resource, which excludes some properties by default. To include those optional properties, set this query parameter to a comma-separated list of the properties you wish to include. - :return: ProjectBriefResponseData - If the method is called asynchronously, - returns the request thread. - """ - - all_params = ['body', 'project_gid', 'opt_fields'] # noqa: E501 - all_params.append('async_req') - all_params.append('_return_http_data_only') - all_params.append('_preload_content') - all_params.append('_request_timeout') - - params = locals() - for key, val in six.iteritems(params['kwargs']): - if key not in all_params: - raise TypeError( - "Got an unexpected keyword argument '%s'" - " to method create_project_brief" % key - ) - params[key] = val - del params['kwargs'] - # verify the required parameter 'body' is set - if ('body' not in params or - params['body'] is None): - raise ValueError("Missing the required parameter `body` when calling `create_project_brief`") # noqa: E501 - # verify the required parameter 'project_gid' is set - if ('project_gid' not in params or - params['project_gid'] is None): - raise ValueError("Missing the required parameter `project_gid` when calling `create_project_brief`") # noqa: E501 - - collection_formats = {} - - path_params = {} - if 'project_gid' in params: - path_params['project_gid'] = params['project_gid'] # noqa: E501 - - query_params = [] - if 'opt_fields' in params: - query_params.append(('opt_fields', params['opt_fields'])) # noqa: E501 - collection_formats['opt_fields'] = 'csv' # noqa: E501 - - header_params = {} - - form_params = [] - local_var_files = {} - - body_params = None - if 'body' in params: - body_params = params['body'] - # HTTP header `Accept` - header_params['Accept'] = self.api_client.select_header_accept( - ['application/json; charset=UTF-8']) # noqa: E501 - - # HTTP header `Content-Type` - header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 - ['application/json; charset=UTF-8']) # noqa: E501 - - # Authentication setting - auth_settings = ['oauth2'] # noqa: E501 - - return self.api_client.call_api( - '/projects/{project_gid}/project_briefs', 'POST', - path_params, - query_params, - header_params, - body=body_params, - post_params=form_params, - files=local_var_files, - response_type='ProjectBriefResponseData', # noqa: E501 - auth_settings=auth_settings, - async_req=params.get('async_req'), - _return_http_data_only=params.get('_return_http_data_only'), - _preload_content=params.get('_preload_content', True), - _request_timeout=params.get('_request_timeout'), - collection_formats=collection_formats) - - def delete_project_brief(self, project_brief_gid, **kwargs): # noqa: E501 - """Delete a project brief # noqa: E501 - - Deletes a specific, existing project brief. Returns an empty data record. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.delete_project_brief(project_brief_gid, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param str project_brief_gid: Globally unique identifier for the project brief. (required) - :return: EmptyResponseData - If the method is called asynchronously, - returns the request thread. - """ - kwargs['_return_http_data_only'] = True - if kwargs.get('async_req'): - return self.delete_project_brief_with_http_info(project_brief_gid, **kwargs) # noqa: E501 - else: - (data) = self.delete_project_brief_with_http_info(project_brief_gid, **kwargs) # noqa: E501 - return data - - def delete_project_brief_with_http_info(self, project_brief_gid, **kwargs): # noqa: E501 - """Delete a project brief # noqa: E501 - - Deletes a specific, existing project brief. Returns an empty data record. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.delete_project_brief_with_http_info(project_brief_gid, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param str project_brief_gid: Globally unique identifier for the project brief. (required) - :return: EmptyResponseData - If the method is called asynchronously, - returns the request thread. - """ - - all_params = ['project_brief_gid'] # noqa: E501 - all_params.append('async_req') - all_params.append('_return_http_data_only') - all_params.append('_preload_content') - all_params.append('_request_timeout') - - params = locals() - for key, val in six.iteritems(params['kwargs']): - if key not in all_params: - raise TypeError( - "Got an unexpected keyword argument '%s'" - " to method delete_project_brief" % key - ) - params[key] = val - del params['kwargs'] - # verify the required parameter 'project_brief_gid' is set - if ('project_brief_gid' not in params or - params['project_brief_gid'] is None): - raise ValueError("Missing the required parameter `project_brief_gid` when calling `delete_project_brief`") # noqa: E501 - - collection_formats = {} - - path_params = {} - if 'project_brief_gid' in params: - path_params['project_brief_gid'] = params['project_brief_gid'] # noqa: E501 - - query_params = [] - - header_params = {} - - form_params = [] - local_var_files = {} - - body_params = None - # HTTP header `Accept` - header_params['Accept'] = self.api_client.select_header_accept( - ['application/json; charset=UTF-8']) # noqa: E501 - - # Authentication setting - auth_settings = ['oauth2'] # noqa: E501 - - return self.api_client.call_api( - '/project_briefs/{project_brief_gid}', 'DELETE', - path_params, - query_params, - header_params, - body=body_params, - post_params=form_params, - files=local_var_files, - response_type='EmptyResponseData', # noqa: E501 - auth_settings=auth_settings, - async_req=params.get('async_req'), - _return_http_data_only=params.get('_return_http_data_only'), - _preload_content=params.get('_preload_content', True), - _request_timeout=params.get('_request_timeout'), - collection_formats=collection_formats) - - def get_project_brief(self, project_brief_gid, **kwargs): # noqa: E501 - """Get a project brief # noqa: E501 - - Get the full record for a project brief. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.get_project_brief(project_brief_gid, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param str project_brief_gid: Globally unique identifier for the project brief. (required) - :param list[str] opt_fields: This endpoint returns a compact resource, which excludes some properties by default. To include those optional properties, set this query parameter to a comma-separated list of the properties you wish to include. - :return: ProjectBriefResponseData - If the method is called asynchronously, - returns the request thread. - """ - kwargs['_return_http_data_only'] = True - if kwargs.get('async_req'): - return self.get_project_brief_with_http_info(project_brief_gid, **kwargs) # noqa: E501 - else: - (data) = self.get_project_brief_with_http_info(project_brief_gid, **kwargs) # noqa: E501 - return data - - def get_project_brief_with_http_info(self, project_brief_gid, **kwargs): # noqa: E501 - """Get a project brief # noqa: E501 - - Get the full record for a project brief. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.get_project_brief_with_http_info(project_brief_gid, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param str project_brief_gid: Globally unique identifier for the project brief. (required) - :param list[str] opt_fields: This endpoint returns a compact resource, which excludes some properties by default. To include those optional properties, set this query parameter to a comma-separated list of the properties you wish to include. - :return: ProjectBriefResponseData - If the method is called asynchronously, - returns the request thread. - """ - - all_params = ['project_brief_gid', 'opt_fields'] # noqa: E501 - all_params.append('async_req') - all_params.append('_return_http_data_only') - all_params.append('_preload_content') - all_params.append('_request_timeout') - - params = locals() - for key, val in six.iteritems(params['kwargs']): - if key not in all_params: - raise TypeError( - "Got an unexpected keyword argument '%s'" - " to method get_project_brief" % key - ) - params[key] = val - del params['kwargs'] - # verify the required parameter 'project_brief_gid' is set - if ('project_brief_gid' not in params or - params['project_brief_gid'] is None): - raise ValueError("Missing the required parameter `project_brief_gid` when calling `get_project_brief`") # noqa: E501 - - collection_formats = {} - - path_params = {} - if 'project_brief_gid' in params: - path_params['project_brief_gid'] = params['project_brief_gid'] # noqa: E501 - - query_params = [] - if 'opt_fields' in params: - query_params.append(('opt_fields', params['opt_fields'])) # noqa: E501 - collection_formats['opt_fields'] = 'csv' # noqa: E501 - - header_params = {} - - form_params = [] - local_var_files = {} - - body_params = None - # HTTP header `Accept` - header_params['Accept'] = self.api_client.select_header_accept( - ['application/json; charset=UTF-8']) # noqa: E501 - - # Authentication setting - auth_settings = ['oauth2'] # noqa: E501 - - return self.api_client.call_api( - '/project_briefs/{project_brief_gid}', 'GET', - path_params, - query_params, - header_params, - body=body_params, - post_params=form_params, - files=local_var_files, - response_type='ProjectBriefResponseData', # noqa: E501 - auth_settings=auth_settings, - async_req=params.get('async_req'), - _return_http_data_only=params.get('_return_http_data_only'), - _preload_content=params.get('_preload_content', True), - _request_timeout=params.get('_request_timeout'), - collection_formats=collection_formats) - - def update_project_brief(self, body, project_brief_gid, **kwargs): # noqa: E501 - """Update a project brief # noqa: E501 - - An existing project brief can be updated by making a PUT request on the URL for that project brief. Only the fields provided in the `data` block will be updated; any unspecified fields will remain unchanged. Returns the complete updated project brief record. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.update_project_brief(body, project_brief_gid, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param ProjectBriefsProjectBriefGidBody body: The updated fields for the project brief. (required) - :param str project_brief_gid: Globally unique identifier for the project brief. (required) - :param list[str] opt_fields: This endpoint returns a compact resource, which excludes some properties by default. To include those optional properties, set this query parameter to a comma-separated list of the properties you wish to include. - :return: ProjectBriefResponseData - If the method is called asynchronously, - returns the request thread. - """ - kwargs['_return_http_data_only'] = True - if kwargs.get('async_req'): - return self.update_project_brief_with_http_info(body, project_brief_gid, **kwargs) # noqa: E501 - else: - (data) = self.update_project_brief_with_http_info(body, project_brief_gid, **kwargs) # noqa: E501 - return data - - def update_project_brief_with_http_info(self, body, project_brief_gid, **kwargs): # noqa: E501 - """Update a project brief # noqa: E501 - - An existing project brief can be updated by making a PUT request on the URL for that project brief. Only the fields provided in the `data` block will be updated; any unspecified fields will remain unchanged. Returns the complete updated project brief record. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.update_project_brief_with_http_info(body, project_brief_gid, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param ProjectBriefsProjectBriefGidBody body: The updated fields for the project brief. (required) - :param str project_brief_gid: Globally unique identifier for the project brief. (required) - :param list[str] opt_fields: This endpoint returns a compact resource, which excludes some properties by default. To include those optional properties, set this query parameter to a comma-separated list of the properties you wish to include. - :return: ProjectBriefResponseData - If the method is called asynchronously, - returns the request thread. - """ - - all_params = ['body', 'project_brief_gid', 'opt_fields'] # noqa: E501 - all_params.append('async_req') - all_params.append('_return_http_data_only') - all_params.append('_preload_content') - all_params.append('_request_timeout') - - params = locals() - for key, val in six.iteritems(params['kwargs']): - if key not in all_params: - raise TypeError( - "Got an unexpected keyword argument '%s'" - " to method update_project_brief" % key - ) - params[key] = val - del params['kwargs'] - # verify the required parameter 'body' is set - if ('body' not in params or - params['body'] is None): - raise ValueError("Missing the required parameter `body` when calling `update_project_brief`") # noqa: E501 - # verify the required parameter 'project_brief_gid' is set - if ('project_brief_gid' not in params or - params['project_brief_gid'] is None): - raise ValueError("Missing the required parameter `project_brief_gid` when calling `update_project_brief`") # noqa: E501 - - collection_formats = {} - - path_params = {} - if 'project_brief_gid' in params: - path_params['project_brief_gid'] = params['project_brief_gid'] # noqa: E501 - - query_params = [] - if 'opt_fields' in params: - query_params.append(('opt_fields', params['opt_fields'])) # noqa: E501 - collection_formats['opt_fields'] = 'csv' # noqa: E501 - - header_params = {} - - form_params = [] - local_var_files = {} - - body_params = None - if 'body' in params: - body_params = params['body'] - # HTTP header `Accept` - header_params['Accept'] = self.api_client.select_header_accept( - ['application/json; charset=UTF-8']) # noqa: E501 - - # HTTP header `Content-Type` - header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 - ['application/json; charset=UTF-8']) # noqa: E501 - - # Authentication setting - auth_settings = ['oauth2'] # noqa: E501 - - return self.api_client.call_api( - '/project_briefs/{project_brief_gid}', 'PUT', - path_params, - query_params, - header_params, - body=body_params, - post_params=form_params, - files=local_var_files, - response_type='ProjectBriefResponseData', # noqa: E501 - auth_settings=auth_settings, - async_req=params.get('async_req'), - _return_http_data_only=params.get('_return_http_data_only'), - _preload_content=params.get('_preload_content', True), - _request_timeout=params.get('_request_timeout'), - collection_formats=collection_formats) + all_params = ['body', 'project_brief_gid', 'opt_fields'] # noqa: E501 + all_params.append('async_req') + all_params.append('header_params') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + params = locals() + for key, val in six.iteritems(params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method update_project_brief" % key + ) + params[key] = val + del params['kwargs'] + # verify the required parameter 'body' is set + if ('body' not in params or + params['body'] is None): + raise ValueError("Missing the required parameter `body` when calling `update_project_brief`") # noqa: E501 + # verify the required parameter 'project_brief_gid' is set + if ('project_brief_gid' not in params or + params['project_brief_gid'] is None): + raise ValueError("Missing the required parameter `project_brief_gid` when calling `update_project_brief`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'project_brief_gid' in params: + path_params['project_brief_gid'] = params['project_brief_gid'] # noqa: E501 + + query_params = [] + if 'opt_fields' in params: + query_params.append(('opt_fields', params['opt_fields'])) # noqa: E501 + collection_formats['opt_fields'] = 'csv' # noqa: E501 + + header_params = kwargs.get("header_params", {}) + + form_params = [] + local_var_files = {} + + body_params = None + if 'body' in params: + body_params = params['body'] + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['application/json; charset=UTF-8']) # noqa: E501 + + # HTTP header `Content-Type` + header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 + ['application/json; charset=UTF-8']) # noqa: E501 + + # Authentication setting + auth_settings = ['oauth2'] # noqa: E501 + + return self.api_client.call_api( + '/project_briefs/{project_brief_gid}', 'PUT', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='ProjectBriefResponseData', # noqa: E501 + auth_settings=auth_settings, + async_req=params.get('async_req'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) diff --git a/asana/api/project_memberships_api.py b/asana/api/project_memberships_api.py index 6a3fc076..384cd4db 100644 --- a/asana/api/project_memberships_api.py +++ b/asana/api/project_memberships_api.py @@ -21,225 +21,227 @@ class ProjectMembershipsApi(object): - """NOTE: This class is auto generated by the swagger code generator program. +"""NOTE: This class is auto generated by the swagger code generator program. - Do not edit the class manually. - Ref: https://github.com/swagger-api/swagger-codegen +Do not edit the class manually. +Ref: https://github.com/swagger-api/swagger-codegen +""" + +def __init__(self, api_client=None): + if api_client is None: + api_client = ApiClient() + self.api_client = api_client + +def get_project_membership(self, project_membership_gid, **kwargs): # noqa: E501 + """Get a project membership # noqa: E501 + + Returns the complete project record for a single project membership. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.get_project_membership(project_membership_gid, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str project_membership_gid: (required) + :param list[str] opt_fields: This endpoint returns a compact resource, which excludes some properties by default. To include those optional properties, set this query parameter to a comma-separated list of the properties you wish to include. + :return: ProjectMembershipNormalResponseData + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = kwargs.get("_return_http_data_only", True) + if kwargs.get('async_req'): + return self.get_project_membership_with_http_info(project_membership_gid, **kwargs) # noqa: E501 + else: + (data) = self.get_project_membership_with_http_info(project_membership_gid, **kwargs) # noqa: E501 + return data + +def get_project_membership_with_http_info(self, project_membership_gid, **kwargs): # noqa: E501 + """Get a project membership # noqa: E501 + + Returns the complete project record for a single project membership. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.get_project_membership_with_http_info(project_membership_gid, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str project_membership_gid: (required) + :param list[str] opt_fields: This endpoint returns a compact resource, which excludes some properties by default. To include those optional properties, set this query parameter to a comma-separated list of the properties you wish to include. + :return: ProjectMembershipNormalResponseData + If the method is called asynchronously, + returns the request thread. + """ + + all_params = ['project_membership_gid', 'opt_fields'] # noqa: E501 + all_params.append('async_req') + all_params.append('header_params') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + params = locals() + for key, val in six.iteritems(params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method get_project_membership" % key + ) + params[key] = val + del params['kwargs'] + # verify the required parameter 'project_membership_gid' is set + if ('project_membership_gid' not in params or + params['project_membership_gid'] is None): + raise ValueError("Missing the required parameter `project_membership_gid` when calling `get_project_membership`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'project_membership_gid' in params: + path_params['project_membership_gid'] = params['project_membership_gid'] # noqa: E501 + + query_params = [] + if 'opt_fields' in params: + query_params.append(('opt_fields', params['opt_fields'])) # noqa: E501 + collection_formats['opt_fields'] = 'csv' # noqa: E501 + + header_params = kwargs.get("header_params", {}) + + form_params = [] + local_var_files = {} + + body_params = None + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['application/json; charset=UTF-8']) # noqa: E501 + + # Authentication setting + auth_settings = ['oauth2'] # noqa: E501 + + return self.api_client.call_api( + '/project_memberships/{project_membership_gid}', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='ProjectMembershipNormalResponseData', # noqa: E501 + auth_settings=auth_settings, + async_req=params.get('async_req'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) + +def get_project_memberships_for_project(self, project_gid, **kwargs): # noqa: E501 + """Get memberships from a project # noqa: E501 + + Returns the compact project membership records for the project. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.get_project_memberships_for_project(project_gid, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str project_gid: Globally unique identifier for the project. (required) + :param str user: A string identifying a user. This can either be the string \"me\", an email, or the gid of a user. + :param int limit: Results per page. The number of objects to return per page. The value must be between 1 and 100. + :param str offset: 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 list[str] opt_fields: This endpoint returns a compact resource, which excludes some properties by default. To include those optional properties, set this query parameter to a comma-separated list of the properties you wish to include. + :return: ProjectMembershipCompactArray + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = kwargs.get("_return_http_data_only", True) + if kwargs.get('async_req'): + return self.get_project_memberships_for_project_with_http_info(project_gid, **kwargs) # noqa: E501 + else: + (data) = self.get_project_memberships_for_project_with_http_info(project_gid, **kwargs) # noqa: E501 + return data + +def get_project_memberships_for_project_with_http_info(self, project_gid, **kwargs): # noqa: E501 + """Get memberships from a project # noqa: E501 + + Returns the compact project membership records for the project. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.get_project_memberships_for_project_with_http_info(project_gid, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str project_gid: Globally unique identifier for the project. (required) + :param str user: A string identifying a user. This can either be the string \"me\", an email, or the gid of a user. + :param int limit: Results per page. The number of objects to return per page. The value must be between 1 and 100. + :param str offset: 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 list[str] opt_fields: This endpoint returns a compact resource, which excludes some properties by default. To include those optional properties, set this query parameter to a comma-separated list of the properties you wish to include. + :return: ProjectMembershipCompactArray + If the method is called asynchronously, + returns the request thread. """ - def __init__(self, api_client=None): - if api_client is None: - api_client = ApiClient() - self.api_client = api_client - - def get_project_membership(self, project_membership_gid, **kwargs): # noqa: E501 - """Get a project membership # noqa: E501 - - Returns the complete project record for a single project membership. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.get_project_membership(project_membership_gid, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param str project_membership_gid: (required) - :param list[str] opt_fields: This endpoint returns a compact resource, which excludes some properties by default. To include those optional properties, set this query parameter to a comma-separated list of the properties you wish to include. - :return: ProjectMembershipNormalResponseData - If the method is called asynchronously, - returns the request thread. - """ - kwargs['_return_http_data_only'] = True - if kwargs.get('async_req'): - return self.get_project_membership_with_http_info(project_membership_gid, **kwargs) # noqa: E501 - else: - (data) = self.get_project_membership_with_http_info(project_membership_gid, **kwargs) # noqa: E501 - return data - - def get_project_membership_with_http_info(self, project_membership_gid, **kwargs): # noqa: E501 - """Get a project membership # noqa: E501 - - Returns the complete project record for a single project membership. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.get_project_membership_with_http_info(project_membership_gid, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param str project_membership_gid: (required) - :param list[str] opt_fields: This endpoint returns a compact resource, which excludes some properties by default. To include those optional properties, set this query parameter to a comma-separated list of the properties you wish to include. - :return: ProjectMembershipNormalResponseData - If the method is called asynchronously, - returns the request thread. - """ - - all_params = ['project_membership_gid', 'opt_fields'] # noqa: E501 - all_params.append('async_req') - all_params.append('_return_http_data_only') - all_params.append('_preload_content') - all_params.append('_request_timeout') - - params = locals() - for key, val in six.iteritems(params['kwargs']): - if key not in all_params: - raise TypeError( - "Got an unexpected keyword argument '%s'" - " to method get_project_membership" % key - ) - params[key] = val - del params['kwargs'] - # verify the required parameter 'project_membership_gid' is set - if ('project_membership_gid' not in params or - params['project_membership_gid'] is None): - raise ValueError("Missing the required parameter `project_membership_gid` when calling `get_project_membership`") # noqa: E501 - - collection_formats = {} - - path_params = {} - if 'project_membership_gid' in params: - path_params['project_membership_gid'] = params['project_membership_gid'] # noqa: E501 - - query_params = [] - if 'opt_fields' in params: - query_params.append(('opt_fields', params['opt_fields'])) # noqa: E501 - collection_formats['opt_fields'] = 'csv' # noqa: E501 - - header_params = {} - - form_params = [] - local_var_files = {} - - body_params = None - # HTTP header `Accept` - header_params['Accept'] = self.api_client.select_header_accept( - ['application/json; charset=UTF-8']) # noqa: E501 - - # Authentication setting - auth_settings = ['oauth2'] # noqa: E501 - - return self.api_client.call_api( - '/project_memberships/{project_membership_gid}', 'GET', - path_params, - query_params, - header_params, - body=body_params, - post_params=form_params, - files=local_var_files, - response_type='ProjectMembershipNormalResponseData', # noqa: E501 - auth_settings=auth_settings, - async_req=params.get('async_req'), - _return_http_data_only=params.get('_return_http_data_only'), - _preload_content=params.get('_preload_content', True), - _request_timeout=params.get('_request_timeout'), - collection_formats=collection_formats) - - def get_project_memberships_for_project(self, project_gid, **kwargs): # noqa: E501 - """Get memberships from a project # noqa: E501 - - Returns the compact project membership records for the project. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.get_project_memberships_for_project(project_gid, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param str project_gid: Globally unique identifier for the project. (required) - :param str user: A string identifying a user. This can either be the string \"me\", an email, or the gid of a user. - :param int limit: Results per page. The number of objects to return per page. The value must be between 1 and 100. - :param str offset: 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 list[str] opt_fields: This endpoint returns a compact resource, which excludes some properties by default. To include those optional properties, set this query parameter to a comma-separated list of the properties you wish to include. - :return: ProjectMembershipCompactArray - If the method is called asynchronously, - returns the request thread. - """ - kwargs['_return_http_data_only'] = True - if kwargs.get('async_req'): - return self.get_project_memberships_for_project_with_http_info(project_gid, **kwargs) # noqa: E501 - else: - (data) = self.get_project_memberships_for_project_with_http_info(project_gid, **kwargs) # noqa: E501 - return data - - def get_project_memberships_for_project_with_http_info(self, project_gid, **kwargs): # noqa: E501 - """Get memberships from a project # noqa: E501 - - Returns the compact project membership records for the project. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.get_project_memberships_for_project_with_http_info(project_gid, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param str project_gid: Globally unique identifier for the project. (required) - :param str user: A string identifying a user. This can either be the string \"me\", an email, or the gid of a user. - :param int limit: Results per page. The number of objects to return per page. The value must be between 1 and 100. - :param str offset: 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 list[str] opt_fields: This endpoint returns a compact resource, which excludes some properties by default. To include those optional properties, set this query parameter to a comma-separated list of the properties you wish to include. - :return: ProjectMembershipCompactArray - If the method is called asynchronously, - returns the request thread. - """ - - all_params = ['project_gid', 'user', 'limit', 'offset', 'opt_fields'] # noqa: E501 - all_params.append('async_req') - all_params.append('_return_http_data_only') - all_params.append('_preload_content') - all_params.append('_request_timeout') - - params = locals() - for key, val in six.iteritems(params['kwargs']): - if key not in all_params: - raise TypeError( - "Got an unexpected keyword argument '%s'" - " to method get_project_memberships_for_project" % key - ) - params[key] = val - del params['kwargs'] - # verify the required parameter 'project_gid' is set - if ('project_gid' not in params or - params['project_gid'] is None): - raise ValueError("Missing the required parameter `project_gid` when calling `get_project_memberships_for_project`") # noqa: E501 - - collection_formats = {} - - path_params = {} - if 'project_gid' in params: - path_params['project_gid'] = params['project_gid'] # noqa: E501 - - query_params = [] - if 'user' in params: - query_params.append(('user', params['user'])) # noqa: E501 - if 'limit' in params: - query_params.append(('limit', params['limit'])) # noqa: E501 - if 'offset' in params: - query_params.append(('offset', params['offset'])) # noqa: E501 - if 'opt_fields' in params: - query_params.append(('opt_fields', params['opt_fields'])) # noqa: E501 - collection_formats['opt_fields'] = 'csv' # noqa: E501 - - header_params = {} - - form_params = [] - local_var_files = {} - - body_params = None - # HTTP header `Accept` - header_params['Accept'] = self.api_client.select_header_accept( - ['application/json; charset=UTF-8']) # noqa: E501 - - # Authentication setting - auth_settings = ['oauth2'] # noqa: E501 - - return self.api_client.call_api( - '/projects/{project_gid}/project_memberships', 'GET', - path_params, - query_params, - header_params, - body=body_params, - post_params=form_params, - files=local_var_files, - response_type='ProjectMembershipCompactArray', # noqa: E501 - auth_settings=auth_settings, - async_req=params.get('async_req'), - _return_http_data_only=params.get('_return_http_data_only'), - _preload_content=params.get('_preload_content', True), - _request_timeout=params.get('_request_timeout'), - collection_formats=collection_formats) + all_params = ['project_gid', 'user', 'limit', 'offset', 'opt_fields'] # noqa: E501 + all_params.append('async_req') + all_params.append('header_params') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + params = locals() + for key, val in six.iteritems(params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method get_project_memberships_for_project" % key + ) + params[key] = val + del params['kwargs'] + # verify the required parameter 'project_gid' is set + if ('project_gid' not in params or + params['project_gid'] is None): + raise ValueError("Missing the required parameter `project_gid` when calling `get_project_memberships_for_project`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'project_gid' in params: + path_params['project_gid'] = params['project_gid'] # noqa: E501 + + query_params = [] + if 'user' in params: + query_params.append(('user', params['user'])) # noqa: E501 + if 'limit' in params: + query_params.append(('limit', params['limit'])) # noqa: E501 + if 'offset' in params: + query_params.append(('offset', params['offset'])) # noqa: E501 + if 'opt_fields' in params: + query_params.append(('opt_fields', params['opt_fields'])) # noqa: E501 + collection_formats['opt_fields'] = 'csv' # noqa: E501 + + header_params = kwargs.get("header_params", {}) + + form_params = [] + local_var_files = {} + + body_params = None + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['application/json; charset=UTF-8']) # noqa: E501 + + # Authentication setting + auth_settings = ['oauth2'] # noqa: E501 + + return self.api_client.call_api( + '/projects/{project_gid}/project_memberships', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='ProjectMembershipCompactArray', # noqa: E501 + auth_settings=auth_settings, + async_req=params.get('async_req'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) diff --git a/asana/api/project_statuses_api.py b/asana/api/project_statuses_api.py index cdce6a20..ca9bfaec 100644 --- a/asana/api/project_statuses_api.py +++ b/asana/api/project_statuses_api.py @@ -21,428 +21,432 @@ class ProjectStatusesApi(object): - """NOTE: This class is auto generated by the swagger code generator program. +"""NOTE: This class is auto generated by the swagger code generator program. - Do not edit the class manually. - Ref: https://github.com/swagger-api/swagger-codegen +Do not edit the class manually. +Ref: https://github.com/swagger-api/swagger-codegen +""" + +def __init__(self, api_client=None): + if api_client is None: + api_client = ApiClient() + self.api_client = api_client + +def create_project_status_for_project(self, body, project_gid, **kwargs): # noqa: E501 + """Create a project status # noqa: E501 + + *Deprecated: new integrations should prefer the `/status_updates` route.* Creates a new status update on the project. Returns the full record of the newly created project status update. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.create_project_status_for_project(body, project_gid, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param ProjectGidProjectStatusesBody body: The project status to create. (required) + :param str project_gid: Globally unique identifier for the project. (required) + :param list[str] opt_fields: This endpoint returns a compact resource, which excludes some properties by default. To include those optional properties, set this query parameter to a comma-separated list of the properties you wish to include. + :return: ProjectStatusResponseData + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = kwargs.get("_return_http_data_only", True) + if kwargs.get('async_req'): + return self.create_project_status_for_project_with_http_info(body, project_gid, **kwargs) # noqa: E501 + else: + (data) = self.create_project_status_for_project_with_http_info(body, project_gid, **kwargs) # noqa: E501 + return data + +def create_project_status_for_project_with_http_info(self, body, project_gid, **kwargs): # noqa: E501 + """Create a project status # noqa: E501 + + *Deprecated: new integrations should prefer the `/status_updates` route.* Creates a new status update on the project. Returns the full record of the newly created project status update. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.create_project_status_for_project_with_http_info(body, project_gid, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param ProjectGidProjectStatusesBody body: The project status to create. (required) + :param str project_gid: Globally unique identifier for the project. (required) + :param list[str] opt_fields: This endpoint returns a compact resource, which excludes some properties by default. To include those optional properties, set this query parameter to a comma-separated list of the properties you wish to include. + :return: ProjectStatusResponseData + If the method is called asynchronously, + returns the request thread. + """ + + all_params = ['body', 'project_gid', 'opt_fields'] # noqa: E501 + all_params.append('async_req') + all_params.append('header_params') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + params = locals() + for key, val in six.iteritems(params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method create_project_status_for_project" % key + ) + params[key] = val + del params['kwargs'] + # verify the required parameter 'body' is set + if ('body' not in params or + params['body'] is None): + raise ValueError("Missing the required parameter `body` when calling `create_project_status_for_project`") # noqa: E501 + # verify the required parameter 'project_gid' is set + if ('project_gid' not in params or + params['project_gid'] is None): + raise ValueError("Missing the required parameter `project_gid` when calling `create_project_status_for_project`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'project_gid' in params: + path_params['project_gid'] = params['project_gid'] # noqa: E501 + + query_params = [] + if 'opt_fields' in params: + query_params.append(('opt_fields', params['opt_fields'])) # noqa: E501 + collection_formats['opt_fields'] = 'csv' # noqa: E501 + + header_params = kwargs.get("header_params", {}) + + form_params = [] + local_var_files = {} + + body_params = None + if 'body' in params: + body_params = params['body'] + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['application/json; charset=UTF-8']) # noqa: E501 + + # HTTP header `Content-Type` + header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 + ['application/json; charset=UTF-8']) # noqa: E501 + + # Authentication setting + auth_settings = ['oauth2'] # noqa: E501 + + return self.api_client.call_api( + '/projects/{project_gid}/project_statuses', 'POST', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='ProjectStatusResponseData', # noqa: E501 + auth_settings=auth_settings, + async_req=params.get('async_req'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) + +def delete_project_status(self, project_status_gid, **kwargs): # noqa: E501 + """Delete a project status # noqa: E501 + + *Deprecated: new integrations should prefer the `/status_updates/{status_gid}` route.* Deletes a specific, existing project status update. Returns an empty data record. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.delete_project_status(project_status_gid, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str project_status_gid: The project status update to get. (required) + :return: EmptyResponseData + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = kwargs.get("_return_http_data_only", True) + if kwargs.get('async_req'): + return self.delete_project_status_with_http_info(project_status_gid, **kwargs) # noqa: E501 + else: + (data) = self.delete_project_status_with_http_info(project_status_gid, **kwargs) # noqa: E501 + return data + +def delete_project_status_with_http_info(self, project_status_gid, **kwargs): # noqa: E501 + """Delete a project status # noqa: E501 + + *Deprecated: new integrations should prefer the `/status_updates/{status_gid}` route.* Deletes a specific, existing project status update. Returns an empty data record. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.delete_project_status_with_http_info(project_status_gid, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str project_status_gid: The project status update to get. (required) + :return: EmptyResponseData + If the method is called asynchronously, + returns the request thread. + """ + + all_params = ['project_status_gid'] # noqa: E501 + all_params.append('async_req') + all_params.append('header_params') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + params = locals() + for key, val in six.iteritems(params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method delete_project_status" % key + ) + params[key] = val + del params['kwargs'] + # verify the required parameter 'project_status_gid' is set + if ('project_status_gid' not in params or + params['project_status_gid'] is None): + raise ValueError("Missing the required parameter `project_status_gid` when calling `delete_project_status`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'project_status_gid' in params: + path_params['project_status_gid'] = params['project_status_gid'] # noqa: E501 + + query_params = [] + + header_params = kwargs.get("header_params", {}) + + form_params = [] + local_var_files = {} + + body_params = None + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['application/json; charset=UTF-8']) # noqa: E501 + + # Authentication setting + auth_settings = ['oauth2'] # noqa: E501 + + return self.api_client.call_api( + '/project_statuses/{project_status_gid}', 'DELETE', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='EmptyResponseData', # noqa: E501 + auth_settings=auth_settings, + async_req=params.get('async_req'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) + +def get_project_status(self, project_status_gid, **kwargs): # noqa: E501 + """Get a project status # noqa: E501 + + *Deprecated: new integrations should prefer the `/status_updates/{status_gid}` route.* Returns the complete record for a single status update. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.get_project_status(project_status_gid, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str project_status_gid: The project status update to get. (required) + :param list[str] opt_fields: This endpoint returns a compact resource, which excludes some properties by default. To include those optional properties, set this query parameter to a comma-separated list of the properties you wish to include. + :return: ProjectStatusResponseData + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = kwargs.get("_return_http_data_only", True) + if kwargs.get('async_req'): + return self.get_project_status_with_http_info(project_status_gid, **kwargs) # noqa: E501 + else: + (data) = self.get_project_status_with_http_info(project_status_gid, **kwargs) # noqa: E501 + return data + +def get_project_status_with_http_info(self, project_status_gid, **kwargs): # noqa: E501 + """Get a project status # noqa: E501 + + *Deprecated: new integrations should prefer the `/status_updates/{status_gid}` route.* Returns the complete record for a single status update. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.get_project_status_with_http_info(project_status_gid, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str project_status_gid: The project status update to get. (required) + :param list[str] opt_fields: This endpoint returns a compact resource, which excludes some properties by default. To include those optional properties, set this query parameter to a comma-separated list of the properties you wish to include. + :return: ProjectStatusResponseData + If the method is called asynchronously, + returns the request thread. + """ + + all_params = ['project_status_gid', 'opt_fields'] # noqa: E501 + all_params.append('async_req') + all_params.append('header_params') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + params = locals() + for key, val in six.iteritems(params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method get_project_status" % key + ) + params[key] = val + del params['kwargs'] + # verify the required parameter 'project_status_gid' is set + if ('project_status_gid' not in params or + params['project_status_gid'] is None): + raise ValueError("Missing the required parameter `project_status_gid` when calling `get_project_status`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'project_status_gid' in params: + path_params['project_status_gid'] = params['project_status_gid'] # noqa: E501 + + query_params = [] + if 'opt_fields' in params: + query_params.append(('opt_fields', params['opt_fields'])) # noqa: E501 + collection_formats['opt_fields'] = 'csv' # noqa: E501 + + header_params = kwargs.get("header_params", {}) + + form_params = [] + local_var_files = {} + + body_params = None + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['application/json; charset=UTF-8']) # noqa: E501 + + # Authentication setting + auth_settings = ['oauth2'] # noqa: E501 + + return self.api_client.call_api( + '/project_statuses/{project_status_gid}', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='ProjectStatusResponseData', # noqa: E501 + auth_settings=auth_settings, + async_req=params.get('async_req'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) + +def get_project_statuses_for_project(self, project_gid, **kwargs): # noqa: E501 + """Get statuses from a project # noqa: E501 + + *Deprecated: new integrations should prefer the `/status_updates` route.* Returns the compact project status update records for all updates on the project. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.get_project_statuses_for_project(project_gid, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str project_gid: Globally unique identifier for the project. (required) + :param int limit: Results per page. The number of objects to return per page. The value must be between 1 and 100. + :param str offset: 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 list[str] opt_fields: This endpoint returns a compact resource, which excludes some properties by default. To include those optional properties, set this query parameter to a comma-separated list of the properties you wish to include. + :return: ProjectStatusResponseArray + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = kwargs.get("_return_http_data_only", True) + if kwargs.get('async_req'): + return self.get_project_statuses_for_project_with_http_info(project_gid, **kwargs) # noqa: E501 + else: + (data) = self.get_project_statuses_for_project_with_http_info(project_gid, **kwargs) # noqa: E501 + return data + +def get_project_statuses_for_project_with_http_info(self, project_gid, **kwargs): # noqa: E501 + """Get statuses from a project # noqa: E501 + + *Deprecated: new integrations should prefer the `/status_updates` route.* Returns the compact project status update records for all updates on the project. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.get_project_statuses_for_project_with_http_info(project_gid, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str project_gid: Globally unique identifier for the project. (required) + :param int limit: Results per page. The number of objects to return per page. The value must be between 1 and 100. + :param str offset: 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 list[str] opt_fields: This endpoint returns a compact resource, which excludes some properties by default. To include those optional properties, set this query parameter to a comma-separated list of the properties you wish to include. + :return: ProjectStatusResponseArray + If the method is called asynchronously, + returns the request thread. """ - def __init__(self, api_client=None): - if api_client is None: - api_client = ApiClient() - self.api_client = api_client - - def create_project_status_for_project(self, body, project_gid, **kwargs): # noqa: E501 - """Create a project status # noqa: E501 - - *Deprecated: new integrations should prefer the `/status_updates` route.* Creates a new status update on the project. Returns the full record of the newly created project status update. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.create_project_status_for_project(body, project_gid, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param ProjectGidProjectStatusesBody body: The project status to create. (required) - :param str project_gid: Globally unique identifier for the project. (required) - :param list[str] opt_fields: This endpoint returns a compact resource, which excludes some properties by default. To include those optional properties, set this query parameter to a comma-separated list of the properties you wish to include. - :return: ProjectStatusResponseData - If the method is called asynchronously, - returns the request thread. - """ - kwargs['_return_http_data_only'] = True - if kwargs.get('async_req'): - return self.create_project_status_for_project_with_http_info(body, project_gid, **kwargs) # noqa: E501 - else: - (data) = self.create_project_status_for_project_with_http_info(body, project_gid, **kwargs) # noqa: E501 - return data - - def create_project_status_for_project_with_http_info(self, body, project_gid, **kwargs): # noqa: E501 - """Create a project status # noqa: E501 - - *Deprecated: new integrations should prefer the `/status_updates` route.* Creates a new status update on the project. Returns the full record of the newly created project status update. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.create_project_status_for_project_with_http_info(body, project_gid, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param ProjectGidProjectStatusesBody body: The project status to create. (required) - :param str project_gid: Globally unique identifier for the project. (required) - :param list[str] opt_fields: This endpoint returns a compact resource, which excludes some properties by default. To include those optional properties, set this query parameter to a comma-separated list of the properties you wish to include. - :return: ProjectStatusResponseData - If the method is called asynchronously, - returns the request thread. - """ - - all_params = ['body', 'project_gid', 'opt_fields'] # noqa: E501 - all_params.append('async_req') - all_params.append('_return_http_data_only') - all_params.append('_preload_content') - all_params.append('_request_timeout') - - params = locals() - for key, val in six.iteritems(params['kwargs']): - if key not in all_params: - raise TypeError( - "Got an unexpected keyword argument '%s'" - " to method create_project_status_for_project" % key - ) - params[key] = val - del params['kwargs'] - # verify the required parameter 'body' is set - if ('body' not in params or - params['body'] is None): - raise ValueError("Missing the required parameter `body` when calling `create_project_status_for_project`") # noqa: E501 - # verify the required parameter 'project_gid' is set - if ('project_gid' not in params or - params['project_gid'] is None): - raise ValueError("Missing the required parameter `project_gid` when calling `create_project_status_for_project`") # noqa: E501 - - collection_formats = {} - - path_params = {} - if 'project_gid' in params: - path_params['project_gid'] = params['project_gid'] # noqa: E501 - - query_params = [] - if 'opt_fields' in params: - query_params.append(('opt_fields', params['opt_fields'])) # noqa: E501 - collection_formats['opt_fields'] = 'csv' # noqa: E501 - - header_params = {} - - form_params = [] - local_var_files = {} - - body_params = None - if 'body' in params: - body_params = params['body'] - # HTTP header `Accept` - header_params['Accept'] = self.api_client.select_header_accept( - ['application/json; charset=UTF-8']) # noqa: E501 - - # HTTP header `Content-Type` - header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 - ['application/json; charset=UTF-8']) # noqa: E501 - - # Authentication setting - auth_settings = ['oauth2'] # noqa: E501 - - return self.api_client.call_api( - '/projects/{project_gid}/project_statuses', 'POST', - path_params, - query_params, - header_params, - body=body_params, - post_params=form_params, - files=local_var_files, - response_type='ProjectStatusResponseData', # noqa: E501 - auth_settings=auth_settings, - async_req=params.get('async_req'), - _return_http_data_only=params.get('_return_http_data_only'), - _preload_content=params.get('_preload_content', True), - _request_timeout=params.get('_request_timeout'), - collection_formats=collection_formats) - - def delete_project_status(self, project_status_gid, **kwargs): # noqa: E501 - """Delete a project status # noqa: E501 - - *Deprecated: new integrations should prefer the `/status_updates/{status_gid}` route.* Deletes a specific, existing project status update. Returns an empty data record. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.delete_project_status(project_status_gid, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param str project_status_gid: The project status update to get. (required) - :return: EmptyResponseData - If the method is called asynchronously, - returns the request thread. - """ - kwargs['_return_http_data_only'] = True - if kwargs.get('async_req'): - return self.delete_project_status_with_http_info(project_status_gid, **kwargs) # noqa: E501 - else: - (data) = self.delete_project_status_with_http_info(project_status_gid, **kwargs) # noqa: E501 - return data - - def delete_project_status_with_http_info(self, project_status_gid, **kwargs): # noqa: E501 - """Delete a project status # noqa: E501 - - *Deprecated: new integrations should prefer the `/status_updates/{status_gid}` route.* Deletes a specific, existing project status update. Returns an empty data record. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.delete_project_status_with_http_info(project_status_gid, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param str project_status_gid: The project status update to get. (required) - :return: EmptyResponseData - If the method is called asynchronously, - returns the request thread. - """ - - all_params = ['project_status_gid'] # noqa: E501 - all_params.append('async_req') - all_params.append('_return_http_data_only') - all_params.append('_preload_content') - all_params.append('_request_timeout') - - params = locals() - for key, val in six.iteritems(params['kwargs']): - if key not in all_params: - raise TypeError( - "Got an unexpected keyword argument '%s'" - " to method delete_project_status" % key - ) - params[key] = val - del params['kwargs'] - # verify the required parameter 'project_status_gid' is set - if ('project_status_gid' not in params or - params['project_status_gid'] is None): - raise ValueError("Missing the required parameter `project_status_gid` when calling `delete_project_status`") # noqa: E501 - - collection_formats = {} - - path_params = {} - if 'project_status_gid' in params: - path_params['project_status_gid'] = params['project_status_gid'] # noqa: E501 - - query_params = [] - - header_params = {} - - form_params = [] - local_var_files = {} - - body_params = None - # HTTP header `Accept` - header_params['Accept'] = self.api_client.select_header_accept( - ['application/json; charset=UTF-8']) # noqa: E501 - - # Authentication setting - auth_settings = ['oauth2'] # noqa: E501 - - return self.api_client.call_api( - '/project_statuses/{project_status_gid}', 'DELETE', - path_params, - query_params, - header_params, - body=body_params, - post_params=form_params, - files=local_var_files, - response_type='EmptyResponseData', # noqa: E501 - auth_settings=auth_settings, - async_req=params.get('async_req'), - _return_http_data_only=params.get('_return_http_data_only'), - _preload_content=params.get('_preload_content', True), - _request_timeout=params.get('_request_timeout'), - collection_formats=collection_formats) - - def get_project_status(self, project_status_gid, **kwargs): # noqa: E501 - """Get a project status # noqa: E501 - - *Deprecated: new integrations should prefer the `/status_updates/{status_gid}` route.* Returns the complete record for a single status update. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.get_project_status(project_status_gid, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param str project_status_gid: The project status update to get. (required) - :param list[str] opt_fields: This endpoint returns a compact resource, which excludes some properties by default. To include those optional properties, set this query parameter to a comma-separated list of the properties you wish to include. - :return: ProjectStatusResponseData - If the method is called asynchronously, - returns the request thread. - """ - kwargs['_return_http_data_only'] = True - if kwargs.get('async_req'): - return self.get_project_status_with_http_info(project_status_gid, **kwargs) # noqa: E501 - else: - (data) = self.get_project_status_with_http_info(project_status_gid, **kwargs) # noqa: E501 - return data - - def get_project_status_with_http_info(self, project_status_gid, **kwargs): # noqa: E501 - """Get a project status # noqa: E501 - - *Deprecated: new integrations should prefer the `/status_updates/{status_gid}` route.* Returns the complete record for a single status update. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.get_project_status_with_http_info(project_status_gid, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param str project_status_gid: The project status update to get. (required) - :param list[str] opt_fields: This endpoint returns a compact resource, which excludes some properties by default. To include those optional properties, set this query parameter to a comma-separated list of the properties you wish to include. - :return: ProjectStatusResponseData - If the method is called asynchronously, - returns the request thread. - """ - - all_params = ['project_status_gid', 'opt_fields'] # noqa: E501 - all_params.append('async_req') - all_params.append('_return_http_data_only') - all_params.append('_preload_content') - all_params.append('_request_timeout') - - params = locals() - for key, val in six.iteritems(params['kwargs']): - if key not in all_params: - raise TypeError( - "Got an unexpected keyword argument '%s'" - " to method get_project_status" % key - ) - params[key] = val - del params['kwargs'] - # verify the required parameter 'project_status_gid' is set - if ('project_status_gid' not in params or - params['project_status_gid'] is None): - raise ValueError("Missing the required parameter `project_status_gid` when calling `get_project_status`") # noqa: E501 - - collection_formats = {} - - path_params = {} - if 'project_status_gid' in params: - path_params['project_status_gid'] = params['project_status_gid'] # noqa: E501 - - query_params = [] - if 'opt_fields' in params: - query_params.append(('opt_fields', params['opt_fields'])) # noqa: E501 - collection_formats['opt_fields'] = 'csv' # noqa: E501 - - header_params = {} - - form_params = [] - local_var_files = {} - - body_params = None - # HTTP header `Accept` - header_params['Accept'] = self.api_client.select_header_accept( - ['application/json; charset=UTF-8']) # noqa: E501 - - # Authentication setting - auth_settings = ['oauth2'] # noqa: E501 - - return self.api_client.call_api( - '/project_statuses/{project_status_gid}', 'GET', - path_params, - query_params, - header_params, - body=body_params, - post_params=form_params, - files=local_var_files, - response_type='ProjectStatusResponseData', # noqa: E501 - auth_settings=auth_settings, - async_req=params.get('async_req'), - _return_http_data_only=params.get('_return_http_data_only'), - _preload_content=params.get('_preload_content', True), - _request_timeout=params.get('_request_timeout'), - collection_formats=collection_formats) - - def get_project_statuses_for_project(self, project_gid, **kwargs): # noqa: E501 - """Get statuses from a project # noqa: E501 - - *Deprecated: new integrations should prefer the `/status_updates` route.* Returns the compact project status update records for all updates on the project. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.get_project_statuses_for_project(project_gid, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param str project_gid: Globally unique identifier for the project. (required) - :param int limit: Results per page. The number of objects to return per page. The value must be between 1 and 100. - :param str offset: 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 list[str] opt_fields: This endpoint returns a compact resource, which excludes some properties by default. To include those optional properties, set this query parameter to a comma-separated list of the properties you wish to include. - :return: ProjectStatusResponseArray - If the method is called asynchronously, - returns the request thread. - """ - kwargs['_return_http_data_only'] = True - if kwargs.get('async_req'): - return self.get_project_statuses_for_project_with_http_info(project_gid, **kwargs) # noqa: E501 - else: - (data) = self.get_project_statuses_for_project_with_http_info(project_gid, **kwargs) # noqa: E501 - return data - - def get_project_statuses_for_project_with_http_info(self, project_gid, **kwargs): # noqa: E501 - """Get statuses from a project # noqa: E501 - - *Deprecated: new integrations should prefer the `/status_updates` route.* Returns the compact project status update records for all updates on the project. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.get_project_statuses_for_project_with_http_info(project_gid, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param str project_gid: Globally unique identifier for the project. (required) - :param int limit: Results per page. The number of objects to return per page. The value must be between 1 and 100. - :param str offset: 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 list[str] opt_fields: This endpoint returns a compact resource, which excludes some properties by default. To include those optional properties, set this query parameter to a comma-separated list of the properties you wish to include. - :return: ProjectStatusResponseArray - If the method is called asynchronously, - returns the request thread. - """ - - all_params = ['project_gid', 'limit', 'offset', 'opt_fields'] # noqa: E501 - all_params.append('async_req') - all_params.append('_return_http_data_only') - all_params.append('_preload_content') - all_params.append('_request_timeout') - - params = locals() - for key, val in six.iteritems(params['kwargs']): - if key not in all_params: - raise TypeError( - "Got an unexpected keyword argument '%s'" - " to method get_project_statuses_for_project" % key - ) - params[key] = val - del params['kwargs'] - # verify the required parameter 'project_gid' is set - if ('project_gid' not in params or - params['project_gid'] is None): - raise ValueError("Missing the required parameter `project_gid` when calling `get_project_statuses_for_project`") # noqa: E501 - - collection_formats = {} - - path_params = {} - if 'project_gid' in params: - path_params['project_gid'] = params['project_gid'] # noqa: E501 - - query_params = [] - if 'limit' in params: - query_params.append(('limit', params['limit'])) # noqa: E501 - if 'offset' in params: - query_params.append(('offset', params['offset'])) # noqa: E501 - if 'opt_fields' in params: - query_params.append(('opt_fields', params['opt_fields'])) # noqa: E501 - collection_formats['opt_fields'] = 'csv' # noqa: E501 - - header_params = {} - - form_params = [] - local_var_files = {} - - body_params = None - # HTTP header `Accept` - header_params['Accept'] = self.api_client.select_header_accept( - ['application/json; charset=UTF-8']) # noqa: E501 - - # Authentication setting - auth_settings = ['oauth2'] # noqa: E501 - - return self.api_client.call_api( - '/projects/{project_gid}/project_statuses', 'GET', - path_params, - query_params, - header_params, - body=body_params, - post_params=form_params, - files=local_var_files, - response_type='ProjectStatusResponseArray', # noqa: E501 - auth_settings=auth_settings, - async_req=params.get('async_req'), - _return_http_data_only=params.get('_return_http_data_only'), - _preload_content=params.get('_preload_content', True), - _request_timeout=params.get('_request_timeout'), - collection_formats=collection_formats) + all_params = ['project_gid', 'limit', 'offset', 'opt_fields'] # noqa: E501 + all_params.append('async_req') + all_params.append('header_params') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + params = locals() + for key, val in six.iteritems(params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method get_project_statuses_for_project" % key + ) + params[key] = val + del params['kwargs'] + # verify the required parameter 'project_gid' is set + if ('project_gid' not in params or + params['project_gid'] is None): + raise ValueError("Missing the required parameter `project_gid` when calling `get_project_statuses_for_project`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'project_gid' in params: + path_params['project_gid'] = params['project_gid'] # noqa: E501 + + query_params = [] + if 'limit' in params: + query_params.append(('limit', params['limit'])) # noqa: E501 + if 'offset' in params: + query_params.append(('offset', params['offset'])) # noqa: E501 + if 'opt_fields' in params: + query_params.append(('opt_fields', params['opt_fields'])) # noqa: E501 + collection_formats['opt_fields'] = 'csv' # noqa: E501 + + header_params = kwargs.get("header_params", {}) + + form_params = [] + local_var_files = {} + + body_params = None + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['application/json; charset=UTF-8']) # noqa: E501 + + # Authentication setting + auth_settings = ['oauth2'] # noqa: E501 + + return self.api_client.call_api( + '/projects/{project_gid}/project_statuses', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='ProjectStatusResponseArray', # noqa: E501 + auth_settings=auth_settings, + async_req=params.get('async_req'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) diff --git a/asana/api/project_templates_api.py b/asana/api/project_templates_api.py index e1876fc4..3c9f79c8 100644 --- a/asana/api/project_templates_api.py +++ b/asana/api/project_templates_api.py @@ -21,532 +21,537 @@ class ProjectTemplatesApi(object): - """NOTE: This class is auto generated by the swagger code generator program. +"""NOTE: This class is auto generated by the swagger code generator program. - Do not edit the class manually. - Ref: https://github.com/swagger-api/swagger-codegen +Do not edit the class manually. +Ref: https://github.com/swagger-api/swagger-codegen +""" + +def __init__(self, api_client=None): + if api_client is None: + api_client = ApiClient() + self.api_client = api_client + +def delete_project_template(self, project_template_gid, **kwargs): # noqa: E501 + """Delete a project template # noqa: E501 + + A specific, existing project template can be deleted by making a DELETE request on the URL for that project template. Returns an empty data record. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.delete_project_template(project_template_gid, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str project_template_gid: Globally unique identifier for the project template. (required) + :return: EmptyResponseData + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = kwargs.get("_return_http_data_only", True) + if kwargs.get('async_req'): + return self.delete_project_template_with_http_info(project_template_gid, **kwargs) # noqa: E501 + else: + (data) = self.delete_project_template_with_http_info(project_template_gid, **kwargs) # noqa: E501 + return data + +def delete_project_template_with_http_info(self, project_template_gid, **kwargs): # noqa: E501 + """Delete a project template # noqa: E501 + + A specific, existing project template can be deleted by making a DELETE request on the URL for that project template. Returns an empty data record. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.delete_project_template_with_http_info(project_template_gid, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str project_template_gid: Globally unique identifier for the project template. (required) + :return: EmptyResponseData + If the method is called asynchronously, + returns the request thread. + """ + + all_params = ['project_template_gid'] # noqa: E501 + all_params.append('async_req') + all_params.append('header_params') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + params = locals() + for key, val in six.iteritems(params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method delete_project_template" % key + ) + params[key] = val + del params['kwargs'] + # verify the required parameter 'project_template_gid' is set + if ('project_template_gid' not in params or + params['project_template_gid'] is None): + raise ValueError("Missing the required parameter `project_template_gid` when calling `delete_project_template`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'project_template_gid' in params: + path_params['project_template_gid'] = params['project_template_gid'] # noqa: E501 + + query_params = [] + + header_params = kwargs.get("header_params", {}) + + form_params = [] + local_var_files = {} + + body_params = None + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['application/json; charset=UTF-8']) # noqa: E501 + + # Authentication setting + auth_settings = ['oauth2'] # noqa: E501 + + return self.api_client.call_api( + '/project_templates/{project_template_gid}', 'DELETE', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='EmptyResponseData', # noqa: E501 + auth_settings=auth_settings, + async_req=params.get('async_req'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) + +def get_project_template(self, project_template_gid, **kwargs): # noqa: E501 + """Get a project template # noqa: E501 + + Returns the complete project template record for a single project template. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.get_project_template(project_template_gid, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str project_template_gid: Globally unique identifier for the project template. (required) + :param list[str] opt_fields: This endpoint returns a compact resource, which excludes some properties by default. To include those optional properties, set this query parameter to a comma-separated list of the properties you wish to include. + :return: ProjectTemplateResponseData + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = kwargs.get("_return_http_data_only", True) + if kwargs.get('async_req'): + return self.get_project_template_with_http_info(project_template_gid, **kwargs) # noqa: E501 + else: + (data) = self.get_project_template_with_http_info(project_template_gid, **kwargs) # noqa: E501 + return data + +def get_project_template_with_http_info(self, project_template_gid, **kwargs): # noqa: E501 + """Get a project template # noqa: E501 + + Returns the complete project template record for a single project template. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.get_project_template_with_http_info(project_template_gid, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str project_template_gid: Globally unique identifier for the project template. (required) + :param list[str] opt_fields: This endpoint returns a compact resource, which excludes some properties by default. To include those optional properties, set this query parameter to a comma-separated list of the properties you wish to include. + :return: ProjectTemplateResponseData + If the method is called asynchronously, + returns the request thread. + """ + + all_params = ['project_template_gid', 'opt_fields'] # noqa: E501 + all_params.append('async_req') + all_params.append('header_params') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + params = locals() + for key, val in six.iteritems(params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method get_project_template" % key + ) + params[key] = val + del params['kwargs'] + # verify the required parameter 'project_template_gid' is set + if ('project_template_gid' not in params or + params['project_template_gid'] is None): + raise ValueError("Missing the required parameter `project_template_gid` when calling `get_project_template`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'project_template_gid' in params: + path_params['project_template_gid'] = params['project_template_gid'] # noqa: E501 + + query_params = [] + if 'opt_fields' in params: + query_params.append(('opt_fields', params['opt_fields'])) # noqa: E501 + collection_formats['opt_fields'] = 'csv' # noqa: E501 + + header_params = kwargs.get("header_params", {}) + + form_params = [] + local_var_files = {} + + body_params = None + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['application/json; charset=UTF-8']) # noqa: E501 + + # Authentication setting + auth_settings = ['oauth2'] # noqa: E501 + + return self.api_client.call_api( + '/project_templates/{project_template_gid}', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='ProjectTemplateResponseData', # noqa: E501 + auth_settings=auth_settings, + async_req=params.get('async_req'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) + +def get_project_templates(self, **kwargs): # noqa: E501 + """Get multiple project templates # noqa: E501 + + Returns the compact project template records for all project templates in the given team or workspace. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.get_project_templates(async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str workspace: The workspace to filter results on. + :param str team: The team to filter projects on. + :param int limit: Results per page. The number of objects to return per page. The value must be between 1 and 100. + :param str offset: 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 list[str] opt_fields: This endpoint returns a compact resource, which excludes some properties by default. To include those optional properties, set this query parameter to a comma-separated list of the properties you wish to include. + :return: ProjectTemplateResponseArray + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = kwargs.get("_return_http_data_only", True) + if kwargs.get('async_req'): + return self.get_project_templates_with_http_info(**kwargs) # noqa: E501 + else: + (data) = self.get_project_templates_with_http_info(**kwargs) # noqa: E501 + return data + +def get_project_templates_with_http_info(self, **kwargs): # noqa: E501 + """Get multiple project templates # noqa: E501 + + Returns the compact project template records for all project templates in the given team or workspace. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.get_project_templates_with_http_info(async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str workspace: The workspace to filter results on. + :param str team: The team to filter projects on. + :param int limit: Results per page. The number of objects to return per page. The value must be between 1 and 100. + :param str offset: 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 list[str] opt_fields: This endpoint returns a compact resource, which excludes some properties by default. To include those optional properties, set this query parameter to a comma-separated list of the properties you wish to include. + :return: ProjectTemplateResponseArray + If the method is called asynchronously, + returns the request thread. + """ + + all_params = ['workspace', 'team', 'limit', 'offset', 'opt_fields'] # noqa: E501 + all_params.append('async_req') + all_params.append('header_params') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + params = locals() + for key, val in six.iteritems(params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method get_project_templates" % key + ) + params[key] = val + del params['kwargs'] + + collection_formats = {} + + path_params = {} + + query_params = [] + if 'workspace' in params: + query_params.append(('workspace', params['workspace'])) # noqa: E501 + if 'team' in params: + query_params.append(('team', params['team'])) # noqa: E501 + if 'limit' in params: + query_params.append(('limit', params['limit'])) # noqa: E501 + if 'offset' in params: + query_params.append(('offset', params['offset'])) # noqa: E501 + if 'opt_fields' in params: + query_params.append(('opt_fields', params['opt_fields'])) # noqa: E501 + collection_formats['opt_fields'] = 'csv' # noqa: E501 + + header_params = kwargs.get("header_params", {}) + + form_params = [] + local_var_files = {} + + body_params = None + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['application/json; charset=UTF-8']) # noqa: E501 + + # Authentication setting + auth_settings = ['oauth2'] # noqa: E501 + + return self.api_client.call_api( + '/project_templates', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='ProjectTemplateResponseArray', # noqa: E501 + auth_settings=auth_settings, + async_req=params.get('async_req'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) + +def get_project_templates_for_team(self, team_gid, **kwargs): # noqa: E501 + """Get a team's project templates # noqa: E501 + + Returns the compact project template records for all project templates in the team. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.get_project_templates_for_team(team_gid, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str team_gid: Globally unique identifier for the team. (required) + :param int limit: Results per page. The number of objects to return per page. The value must be between 1 and 100. + :param str offset: 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 list[str] opt_fields: This endpoint returns a compact resource, which excludes some properties by default. To include those optional properties, set this query parameter to a comma-separated list of the properties you wish to include. + :return: ProjectTemplateResponseArray + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = kwargs.get("_return_http_data_only", True) + if kwargs.get('async_req'): + return self.get_project_templates_for_team_with_http_info(team_gid, **kwargs) # noqa: E501 + else: + (data) = self.get_project_templates_for_team_with_http_info(team_gid, **kwargs) # noqa: E501 + return data + +def get_project_templates_for_team_with_http_info(self, team_gid, **kwargs): # noqa: E501 + """Get a team's project templates # noqa: E501 + + Returns the compact project template records for all project templates in the team. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.get_project_templates_for_team_with_http_info(team_gid, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str team_gid: Globally unique identifier for the team. (required) + :param int limit: Results per page. The number of objects to return per page. The value must be between 1 and 100. + :param str offset: 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 list[str] opt_fields: This endpoint returns a compact resource, which excludes some properties by default. To include those optional properties, set this query parameter to a comma-separated list of the properties you wish to include. + :return: ProjectTemplateResponseArray + If the method is called asynchronously, + returns the request thread. + """ + + all_params = ['team_gid', 'limit', 'offset', 'opt_fields'] # noqa: E501 + all_params.append('async_req') + all_params.append('header_params') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + params = locals() + for key, val in six.iteritems(params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method get_project_templates_for_team" % key + ) + params[key] = val + del params['kwargs'] + # verify the required parameter 'team_gid' is set + if ('team_gid' not in params or + params['team_gid'] is None): + raise ValueError("Missing the required parameter `team_gid` when calling `get_project_templates_for_team`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'team_gid' in params: + path_params['team_gid'] = params['team_gid'] # noqa: E501 + + query_params = [] + if 'limit' in params: + query_params.append(('limit', params['limit'])) # noqa: E501 + if 'offset' in params: + query_params.append(('offset', params['offset'])) # noqa: E501 + if 'opt_fields' in params: + query_params.append(('opt_fields', params['opt_fields'])) # noqa: E501 + collection_formats['opt_fields'] = 'csv' # noqa: E501 + + header_params = kwargs.get("header_params", {}) + + form_params = [] + local_var_files = {} + + body_params = None + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['application/json; charset=UTF-8']) # noqa: E501 + + # Authentication setting + auth_settings = ['oauth2'] # noqa: E501 + + return self.api_client.call_api( + '/teams/{team_gid}/project_templates', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='ProjectTemplateResponseArray', # noqa: E501 + auth_settings=auth_settings, + async_req=params.get('async_req'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) + +def instantiate_project(self, project_template_gid, **kwargs): # noqa: E501 + """Instantiate a project from a project template # noqa: E501 + + Creates and returns a job that will asynchronously handle the project instantiation. To form this request, it is recommended to first make a request to [get a project template](/reference/getprojecttemplate). Then, from the response, copy the `gid` from the object in the `requested_dates` array. This `gid` should be used in `requested_dates` to instantiate a project. _Note: The body of this request will differ if your workspace is an organization. To determine if your workspace is an organization, use the [is_organization](/reference/workspaces) parameter._ # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.instantiate_project(project_template_gid, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str project_template_gid: Globally unique identifier for the project template. (required) + :param ProjectTemplateGidInstantiateProjectBody body: Describes the inputs used for instantiating a project, such as the resulting project's name, which team it should be created in, and values for date variables. + :param list[str] opt_fields: This endpoint returns a compact resource, which excludes some properties by default. To include those optional properties, set this query parameter to a comma-separated list of the properties you wish to include. + :return: JobResponseData + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = kwargs.get("_return_http_data_only", True) + if kwargs.get('async_req'): + return self.instantiate_project_with_http_info(project_template_gid, **kwargs) # noqa: E501 + else: + (data) = self.instantiate_project_with_http_info(project_template_gid, **kwargs) # noqa: E501 + return data + +def instantiate_project_with_http_info(self, project_template_gid, **kwargs): # noqa: E501 + """Instantiate a project from a project template # noqa: E501 + + Creates and returns a job that will asynchronously handle the project instantiation. To form this request, it is recommended to first make a request to [get a project template](/reference/getprojecttemplate). Then, from the response, copy the `gid` from the object in the `requested_dates` array. This `gid` should be used in `requested_dates` to instantiate a project. _Note: The body of this request will differ if your workspace is an organization. To determine if your workspace is an organization, use the [is_organization](/reference/workspaces) parameter._ # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.instantiate_project_with_http_info(project_template_gid, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str project_template_gid: Globally unique identifier for the project template. (required) + :param ProjectTemplateGidInstantiateProjectBody body: Describes the inputs used for instantiating a project, such as the resulting project's name, which team it should be created in, and values for date variables. + :param list[str] opt_fields: This endpoint returns a compact resource, which excludes some properties by default. To include those optional properties, set this query parameter to a comma-separated list of the properties you wish to include. + :return: JobResponseData + If the method is called asynchronously, + returns the request thread. """ - def __init__(self, api_client=None): - if api_client is None: - api_client = ApiClient() - self.api_client = api_client - - def delete_project_template(self, project_template_gid, **kwargs): # noqa: E501 - """Delete a project template # noqa: E501 - - A specific, existing project template can be deleted by making a DELETE request on the URL for that project template. Returns an empty data record. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.delete_project_template(project_template_gid, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param str project_template_gid: Globally unique identifier for the project template. (required) - :return: EmptyResponseData - If the method is called asynchronously, - returns the request thread. - """ - kwargs['_return_http_data_only'] = True - if kwargs.get('async_req'): - return self.delete_project_template_with_http_info(project_template_gid, **kwargs) # noqa: E501 - else: - (data) = self.delete_project_template_with_http_info(project_template_gid, **kwargs) # noqa: E501 - return data - - def delete_project_template_with_http_info(self, project_template_gid, **kwargs): # noqa: E501 - """Delete a project template # noqa: E501 - - A specific, existing project template can be deleted by making a DELETE request on the URL for that project template. Returns an empty data record. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.delete_project_template_with_http_info(project_template_gid, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param str project_template_gid: Globally unique identifier for the project template. (required) - :return: EmptyResponseData - If the method is called asynchronously, - returns the request thread. - """ - - all_params = ['project_template_gid'] # noqa: E501 - all_params.append('async_req') - all_params.append('_return_http_data_only') - all_params.append('_preload_content') - all_params.append('_request_timeout') - - params = locals() - for key, val in six.iteritems(params['kwargs']): - if key not in all_params: - raise TypeError( - "Got an unexpected keyword argument '%s'" - " to method delete_project_template" % key - ) - params[key] = val - del params['kwargs'] - # verify the required parameter 'project_template_gid' is set - if ('project_template_gid' not in params or - params['project_template_gid'] is None): - raise ValueError("Missing the required parameter `project_template_gid` when calling `delete_project_template`") # noqa: E501 - - collection_formats = {} - - path_params = {} - if 'project_template_gid' in params: - path_params['project_template_gid'] = params['project_template_gid'] # noqa: E501 - - query_params = [] - - header_params = {} - - form_params = [] - local_var_files = {} - - body_params = None - # HTTP header `Accept` - header_params['Accept'] = self.api_client.select_header_accept( - ['application/json; charset=UTF-8']) # noqa: E501 - - # Authentication setting - auth_settings = ['oauth2'] # noqa: E501 - - return self.api_client.call_api( - '/project_templates/{project_template_gid}', 'DELETE', - path_params, - query_params, - header_params, - body=body_params, - post_params=form_params, - files=local_var_files, - response_type='EmptyResponseData', # noqa: E501 - auth_settings=auth_settings, - async_req=params.get('async_req'), - _return_http_data_only=params.get('_return_http_data_only'), - _preload_content=params.get('_preload_content', True), - _request_timeout=params.get('_request_timeout'), - collection_formats=collection_formats) - - def get_project_template(self, project_template_gid, **kwargs): # noqa: E501 - """Get a project template # noqa: E501 - - Returns the complete project template record for a single project template. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.get_project_template(project_template_gid, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param str project_template_gid: Globally unique identifier for the project template. (required) - :param list[str] opt_fields: This endpoint returns a compact resource, which excludes some properties by default. To include those optional properties, set this query parameter to a comma-separated list of the properties you wish to include. - :return: ProjectTemplateResponseData - If the method is called asynchronously, - returns the request thread. - """ - kwargs['_return_http_data_only'] = True - if kwargs.get('async_req'): - return self.get_project_template_with_http_info(project_template_gid, **kwargs) # noqa: E501 - else: - (data) = self.get_project_template_with_http_info(project_template_gid, **kwargs) # noqa: E501 - return data - - def get_project_template_with_http_info(self, project_template_gid, **kwargs): # noqa: E501 - """Get a project template # noqa: E501 - - Returns the complete project template record for a single project template. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.get_project_template_with_http_info(project_template_gid, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param str project_template_gid: Globally unique identifier for the project template. (required) - :param list[str] opt_fields: This endpoint returns a compact resource, which excludes some properties by default. To include those optional properties, set this query parameter to a comma-separated list of the properties you wish to include. - :return: ProjectTemplateResponseData - If the method is called asynchronously, - returns the request thread. - """ - - all_params = ['project_template_gid', 'opt_fields'] # noqa: E501 - all_params.append('async_req') - all_params.append('_return_http_data_only') - all_params.append('_preload_content') - all_params.append('_request_timeout') - - params = locals() - for key, val in six.iteritems(params['kwargs']): - if key not in all_params: - raise TypeError( - "Got an unexpected keyword argument '%s'" - " to method get_project_template" % key - ) - params[key] = val - del params['kwargs'] - # verify the required parameter 'project_template_gid' is set - if ('project_template_gid' not in params or - params['project_template_gid'] is None): - raise ValueError("Missing the required parameter `project_template_gid` when calling `get_project_template`") # noqa: E501 - - collection_formats = {} - - path_params = {} - if 'project_template_gid' in params: - path_params['project_template_gid'] = params['project_template_gid'] # noqa: E501 - - query_params = [] - if 'opt_fields' in params: - query_params.append(('opt_fields', params['opt_fields'])) # noqa: E501 - collection_formats['opt_fields'] = 'csv' # noqa: E501 - - header_params = {} - - form_params = [] - local_var_files = {} - - body_params = None - # HTTP header `Accept` - header_params['Accept'] = self.api_client.select_header_accept( - ['application/json; charset=UTF-8']) # noqa: E501 - - # Authentication setting - auth_settings = ['oauth2'] # noqa: E501 - - return self.api_client.call_api( - '/project_templates/{project_template_gid}', 'GET', - path_params, - query_params, - header_params, - body=body_params, - post_params=form_params, - files=local_var_files, - response_type='ProjectTemplateResponseData', # noqa: E501 - auth_settings=auth_settings, - async_req=params.get('async_req'), - _return_http_data_only=params.get('_return_http_data_only'), - _preload_content=params.get('_preload_content', True), - _request_timeout=params.get('_request_timeout'), - collection_formats=collection_formats) - - def get_project_templates(self, **kwargs): # noqa: E501 - """Get multiple project templates # noqa: E501 - - Returns the compact project template records for all project templates in the given team or workspace. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.get_project_templates(async_req=True) - >>> result = thread.get() - - :param async_req bool - :param str workspace: The workspace to filter results on. - :param str team: The team to filter projects on. - :param int limit: Results per page. The number of objects to return per page. The value must be between 1 and 100. - :param str offset: 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 list[str] opt_fields: This endpoint returns a compact resource, which excludes some properties by default. To include those optional properties, set this query parameter to a comma-separated list of the properties you wish to include. - :return: ProjectTemplateResponseArray - If the method is called asynchronously, - returns the request thread. - """ - kwargs['_return_http_data_only'] = True - if kwargs.get('async_req'): - return self.get_project_templates_with_http_info(**kwargs) # noqa: E501 - else: - (data) = self.get_project_templates_with_http_info(**kwargs) # noqa: E501 - return data - - def get_project_templates_with_http_info(self, **kwargs): # noqa: E501 - """Get multiple project templates # noqa: E501 - - Returns the compact project template records for all project templates in the given team or workspace. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.get_project_templates_with_http_info(async_req=True) - >>> result = thread.get() - - :param async_req bool - :param str workspace: The workspace to filter results on. - :param str team: The team to filter projects on. - :param int limit: Results per page. The number of objects to return per page. The value must be between 1 and 100. - :param str offset: 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 list[str] opt_fields: This endpoint returns a compact resource, which excludes some properties by default. To include those optional properties, set this query parameter to a comma-separated list of the properties you wish to include. - :return: ProjectTemplateResponseArray - If the method is called asynchronously, - returns the request thread. - """ - - all_params = ['workspace', 'team', 'limit', 'offset', 'opt_fields'] # noqa: E501 - all_params.append('async_req') - all_params.append('_return_http_data_only') - all_params.append('_preload_content') - all_params.append('_request_timeout') - - params = locals() - for key, val in six.iteritems(params['kwargs']): - if key not in all_params: - raise TypeError( - "Got an unexpected keyword argument '%s'" - " to method get_project_templates" % key - ) - params[key] = val - del params['kwargs'] - - collection_formats = {} - - path_params = {} - - query_params = [] - if 'workspace' in params: - query_params.append(('workspace', params['workspace'])) # noqa: E501 - if 'team' in params: - query_params.append(('team', params['team'])) # noqa: E501 - if 'limit' in params: - query_params.append(('limit', params['limit'])) # noqa: E501 - if 'offset' in params: - query_params.append(('offset', params['offset'])) # noqa: E501 - if 'opt_fields' in params: - query_params.append(('opt_fields', params['opt_fields'])) # noqa: E501 - collection_formats['opt_fields'] = 'csv' # noqa: E501 - - header_params = {} - - form_params = [] - local_var_files = {} - - body_params = None - # HTTP header `Accept` - header_params['Accept'] = self.api_client.select_header_accept( - ['application/json; charset=UTF-8']) # noqa: E501 - - # Authentication setting - auth_settings = ['oauth2'] # noqa: E501 - - return self.api_client.call_api( - '/project_templates', 'GET', - path_params, - query_params, - header_params, - body=body_params, - post_params=form_params, - files=local_var_files, - response_type='ProjectTemplateResponseArray', # noqa: E501 - auth_settings=auth_settings, - async_req=params.get('async_req'), - _return_http_data_only=params.get('_return_http_data_only'), - _preload_content=params.get('_preload_content', True), - _request_timeout=params.get('_request_timeout'), - collection_formats=collection_formats) - - def get_project_templates_for_team(self, team_gid, **kwargs): # noqa: E501 - """Get a team's project templates # noqa: E501 - - Returns the compact project template records for all project templates in the team. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.get_project_templates_for_team(team_gid, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param str team_gid: Globally unique identifier for the team. (required) - :param int limit: Results per page. The number of objects to return per page. The value must be between 1 and 100. - :param str offset: 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 list[str] opt_fields: This endpoint returns a compact resource, which excludes some properties by default. To include those optional properties, set this query parameter to a comma-separated list of the properties you wish to include. - :return: ProjectTemplateResponseArray - If the method is called asynchronously, - returns the request thread. - """ - kwargs['_return_http_data_only'] = True - if kwargs.get('async_req'): - return self.get_project_templates_for_team_with_http_info(team_gid, **kwargs) # noqa: E501 - else: - (data) = self.get_project_templates_for_team_with_http_info(team_gid, **kwargs) # noqa: E501 - return data - - def get_project_templates_for_team_with_http_info(self, team_gid, **kwargs): # noqa: E501 - """Get a team's project templates # noqa: E501 - - Returns the compact project template records for all project templates in the team. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.get_project_templates_for_team_with_http_info(team_gid, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param str team_gid: Globally unique identifier for the team. (required) - :param int limit: Results per page. The number of objects to return per page. The value must be between 1 and 100. - :param str offset: 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 list[str] opt_fields: This endpoint returns a compact resource, which excludes some properties by default. To include those optional properties, set this query parameter to a comma-separated list of the properties you wish to include. - :return: ProjectTemplateResponseArray - If the method is called asynchronously, - returns the request thread. - """ - - all_params = ['team_gid', 'limit', 'offset', 'opt_fields'] # noqa: E501 - all_params.append('async_req') - all_params.append('_return_http_data_only') - all_params.append('_preload_content') - all_params.append('_request_timeout') - - params = locals() - for key, val in six.iteritems(params['kwargs']): - if key not in all_params: - raise TypeError( - "Got an unexpected keyword argument '%s'" - " to method get_project_templates_for_team" % key - ) - params[key] = val - del params['kwargs'] - # verify the required parameter 'team_gid' is set - if ('team_gid' not in params or - params['team_gid'] is None): - raise ValueError("Missing the required parameter `team_gid` when calling `get_project_templates_for_team`") # noqa: E501 - - collection_formats = {} - - path_params = {} - if 'team_gid' in params: - path_params['team_gid'] = params['team_gid'] # noqa: E501 - - query_params = [] - if 'limit' in params: - query_params.append(('limit', params['limit'])) # noqa: E501 - if 'offset' in params: - query_params.append(('offset', params['offset'])) # noqa: E501 - if 'opt_fields' in params: - query_params.append(('opt_fields', params['opt_fields'])) # noqa: E501 - collection_formats['opt_fields'] = 'csv' # noqa: E501 - - header_params = {} - - form_params = [] - local_var_files = {} - - body_params = None - # HTTP header `Accept` - header_params['Accept'] = self.api_client.select_header_accept( - ['application/json; charset=UTF-8']) # noqa: E501 - - # Authentication setting - auth_settings = ['oauth2'] # noqa: E501 - - return self.api_client.call_api( - '/teams/{team_gid}/project_templates', 'GET', - path_params, - query_params, - header_params, - body=body_params, - post_params=form_params, - files=local_var_files, - response_type='ProjectTemplateResponseArray', # noqa: E501 - auth_settings=auth_settings, - async_req=params.get('async_req'), - _return_http_data_only=params.get('_return_http_data_only'), - _preload_content=params.get('_preload_content', True), - _request_timeout=params.get('_request_timeout'), - collection_formats=collection_formats) - - def instantiate_project(self, project_template_gid, **kwargs): # noqa: E501 - """Instantiate a project from a project template # noqa: E501 - - Creates and returns a job that will asynchronously handle the project instantiation. To form this request, it is recommended to first make a request to [get a project template](/reference/getprojecttemplate). Then, from the response, copy the `gid` from the object in the `requested_dates` array. This `gid` should be used in `requested_dates` to instantiate a project. _Note: The body of this request will differ if your workspace is an organization. To determine if your workspace is an organization, use the [is_organization](/reference/workspaces) parameter._ # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.instantiate_project(project_template_gid, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param str project_template_gid: Globally unique identifier for the project template. (required) - :param ProjectTemplateGidInstantiateProjectBody body: Describes the inputs used for instantiating a project, such as the resulting project's name, which team it should be created in, and values for date variables. - :param list[str] opt_fields: This endpoint returns a compact resource, which excludes some properties by default. To include those optional properties, set this query parameter to a comma-separated list of the properties you wish to include. - :return: JobResponseData - If the method is called asynchronously, - returns the request thread. - """ - kwargs['_return_http_data_only'] = True - if kwargs.get('async_req'): - return self.instantiate_project_with_http_info(project_template_gid, **kwargs) # noqa: E501 - else: - (data) = self.instantiate_project_with_http_info(project_template_gid, **kwargs) # noqa: E501 - return data - - def instantiate_project_with_http_info(self, project_template_gid, **kwargs): # noqa: E501 - """Instantiate a project from a project template # noqa: E501 - - Creates and returns a job that will asynchronously handle the project instantiation. To form this request, it is recommended to first make a request to [get a project template](/reference/getprojecttemplate). Then, from the response, copy the `gid` from the object in the `requested_dates` array. This `gid` should be used in `requested_dates` to instantiate a project. _Note: The body of this request will differ if your workspace is an organization. To determine if your workspace is an organization, use the [is_organization](/reference/workspaces) parameter._ # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.instantiate_project_with_http_info(project_template_gid, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param str project_template_gid: Globally unique identifier for the project template. (required) - :param ProjectTemplateGidInstantiateProjectBody body: Describes the inputs used for instantiating a project, such as the resulting project's name, which team it should be created in, and values for date variables. - :param list[str] opt_fields: This endpoint returns a compact resource, which excludes some properties by default. To include those optional properties, set this query parameter to a comma-separated list of the properties you wish to include. - :return: JobResponseData - If the method is called asynchronously, - returns the request thread. - """ - - all_params = ['project_template_gid', 'body', 'opt_fields'] # noqa: E501 - all_params.append('async_req') - all_params.append('_return_http_data_only') - all_params.append('_preload_content') - all_params.append('_request_timeout') - - params = locals() - for key, val in six.iteritems(params['kwargs']): - if key not in all_params: - raise TypeError( - "Got an unexpected keyword argument '%s'" - " to method instantiate_project" % key - ) - params[key] = val - del params['kwargs'] - # verify the required parameter 'project_template_gid' is set - if ('project_template_gid' not in params or - params['project_template_gid'] is None): - raise ValueError("Missing the required parameter `project_template_gid` when calling `instantiate_project`") # noqa: E501 - - collection_formats = {} - - path_params = {} - if 'project_template_gid' in params: - path_params['project_template_gid'] = params['project_template_gid'] # noqa: E501 - - query_params = [] - if 'opt_fields' in params: - query_params.append(('opt_fields', params['opt_fields'])) # noqa: E501 - collection_formats['opt_fields'] = 'csv' # noqa: E501 - - header_params = {} - - form_params = [] - local_var_files = {} - - body_params = None - if 'body' in params: - body_params = params['body'] - # HTTP header `Accept` - header_params['Accept'] = self.api_client.select_header_accept( - ['application/json; charset=UTF-8']) # noqa: E501 - - # HTTP header `Content-Type` - header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 - ['application/json; charset=UTF-8']) # noqa: E501 - - # Authentication setting - auth_settings = ['oauth2'] # noqa: E501 - - return self.api_client.call_api( - '/project_templates/{project_template_gid}/instantiateProject', 'POST', - path_params, - query_params, - header_params, - body=body_params, - post_params=form_params, - files=local_var_files, - response_type='JobResponseData', # noqa: E501 - auth_settings=auth_settings, - async_req=params.get('async_req'), - _return_http_data_only=params.get('_return_http_data_only'), - _preload_content=params.get('_preload_content', True), - _request_timeout=params.get('_request_timeout'), - collection_formats=collection_formats) + all_params = ['project_template_gid', 'body', 'opt_fields'] # noqa: E501 + all_params.append('async_req') + all_params.append('header_params') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + params = locals() + for key, val in six.iteritems(params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method instantiate_project" % key + ) + params[key] = val + del params['kwargs'] + # verify the required parameter 'project_template_gid' is set + if ('project_template_gid' not in params or + params['project_template_gid'] is None): + raise ValueError("Missing the required parameter `project_template_gid` when calling `instantiate_project`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'project_template_gid' in params: + path_params['project_template_gid'] = params['project_template_gid'] # noqa: E501 + + query_params = [] + if 'opt_fields' in params: + query_params.append(('opt_fields', params['opt_fields'])) # noqa: E501 + collection_formats['opt_fields'] = 'csv' # noqa: E501 + + header_params = kwargs.get("header_params", {}) + + form_params = [] + local_var_files = {} + + body_params = None + if 'body' in params: + body_params = params['body'] + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['application/json; charset=UTF-8']) # noqa: E501 + + # HTTP header `Content-Type` + header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 + ['application/json; charset=UTF-8']) # noqa: E501 + + # Authentication setting + auth_settings = ['oauth2'] # noqa: E501 + + return self.api_client.call_api( + '/project_templates/{project_template_gid}/instantiateProject', 'POST', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='JobResponseData', # noqa: E501 + auth_settings=auth_settings, + async_req=params.get('async_req'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) diff --git a/asana/api/projects_api.py b/asana/api/projects_api.py index 3bba96d3..e61c06c4 100644 --- a/asana/api/projects_api.py +++ b/asana/api/projects_api.py @@ -21,2074 +21,2093 @@ class ProjectsApi(object): - """NOTE: This class is auto generated by the swagger code generator program. +"""NOTE: This class is auto generated by the swagger code generator program. - Do not edit the class manually. - Ref: https://github.com/swagger-api/swagger-codegen +Do not edit the class manually. +Ref: https://github.com/swagger-api/swagger-codegen +""" + +def __init__(self, api_client=None): + if api_client is None: + api_client = ApiClient() + self.api_client = api_client + +def add_custom_field_setting_for_project(self, body, project_gid, **kwargs): # noqa: E501 + """Add a custom field to a project # noqa: E501 + + Custom fields are associated with projects by way of custom field settings. This method creates a setting for the project. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.add_custom_field_setting_for_project(body, project_gid, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param ProjectGidAddCustomFieldSettingBody body: Information about the custom field setting. (required) + :param str project_gid: Globally unique identifier for the project. (required) + :return: CustomFieldSettingResponseData + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = kwargs.get("_return_http_data_only", True) + if kwargs.get('async_req'): + return self.add_custom_field_setting_for_project_with_http_info(body, project_gid, **kwargs) # noqa: E501 + else: + (data) = self.add_custom_field_setting_for_project_with_http_info(body, project_gid, **kwargs) # noqa: E501 + return data + +def add_custom_field_setting_for_project_with_http_info(self, body, project_gid, **kwargs): # noqa: E501 + """Add a custom field to a project # noqa: E501 + + Custom fields are associated with projects by way of custom field settings. This method creates a setting for the project. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.add_custom_field_setting_for_project_with_http_info(body, project_gid, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param ProjectGidAddCustomFieldSettingBody body: Information about the custom field setting. (required) + :param str project_gid: Globally unique identifier for the project. (required) + :return: CustomFieldSettingResponseData + If the method is called asynchronously, + returns the request thread. + """ + + all_params = ['body', 'project_gid'] # noqa: E501 + all_params.append('async_req') + all_params.append('header_params') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + params = locals() + for key, val in six.iteritems(params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method add_custom_field_setting_for_project" % key + ) + params[key] = val + del params['kwargs'] + # verify the required parameter 'body' is set + if ('body' not in params or + params['body'] is None): + raise ValueError("Missing the required parameter `body` when calling `add_custom_field_setting_for_project`") # noqa: E501 + # verify the required parameter 'project_gid' is set + if ('project_gid' not in params or + params['project_gid'] is None): + raise ValueError("Missing the required parameter `project_gid` when calling `add_custom_field_setting_for_project`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'project_gid' in params: + path_params['project_gid'] = params['project_gid'] # noqa: E501 + + query_params = [] + + header_params = kwargs.get("header_params", {}) + + form_params = [] + local_var_files = {} + + body_params = None + if 'body' in params: + body_params = params['body'] + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['application/json; charset=UTF-8']) # noqa: E501 + + # HTTP header `Content-Type` + header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 + ['application/json; charset=UTF-8']) # noqa: E501 + + # Authentication setting + auth_settings = ['oauth2'] # noqa: E501 + + return self.api_client.call_api( + '/projects/{project_gid}/addCustomFieldSetting', 'POST', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='CustomFieldSettingResponseData', # noqa: E501 + auth_settings=auth_settings, + async_req=params.get('async_req'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) + +def add_followers_for_project(self, body, project_gid, **kwargs): # noqa: E501 + """Add followers to a project # noqa: E501 + + Adds the specified list of users as followers to the project. Followers are a subset of members who have opted in to receive \"tasks added\" notifications for a project. Therefore, if the users are not already members of the project, they will also become members as a result of this operation. Returns the updated project record. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.add_followers_for_project(body, project_gid, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param ProjectGidAddFollowersBody body: Information about the followers being added. (required) + :param str project_gid: Globally unique identifier for the project. (required) + :param list[str] opt_fields: This endpoint returns a compact resource, which excludes some properties by default. To include those optional properties, set this query parameter to a comma-separated list of the properties you wish to include. + :return: ProjectResponseData + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = kwargs.get("_return_http_data_only", True) + if kwargs.get('async_req'): + return self.add_followers_for_project_with_http_info(body, project_gid, **kwargs) # noqa: E501 + else: + (data) = self.add_followers_for_project_with_http_info(body, project_gid, **kwargs) # noqa: E501 + return data + +def add_followers_for_project_with_http_info(self, body, project_gid, **kwargs): # noqa: E501 + """Add followers to a project # noqa: E501 + + Adds the specified list of users as followers to the project. Followers are a subset of members who have opted in to receive \"tasks added\" notifications for a project. Therefore, if the users are not already members of the project, they will also become members as a result of this operation. Returns the updated project record. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.add_followers_for_project_with_http_info(body, project_gid, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param ProjectGidAddFollowersBody body: Information about the followers being added. (required) + :param str project_gid: Globally unique identifier for the project. (required) + :param list[str] opt_fields: This endpoint returns a compact resource, which excludes some properties by default. To include those optional properties, set this query parameter to a comma-separated list of the properties you wish to include. + :return: ProjectResponseData + If the method is called asynchronously, + returns the request thread. + """ + + all_params = ['body', 'project_gid', 'opt_fields'] # noqa: E501 + all_params.append('async_req') + all_params.append('header_params') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + params = locals() + for key, val in six.iteritems(params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method add_followers_for_project" % key + ) + params[key] = val + del params['kwargs'] + # verify the required parameter 'body' is set + if ('body' not in params or + params['body'] is None): + raise ValueError("Missing the required parameter `body` when calling `add_followers_for_project`") # noqa: E501 + # verify the required parameter 'project_gid' is set + if ('project_gid' not in params or + params['project_gid'] is None): + raise ValueError("Missing the required parameter `project_gid` when calling `add_followers_for_project`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'project_gid' in params: + path_params['project_gid'] = params['project_gid'] # noqa: E501 + + query_params = [] + if 'opt_fields' in params: + query_params.append(('opt_fields', params['opt_fields'])) # noqa: E501 + collection_formats['opt_fields'] = 'csv' # noqa: E501 + + header_params = kwargs.get("header_params", {}) + + form_params = [] + local_var_files = {} + + body_params = None + if 'body' in params: + body_params = params['body'] + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['application/json; charset=UTF-8']) # noqa: E501 + + # HTTP header `Content-Type` + header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 + ['application/json; charset=UTF-8']) # noqa: E501 + + # Authentication setting + auth_settings = ['oauth2'] # noqa: E501 + + return self.api_client.call_api( + '/projects/{project_gid}/addFollowers', 'POST', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='ProjectResponseData', # noqa: E501 + auth_settings=auth_settings, + async_req=params.get('async_req'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) + +def add_members_for_project(self, body, project_gid, **kwargs): # noqa: E501 + """Add users to a project # noqa: E501 + + Adds the specified list of users as members of the project. Note that a user being added as a member may also be added as a *follower* as a result of this operation. This is because the user's default notification settings (i.e., in the \"Notifcations\" tab of \"My Profile Settings\") will override this endpoint's default behavior of setting \"Tasks added\" notifications to `false`. Returns the updated project record. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.add_members_for_project(body, project_gid, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param ProjectGidAddMembersBody body: Information about the members being added. (required) + :param str project_gid: Globally unique identifier for the project. (required) + :param list[str] opt_fields: This endpoint returns a compact resource, which excludes some properties by default. To include those optional properties, set this query parameter to a comma-separated list of the properties you wish to include. + :return: ProjectResponseData + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = kwargs.get("_return_http_data_only", True) + if kwargs.get('async_req'): + return self.add_members_for_project_with_http_info(body, project_gid, **kwargs) # noqa: E501 + else: + (data) = self.add_members_for_project_with_http_info(body, project_gid, **kwargs) # noqa: E501 + return data + +def add_members_for_project_with_http_info(self, body, project_gid, **kwargs): # noqa: E501 + """Add users to a project # noqa: E501 + + Adds the specified list of users as members of the project. Note that a user being added as a member may also be added as a *follower* as a result of this operation. This is because the user's default notification settings (i.e., in the \"Notifcations\" tab of \"My Profile Settings\") will override this endpoint's default behavior of setting \"Tasks added\" notifications to `false`. Returns the updated project record. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.add_members_for_project_with_http_info(body, project_gid, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param ProjectGidAddMembersBody body: Information about the members being added. (required) + :param str project_gid: Globally unique identifier for the project. (required) + :param list[str] opt_fields: This endpoint returns a compact resource, which excludes some properties by default. To include those optional properties, set this query parameter to a comma-separated list of the properties you wish to include. + :return: ProjectResponseData + If the method is called asynchronously, + returns the request thread. + """ + + all_params = ['body', 'project_gid', 'opt_fields'] # noqa: E501 + all_params.append('async_req') + all_params.append('header_params') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + params = locals() + for key, val in six.iteritems(params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method add_members_for_project" % key + ) + params[key] = val + del params['kwargs'] + # verify the required parameter 'body' is set + if ('body' not in params or + params['body'] is None): + raise ValueError("Missing the required parameter `body` when calling `add_members_for_project`") # noqa: E501 + # verify the required parameter 'project_gid' is set + if ('project_gid' not in params or + params['project_gid'] is None): + raise ValueError("Missing the required parameter `project_gid` when calling `add_members_for_project`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'project_gid' in params: + path_params['project_gid'] = params['project_gid'] # noqa: E501 + + query_params = [] + if 'opt_fields' in params: + query_params.append(('opt_fields', params['opt_fields'])) # noqa: E501 + collection_formats['opt_fields'] = 'csv' # noqa: E501 + + header_params = kwargs.get("header_params", {}) + + form_params = [] + local_var_files = {} + + body_params = None + if 'body' in params: + body_params = params['body'] + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['application/json; charset=UTF-8']) # noqa: E501 + + # HTTP header `Content-Type` + header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 + ['application/json; charset=UTF-8']) # noqa: E501 + + # Authentication setting + auth_settings = ['oauth2'] # noqa: E501 + + return self.api_client.call_api( + '/projects/{project_gid}/addMembers', 'POST', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='ProjectResponseData', # noqa: E501 + auth_settings=auth_settings, + async_req=params.get('async_req'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) + +def create_project(self, body, **kwargs): # noqa: E501 + """Create a project # noqa: E501 + + Create a new project in a workspace or team. Every project is required to be created in a specific workspace or organization, and this cannot be changed once set. Note that you can use the `workspace` parameter regardless of whether or not it is an organization. If the workspace for your project is an organization, you must also supply a `team` to share the project with. Returns the full record of the newly created project. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.create_project(body, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param ProjectsBody body: The project to create. (required) + :param list[str] opt_fields: This endpoint returns a compact resource, which excludes some properties by default. To include those optional properties, set this query parameter to a comma-separated list of the properties you wish to include. + :return: ProjectResponseData + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = kwargs.get("_return_http_data_only", True) + if kwargs.get('async_req'): + return self.create_project_with_http_info(body, **kwargs) # noqa: E501 + else: + (data) = self.create_project_with_http_info(body, **kwargs) # noqa: E501 + return data + +def create_project_with_http_info(self, body, **kwargs): # noqa: E501 + """Create a project # noqa: E501 + + Create a new project in a workspace or team. Every project is required to be created in a specific workspace or organization, and this cannot be changed once set. Note that you can use the `workspace` parameter regardless of whether or not it is an organization. If the workspace for your project is an organization, you must also supply a `team` to share the project with. Returns the full record of the newly created project. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.create_project_with_http_info(body, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param ProjectsBody body: The project to create. (required) + :param list[str] opt_fields: This endpoint returns a compact resource, which excludes some properties by default. To include those optional properties, set this query parameter to a comma-separated list of the properties you wish to include. + :return: ProjectResponseData + If the method is called asynchronously, + returns the request thread. + """ + + all_params = ['body', 'opt_fields'] # noqa: E501 + all_params.append('async_req') + all_params.append('header_params') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + params = locals() + for key, val in six.iteritems(params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method create_project" % key + ) + params[key] = val + del params['kwargs'] + # verify the required parameter 'body' is set + if ('body' not in params or + params['body'] is None): + raise ValueError("Missing the required parameter `body` when calling `create_project`") # noqa: E501 + + collection_formats = {} + + path_params = {} + + query_params = [] + if 'opt_fields' in params: + query_params.append(('opt_fields', params['opt_fields'])) # noqa: E501 + collection_formats['opt_fields'] = 'csv' # noqa: E501 + + header_params = kwargs.get("header_params", {}) + + form_params = [] + local_var_files = {} + + body_params = None + if 'body' in params: + body_params = params['body'] + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['application/json; charset=UTF-8']) # noqa: E501 + + # HTTP header `Content-Type` + header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 + ['application/json; charset=UTF-8']) # noqa: E501 + + # Authentication setting + auth_settings = ['oauth2'] # noqa: E501 + + return self.api_client.call_api( + '/projects', 'POST', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='ProjectResponseData', # noqa: E501 + auth_settings=auth_settings, + async_req=params.get('async_req'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) + +def create_project_for_team(self, body, team_gid, **kwargs): # noqa: E501 + """Create a project in a team # noqa: E501 + + Creates a project shared with the given team. Returns the full record of the newly created project. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.create_project_for_team(body, team_gid, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param TeamGidProjectsBody body: The new project to create. (required) + :param str team_gid: Globally unique identifier for the team. (required) + :param list[str] opt_fields: This endpoint returns a compact resource, which excludes some properties by default. To include those optional properties, set this query parameter to a comma-separated list of the properties you wish to include. + :return: ProjectResponseData + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = kwargs.get("_return_http_data_only", True) + if kwargs.get('async_req'): + return self.create_project_for_team_with_http_info(body, team_gid, **kwargs) # noqa: E501 + else: + (data) = self.create_project_for_team_with_http_info(body, team_gid, **kwargs) # noqa: E501 + return data + +def create_project_for_team_with_http_info(self, body, team_gid, **kwargs): # noqa: E501 + """Create a project in a team # noqa: E501 + + Creates a project shared with the given team. Returns the full record of the newly created project. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.create_project_for_team_with_http_info(body, team_gid, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param TeamGidProjectsBody body: The new project to create. (required) + :param str team_gid: Globally unique identifier for the team. (required) + :param list[str] opt_fields: This endpoint returns a compact resource, which excludes some properties by default. To include those optional properties, set this query parameter to a comma-separated list of the properties you wish to include. + :return: ProjectResponseData + If the method is called asynchronously, + returns the request thread. + """ + + all_params = ['body', 'team_gid', 'opt_fields'] # noqa: E501 + all_params.append('async_req') + all_params.append('header_params') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + params = locals() + for key, val in six.iteritems(params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method create_project_for_team" % key + ) + params[key] = val + del params['kwargs'] + # verify the required parameter 'body' is set + if ('body' not in params or + params['body'] is None): + raise ValueError("Missing the required parameter `body` when calling `create_project_for_team`") # noqa: E501 + # verify the required parameter 'team_gid' is set + if ('team_gid' not in params or + params['team_gid'] is None): + raise ValueError("Missing the required parameter `team_gid` when calling `create_project_for_team`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'team_gid' in params: + path_params['team_gid'] = params['team_gid'] # noqa: E501 + + query_params = [] + if 'opt_fields' in params: + query_params.append(('opt_fields', params['opt_fields'])) # noqa: E501 + collection_formats['opt_fields'] = 'csv' # noqa: E501 + + header_params = kwargs.get("header_params", {}) + + form_params = [] + local_var_files = {} + + body_params = None + if 'body' in params: + body_params = params['body'] + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['application/json; charset=UTF-8']) # noqa: E501 + + # HTTP header `Content-Type` + header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 + ['application/json; charset=UTF-8']) # noqa: E501 + + # Authentication setting + auth_settings = ['oauth2'] # noqa: E501 + + return self.api_client.call_api( + '/teams/{team_gid}/projects', 'POST', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='ProjectResponseData', # noqa: E501 + auth_settings=auth_settings, + async_req=params.get('async_req'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) + +def create_project_for_workspace(self, body, workspace_gid, **kwargs): # noqa: E501 + """Create a project in a workspace # noqa: E501 + + Creates a project in the workspace. If the workspace for your project is an organization, you must also supply a team to share the project with. Returns the full record of the newly created project. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.create_project_for_workspace(body, workspace_gid, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param WorkspaceGidProjectsBody body: The new project to create. (required) + :param str workspace_gid: Globally unique identifier for the workspace or organization. (required) + :param list[str] opt_fields: This endpoint returns a compact resource, which excludes some properties by default. To include those optional properties, set this query parameter to a comma-separated list of the properties you wish to include. + :return: ProjectResponseData + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = kwargs.get("_return_http_data_only", True) + if kwargs.get('async_req'): + return self.create_project_for_workspace_with_http_info(body, workspace_gid, **kwargs) # noqa: E501 + else: + (data) = self.create_project_for_workspace_with_http_info(body, workspace_gid, **kwargs) # noqa: E501 + return data + +def create_project_for_workspace_with_http_info(self, body, workspace_gid, **kwargs): # noqa: E501 + """Create a project in a workspace # noqa: E501 + + Creates a project in the workspace. If the workspace for your project is an organization, you must also supply a team to share the project with. Returns the full record of the newly created project. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.create_project_for_workspace_with_http_info(body, workspace_gid, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param WorkspaceGidProjectsBody body: The new project to create. (required) + :param str workspace_gid: Globally unique identifier for the workspace or organization. (required) + :param list[str] opt_fields: This endpoint returns a compact resource, which excludes some properties by default. To include those optional properties, set this query parameter to a comma-separated list of the properties you wish to include. + :return: ProjectResponseData + If the method is called asynchronously, + returns the request thread. + """ + + all_params = ['body', 'workspace_gid', 'opt_fields'] # noqa: E501 + all_params.append('async_req') + all_params.append('header_params') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + params = locals() + for key, val in six.iteritems(params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method create_project_for_workspace" % key + ) + params[key] = val + del params['kwargs'] + # verify the required parameter 'body' is set + if ('body' not in params or + params['body'] is None): + raise ValueError("Missing the required parameter `body` when calling `create_project_for_workspace`") # noqa: E501 + # verify the required parameter 'workspace_gid' is set + if ('workspace_gid' not in params or + params['workspace_gid'] is None): + raise ValueError("Missing the required parameter `workspace_gid` when calling `create_project_for_workspace`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'workspace_gid' in params: + path_params['workspace_gid'] = params['workspace_gid'] # noqa: E501 + + query_params = [] + if 'opt_fields' in params: + query_params.append(('opt_fields', params['opt_fields'])) # noqa: E501 + collection_formats['opt_fields'] = 'csv' # noqa: E501 + + header_params = kwargs.get("header_params", {}) + + form_params = [] + local_var_files = {} + + body_params = None + if 'body' in params: + body_params = params['body'] + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['application/json; charset=UTF-8']) # noqa: E501 + + # HTTP header `Content-Type` + header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 + ['application/json; charset=UTF-8']) # noqa: E501 + + # Authentication setting + auth_settings = ['oauth2'] # noqa: E501 + + return self.api_client.call_api( + '/workspaces/{workspace_gid}/projects', 'POST', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='ProjectResponseData', # noqa: E501 + auth_settings=auth_settings, + async_req=params.get('async_req'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) + +def delete_project(self, project_gid, **kwargs): # noqa: E501 + """Delete a project # noqa: E501 + + A specific, existing project can be deleted by making a DELETE request on the URL for that project. Returns an empty data record. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.delete_project(project_gid, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str project_gid: Globally unique identifier for the project. (required) + :return: EmptyResponseData + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = kwargs.get("_return_http_data_only", True) + if kwargs.get('async_req'): + return self.delete_project_with_http_info(project_gid, **kwargs) # noqa: E501 + else: + (data) = self.delete_project_with_http_info(project_gid, **kwargs) # noqa: E501 + return data + +def delete_project_with_http_info(self, project_gid, **kwargs): # noqa: E501 + """Delete a project # noqa: E501 + + A specific, existing project can be deleted by making a DELETE request on the URL for that project. Returns an empty data record. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.delete_project_with_http_info(project_gid, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str project_gid: Globally unique identifier for the project. (required) + :return: EmptyResponseData + If the method is called asynchronously, + returns the request thread. + """ + + all_params = ['project_gid'] # noqa: E501 + all_params.append('async_req') + all_params.append('header_params') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + params = locals() + for key, val in six.iteritems(params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method delete_project" % key + ) + params[key] = val + del params['kwargs'] + # verify the required parameter 'project_gid' is set + if ('project_gid' not in params or + params['project_gid'] is None): + raise ValueError("Missing the required parameter `project_gid` when calling `delete_project`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'project_gid' in params: + path_params['project_gid'] = params['project_gid'] # noqa: E501 + + query_params = [] + + header_params = kwargs.get("header_params", {}) + + form_params = [] + local_var_files = {} + + body_params = None + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['application/json; charset=UTF-8']) # noqa: E501 + + # Authentication setting + auth_settings = ['oauth2'] # noqa: E501 + + return self.api_client.call_api( + '/projects/{project_gid}', 'DELETE', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='EmptyResponseData', # noqa: E501 + auth_settings=auth_settings, + async_req=params.get('async_req'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) + +def duplicate_project(self, project_gid, **kwargs): # noqa: E501 + """Duplicate a project # noqa: E501 + + Creates and returns a job that will asynchronously handle the duplication. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.duplicate_project(project_gid, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str project_gid: Globally unique identifier for the project. (required) + :param ProjectGidDuplicateBody body: Describes the duplicate's name and the elements that will be duplicated. + :param list[str] opt_fields: This endpoint returns a compact resource, which excludes some properties by default. To include those optional properties, set this query parameter to a comma-separated list of the properties you wish to include. + :return: JobResponseData + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = kwargs.get("_return_http_data_only", True) + if kwargs.get('async_req'): + return self.duplicate_project_with_http_info(project_gid, **kwargs) # noqa: E501 + else: + (data) = self.duplicate_project_with_http_info(project_gid, **kwargs) # noqa: E501 + return data + +def duplicate_project_with_http_info(self, project_gid, **kwargs): # noqa: E501 + """Duplicate a project # noqa: E501 + + Creates and returns a job that will asynchronously handle the duplication. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.duplicate_project_with_http_info(project_gid, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str project_gid: Globally unique identifier for the project. (required) + :param ProjectGidDuplicateBody body: Describes the duplicate's name and the elements that will be duplicated. + :param list[str] opt_fields: This endpoint returns a compact resource, which excludes some properties by default. To include those optional properties, set this query parameter to a comma-separated list of the properties you wish to include. + :return: JobResponseData + If the method is called asynchronously, + returns the request thread. + """ + + all_params = ['project_gid', 'body', 'opt_fields'] # noqa: E501 + all_params.append('async_req') + all_params.append('header_params') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + params = locals() + for key, val in six.iteritems(params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method duplicate_project" % key + ) + params[key] = val + del params['kwargs'] + # verify the required parameter 'project_gid' is set + if ('project_gid' not in params or + params['project_gid'] is None): + raise ValueError("Missing the required parameter `project_gid` when calling `duplicate_project`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'project_gid' in params: + path_params['project_gid'] = params['project_gid'] # noqa: E501 + + query_params = [] + if 'opt_fields' in params: + query_params.append(('opt_fields', params['opt_fields'])) # noqa: E501 + collection_formats['opt_fields'] = 'csv' # noqa: E501 + + header_params = kwargs.get("header_params", {}) + + form_params = [] + local_var_files = {} + + body_params = None + if 'body' in params: + body_params = params['body'] + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['application/json; charset=UTF-8']) # noqa: E501 + + # HTTP header `Content-Type` + header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 + ['application/json; charset=UTF-8']) # noqa: E501 + + # Authentication setting + auth_settings = ['oauth2'] # noqa: E501 + + return self.api_client.call_api( + '/projects/{project_gid}/duplicate', 'POST', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='JobResponseData', # noqa: E501 + auth_settings=auth_settings, + async_req=params.get('async_req'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) + +def get_project(self, project_gid, **kwargs): # noqa: E501 + """Get a project # noqa: E501 + + Returns the complete project record for a single project. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.get_project(project_gid, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str project_gid: Globally unique identifier for the project. (required) + :param list[str] opt_fields: This endpoint returns a compact resource, which excludes some properties by default. To include those optional properties, set this query parameter to a comma-separated list of the properties you wish to include. + :return: ProjectResponseData + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = kwargs.get("_return_http_data_only", True) + if kwargs.get('async_req'): + return self.get_project_with_http_info(project_gid, **kwargs) # noqa: E501 + else: + (data) = self.get_project_with_http_info(project_gid, **kwargs) # noqa: E501 + return data + +def get_project_with_http_info(self, project_gid, **kwargs): # noqa: E501 + """Get a project # noqa: E501 + + Returns the complete project record for a single project. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.get_project_with_http_info(project_gid, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str project_gid: Globally unique identifier for the project. (required) + :param list[str] opt_fields: This endpoint returns a compact resource, which excludes some properties by default. To include those optional properties, set this query parameter to a comma-separated list of the properties you wish to include. + :return: ProjectResponseData + If the method is called asynchronously, + returns the request thread. + """ + + all_params = ['project_gid', 'opt_fields'] # noqa: E501 + all_params.append('async_req') + all_params.append('header_params') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + params = locals() + for key, val in six.iteritems(params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method get_project" % key + ) + params[key] = val + del params['kwargs'] + # verify the required parameter 'project_gid' is set + if ('project_gid' not in params or + params['project_gid'] is None): + raise ValueError("Missing the required parameter `project_gid` when calling `get_project`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'project_gid' in params: + path_params['project_gid'] = params['project_gid'] # noqa: E501 + + query_params = [] + if 'opt_fields' in params: + query_params.append(('opt_fields', params['opt_fields'])) # noqa: E501 + collection_formats['opt_fields'] = 'csv' # noqa: E501 + + header_params = kwargs.get("header_params", {}) + + form_params = [] + local_var_files = {} + + body_params = None + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['application/json; charset=UTF-8']) # noqa: E501 + + # Authentication setting + auth_settings = ['oauth2'] # noqa: E501 + + return self.api_client.call_api( + '/projects/{project_gid}', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='ProjectResponseData', # noqa: E501 + auth_settings=auth_settings, + async_req=params.get('async_req'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) + +def get_projects(self, **kwargs): # noqa: E501 + """Get multiple projects # noqa: E501 + + Returns the compact project records for some filtered set of projects. Use one or more of the parameters provided to filter the projects returned. *Note: This endpoint may timeout for large domains. Try filtering by team!* # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.get_projects(async_req=True) + >>> result = thread.get() + + :param async_req bool + :param int limit: Results per page. The number of objects to return per page. The value must be between 1 and 100. + :param str offset: 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 str workspace: The workspace or organization to filter projects on. + :param str team: The team to filter projects on. + :param bool archived: Only return projects whose `archived` field takes on the value of this parameter. + :param list[str] opt_fields: This endpoint returns a compact resource, which excludes some properties by default. To include those optional properties, set this query parameter to a comma-separated list of the properties you wish to include. + :return: ProjectResponseArray + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = kwargs.get("_return_http_data_only", True) + if kwargs.get('async_req'): + return self.get_projects_with_http_info(**kwargs) # noqa: E501 + else: + (data) = self.get_projects_with_http_info(**kwargs) # noqa: E501 + return data + +def get_projects_with_http_info(self, **kwargs): # noqa: E501 + """Get multiple projects # noqa: E501 + + Returns the compact project records for some filtered set of projects. Use one or more of the parameters provided to filter the projects returned. *Note: This endpoint may timeout for large domains. Try filtering by team!* # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.get_projects_with_http_info(async_req=True) + >>> result = thread.get() + + :param async_req bool + :param int limit: Results per page. The number of objects to return per page. The value must be between 1 and 100. + :param str offset: 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 str workspace: The workspace or organization to filter projects on. + :param str team: The team to filter projects on. + :param bool archived: Only return projects whose `archived` field takes on the value of this parameter. + :param list[str] opt_fields: This endpoint returns a compact resource, which excludes some properties by default. To include those optional properties, set this query parameter to a comma-separated list of the properties you wish to include. + :return: ProjectResponseArray + If the method is called asynchronously, + returns the request thread. + """ + + all_params = ['limit', 'offset', 'workspace', 'team', 'archived', 'opt_fields'] # noqa: E501 + all_params.append('async_req') + all_params.append('header_params') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + params = locals() + for key, val in six.iteritems(params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method get_projects" % key + ) + params[key] = val + del params['kwargs'] + + collection_formats = {} + + path_params = {} + + query_params = [] + if 'limit' in params: + query_params.append(('limit', params['limit'])) # noqa: E501 + if 'offset' in params: + query_params.append(('offset', params['offset'])) # noqa: E501 + if 'workspace' in params: + query_params.append(('workspace', params['workspace'])) # noqa: E501 + if 'team' in params: + query_params.append(('team', params['team'])) # noqa: E501 + if 'archived' in params: + query_params.append(('archived', params['archived'])) # noqa: E501 + if 'opt_fields' in params: + query_params.append(('opt_fields', params['opt_fields'])) # noqa: E501 + collection_formats['opt_fields'] = 'csv' # noqa: E501 + + header_params = kwargs.get("header_params", {}) + + form_params = [] + local_var_files = {} + + body_params = None + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['application/json; charset=UTF-8']) # noqa: E501 + + # Authentication setting + auth_settings = ['oauth2'] # noqa: E501 + + return self.api_client.call_api( + '/projects', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='ProjectResponseArray', # noqa: E501 + auth_settings=auth_settings, + async_req=params.get('async_req'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) + +def get_projects_for_task(self, task_gid, **kwargs): # noqa: E501 + """Get projects a task is in # noqa: E501 + + Returns a compact representation of all of the projects the task is in. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.get_projects_for_task(task_gid, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str task_gid: The task to operate on. (required) + :param int limit: Results per page. The number of objects to return per page. The value must be between 1 and 100. + :param str offset: 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 list[str] opt_fields: This endpoint returns a compact resource, which excludes some properties by default. To include those optional properties, set this query parameter to a comma-separated list of the properties you wish to include. + :return: ProjectResponseArray + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = kwargs.get("_return_http_data_only", True) + if kwargs.get('async_req'): + return self.get_projects_for_task_with_http_info(task_gid, **kwargs) # noqa: E501 + else: + (data) = self.get_projects_for_task_with_http_info(task_gid, **kwargs) # noqa: E501 + return data + +def get_projects_for_task_with_http_info(self, task_gid, **kwargs): # noqa: E501 + """Get projects a task is in # noqa: E501 + + Returns a compact representation of all of the projects the task is in. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.get_projects_for_task_with_http_info(task_gid, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str task_gid: The task to operate on. (required) + :param int limit: Results per page. The number of objects to return per page. The value must be between 1 and 100. + :param str offset: 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 list[str] opt_fields: This endpoint returns a compact resource, which excludes some properties by default. To include those optional properties, set this query parameter to a comma-separated list of the properties you wish to include. + :return: ProjectResponseArray + If the method is called asynchronously, + returns the request thread. + """ + + all_params = ['task_gid', 'limit', 'offset', 'opt_fields'] # noqa: E501 + all_params.append('async_req') + all_params.append('header_params') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + params = locals() + for key, val in six.iteritems(params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method get_projects_for_task" % key + ) + params[key] = val + del params['kwargs'] + # verify the required parameter 'task_gid' is set + if ('task_gid' not in params or + params['task_gid'] is None): + raise ValueError("Missing the required parameter `task_gid` when calling `get_projects_for_task`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'task_gid' in params: + path_params['task_gid'] = params['task_gid'] # noqa: E501 + + query_params = [] + if 'limit' in params: + query_params.append(('limit', params['limit'])) # noqa: E501 + if 'offset' in params: + query_params.append(('offset', params['offset'])) # noqa: E501 + if 'opt_fields' in params: + query_params.append(('opt_fields', params['opt_fields'])) # noqa: E501 + collection_formats['opt_fields'] = 'csv' # noqa: E501 + + header_params = kwargs.get("header_params", {}) + + form_params = [] + local_var_files = {} + + body_params = None + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['application/json; charset=UTF-8']) # noqa: E501 + + # Authentication setting + auth_settings = ['oauth2'] # noqa: E501 + + return self.api_client.call_api( + '/tasks/{task_gid}/projects', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='ProjectResponseArray', # noqa: E501 + auth_settings=auth_settings, + async_req=params.get('async_req'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) + +def get_projects_for_team(self, team_gid, **kwargs): # noqa: E501 + """Get a team's projects # noqa: E501 + + Returns the compact project records for all projects in the team. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.get_projects_for_team(team_gid, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str team_gid: Globally unique identifier for the team. (required) + :param int limit: Results per page. The number of objects to return per page. The value must be between 1 and 100. + :param str offset: 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 bool archived: Only return projects whose `archived` field takes on the value of this parameter. + :param list[str] opt_fields: This endpoint returns a compact resource, which excludes some properties by default. To include those optional properties, set this query parameter to a comma-separated list of the properties you wish to include. + :return: ProjectResponseArray + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = kwargs.get("_return_http_data_only", True) + if kwargs.get('async_req'): + return self.get_projects_for_team_with_http_info(team_gid, **kwargs) # noqa: E501 + else: + (data) = self.get_projects_for_team_with_http_info(team_gid, **kwargs) # noqa: E501 + return data + +def get_projects_for_team_with_http_info(self, team_gid, **kwargs): # noqa: E501 + """Get a team's projects # noqa: E501 + + Returns the compact project records for all projects in the team. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.get_projects_for_team_with_http_info(team_gid, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str team_gid: Globally unique identifier for the team. (required) + :param int limit: Results per page. The number of objects to return per page. The value must be between 1 and 100. + :param str offset: 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 bool archived: Only return projects whose `archived` field takes on the value of this parameter. + :param list[str] opt_fields: This endpoint returns a compact resource, which excludes some properties by default. To include those optional properties, set this query parameter to a comma-separated list of the properties you wish to include. + :return: ProjectResponseArray + If the method is called asynchronously, + returns the request thread. + """ + + all_params = ['team_gid', 'limit', 'offset', 'archived', 'opt_fields'] # noqa: E501 + all_params.append('async_req') + all_params.append('header_params') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + params = locals() + for key, val in six.iteritems(params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method get_projects_for_team" % key + ) + params[key] = val + del params['kwargs'] + # verify the required parameter 'team_gid' is set + if ('team_gid' not in params or + params['team_gid'] is None): + raise ValueError("Missing the required parameter `team_gid` when calling `get_projects_for_team`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'team_gid' in params: + path_params['team_gid'] = params['team_gid'] # noqa: E501 + + query_params = [] + if 'limit' in params: + query_params.append(('limit', params['limit'])) # noqa: E501 + if 'offset' in params: + query_params.append(('offset', params['offset'])) # noqa: E501 + if 'archived' in params: + query_params.append(('archived', params['archived'])) # noqa: E501 + if 'opt_fields' in params: + query_params.append(('opt_fields', params['opt_fields'])) # noqa: E501 + collection_formats['opt_fields'] = 'csv' # noqa: E501 + + header_params = kwargs.get("header_params", {}) + + form_params = [] + local_var_files = {} + + body_params = None + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['application/json; charset=UTF-8']) # noqa: E501 + + # Authentication setting + auth_settings = ['oauth2'] # noqa: E501 + + return self.api_client.call_api( + '/teams/{team_gid}/projects', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='ProjectResponseArray', # noqa: E501 + auth_settings=auth_settings, + async_req=params.get('async_req'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) + +def get_projects_for_workspace(self, workspace_gid, **kwargs): # noqa: E501 + """Get all projects in a workspace # noqa: E501 + + Returns the compact project records for all projects in the workspace. *Note: This endpoint may timeout for large domains. Prefer the `/teams/{team_gid}/projects` endpoint.* # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.get_projects_for_workspace(workspace_gid, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str workspace_gid: Globally unique identifier for the workspace or organization. (required) + :param int limit: Results per page. The number of objects to return per page. The value must be between 1 and 100. + :param str offset: 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 bool archived: Only return projects whose `archived` field takes on the value of this parameter. + :param list[str] opt_fields: This endpoint returns a compact resource, which excludes some properties by default. To include those optional properties, set this query parameter to a comma-separated list of the properties you wish to include. + :return: ProjectResponseArray + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = kwargs.get("_return_http_data_only", True) + if kwargs.get('async_req'): + return self.get_projects_for_workspace_with_http_info(workspace_gid, **kwargs) # noqa: E501 + else: + (data) = self.get_projects_for_workspace_with_http_info(workspace_gid, **kwargs) # noqa: E501 + return data + +def get_projects_for_workspace_with_http_info(self, workspace_gid, **kwargs): # noqa: E501 + """Get all projects in a workspace # noqa: E501 + + Returns the compact project records for all projects in the workspace. *Note: This endpoint may timeout for large domains. Prefer the `/teams/{team_gid}/projects` endpoint.* # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.get_projects_for_workspace_with_http_info(workspace_gid, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str workspace_gid: Globally unique identifier for the workspace or organization. (required) + :param int limit: Results per page. The number of objects to return per page. The value must be between 1 and 100. + :param str offset: 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 bool archived: Only return projects whose `archived` field takes on the value of this parameter. + :param list[str] opt_fields: This endpoint returns a compact resource, which excludes some properties by default. To include those optional properties, set this query parameter to a comma-separated list of the properties you wish to include. + :return: ProjectResponseArray + If the method is called asynchronously, + returns the request thread. + """ + + all_params = ['workspace_gid', 'limit', 'offset', 'archived', 'opt_fields'] # noqa: E501 + all_params.append('async_req') + all_params.append('header_params') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + params = locals() + for key, val in six.iteritems(params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method get_projects_for_workspace" % key + ) + params[key] = val + del params['kwargs'] + # verify the required parameter 'workspace_gid' is set + if ('workspace_gid' not in params or + params['workspace_gid'] is None): + raise ValueError("Missing the required parameter `workspace_gid` when calling `get_projects_for_workspace`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'workspace_gid' in params: + path_params['workspace_gid'] = params['workspace_gid'] # noqa: E501 + + query_params = [] + if 'limit' in params: + query_params.append(('limit', params['limit'])) # noqa: E501 + if 'offset' in params: + query_params.append(('offset', params['offset'])) # noqa: E501 + if 'archived' in params: + query_params.append(('archived', params['archived'])) # noqa: E501 + if 'opt_fields' in params: + query_params.append(('opt_fields', params['opt_fields'])) # noqa: E501 + collection_formats['opt_fields'] = 'csv' # noqa: E501 + + header_params = kwargs.get("header_params", {}) + + form_params = [] + local_var_files = {} + + body_params = None + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['application/json; charset=UTF-8']) # noqa: E501 + + # Authentication setting + auth_settings = ['oauth2'] # noqa: E501 + + return self.api_client.call_api( + '/workspaces/{workspace_gid}/projects', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='ProjectResponseArray', # noqa: E501 + auth_settings=auth_settings, + async_req=params.get('async_req'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) + +def get_task_counts_for_project(self, project_gid, **kwargs): # noqa: E501 + """Get task count of a project # noqa: E501 + + Get an object that holds task count fields. **All fields are excluded by default**. You must [opt in](/docs/inputoutput-options) using `opt_fields` to get any information from this endpoint. This endpoint has an additional [rate limit](/docs/rate-limits) and each field counts especially high against our [cost limits](/docs/rate-limits#cost-limits). Milestones are just tasks, so they are included in the `num_tasks`, `num_incomplete_tasks`, and `num_completed_tasks` counts. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.get_task_counts_for_project(project_gid, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str project_gid: Globally unique identifier for the project. (required) + :param list[str] opt_fields: This endpoint returns a compact resource, which excludes some properties by default. To include those optional properties, set this query parameter to a comma-separated list of the properties you wish to include. + :return: TaskCountResponseData + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = kwargs.get("_return_http_data_only", True) + if kwargs.get('async_req'): + return self.get_task_counts_for_project_with_http_info(project_gid, **kwargs) # noqa: E501 + else: + (data) = self.get_task_counts_for_project_with_http_info(project_gid, **kwargs) # noqa: E501 + return data + +def get_task_counts_for_project_with_http_info(self, project_gid, **kwargs): # noqa: E501 + """Get task count of a project # noqa: E501 + + Get an object that holds task count fields. **All fields are excluded by default**. You must [opt in](/docs/inputoutput-options) using `opt_fields` to get any information from this endpoint. This endpoint has an additional [rate limit](/docs/rate-limits) and each field counts especially high against our [cost limits](/docs/rate-limits#cost-limits). Milestones are just tasks, so they are included in the `num_tasks`, `num_incomplete_tasks`, and `num_completed_tasks` counts. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.get_task_counts_for_project_with_http_info(project_gid, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str project_gid: Globally unique identifier for the project. (required) + :param list[str] opt_fields: This endpoint returns a compact resource, which excludes some properties by default. To include those optional properties, set this query parameter to a comma-separated list of the properties you wish to include. + :return: TaskCountResponseData + If the method is called asynchronously, + returns the request thread. + """ + + all_params = ['project_gid', 'opt_fields'] # noqa: E501 + all_params.append('async_req') + all_params.append('header_params') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + params = locals() + for key, val in six.iteritems(params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method get_task_counts_for_project" % key + ) + params[key] = val + del params['kwargs'] + # verify the required parameter 'project_gid' is set + if ('project_gid' not in params or + params['project_gid'] is None): + raise ValueError("Missing the required parameter `project_gid` when calling `get_task_counts_for_project`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'project_gid' in params: + path_params['project_gid'] = params['project_gid'] # noqa: E501 + + query_params = [] + if 'opt_fields' in params: + query_params.append(('opt_fields', params['opt_fields'])) # noqa: E501 + collection_formats['opt_fields'] = 'csv' # noqa: E501 + + header_params = kwargs.get("header_params", {}) + + form_params = [] + local_var_files = {} + + body_params = None + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['application/json; charset=UTF-8']) # noqa: E501 + + # Authentication setting + auth_settings = ['oauth2'] # noqa: E501 + + return self.api_client.call_api( + '/projects/{project_gid}/task_counts', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='TaskCountResponseData', # noqa: E501 + auth_settings=auth_settings, + async_req=params.get('async_req'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) + +def project_save_as_template(self, body, project_gid, **kwargs): # noqa: E501 + """Create a project template from a project # noqa: E501 + + Creates and returns a job that will asynchronously handle the project template creation. Note that while the resulting project template can be accessed with the API, it won't be visible in the Asana UI until Project Templates 2.0 is launched in the app. See more in [this forum post](https://forum.asana.com/t/a-new-api-for-project-templates/156432). # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.project_save_as_template(body, project_gid, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param ProjectGidSaveAsTemplateBody body: Describes the inputs used for creating a project template, such as the resulting project template's name, which team it should be created in. (required) + :param str project_gid: Globally unique identifier for the project. (required) + :param list[str] opt_fields: This endpoint returns a compact resource, which excludes some properties by default. To include those optional properties, set this query parameter to a comma-separated list of the properties you wish to include. + :return: JobResponseData + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = kwargs.get("_return_http_data_only", True) + if kwargs.get('async_req'): + return self.project_save_as_template_with_http_info(body, project_gid, **kwargs) # noqa: E501 + else: + (data) = self.project_save_as_template_with_http_info(body, project_gid, **kwargs) # noqa: E501 + return data + +def project_save_as_template_with_http_info(self, body, project_gid, **kwargs): # noqa: E501 + """Create a project template from a project # noqa: E501 + + Creates and returns a job that will asynchronously handle the project template creation. Note that while the resulting project template can be accessed with the API, it won't be visible in the Asana UI until Project Templates 2.0 is launched in the app. See more in [this forum post](https://forum.asana.com/t/a-new-api-for-project-templates/156432). # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.project_save_as_template_with_http_info(body, project_gid, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param ProjectGidSaveAsTemplateBody body: Describes the inputs used for creating a project template, such as the resulting project template's name, which team it should be created in. (required) + :param str project_gid: Globally unique identifier for the project. (required) + :param list[str] opt_fields: This endpoint returns a compact resource, which excludes some properties by default. To include those optional properties, set this query parameter to a comma-separated list of the properties you wish to include. + :return: JobResponseData + If the method is called asynchronously, + returns the request thread. + """ + + all_params = ['body', 'project_gid', 'opt_fields'] # noqa: E501 + all_params.append('async_req') + all_params.append('header_params') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + params = locals() + for key, val in six.iteritems(params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method project_save_as_template" % key + ) + params[key] = val + del params['kwargs'] + # verify the required parameter 'body' is set + if ('body' not in params or + params['body'] is None): + raise ValueError("Missing the required parameter `body` when calling `project_save_as_template`") # noqa: E501 + # verify the required parameter 'project_gid' is set + if ('project_gid' not in params or + params['project_gid'] is None): + raise ValueError("Missing the required parameter `project_gid` when calling `project_save_as_template`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'project_gid' in params: + path_params['project_gid'] = params['project_gid'] # noqa: E501 + + query_params = [] + if 'opt_fields' in params: + query_params.append(('opt_fields', params['opt_fields'])) # noqa: E501 + collection_formats['opt_fields'] = 'csv' # noqa: E501 + + header_params = kwargs.get("header_params", {}) + + form_params = [] + local_var_files = {} + + body_params = None + if 'body' in params: + body_params = params['body'] + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['application/json; charset=UTF-8']) # noqa: E501 + + # HTTP header `Content-Type` + header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 + ['application/json; charset=UTF-8']) # noqa: E501 + + # Authentication setting + auth_settings = ['oauth2'] # noqa: E501 + + return self.api_client.call_api( + '/projects/{project_gid}/saveAsTemplate', 'POST', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='JobResponseData', # noqa: E501 + auth_settings=auth_settings, + async_req=params.get('async_req'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) + +def remove_custom_field_setting_for_project(self, body, project_gid, **kwargs): # noqa: E501 + """Remove a custom field from a project # noqa: E501 + + Removes a custom field setting from a project. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.remove_custom_field_setting_for_project(body, project_gid, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param ProjectGidRemoveCustomFieldSettingBody body: Information about the custom field setting being removed. (required) + :param str project_gid: Globally unique identifier for the project. (required) + :return: EmptyResponseData + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = kwargs.get("_return_http_data_only", True) + if kwargs.get('async_req'): + return self.remove_custom_field_setting_for_project_with_http_info(body, project_gid, **kwargs) # noqa: E501 + else: + (data) = self.remove_custom_field_setting_for_project_with_http_info(body, project_gid, **kwargs) # noqa: E501 + return data + +def remove_custom_field_setting_for_project_with_http_info(self, body, project_gid, **kwargs): # noqa: E501 + """Remove a custom field from a project # noqa: E501 + + Removes a custom field setting from a project. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.remove_custom_field_setting_for_project_with_http_info(body, project_gid, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param ProjectGidRemoveCustomFieldSettingBody body: Information about the custom field setting being removed. (required) + :param str project_gid: Globally unique identifier for the project. (required) + :return: EmptyResponseData + If the method is called asynchronously, + returns the request thread. + """ + + all_params = ['body', 'project_gid'] # noqa: E501 + all_params.append('async_req') + all_params.append('header_params') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + params = locals() + for key, val in six.iteritems(params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method remove_custom_field_setting_for_project" % key + ) + params[key] = val + del params['kwargs'] + # verify the required parameter 'body' is set + if ('body' not in params or + params['body'] is None): + raise ValueError("Missing the required parameter `body` when calling `remove_custom_field_setting_for_project`") # noqa: E501 + # verify the required parameter 'project_gid' is set + if ('project_gid' not in params or + params['project_gid'] is None): + raise ValueError("Missing the required parameter `project_gid` when calling `remove_custom_field_setting_for_project`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'project_gid' in params: + path_params['project_gid'] = params['project_gid'] # noqa: E501 + + query_params = [] + + header_params = kwargs.get("header_params", {}) + + form_params = [] + local_var_files = {} + + body_params = None + if 'body' in params: + body_params = params['body'] + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['application/json; charset=UTF-8']) # noqa: E501 + + # HTTP header `Content-Type` + header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 + ['application/json; charset=UTF-8']) # noqa: E501 + + # Authentication setting + auth_settings = ['oauth2'] # noqa: E501 + + return self.api_client.call_api( + '/projects/{project_gid}/removeCustomFieldSetting', 'POST', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='EmptyResponseData', # noqa: E501 + auth_settings=auth_settings, + async_req=params.get('async_req'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) + +def remove_followers_for_project(self, body, project_gid, **kwargs): # noqa: E501 + """Remove followers from a project # noqa: E501 + + Removes the specified list of users from following the project, this will not affect project membership status. Returns the updated project record. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.remove_followers_for_project(body, project_gid, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param ProjectGidRemoveFollowersBody body: Information about the followers being removed. (required) + :param str project_gid: Globally unique identifier for the project. (required) + :param list[str] opt_fields: This endpoint returns a compact resource, which excludes some properties by default. To include those optional properties, set this query parameter to a comma-separated list of the properties you wish to include. + :return: ProjectResponseData + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = kwargs.get("_return_http_data_only", True) + if kwargs.get('async_req'): + return self.remove_followers_for_project_with_http_info(body, project_gid, **kwargs) # noqa: E501 + else: + (data) = self.remove_followers_for_project_with_http_info(body, project_gid, **kwargs) # noqa: E501 + return data + +def remove_followers_for_project_with_http_info(self, body, project_gid, **kwargs): # noqa: E501 + """Remove followers from a project # noqa: E501 + + Removes the specified list of users from following the project, this will not affect project membership status. Returns the updated project record. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.remove_followers_for_project_with_http_info(body, project_gid, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param ProjectGidRemoveFollowersBody body: Information about the followers being removed. (required) + :param str project_gid: Globally unique identifier for the project. (required) + :param list[str] opt_fields: This endpoint returns a compact resource, which excludes some properties by default. To include those optional properties, set this query parameter to a comma-separated list of the properties you wish to include. + :return: ProjectResponseData + If the method is called asynchronously, + returns the request thread. + """ + + all_params = ['body', 'project_gid', 'opt_fields'] # noqa: E501 + all_params.append('async_req') + all_params.append('header_params') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + params = locals() + for key, val in six.iteritems(params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method remove_followers_for_project" % key + ) + params[key] = val + del params['kwargs'] + # verify the required parameter 'body' is set + if ('body' not in params or + params['body'] is None): + raise ValueError("Missing the required parameter `body` when calling `remove_followers_for_project`") # noqa: E501 + # verify the required parameter 'project_gid' is set + if ('project_gid' not in params or + params['project_gid'] is None): + raise ValueError("Missing the required parameter `project_gid` when calling `remove_followers_for_project`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'project_gid' in params: + path_params['project_gid'] = params['project_gid'] # noqa: E501 + + query_params = [] + if 'opt_fields' in params: + query_params.append(('opt_fields', params['opt_fields'])) # noqa: E501 + collection_formats['opt_fields'] = 'csv' # noqa: E501 + + header_params = kwargs.get("header_params", {}) + + form_params = [] + local_var_files = {} + + body_params = None + if 'body' in params: + body_params = params['body'] + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['application/json; charset=UTF-8']) # noqa: E501 + + # HTTP header `Content-Type` + header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 + ['application/json; charset=UTF-8']) # noqa: E501 + + # Authentication setting + auth_settings = ['oauth2'] # noqa: E501 + + return self.api_client.call_api( + '/projects/{project_gid}/removeFollowers', 'POST', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='ProjectResponseData', # noqa: E501 + auth_settings=auth_settings, + async_req=params.get('async_req'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) + +def remove_members_for_project(self, body, project_gid, **kwargs): # noqa: E501 + """Remove users from a project # noqa: E501 + + Removes the specified list of users from members of the project. Returns the updated project record. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.remove_members_for_project(body, project_gid, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param ProjectGidRemoveMembersBody body: Information about the members being removed. (required) + :param str project_gid: Globally unique identifier for the project. (required) + :param list[str] opt_fields: This endpoint returns a compact resource, which excludes some properties by default. To include those optional properties, set this query parameter to a comma-separated list of the properties you wish to include. + :return: ProjectResponseData + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = kwargs.get("_return_http_data_only", True) + if kwargs.get('async_req'): + return self.remove_members_for_project_with_http_info(body, project_gid, **kwargs) # noqa: E501 + else: + (data) = self.remove_members_for_project_with_http_info(body, project_gid, **kwargs) # noqa: E501 + return data + +def remove_members_for_project_with_http_info(self, body, project_gid, **kwargs): # noqa: E501 + """Remove users from a project # noqa: E501 + + Removes the specified list of users from members of the project. Returns the updated project record. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.remove_members_for_project_with_http_info(body, project_gid, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param ProjectGidRemoveMembersBody body: Information about the members being removed. (required) + :param str project_gid: Globally unique identifier for the project. (required) + :param list[str] opt_fields: This endpoint returns a compact resource, which excludes some properties by default. To include those optional properties, set this query parameter to a comma-separated list of the properties you wish to include. + :return: ProjectResponseData + If the method is called asynchronously, + returns the request thread. + """ + + all_params = ['body', 'project_gid', 'opt_fields'] # noqa: E501 + all_params.append('async_req') + all_params.append('header_params') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + params = locals() + for key, val in six.iteritems(params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method remove_members_for_project" % key + ) + params[key] = val + del params['kwargs'] + # verify the required parameter 'body' is set + if ('body' not in params or + params['body'] is None): + raise ValueError("Missing the required parameter `body` when calling `remove_members_for_project`") # noqa: E501 + # verify the required parameter 'project_gid' is set + if ('project_gid' not in params or + params['project_gid'] is None): + raise ValueError("Missing the required parameter `project_gid` when calling `remove_members_for_project`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'project_gid' in params: + path_params['project_gid'] = params['project_gid'] # noqa: E501 + + query_params = [] + if 'opt_fields' in params: + query_params.append(('opt_fields', params['opt_fields'])) # noqa: E501 + collection_formats['opt_fields'] = 'csv' # noqa: E501 + + header_params = kwargs.get("header_params", {}) + + form_params = [] + local_var_files = {} + + body_params = None + if 'body' in params: + body_params = params['body'] + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['application/json; charset=UTF-8']) # noqa: E501 + + # HTTP header `Content-Type` + header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 + ['application/json; charset=UTF-8']) # noqa: E501 + + # Authentication setting + auth_settings = ['oauth2'] # noqa: E501 + + return self.api_client.call_api( + '/projects/{project_gid}/removeMembers', 'POST', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='ProjectResponseData', # noqa: E501 + auth_settings=auth_settings, + async_req=params.get('async_req'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) + +def update_project(self, body, project_gid, **kwargs): # noqa: E501 + """Update a project # noqa: E501 + + A specific, existing project can be updated by making a PUT request on the URL for that project. Only the fields provided in the `data` block will be updated; any unspecified fields will remain unchanged. When using this method, it is best to specify only those fields you wish to change, or else you may overwrite changes made by another user since you last retrieved the task. Returns the complete updated project record. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.update_project(body, project_gid, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param ProjectsProjectGidBody body: The updated fields for the project. (required) + :param str project_gid: Globally unique identifier for the project. (required) + :param list[str] opt_fields: This endpoint returns a compact resource, which excludes some properties by default. To include those optional properties, set this query parameter to a comma-separated list of the properties you wish to include. + :return: ProjectResponseData + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = kwargs.get("_return_http_data_only", True) + if kwargs.get('async_req'): + return self.update_project_with_http_info(body, project_gid, **kwargs) # noqa: E501 + else: + (data) = self.update_project_with_http_info(body, project_gid, **kwargs) # noqa: E501 + return data + +def update_project_with_http_info(self, body, project_gid, **kwargs): # noqa: E501 + """Update a project # noqa: E501 + + A specific, existing project can be updated by making a PUT request on the URL for that project. Only the fields provided in the `data` block will be updated; any unspecified fields will remain unchanged. When using this method, it is best to specify only those fields you wish to change, or else you may overwrite changes made by another user since you last retrieved the task. Returns the complete updated project record. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.update_project_with_http_info(body, project_gid, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param ProjectsProjectGidBody body: The updated fields for the project. (required) + :param str project_gid: Globally unique identifier for the project. (required) + :param list[str] opt_fields: This endpoint returns a compact resource, which excludes some properties by default. To include those optional properties, set this query parameter to a comma-separated list of the properties you wish to include. + :return: ProjectResponseData + If the method is called asynchronously, + returns the request thread. """ - def __init__(self, api_client=None): - if api_client is None: - api_client = ApiClient() - self.api_client = api_client - - def add_custom_field_setting_for_project(self, body, project_gid, **kwargs): # noqa: E501 - """Add a custom field to a project # noqa: E501 - - Custom fields are associated with projects by way of custom field settings. This method creates a setting for the project. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.add_custom_field_setting_for_project(body, project_gid, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param ProjectGidAddCustomFieldSettingBody body: Information about the custom field setting. (required) - :param str project_gid: Globally unique identifier for the project. (required) - :return: CustomFieldSettingResponseData - If the method is called asynchronously, - returns the request thread. - """ - kwargs['_return_http_data_only'] = True - if kwargs.get('async_req'): - return self.add_custom_field_setting_for_project_with_http_info(body, project_gid, **kwargs) # noqa: E501 - else: - (data) = self.add_custom_field_setting_for_project_with_http_info(body, project_gid, **kwargs) # noqa: E501 - return data - - def add_custom_field_setting_for_project_with_http_info(self, body, project_gid, **kwargs): # noqa: E501 - """Add a custom field to a project # noqa: E501 - - Custom fields are associated with projects by way of custom field settings. This method creates a setting for the project. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.add_custom_field_setting_for_project_with_http_info(body, project_gid, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param ProjectGidAddCustomFieldSettingBody body: Information about the custom field setting. (required) - :param str project_gid: Globally unique identifier for the project. (required) - :return: CustomFieldSettingResponseData - If the method is called asynchronously, - returns the request thread. - """ - - all_params = ['body', 'project_gid'] # noqa: E501 - all_params.append('async_req') - all_params.append('_return_http_data_only') - all_params.append('_preload_content') - all_params.append('_request_timeout') - - params = locals() - for key, val in six.iteritems(params['kwargs']): - if key not in all_params: - raise TypeError( - "Got an unexpected keyword argument '%s'" - " to method add_custom_field_setting_for_project" % key - ) - params[key] = val - del params['kwargs'] - # verify the required parameter 'body' is set - if ('body' not in params or - params['body'] is None): - raise ValueError("Missing the required parameter `body` when calling `add_custom_field_setting_for_project`") # noqa: E501 - # verify the required parameter 'project_gid' is set - if ('project_gid' not in params or - params['project_gid'] is None): - raise ValueError("Missing the required parameter `project_gid` when calling `add_custom_field_setting_for_project`") # noqa: E501 - - collection_formats = {} - - path_params = {} - if 'project_gid' in params: - path_params['project_gid'] = params['project_gid'] # noqa: E501 - - query_params = [] - - header_params = {} - - form_params = [] - local_var_files = {} - - body_params = None - if 'body' in params: - body_params = params['body'] - # HTTP header `Accept` - header_params['Accept'] = self.api_client.select_header_accept( - ['application/json; charset=UTF-8']) # noqa: E501 - - # HTTP header `Content-Type` - header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 - ['application/json; charset=UTF-8']) # noqa: E501 - - # Authentication setting - auth_settings = ['oauth2'] # noqa: E501 - - return self.api_client.call_api( - '/projects/{project_gid}/addCustomFieldSetting', 'POST', - path_params, - query_params, - header_params, - body=body_params, - post_params=form_params, - files=local_var_files, - response_type='CustomFieldSettingResponseData', # noqa: E501 - auth_settings=auth_settings, - async_req=params.get('async_req'), - _return_http_data_only=params.get('_return_http_data_only'), - _preload_content=params.get('_preload_content', True), - _request_timeout=params.get('_request_timeout'), - collection_formats=collection_formats) - - def add_followers_for_project(self, body, project_gid, **kwargs): # noqa: E501 - """Add followers to a project # noqa: E501 - - Adds the specified list of users as followers to the project. Followers are a subset of members who have opted in to receive \"tasks added\" notifications for a project. Therefore, if the users are not already members of the project, they will also become members as a result of this operation. Returns the updated project record. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.add_followers_for_project(body, project_gid, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param ProjectGidAddFollowersBody body: Information about the followers being added. (required) - :param str project_gid: Globally unique identifier for the project. (required) - :param list[str] opt_fields: This endpoint returns a compact resource, which excludes some properties by default. To include those optional properties, set this query parameter to a comma-separated list of the properties you wish to include. - :return: ProjectResponseData - If the method is called asynchronously, - returns the request thread. - """ - kwargs['_return_http_data_only'] = True - if kwargs.get('async_req'): - return self.add_followers_for_project_with_http_info(body, project_gid, **kwargs) # noqa: E501 - else: - (data) = self.add_followers_for_project_with_http_info(body, project_gid, **kwargs) # noqa: E501 - return data - - def add_followers_for_project_with_http_info(self, body, project_gid, **kwargs): # noqa: E501 - """Add followers to a project # noqa: E501 - - Adds the specified list of users as followers to the project. Followers are a subset of members who have opted in to receive \"tasks added\" notifications for a project. Therefore, if the users are not already members of the project, they will also become members as a result of this operation. Returns the updated project record. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.add_followers_for_project_with_http_info(body, project_gid, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param ProjectGidAddFollowersBody body: Information about the followers being added. (required) - :param str project_gid: Globally unique identifier for the project. (required) - :param list[str] opt_fields: This endpoint returns a compact resource, which excludes some properties by default. To include those optional properties, set this query parameter to a comma-separated list of the properties you wish to include. - :return: ProjectResponseData - If the method is called asynchronously, - returns the request thread. - """ - - all_params = ['body', 'project_gid', 'opt_fields'] # noqa: E501 - all_params.append('async_req') - all_params.append('_return_http_data_only') - all_params.append('_preload_content') - all_params.append('_request_timeout') - - params = locals() - for key, val in six.iteritems(params['kwargs']): - if key not in all_params: - raise TypeError( - "Got an unexpected keyword argument '%s'" - " to method add_followers_for_project" % key - ) - params[key] = val - del params['kwargs'] - # verify the required parameter 'body' is set - if ('body' not in params or - params['body'] is None): - raise ValueError("Missing the required parameter `body` when calling `add_followers_for_project`") # noqa: E501 - # verify the required parameter 'project_gid' is set - if ('project_gid' not in params or - params['project_gid'] is None): - raise ValueError("Missing the required parameter `project_gid` when calling `add_followers_for_project`") # noqa: E501 - - collection_formats = {} - - path_params = {} - if 'project_gid' in params: - path_params['project_gid'] = params['project_gid'] # noqa: E501 - - query_params = [] - if 'opt_fields' in params: - query_params.append(('opt_fields', params['opt_fields'])) # noqa: E501 - collection_formats['opt_fields'] = 'csv' # noqa: E501 - - header_params = {} - - form_params = [] - local_var_files = {} - - body_params = None - if 'body' in params: - body_params = params['body'] - # HTTP header `Accept` - header_params['Accept'] = self.api_client.select_header_accept( - ['application/json; charset=UTF-8']) # noqa: E501 - - # HTTP header `Content-Type` - header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 - ['application/json; charset=UTF-8']) # noqa: E501 - - # Authentication setting - auth_settings = ['oauth2'] # noqa: E501 - - return self.api_client.call_api( - '/projects/{project_gid}/addFollowers', 'POST', - path_params, - query_params, - header_params, - body=body_params, - post_params=form_params, - files=local_var_files, - response_type='ProjectResponseData', # noqa: E501 - auth_settings=auth_settings, - async_req=params.get('async_req'), - _return_http_data_only=params.get('_return_http_data_only'), - _preload_content=params.get('_preload_content', True), - _request_timeout=params.get('_request_timeout'), - collection_formats=collection_formats) - - def add_members_for_project(self, body, project_gid, **kwargs): # noqa: E501 - """Add users to a project # noqa: E501 - - Adds the specified list of users as members of the project. Note that a user being added as a member may also be added as a *follower* as a result of this operation. This is because the user's default notification settings (i.e., in the \"Notifcations\" tab of \"My Profile Settings\") will override this endpoint's default behavior of setting \"Tasks added\" notifications to `false`. Returns the updated project record. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.add_members_for_project(body, project_gid, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param ProjectGidAddMembersBody body: Information about the members being added. (required) - :param str project_gid: Globally unique identifier for the project. (required) - :param list[str] opt_fields: This endpoint returns a compact resource, which excludes some properties by default. To include those optional properties, set this query parameter to a comma-separated list of the properties you wish to include. - :return: ProjectResponseData - If the method is called asynchronously, - returns the request thread. - """ - kwargs['_return_http_data_only'] = True - if kwargs.get('async_req'): - return self.add_members_for_project_with_http_info(body, project_gid, **kwargs) # noqa: E501 - else: - (data) = self.add_members_for_project_with_http_info(body, project_gid, **kwargs) # noqa: E501 - return data - - def add_members_for_project_with_http_info(self, body, project_gid, **kwargs): # noqa: E501 - """Add users to a project # noqa: E501 - - Adds the specified list of users as members of the project. Note that a user being added as a member may also be added as a *follower* as a result of this operation. This is because the user's default notification settings (i.e., in the \"Notifcations\" tab of \"My Profile Settings\") will override this endpoint's default behavior of setting \"Tasks added\" notifications to `false`. Returns the updated project record. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.add_members_for_project_with_http_info(body, project_gid, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param ProjectGidAddMembersBody body: Information about the members being added. (required) - :param str project_gid: Globally unique identifier for the project. (required) - :param list[str] opt_fields: This endpoint returns a compact resource, which excludes some properties by default. To include those optional properties, set this query parameter to a comma-separated list of the properties you wish to include. - :return: ProjectResponseData - If the method is called asynchronously, - returns the request thread. - """ - - all_params = ['body', 'project_gid', 'opt_fields'] # noqa: E501 - all_params.append('async_req') - all_params.append('_return_http_data_only') - all_params.append('_preload_content') - all_params.append('_request_timeout') - - params = locals() - for key, val in six.iteritems(params['kwargs']): - if key not in all_params: - raise TypeError( - "Got an unexpected keyword argument '%s'" - " to method add_members_for_project" % key - ) - params[key] = val - del params['kwargs'] - # verify the required parameter 'body' is set - if ('body' not in params or - params['body'] is None): - raise ValueError("Missing the required parameter `body` when calling `add_members_for_project`") # noqa: E501 - # verify the required parameter 'project_gid' is set - if ('project_gid' not in params or - params['project_gid'] is None): - raise ValueError("Missing the required parameter `project_gid` when calling `add_members_for_project`") # noqa: E501 - - collection_formats = {} - - path_params = {} - if 'project_gid' in params: - path_params['project_gid'] = params['project_gid'] # noqa: E501 - - query_params = [] - if 'opt_fields' in params: - query_params.append(('opt_fields', params['opt_fields'])) # noqa: E501 - collection_formats['opt_fields'] = 'csv' # noqa: E501 - - header_params = {} - - form_params = [] - local_var_files = {} - - body_params = None - if 'body' in params: - body_params = params['body'] - # HTTP header `Accept` - header_params['Accept'] = self.api_client.select_header_accept( - ['application/json; charset=UTF-8']) # noqa: E501 - - # HTTP header `Content-Type` - header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 - ['application/json; charset=UTF-8']) # noqa: E501 - - # Authentication setting - auth_settings = ['oauth2'] # noqa: E501 - - return self.api_client.call_api( - '/projects/{project_gid}/addMembers', 'POST', - path_params, - query_params, - header_params, - body=body_params, - post_params=form_params, - files=local_var_files, - response_type='ProjectResponseData', # noqa: E501 - auth_settings=auth_settings, - async_req=params.get('async_req'), - _return_http_data_only=params.get('_return_http_data_only'), - _preload_content=params.get('_preload_content', True), - _request_timeout=params.get('_request_timeout'), - collection_formats=collection_formats) - - def create_project(self, body, **kwargs): # noqa: E501 - """Create a project # noqa: E501 - - Create a new project in a workspace or team. Every project is required to be created in a specific workspace or organization, and this cannot be changed once set. Note that you can use the `workspace` parameter regardless of whether or not it is an organization. If the workspace for your project is an organization, you must also supply a `team` to share the project with. Returns the full record of the newly created project. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.create_project(body, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param ProjectsBody body: The project to create. (required) - :param list[str] opt_fields: This endpoint returns a compact resource, which excludes some properties by default. To include those optional properties, set this query parameter to a comma-separated list of the properties you wish to include. - :return: ProjectResponseData - If the method is called asynchronously, - returns the request thread. - """ - kwargs['_return_http_data_only'] = True - if kwargs.get('async_req'): - return self.create_project_with_http_info(body, **kwargs) # noqa: E501 - else: - (data) = self.create_project_with_http_info(body, **kwargs) # noqa: E501 - return data - - def create_project_with_http_info(self, body, **kwargs): # noqa: E501 - """Create a project # noqa: E501 - - Create a new project in a workspace or team. Every project is required to be created in a specific workspace or organization, and this cannot be changed once set. Note that you can use the `workspace` parameter regardless of whether or not it is an organization. If the workspace for your project is an organization, you must also supply a `team` to share the project with. Returns the full record of the newly created project. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.create_project_with_http_info(body, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param ProjectsBody body: The project to create. (required) - :param list[str] opt_fields: This endpoint returns a compact resource, which excludes some properties by default. To include those optional properties, set this query parameter to a comma-separated list of the properties you wish to include. - :return: ProjectResponseData - If the method is called asynchronously, - returns the request thread. - """ - - all_params = ['body', 'opt_fields'] # noqa: E501 - all_params.append('async_req') - all_params.append('_return_http_data_only') - all_params.append('_preload_content') - all_params.append('_request_timeout') - - params = locals() - for key, val in six.iteritems(params['kwargs']): - if key not in all_params: - raise TypeError( - "Got an unexpected keyword argument '%s'" - " to method create_project" % key - ) - params[key] = val - del params['kwargs'] - # verify the required parameter 'body' is set - if ('body' not in params or - params['body'] is None): - raise ValueError("Missing the required parameter `body` when calling `create_project`") # noqa: E501 - - collection_formats = {} - - path_params = {} - - query_params = [] - if 'opt_fields' in params: - query_params.append(('opt_fields', params['opt_fields'])) # noqa: E501 - collection_formats['opt_fields'] = 'csv' # noqa: E501 - - header_params = {} - - form_params = [] - local_var_files = {} - - body_params = None - if 'body' in params: - body_params = params['body'] - # HTTP header `Accept` - header_params['Accept'] = self.api_client.select_header_accept( - ['application/json; charset=UTF-8']) # noqa: E501 - - # HTTP header `Content-Type` - header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 - ['application/json; charset=UTF-8']) # noqa: E501 - - # Authentication setting - auth_settings = ['oauth2'] # noqa: E501 - - return self.api_client.call_api( - '/projects', 'POST', - path_params, - query_params, - header_params, - body=body_params, - post_params=form_params, - files=local_var_files, - response_type='ProjectResponseData', # noqa: E501 - auth_settings=auth_settings, - async_req=params.get('async_req'), - _return_http_data_only=params.get('_return_http_data_only'), - _preload_content=params.get('_preload_content', True), - _request_timeout=params.get('_request_timeout'), - collection_formats=collection_formats) - - def create_project_for_team(self, body, team_gid, **kwargs): # noqa: E501 - """Create a project in a team # noqa: E501 - - Creates a project shared with the given team. Returns the full record of the newly created project. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.create_project_for_team(body, team_gid, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param TeamGidProjectsBody body: The new project to create. (required) - :param str team_gid: Globally unique identifier for the team. (required) - :param list[str] opt_fields: This endpoint returns a compact resource, which excludes some properties by default. To include those optional properties, set this query parameter to a comma-separated list of the properties you wish to include. - :return: ProjectResponseData - If the method is called asynchronously, - returns the request thread. - """ - kwargs['_return_http_data_only'] = True - if kwargs.get('async_req'): - return self.create_project_for_team_with_http_info(body, team_gid, **kwargs) # noqa: E501 - else: - (data) = self.create_project_for_team_with_http_info(body, team_gid, **kwargs) # noqa: E501 - return data - - def create_project_for_team_with_http_info(self, body, team_gid, **kwargs): # noqa: E501 - """Create a project in a team # noqa: E501 - - Creates a project shared with the given team. Returns the full record of the newly created project. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.create_project_for_team_with_http_info(body, team_gid, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param TeamGidProjectsBody body: The new project to create. (required) - :param str team_gid: Globally unique identifier for the team. (required) - :param list[str] opt_fields: This endpoint returns a compact resource, which excludes some properties by default. To include those optional properties, set this query parameter to a comma-separated list of the properties you wish to include. - :return: ProjectResponseData - If the method is called asynchronously, - returns the request thread. - """ - - all_params = ['body', 'team_gid', 'opt_fields'] # noqa: E501 - all_params.append('async_req') - all_params.append('_return_http_data_only') - all_params.append('_preload_content') - all_params.append('_request_timeout') - - params = locals() - for key, val in six.iteritems(params['kwargs']): - if key not in all_params: - raise TypeError( - "Got an unexpected keyword argument '%s'" - " to method create_project_for_team" % key - ) - params[key] = val - del params['kwargs'] - # verify the required parameter 'body' is set - if ('body' not in params or - params['body'] is None): - raise ValueError("Missing the required parameter `body` when calling `create_project_for_team`") # noqa: E501 - # verify the required parameter 'team_gid' is set - if ('team_gid' not in params or - params['team_gid'] is None): - raise ValueError("Missing the required parameter `team_gid` when calling `create_project_for_team`") # noqa: E501 - - collection_formats = {} - - path_params = {} - if 'team_gid' in params: - path_params['team_gid'] = params['team_gid'] # noqa: E501 - - query_params = [] - if 'opt_fields' in params: - query_params.append(('opt_fields', params['opt_fields'])) # noqa: E501 - collection_formats['opt_fields'] = 'csv' # noqa: E501 - - header_params = {} - - form_params = [] - local_var_files = {} - - body_params = None - if 'body' in params: - body_params = params['body'] - # HTTP header `Accept` - header_params['Accept'] = self.api_client.select_header_accept( - ['application/json; charset=UTF-8']) # noqa: E501 - - # HTTP header `Content-Type` - header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 - ['application/json; charset=UTF-8']) # noqa: E501 - - # Authentication setting - auth_settings = ['oauth2'] # noqa: E501 - - return self.api_client.call_api( - '/teams/{team_gid}/projects', 'POST', - path_params, - query_params, - header_params, - body=body_params, - post_params=form_params, - files=local_var_files, - response_type='ProjectResponseData', # noqa: E501 - auth_settings=auth_settings, - async_req=params.get('async_req'), - _return_http_data_only=params.get('_return_http_data_only'), - _preload_content=params.get('_preload_content', True), - _request_timeout=params.get('_request_timeout'), - collection_formats=collection_formats) - - def create_project_for_workspace(self, body, workspace_gid, **kwargs): # noqa: E501 - """Create a project in a workspace # noqa: E501 - - Creates a project in the workspace. If the workspace for your project is an organization, you must also supply a team to share the project with. Returns the full record of the newly created project. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.create_project_for_workspace(body, workspace_gid, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param WorkspaceGidProjectsBody body: The new project to create. (required) - :param str workspace_gid: Globally unique identifier for the workspace or organization. (required) - :param list[str] opt_fields: This endpoint returns a compact resource, which excludes some properties by default. To include those optional properties, set this query parameter to a comma-separated list of the properties you wish to include. - :return: ProjectResponseData - If the method is called asynchronously, - returns the request thread. - """ - kwargs['_return_http_data_only'] = True - if kwargs.get('async_req'): - return self.create_project_for_workspace_with_http_info(body, workspace_gid, **kwargs) # noqa: E501 - else: - (data) = self.create_project_for_workspace_with_http_info(body, workspace_gid, **kwargs) # noqa: E501 - return data - - def create_project_for_workspace_with_http_info(self, body, workspace_gid, **kwargs): # noqa: E501 - """Create a project in a workspace # noqa: E501 - - Creates a project in the workspace. If the workspace for your project is an organization, you must also supply a team to share the project with. Returns the full record of the newly created project. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.create_project_for_workspace_with_http_info(body, workspace_gid, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param WorkspaceGidProjectsBody body: The new project to create. (required) - :param str workspace_gid: Globally unique identifier for the workspace or organization. (required) - :param list[str] opt_fields: This endpoint returns a compact resource, which excludes some properties by default. To include those optional properties, set this query parameter to a comma-separated list of the properties you wish to include. - :return: ProjectResponseData - If the method is called asynchronously, - returns the request thread. - """ - - all_params = ['body', 'workspace_gid', 'opt_fields'] # noqa: E501 - all_params.append('async_req') - all_params.append('_return_http_data_only') - all_params.append('_preload_content') - all_params.append('_request_timeout') - - params = locals() - for key, val in six.iteritems(params['kwargs']): - if key not in all_params: - raise TypeError( - "Got an unexpected keyword argument '%s'" - " to method create_project_for_workspace" % key - ) - params[key] = val - del params['kwargs'] - # verify the required parameter 'body' is set - if ('body' not in params or - params['body'] is None): - raise ValueError("Missing the required parameter `body` when calling `create_project_for_workspace`") # noqa: E501 - # verify the required parameter 'workspace_gid' is set - if ('workspace_gid' not in params or - params['workspace_gid'] is None): - raise ValueError("Missing the required parameter `workspace_gid` when calling `create_project_for_workspace`") # noqa: E501 - - collection_formats = {} - - path_params = {} - if 'workspace_gid' in params: - path_params['workspace_gid'] = params['workspace_gid'] # noqa: E501 - - query_params = [] - if 'opt_fields' in params: - query_params.append(('opt_fields', params['opt_fields'])) # noqa: E501 - collection_formats['opt_fields'] = 'csv' # noqa: E501 - - header_params = {} - - form_params = [] - local_var_files = {} - - body_params = None - if 'body' in params: - body_params = params['body'] - # HTTP header `Accept` - header_params['Accept'] = self.api_client.select_header_accept( - ['application/json; charset=UTF-8']) # noqa: E501 - - # HTTP header `Content-Type` - header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 - ['application/json; charset=UTF-8']) # noqa: E501 - - # Authentication setting - auth_settings = ['oauth2'] # noqa: E501 - - return self.api_client.call_api( - '/workspaces/{workspace_gid}/projects', 'POST', - path_params, - query_params, - header_params, - body=body_params, - post_params=form_params, - files=local_var_files, - response_type='ProjectResponseData', # noqa: E501 - auth_settings=auth_settings, - async_req=params.get('async_req'), - _return_http_data_only=params.get('_return_http_data_only'), - _preload_content=params.get('_preload_content', True), - _request_timeout=params.get('_request_timeout'), - collection_formats=collection_formats) - - def delete_project(self, project_gid, **kwargs): # noqa: E501 - """Delete a project # noqa: E501 - - A specific, existing project can be deleted by making a DELETE request on the URL for that project. Returns an empty data record. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.delete_project(project_gid, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param str project_gid: Globally unique identifier for the project. (required) - :return: EmptyResponseData - If the method is called asynchronously, - returns the request thread. - """ - kwargs['_return_http_data_only'] = True - if kwargs.get('async_req'): - return self.delete_project_with_http_info(project_gid, **kwargs) # noqa: E501 - else: - (data) = self.delete_project_with_http_info(project_gid, **kwargs) # noqa: E501 - return data - - def delete_project_with_http_info(self, project_gid, **kwargs): # noqa: E501 - """Delete a project # noqa: E501 - - A specific, existing project can be deleted by making a DELETE request on the URL for that project. Returns an empty data record. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.delete_project_with_http_info(project_gid, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param str project_gid: Globally unique identifier for the project. (required) - :return: EmptyResponseData - If the method is called asynchronously, - returns the request thread. - """ - - all_params = ['project_gid'] # noqa: E501 - all_params.append('async_req') - all_params.append('_return_http_data_only') - all_params.append('_preload_content') - all_params.append('_request_timeout') - - params = locals() - for key, val in six.iteritems(params['kwargs']): - if key not in all_params: - raise TypeError( - "Got an unexpected keyword argument '%s'" - " to method delete_project" % key - ) - params[key] = val - del params['kwargs'] - # verify the required parameter 'project_gid' is set - if ('project_gid' not in params or - params['project_gid'] is None): - raise ValueError("Missing the required parameter `project_gid` when calling `delete_project`") # noqa: E501 - - collection_formats = {} - - path_params = {} - if 'project_gid' in params: - path_params['project_gid'] = params['project_gid'] # noqa: E501 - - query_params = [] - - header_params = {} - - form_params = [] - local_var_files = {} - - body_params = None - # HTTP header `Accept` - header_params['Accept'] = self.api_client.select_header_accept( - ['application/json; charset=UTF-8']) # noqa: E501 - - # Authentication setting - auth_settings = ['oauth2'] # noqa: E501 - - return self.api_client.call_api( - '/projects/{project_gid}', 'DELETE', - path_params, - query_params, - header_params, - body=body_params, - post_params=form_params, - files=local_var_files, - response_type='EmptyResponseData', # noqa: E501 - auth_settings=auth_settings, - async_req=params.get('async_req'), - _return_http_data_only=params.get('_return_http_data_only'), - _preload_content=params.get('_preload_content', True), - _request_timeout=params.get('_request_timeout'), - collection_formats=collection_formats) - - def duplicate_project(self, project_gid, **kwargs): # noqa: E501 - """Duplicate a project # noqa: E501 - - Creates and returns a job that will asynchronously handle the duplication. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.duplicate_project(project_gid, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param str project_gid: Globally unique identifier for the project. (required) - :param ProjectGidDuplicateBody body: Describes the duplicate's name and the elements that will be duplicated. - :param list[str] opt_fields: This endpoint returns a compact resource, which excludes some properties by default. To include those optional properties, set this query parameter to a comma-separated list of the properties you wish to include. - :return: JobResponseData - If the method is called asynchronously, - returns the request thread. - """ - kwargs['_return_http_data_only'] = True - if kwargs.get('async_req'): - return self.duplicate_project_with_http_info(project_gid, **kwargs) # noqa: E501 - else: - (data) = self.duplicate_project_with_http_info(project_gid, **kwargs) # noqa: E501 - return data - - def duplicate_project_with_http_info(self, project_gid, **kwargs): # noqa: E501 - """Duplicate a project # noqa: E501 - - Creates and returns a job that will asynchronously handle the duplication. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.duplicate_project_with_http_info(project_gid, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param str project_gid: Globally unique identifier for the project. (required) - :param ProjectGidDuplicateBody body: Describes the duplicate's name and the elements that will be duplicated. - :param list[str] opt_fields: This endpoint returns a compact resource, which excludes some properties by default. To include those optional properties, set this query parameter to a comma-separated list of the properties you wish to include. - :return: JobResponseData - If the method is called asynchronously, - returns the request thread. - """ - - all_params = ['project_gid', 'body', 'opt_fields'] # noqa: E501 - all_params.append('async_req') - all_params.append('_return_http_data_only') - all_params.append('_preload_content') - all_params.append('_request_timeout') - - params = locals() - for key, val in six.iteritems(params['kwargs']): - if key not in all_params: - raise TypeError( - "Got an unexpected keyword argument '%s'" - " to method duplicate_project" % key - ) - params[key] = val - del params['kwargs'] - # verify the required parameter 'project_gid' is set - if ('project_gid' not in params or - params['project_gid'] is None): - raise ValueError("Missing the required parameter `project_gid` when calling `duplicate_project`") # noqa: E501 - - collection_formats = {} - - path_params = {} - if 'project_gid' in params: - path_params['project_gid'] = params['project_gid'] # noqa: E501 - - query_params = [] - if 'opt_fields' in params: - query_params.append(('opt_fields', params['opt_fields'])) # noqa: E501 - collection_formats['opt_fields'] = 'csv' # noqa: E501 - - header_params = {} - - form_params = [] - local_var_files = {} - - body_params = None - if 'body' in params: - body_params = params['body'] - # HTTP header `Accept` - header_params['Accept'] = self.api_client.select_header_accept( - ['application/json; charset=UTF-8']) # noqa: E501 - - # HTTP header `Content-Type` - header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 - ['application/json; charset=UTF-8']) # noqa: E501 - - # Authentication setting - auth_settings = ['oauth2'] # noqa: E501 - - return self.api_client.call_api( - '/projects/{project_gid}/duplicate', 'POST', - path_params, - query_params, - header_params, - body=body_params, - post_params=form_params, - files=local_var_files, - response_type='JobResponseData', # noqa: E501 - auth_settings=auth_settings, - async_req=params.get('async_req'), - _return_http_data_only=params.get('_return_http_data_only'), - _preload_content=params.get('_preload_content', True), - _request_timeout=params.get('_request_timeout'), - collection_formats=collection_formats) - - def get_project(self, project_gid, **kwargs): # noqa: E501 - """Get a project # noqa: E501 - - Returns the complete project record for a single project. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.get_project(project_gid, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param str project_gid: Globally unique identifier for the project. (required) - :param list[str] opt_fields: This endpoint returns a compact resource, which excludes some properties by default. To include those optional properties, set this query parameter to a comma-separated list of the properties you wish to include. - :return: ProjectResponseData - If the method is called asynchronously, - returns the request thread. - """ - kwargs['_return_http_data_only'] = True - if kwargs.get('async_req'): - return self.get_project_with_http_info(project_gid, **kwargs) # noqa: E501 - else: - (data) = self.get_project_with_http_info(project_gid, **kwargs) # noqa: E501 - return data - - def get_project_with_http_info(self, project_gid, **kwargs): # noqa: E501 - """Get a project # noqa: E501 - - Returns the complete project record for a single project. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.get_project_with_http_info(project_gid, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param str project_gid: Globally unique identifier for the project. (required) - :param list[str] opt_fields: This endpoint returns a compact resource, which excludes some properties by default. To include those optional properties, set this query parameter to a comma-separated list of the properties you wish to include. - :return: ProjectResponseData - If the method is called asynchronously, - returns the request thread. - """ - - all_params = ['project_gid', 'opt_fields'] # noqa: E501 - all_params.append('async_req') - all_params.append('_return_http_data_only') - all_params.append('_preload_content') - all_params.append('_request_timeout') - - params = locals() - for key, val in six.iteritems(params['kwargs']): - if key not in all_params: - raise TypeError( - "Got an unexpected keyword argument '%s'" - " to method get_project" % key - ) - params[key] = val - del params['kwargs'] - # verify the required parameter 'project_gid' is set - if ('project_gid' not in params or - params['project_gid'] is None): - raise ValueError("Missing the required parameter `project_gid` when calling `get_project`") # noqa: E501 - - collection_formats = {} - - path_params = {} - if 'project_gid' in params: - path_params['project_gid'] = params['project_gid'] # noqa: E501 - - query_params = [] - if 'opt_fields' in params: - query_params.append(('opt_fields', params['opt_fields'])) # noqa: E501 - collection_formats['opt_fields'] = 'csv' # noqa: E501 - - header_params = {} - - form_params = [] - local_var_files = {} - - body_params = None - # HTTP header `Accept` - header_params['Accept'] = self.api_client.select_header_accept( - ['application/json; charset=UTF-8']) # noqa: E501 - - # Authentication setting - auth_settings = ['oauth2'] # noqa: E501 - - return self.api_client.call_api( - '/projects/{project_gid}', 'GET', - path_params, - query_params, - header_params, - body=body_params, - post_params=form_params, - files=local_var_files, - response_type='ProjectResponseData', # noqa: E501 - auth_settings=auth_settings, - async_req=params.get('async_req'), - _return_http_data_only=params.get('_return_http_data_only'), - _preload_content=params.get('_preload_content', True), - _request_timeout=params.get('_request_timeout'), - collection_formats=collection_formats) - - def get_projects(self, **kwargs): # noqa: E501 - """Get multiple projects # noqa: E501 - - Returns the compact project records for some filtered set of projects. Use one or more of the parameters provided to filter the projects returned. *Note: This endpoint may timeout for large domains. Try filtering by team!* # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.get_projects(async_req=True) - >>> result = thread.get() - - :param async_req bool - :param int limit: Results per page. The number of objects to return per page. The value must be between 1 and 100. - :param str offset: 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 str workspace: The workspace or organization to filter projects on. - :param str team: The team to filter projects on. - :param bool archived: Only return projects whose `archived` field takes on the value of this parameter. - :param list[str] opt_fields: This endpoint returns a compact resource, which excludes some properties by default. To include those optional properties, set this query parameter to a comma-separated list of the properties you wish to include. - :return: ProjectResponseArray - If the method is called asynchronously, - returns the request thread. - """ - kwargs['_return_http_data_only'] = True - if kwargs.get('async_req'): - return self.get_projects_with_http_info(**kwargs) # noqa: E501 - else: - (data) = self.get_projects_with_http_info(**kwargs) # noqa: E501 - return data - - def get_projects_with_http_info(self, **kwargs): # noqa: E501 - """Get multiple projects # noqa: E501 - - Returns the compact project records for some filtered set of projects. Use one or more of the parameters provided to filter the projects returned. *Note: This endpoint may timeout for large domains. Try filtering by team!* # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.get_projects_with_http_info(async_req=True) - >>> result = thread.get() - - :param async_req bool - :param int limit: Results per page. The number of objects to return per page. The value must be between 1 and 100. - :param str offset: 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 str workspace: The workspace or organization to filter projects on. - :param str team: The team to filter projects on. - :param bool archived: Only return projects whose `archived` field takes on the value of this parameter. - :param list[str] opt_fields: This endpoint returns a compact resource, which excludes some properties by default. To include those optional properties, set this query parameter to a comma-separated list of the properties you wish to include. - :return: ProjectResponseArray - If the method is called asynchronously, - returns the request thread. - """ - - all_params = ['limit', 'offset', 'workspace', 'team', 'archived', 'opt_fields'] # noqa: E501 - all_params.append('async_req') - all_params.append('_return_http_data_only') - all_params.append('_preload_content') - all_params.append('_request_timeout') - - params = locals() - for key, val in six.iteritems(params['kwargs']): - if key not in all_params: - raise TypeError( - "Got an unexpected keyword argument '%s'" - " to method get_projects" % key - ) - params[key] = val - del params['kwargs'] - - collection_formats = {} - - path_params = {} - - query_params = [] - if 'limit' in params: - query_params.append(('limit', params['limit'])) # noqa: E501 - if 'offset' in params: - query_params.append(('offset', params['offset'])) # noqa: E501 - if 'workspace' in params: - query_params.append(('workspace', params['workspace'])) # noqa: E501 - if 'team' in params: - query_params.append(('team', params['team'])) # noqa: E501 - if 'archived' in params: - query_params.append(('archived', params['archived'])) # noqa: E501 - if 'opt_fields' in params: - query_params.append(('opt_fields', params['opt_fields'])) # noqa: E501 - collection_formats['opt_fields'] = 'csv' # noqa: E501 - - header_params = {} - - form_params = [] - local_var_files = {} - - body_params = None - # HTTP header `Accept` - header_params['Accept'] = self.api_client.select_header_accept( - ['application/json; charset=UTF-8']) # noqa: E501 - - # Authentication setting - auth_settings = ['oauth2'] # noqa: E501 - - return self.api_client.call_api( - '/projects', 'GET', - path_params, - query_params, - header_params, - body=body_params, - post_params=form_params, - files=local_var_files, - response_type='ProjectResponseArray', # noqa: E501 - auth_settings=auth_settings, - async_req=params.get('async_req'), - _return_http_data_only=params.get('_return_http_data_only'), - _preload_content=params.get('_preload_content', True), - _request_timeout=params.get('_request_timeout'), - collection_formats=collection_formats) - - def get_projects_for_task(self, task_gid, **kwargs): # noqa: E501 - """Get projects a task is in # noqa: E501 - - Returns a compact representation of all of the projects the task is in. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.get_projects_for_task(task_gid, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param str task_gid: The task to operate on. (required) - :param int limit: Results per page. The number of objects to return per page. The value must be between 1 and 100. - :param str offset: 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 list[str] opt_fields: This endpoint returns a compact resource, which excludes some properties by default. To include those optional properties, set this query parameter to a comma-separated list of the properties you wish to include. - :return: ProjectResponseArray - If the method is called asynchronously, - returns the request thread. - """ - kwargs['_return_http_data_only'] = True - if kwargs.get('async_req'): - return self.get_projects_for_task_with_http_info(task_gid, **kwargs) # noqa: E501 - else: - (data) = self.get_projects_for_task_with_http_info(task_gid, **kwargs) # noqa: E501 - return data - - def get_projects_for_task_with_http_info(self, task_gid, **kwargs): # noqa: E501 - """Get projects a task is in # noqa: E501 - - Returns a compact representation of all of the projects the task is in. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.get_projects_for_task_with_http_info(task_gid, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param str task_gid: The task to operate on. (required) - :param int limit: Results per page. The number of objects to return per page. The value must be between 1 and 100. - :param str offset: 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 list[str] opt_fields: This endpoint returns a compact resource, which excludes some properties by default. To include those optional properties, set this query parameter to a comma-separated list of the properties you wish to include. - :return: ProjectResponseArray - If the method is called asynchronously, - returns the request thread. - """ - - all_params = ['task_gid', 'limit', 'offset', 'opt_fields'] # noqa: E501 - all_params.append('async_req') - all_params.append('_return_http_data_only') - all_params.append('_preload_content') - all_params.append('_request_timeout') - - params = locals() - for key, val in six.iteritems(params['kwargs']): - if key not in all_params: - raise TypeError( - "Got an unexpected keyword argument '%s'" - " to method get_projects_for_task" % key - ) - params[key] = val - del params['kwargs'] - # verify the required parameter 'task_gid' is set - if ('task_gid' not in params or - params['task_gid'] is None): - raise ValueError("Missing the required parameter `task_gid` when calling `get_projects_for_task`") # noqa: E501 - - collection_formats = {} - - path_params = {} - if 'task_gid' in params: - path_params['task_gid'] = params['task_gid'] # noqa: E501 - - query_params = [] - if 'limit' in params: - query_params.append(('limit', params['limit'])) # noqa: E501 - if 'offset' in params: - query_params.append(('offset', params['offset'])) # noqa: E501 - if 'opt_fields' in params: - query_params.append(('opt_fields', params['opt_fields'])) # noqa: E501 - collection_formats['opt_fields'] = 'csv' # noqa: E501 - - header_params = {} - - form_params = [] - local_var_files = {} - - body_params = None - # HTTP header `Accept` - header_params['Accept'] = self.api_client.select_header_accept( - ['application/json; charset=UTF-8']) # noqa: E501 - - # Authentication setting - auth_settings = ['oauth2'] # noqa: E501 - - return self.api_client.call_api( - '/tasks/{task_gid}/projects', 'GET', - path_params, - query_params, - header_params, - body=body_params, - post_params=form_params, - files=local_var_files, - response_type='ProjectResponseArray', # noqa: E501 - auth_settings=auth_settings, - async_req=params.get('async_req'), - _return_http_data_only=params.get('_return_http_data_only'), - _preload_content=params.get('_preload_content', True), - _request_timeout=params.get('_request_timeout'), - collection_formats=collection_formats) - - def get_projects_for_team(self, team_gid, **kwargs): # noqa: E501 - """Get a team's projects # noqa: E501 - - Returns the compact project records for all projects in the team. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.get_projects_for_team(team_gid, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param str team_gid: Globally unique identifier for the team. (required) - :param int limit: Results per page. The number of objects to return per page. The value must be between 1 and 100. - :param str offset: 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 bool archived: Only return projects whose `archived` field takes on the value of this parameter. - :param list[str] opt_fields: This endpoint returns a compact resource, which excludes some properties by default. To include those optional properties, set this query parameter to a comma-separated list of the properties you wish to include. - :return: ProjectResponseArray - If the method is called asynchronously, - returns the request thread. - """ - kwargs['_return_http_data_only'] = True - if kwargs.get('async_req'): - return self.get_projects_for_team_with_http_info(team_gid, **kwargs) # noqa: E501 - else: - (data) = self.get_projects_for_team_with_http_info(team_gid, **kwargs) # noqa: E501 - return data - - def get_projects_for_team_with_http_info(self, team_gid, **kwargs): # noqa: E501 - """Get a team's projects # noqa: E501 - - Returns the compact project records for all projects in the team. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.get_projects_for_team_with_http_info(team_gid, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param str team_gid: Globally unique identifier for the team. (required) - :param int limit: Results per page. The number of objects to return per page. The value must be between 1 and 100. - :param str offset: 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 bool archived: Only return projects whose `archived` field takes on the value of this parameter. - :param list[str] opt_fields: This endpoint returns a compact resource, which excludes some properties by default. To include those optional properties, set this query parameter to a comma-separated list of the properties you wish to include. - :return: ProjectResponseArray - If the method is called asynchronously, - returns the request thread. - """ - - all_params = ['team_gid', 'limit', 'offset', 'archived', 'opt_fields'] # noqa: E501 - all_params.append('async_req') - all_params.append('_return_http_data_only') - all_params.append('_preload_content') - all_params.append('_request_timeout') - - params = locals() - for key, val in six.iteritems(params['kwargs']): - if key not in all_params: - raise TypeError( - "Got an unexpected keyword argument '%s'" - " to method get_projects_for_team" % key - ) - params[key] = val - del params['kwargs'] - # verify the required parameter 'team_gid' is set - if ('team_gid' not in params or - params['team_gid'] is None): - raise ValueError("Missing the required parameter `team_gid` when calling `get_projects_for_team`") # noqa: E501 - - collection_formats = {} - - path_params = {} - if 'team_gid' in params: - path_params['team_gid'] = params['team_gid'] # noqa: E501 - - query_params = [] - if 'limit' in params: - query_params.append(('limit', params['limit'])) # noqa: E501 - if 'offset' in params: - query_params.append(('offset', params['offset'])) # noqa: E501 - if 'archived' in params: - query_params.append(('archived', params['archived'])) # noqa: E501 - if 'opt_fields' in params: - query_params.append(('opt_fields', params['opt_fields'])) # noqa: E501 - collection_formats['opt_fields'] = 'csv' # noqa: E501 - - header_params = {} - - form_params = [] - local_var_files = {} - - body_params = None - # HTTP header `Accept` - header_params['Accept'] = self.api_client.select_header_accept( - ['application/json; charset=UTF-8']) # noqa: E501 - - # Authentication setting - auth_settings = ['oauth2'] # noqa: E501 - - return self.api_client.call_api( - '/teams/{team_gid}/projects', 'GET', - path_params, - query_params, - header_params, - body=body_params, - post_params=form_params, - files=local_var_files, - response_type='ProjectResponseArray', # noqa: E501 - auth_settings=auth_settings, - async_req=params.get('async_req'), - _return_http_data_only=params.get('_return_http_data_only'), - _preload_content=params.get('_preload_content', True), - _request_timeout=params.get('_request_timeout'), - collection_formats=collection_formats) - - def get_projects_for_workspace(self, workspace_gid, **kwargs): # noqa: E501 - """Get all projects in a workspace # noqa: E501 - - Returns the compact project records for all projects in the workspace. *Note: This endpoint may timeout for large domains. Prefer the `/teams/{team_gid}/projects` endpoint.* # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.get_projects_for_workspace(workspace_gid, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param str workspace_gid: Globally unique identifier for the workspace or organization. (required) - :param int limit: Results per page. The number of objects to return per page. The value must be between 1 and 100. - :param str offset: 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 bool archived: Only return projects whose `archived` field takes on the value of this parameter. - :param list[str] opt_fields: This endpoint returns a compact resource, which excludes some properties by default. To include those optional properties, set this query parameter to a comma-separated list of the properties you wish to include. - :return: ProjectResponseArray - If the method is called asynchronously, - returns the request thread. - """ - kwargs['_return_http_data_only'] = True - if kwargs.get('async_req'): - return self.get_projects_for_workspace_with_http_info(workspace_gid, **kwargs) # noqa: E501 - else: - (data) = self.get_projects_for_workspace_with_http_info(workspace_gid, **kwargs) # noqa: E501 - return data - - def get_projects_for_workspace_with_http_info(self, workspace_gid, **kwargs): # noqa: E501 - """Get all projects in a workspace # noqa: E501 - - Returns the compact project records for all projects in the workspace. *Note: This endpoint may timeout for large domains. Prefer the `/teams/{team_gid}/projects` endpoint.* # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.get_projects_for_workspace_with_http_info(workspace_gid, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param str workspace_gid: Globally unique identifier for the workspace or organization. (required) - :param int limit: Results per page. The number of objects to return per page. The value must be between 1 and 100. - :param str offset: 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 bool archived: Only return projects whose `archived` field takes on the value of this parameter. - :param list[str] opt_fields: This endpoint returns a compact resource, which excludes some properties by default. To include those optional properties, set this query parameter to a comma-separated list of the properties you wish to include. - :return: ProjectResponseArray - If the method is called asynchronously, - returns the request thread. - """ - - all_params = ['workspace_gid', 'limit', 'offset', 'archived', 'opt_fields'] # noqa: E501 - all_params.append('async_req') - all_params.append('_return_http_data_only') - all_params.append('_preload_content') - all_params.append('_request_timeout') - - params = locals() - for key, val in six.iteritems(params['kwargs']): - if key not in all_params: - raise TypeError( - "Got an unexpected keyword argument '%s'" - " to method get_projects_for_workspace" % key - ) - params[key] = val - del params['kwargs'] - # verify the required parameter 'workspace_gid' is set - if ('workspace_gid' not in params or - params['workspace_gid'] is None): - raise ValueError("Missing the required parameter `workspace_gid` when calling `get_projects_for_workspace`") # noqa: E501 - - collection_formats = {} - - path_params = {} - if 'workspace_gid' in params: - path_params['workspace_gid'] = params['workspace_gid'] # noqa: E501 - - query_params = [] - if 'limit' in params: - query_params.append(('limit', params['limit'])) # noqa: E501 - if 'offset' in params: - query_params.append(('offset', params['offset'])) # noqa: E501 - if 'archived' in params: - query_params.append(('archived', params['archived'])) # noqa: E501 - if 'opt_fields' in params: - query_params.append(('opt_fields', params['opt_fields'])) # noqa: E501 - collection_formats['opt_fields'] = 'csv' # noqa: E501 - - header_params = {} - - form_params = [] - local_var_files = {} - - body_params = None - # HTTP header `Accept` - header_params['Accept'] = self.api_client.select_header_accept( - ['application/json; charset=UTF-8']) # noqa: E501 - - # Authentication setting - auth_settings = ['oauth2'] # noqa: E501 - - return self.api_client.call_api( - '/workspaces/{workspace_gid}/projects', 'GET', - path_params, - query_params, - header_params, - body=body_params, - post_params=form_params, - files=local_var_files, - response_type='ProjectResponseArray', # noqa: E501 - auth_settings=auth_settings, - async_req=params.get('async_req'), - _return_http_data_only=params.get('_return_http_data_only'), - _preload_content=params.get('_preload_content', True), - _request_timeout=params.get('_request_timeout'), - collection_formats=collection_formats) - - def get_task_counts_for_project(self, project_gid, **kwargs): # noqa: E501 - """Get task count of a project # noqa: E501 - - Get an object that holds task count fields. **All fields are excluded by default**. You must [opt in](/docs/inputoutput-options) using `opt_fields` to get any information from this endpoint. This endpoint has an additional [rate limit](/docs/rate-limits) and each field counts especially high against our [cost limits](/docs/rate-limits#cost-limits). Milestones are just tasks, so they are included in the `num_tasks`, `num_incomplete_tasks`, and `num_completed_tasks` counts. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.get_task_counts_for_project(project_gid, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param str project_gid: Globally unique identifier for the project. (required) - :param list[str] opt_fields: This endpoint returns a compact resource, which excludes some properties by default. To include those optional properties, set this query parameter to a comma-separated list of the properties you wish to include. - :return: TaskCountResponseData - If the method is called asynchronously, - returns the request thread. - """ - kwargs['_return_http_data_only'] = True - if kwargs.get('async_req'): - return self.get_task_counts_for_project_with_http_info(project_gid, **kwargs) # noqa: E501 - else: - (data) = self.get_task_counts_for_project_with_http_info(project_gid, **kwargs) # noqa: E501 - return data - - def get_task_counts_for_project_with_http_info(self, project_gid, **kwargs): # noqa: E501 - """Get task count of a project # noqa: E501 - - Get an object that holds task count fields. **All fields are excluded by default**. You must [opt in](/docs/inputoutput-options) using `opt_fields` to get any information from this endpoint. This endpoint has an additional [rate limit](/docs/rate-limits) and each field counts especially high against our [cost limits](/docs/rate-limits#cost-limits). Milestones are just tasks, so they are included in the `num_tasks`, `num_incomplete_tasks`, and `num_completed_tasks` counts. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.get_task_counts_for_project_with_http_info(project_gid, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param str project_gid: Globally unique identifier for the project. (required) - :param list[str] opt_fields: This endpoint returns a compact resource, which excludes some properties by default. To include those optional properties, set this query parameter to a comma-separated list of the properties you wish to include. - :return: TaskCountResponseData - If the method is called asynchronously, - returns the request thread. - """ - - all_params = ['project_gid', 'opt_fields'] # noqa: E501 - all_params.append('async_req') - all_params.append('_return_http_data_only') - all_params.append('_preload_content') - all_params.append('_request_timeout') - - params = locals() - for key, val in six.iteritems(params['kwargs']): - if key not in all_params: - raise TypeError( - "Got an unexpected keyword argument '%s'" - " to method get_task_counts_for_project" % key - ) - params[key] = val - del params['kwargs'] - # verify the required parameter 'project_gid' is set - if ('project_gid' not in params or - params['project_gid'] is None): - raise ValueError("Missing the required parameter `project_gid` when calling `get_task_counts_for_project`") # noqa: E501 - - collection_formats = {} - - path_params = {} - if 'project_gid' in params: - path_params['project_gid'] = params['project_gid'] # noqa: E501 - - query_params = [] - if 'opt_fields' in params: - query_params.append(('opt_fields', params['opt_fields'])) # noqa: E501 - collection_formats['opt_fields'] = 'csv' # noqa: E501 - - header_params = {} - - form_params = [] - local_var_files = {} - - body_params = None - # HTTP header `Accept` - header_params['Accept'] = self.api_client.select_header_accept( - ['application/json; charset=UTF-8']) # noqa: E501 - - # Authentication setting - auth_settings = ['oauth2'] # noqa: E501 - - return self.api_client.call_api( - '/projects/{project_gid}/task_counts', 'GET', - path_params, - query_params, - header_params, - body=body_params, - post_params=form_params, - files=local_var_files, - response_type='TaskCountResponseData', # noqa: E501 - auth_settings=auth_settings, - async_req=params.get('async_req'), - _return_http_data_only=params.get('_return_http_data_only'), - _preload_content=params.get('_preload_content', True), - _request_timeout=params.get('_request_timeout'), - collection_formats=collection_formats) - - def project_save_as_template(self, body, project_gid, **kwargs): # noqa: E501 - """Create a project template from a project # noqa: E501 - - Creates and returns a job that will asynchronously handle the project template creation. Note that while the resulting project template can be accessed with the API, it won't be visible in the Asana UI until Project Templates 2.0 is launched in the app. See more in [this forum post](https://forum.asana.com/t/a-new-api-for-project-templates/156432). # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.project_save_as_template(body, project_gid, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param ProjectGidSaveAsTemplateBody body: Describes the inputs used for creating a project template, such as the resulting project template's name, which team it should be created in. (required) - :param str project_gid: Globally unique identifier for the project. (required) - :param list[str] opt_fields: This endpoint returns a compact resource, which excludes some properties by default. To include those optional properties, set this query parameter to a comma-separated list of the properties you wish to include. - :return: JobResponseData - If the method is called asynchronously, - returns the request thread. - """ - kwargs['_return_http_data_only'] = True - if kwargs.get('async_req'): - return self.project_save_as_template_with_http_info(body, project_gid, **kwargs) # noqa: E501 - else: - (data) = self.project_save_as_template_with_http_info(body, project_gid, **kwargs) # noqa: E501 - return data - - def project_save_as_template_with_http_info(self, body, project_gid, **kwargs): # noqa: E501 - """Create a project template from a project # noqa: E501 - - Creates and returns a job that will asynchronously handle the project template creation. Note that while the resulting project template can be accessed with the API, it won't be visible in the Asana UI until Project Templates 2.0 is launched in the app. See more in [this forum post](https://forum.asana.com/t/a-new-api-for-project-templates/156432). # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.project_save_as_template_with_http_info(body, project_gid, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param ProjectGidSaveAsTemplateBody body: Describes the inputs used for creating a project template, such as the resulting project template's name, which team it should be created in. (required) - :param str project_gid: Globally unique identifier for the project. (required) - :param list[str] opt_fields: This endpoint returns a compact resource, which excludes some properties by default. To include those optional properties, set this query parameter to a comma-separated list of the properties you wish to include. - :return: JobResponseData - If the method is called asynchronously, - returns the request thread. - """ - - all_params = ['body', 'project_gid', 'opt_fields'] # noqa: E501 - all_params.append('async_req') - all_params.append('_return_http_data_only') - all_params.append('_preload_content') - all_params.append('_request_timeout') - - params = locals() - for key, val in six.iteritems(params['kwargs']): - if key not in all_params: - raise TypeError( - "Got an unexpected keyword argument '%s'" - " to method project_save_as_template" % key - ) - params[key] = val - del params['kwargs'] - # verify the required parameter 'body' is set - if ('body' not in params or - params['body'] is None): - raise ValueError("Missing the required parameter `body` when calling `project_save_as_template`") # noqa: E501 - # verify the required parameter 'project_gid' is set - if ('project_gid' not in params or - params['project_gid'] is None): - raise ValueError("Missing the required parameter `project_gid` when calling `project_save_as_template`") # noqa: E501 - - collection_formats = {} - - path_params = {} - if 'project_gid' in params: - path_params['project_gid'] = params['project_gid'] # noqa: E501 - - query_params = [] - if 'opt_fields' in params: - query_params.append(('opt_fields', params['opt_fields'])) # noqa: E501 - collection_formats['opt_fields'] = 'csv' # noqa: E501 - - header_params = {} - - form_params = [] - local_var_files = {} - - body_params = None - if 'body' in params: - body_params = params['body'] - # HTTP header `Accept` - header_params['Accept'] = self.api_client.select_header_accept( - ['application/json; charset=UTF-8']) # noqa: E501 - - # HTTP header `Content-Type` - header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 - ['application/json; charset=UTF-8']) # noqa: E501 - - # Authentication setting - auth_settings = ['oauth2'] # noqa: E501 - - return self.api_client.call_api( - '/projects/{project_gid}/saveAsTemplate', 'POST', - path_params, - query_params, - header_params, - body=body_params, - post_params=form_params, - files=local_var_files, - response_type='JobResponseData', # noqa: E501 - auth_settings=auth_settings, - async_req=params.get('async_req'), - _return_http_data_only=params.get('_return_http_data_only'), - _preload_content=params.get('_preload_content', True), - _request_timeout=params.get('_request_timeout'), - collection_formats=collection_formats) - - def remove_custom_field_setting_for_project(self, body, project_gid, **kwargs): # noqa: E501 - """Remove a custom field from a project # noqa: E501 - - Removes a custom field setting from a project. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.remove_custom_field_setting_for_project(body, project_gid, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param ProjectGidRemoveCustomFieldSettingBody body: Information about the custom field setting being removed. (required) - :param str project_gid: Globally unique identifier for the project. (required) - :return: EmptyResponseData - If the method is called asynchronously, - returns the request thread. - """ - kwargs['_return_http_data_only'] = True - if kwargs.get('async_req'): - return self.remove_custom_field_setting_for_project_with_http_info(body, project_gid, **kwargs) # noqa: E501 - else: - (data) = self.remove_custom_field_setting_for_project_with_http_info(body, project_gid, **kwargs) # noqa: E501 - return data - - def remove_custom_field_setting_for_project_with_http_info(self, body, project_gid, **kwargs): # noqa: E501 - """Remove a custom field from a project # noqa: E501 - - Removes a custom field setting from a project. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.remove_custom_field_setting_for_project_with_http_info(body, project_gid, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param ProjectGidRemoveCustomFieldSettingBody body: Information about the custom field setting being removed. (required) - :param str project_gid: Globally unique identifier for the project. (required) - :return: EmptyResponseData - If the method is called asynchronously, - returns the request thread. - """ - - all_params = ['body', 'project_gid'] # noqa: E501 - all_params.append('async_req') - all_params.append('_return_http_data_only') - all_params.append('_preload_content') - all_params.append('_request_timeout') - - params = locals() - for key, val in six.iteritems(params['kwargs']): - if key not in all_params: - raise TypeError( - "Got an unexpected keyword argument '%s'" - " to method remove_custom_field_setting_for_project" % key - ) - params[key] = val - del params['kwargs'] - # verify the required parameter 'body' is set - if ('body' not in params or - params['body'] is None): - raise ValueError("Missing the required parameter `body` when calling `remove_custom_field_setting_for_project`") # noqa: E501 - # verify the required parameter 'project_gid' is set - if ('project_gid' not in params or - params['project_gid'] is None): - raise ValueError("Missing the required parameter `project_gid` when calling `remove_custom_field_setting_for_project`") # noqa: E501 - - collection_formats = {} - - path_params = {} - if 'project_gid' in params: - path_params['project_gid'] = params['project_gid'] # noqa: E501 - - query_params = [] - - header_params = {} - - form_params = [] - local_var_files = {} - - body_params = None - if 'body' in params: - body_params = params['body'] - # HTTP header `Accept` - header_params['Accept'] = self.api_client.select_header_accept( - ['application/json; charset=UTF-8']) # noqa: E501 - - # HTTP header `Content-Type` - header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 - ['application/json; charset=UTF-8']) # noqa: E501 - - # Authentication setting - auth_settings = ['oauth2'] # noqa: E501 - - return self.api_client.call_api( - '/projects/{project_gid}/removeCustomFieldSetting', 'POST', - path_params, - query_params, - header_params, - body=body_params, - post_params=form_params, - files=local_var_files, - response_type='EmptyResponseData', # noqa: E501 - auth_settings=auth_settings, - async_req=params.get('async_req'), - _return_http_data_only=params.get('_return_http_data_only'), - _preload_content=params.get('_preload_content', True), - _request_timeout=params.get('_request_timeout'), - collection_formats=collection_formats) - - def remove_followers_for_project(self, body, project_gid, **kwargs): # noqa: E501 - """Remove followers from a project # noqa: E501 - - Removes the specified list of users from following the project, this will not affect project membership status. Returns the updated project record. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.remove_followers_for_project(body, project_gid, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param ProjectGidRemoveFollowersBody body: Information about the followers being removed. (required) - :param str project_gid: Globally unique identifier for the project. (required) - :param list[str] opt_fields: This endpoint returns a compact resource, which excludes some properties by default. To include those optional properties, set this query parameter to a comma-separated list of the properties you wish to include. - :return: ProjectResponseData - If the method is called asynchronously, - returns the request thread. - """ - kwargs['_return_http_data_only'] = True - if kwargs.get('async_req'): - return self.remove_followers_for_project_with_http_info(body, project_gid, **kwargs) # noqa: E501 - else: - (data) = self.remove_followers_for_project_with_http_info(body, project_gid, **kwargs) # noqa: E501 - return data - - def remove_followers_for_project_with_http_info(self, body, project_gid, **kwargs): # noqa: E501 - """Remove followers from a project # noqa: E501 - - Removes the specified list of users from following the project, this will not affect project membership status. Returns the updated project record. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.remove_followers_for_project_with_http_info(body, project_gid, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param ProjectGidRemoveFollowersBody body: Information about the followers being removed. (required) - :param str project_gid: Globally unique identifier for the project. (required) - :param list[str] opt_fields: This endpoint returns a compact resource, which excludes some properties by default. To include those optional properties, set this query parameter to a comma-separated list of the properties you wish to include. - :return: ProjectResponseData - If the method is called asynchronously, - returns the request thread. - """ - - all_params = ['body', 'project_gid', 'opt_fields'] # noqa: E501 - all_params.append('async_req') - all_params.append('_return_http_data_only') - all_params.append('_preload_content') - all_params.append('_request_timeout') - - params = locals() - for key, val in six.iteritems(params['kwargs']): - if key not in all_params: - raise TypeError( - "Got an unexpected keyword argument '%s'" - " to method remove_followers_for_project" % key - ) - params[key] = val - del params['kwargs'] - # verify the required parameter 'body' is set - if ('body' not in params or - params['body'] is None): - raise ValueError("Missing the required parameter `body` when calling `remove_followers_for_project`") # noqa: E501 - # verify the required parameter 'project_gid' is set - if ('project_gid' not in params or - params['project_gid'] is None): - raise ValueError("Missing the required parameter `project_gid` when calling `remove_followers_for_project`") # noqa: E501 - - collection_formats = {} - - path_params = {} - if 'project_gid' in params: - path_params['project_gid'] = params['project_gid'] # noqa: E501 - - query_params = [] - if 'opt_fields' in params: - query_params.append(('opt_fields', params['opt_fields'])) # noqa: E501 - collection_formats['opt_fields'] = 'csv' # noqa: E501 - - header_params = {} - - form_params = [] - local_var_files = {} - - body_params = None - if 'body' in params: - body_params = params['body'] - # HTTP header `Accept` - header_params['Accept'] = self.api_client.select_header_accept( - ['application/json; charset=UTF-8']) # noqa: E501 - - # HTTP header `Content-Type` - header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 - ['application/json; charset=UTF-8']) # noqa: E501 - - # Authentication setting - auth_settings = ['oauth2'] # noqa: E501 - - return self.api_client.call_api( - '/projects/{project_gid}/removeFollowers', 'POST', - path_params, - query_params, - header_params, - body=body_params, - post_params=form_params, - files=local_var_files, - response_type='ProjectResponseData', # noqa: E501 - auth_settings=auth_settings, - async_req=params.get('async_req'), - _return_http_data_only=params.get('_return_http_data_only'), - _preload_content=params.get('_preload_content', True), - _request_timeout=params.get('_request_timeout'), - collection_formats=collection_formats) - - def remove_members_for_project(self, body, project_gid, **kwargs): # noqa: E501 - """Remove users from a project # noqa: E501 - - Removes the specified list of users from members of the project. Returns the updated project record. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.remove_members_for_project(body, project_gid, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param ProjectGidRemoveMembersBody body: Information about the members being removed. (required) - :param str project_gid: Globally unique identifier for the project. (required) - :param list[str] opt_fields: This endpoint returns a compact resource, which excludes some properties by default. To include those optional properties, set this query parameter to a comma-separated list of the properties you wish to include. - :return: ProjectResponseData - If the method is called asynchronously, - returns the request thread. - """ - kwargs['_return_http_data_only'] = True - if kwargs.get('async_req'): - return self.remove_members_for_project_with_http_info(body, project_gid, **kwargs) # noqa: E501 - else: - (data) = self.remove_members_for_project_with_http_info(body, project_gid, **kwargs) # noqa: E501 - return data - - def remove_members_for_project_with_http_info(self, body, project_gid, **kwargs): # noqa: E501 - """Remove users from a project # noqa: E501 - - Removes the specified list of users from members of the project. Returns the updated project record. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.remove_members_for_project_with_http_info(body, project_gid, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param ProjectGidRemoveMembersBody body: Information about the members being removed. (required) - :param str project_gid: Globally unique identifier for the project. (required) - :param list[str] opt_fields: This endpoint returns a compact resource, which excludes some properties by default. To include those optional properties, set this query parameter to a comma-separated list of the properties you wish to include. - :return: ProjectResponseData - If the method is called asynchronously, - returns the request thread. - """ - - all_params = ['body', 'project_gid', 'opt_fields'] # noqa: E501 - all_params.append('async_req') - all_params.append('_return_http_data_only') - all_params.append('_preload_content') - all_params.append('_request_timeout') - - params = locals() - for key, val in six.iteritems(params['kwargs']): - if key not in all_params: - raise TypeError( - "Got an unexpected keyword argument '%s'" - " to method remove_members_for_project" % key - ) - params[key] = val - del params['kwargs'] - # verify the required parameter 'body' is set - if ('body' not in params or - params['body'] is None): - raise ValueError("Missing the required parameter `body` when calling `remove_members_for_project`") # noqa: E501 - # verify the required parameter 'project_gid' is set - if ('project_gid' not in params or - params['project_gid'] is None): - raise ValueError("Missing the required parameter `project_gid` when calling `remove_members_for_project`") # noqa: E501 - - collection_formats = {} - - path_params = {} - if 'project_gid' in params: - path_params['project_gid'] = params['project_gid'] # noqa: E501 - - query_params = [] - if 'opt_fields' in params: - query_params.append(('opt_fields', params['opt_fields'])) # noqa: E501 - collection_formats['opt_fields'] = 'csv' # noqa: E501 - - header_params = {} - - form_params = [] - local_var_files = {} - - body_params = None - if 'body' in params: - body_params = params['body'] - # HTTP header `Accept` - header_params['Accept'] = self.api_client.select_header_accept( - ['application/json; charset=UTF-8']) # noqa: E501 - - # HTTP header `Content-Type` - header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 - ['application/json; charset=UTF-8']) # noqa: E501 - - # Authentication setting - auth_settings = ['oauth2'] # noqa: E501 - - return self.api_client.call_api( - '/projects/{project_gid}/removeMembers', 'POST', - path_params, - query_params, - header_params, - body=body_params, - post_params=form_params, - files=local_var_files, - response_type='ProjectResponseData', # noqa: E501 - auth_settings=auth_settings, - async_req=params.get('async_req'), - _return_http_data_only=params.get('_return_http_data_only'), - _preload_content=params.get('_preload_content', True), - _request_timeout=params.get('_request_timeout'), - collection_formats=collection_formats) - - def update_project(self, body, project_gid, **kwargs): # noqa: E501 - """Update a project # noqa: E501 - - A specific, existing project can be updated by making a PUT request on the URL for that project. Only the fields provided in the `data` block will be updated; any unspecified fields will remain unchanged. When using this method, it is best to specify only those fields you wish to change, or else you may overwrite changes made by another user since you last retrieved the task. Returns the complete updated project record. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.update_project(body, project_gid, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param ProjectsProjectGidBody body: The updated fields for the project. (required) - :param str project_gid: Globally unique identifier for the project. (required) - :param list[str] opt_fields: This endpoint returns a compact resource, which excludes some properties by default. To include those optional properties, set this query parameter to a comma-separated list of the properties you wish to include. - :return: ProjectResponseData - If the method is called asynchronously, - returns the request thread. - """ - kwargs['_return_http_data_only'] = True - if kwargs.get('async_req'): - return self.update_project_with_http_info(body, project_gid, **kwargs) # noqa: E501 - else: - (data) = self.update_project_with_http_info(body, project_gid, **kwargs) # noqa: E501 - return data - - def update_project_with_http_info(self, body, project_gid, **kwargs): # noqa: E501 - """Update a project # noqa: E501 - - A specific, existing project can be updated by making a PUT request on the URL for that project. Only the fields provided in the `data` block will be updated; any unspecified fields will remain unchanged. When using this method, it is best to specify only those fields you wish to change, or else you may overwrite changes made by another user since you last retrieved the task. Returns the complete updated project record. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.update_project_with_http_info(body, project_gid, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param ProjectsProjectGidBody body: The updated fields for the project. (required) - :param str project_gid: Globally unique identifier for the project. (required) - :param list[str] opt_fields: This endpoint returns a compact resource, which excludes some properties by default. To include those optional properties, set this query parameter to a comma-separated list of the properties you wish to include. - :return: ProjectResponseData - If the method is called asynchronously, - returns the request thread. - """ - - all_params = ['body', 'project_gid', 'opt_fields'] # noqa: E501 - all_params.append('async_req') - all_params.append('_return_http_data_only') - all_params.append('_preload_content') - all_params.append('_request_timeout') - - params = locals() - for key, val in six.iteritems(params['kwargs']): - if key not in all_params: - raise TypeError( - "Got an unexpected keyword argument '%s'" - " to method update_project" % key - ) - params[key] = val - del params['kwargs'] - # verify the required parameter 'body' is set - if ('body' not in params or - params['body'] is None): - raise ValueError("Missing the required parameter `body` when calling `update_project`") # noqa: E501 - # verify the required parameter 'project_gid' is set - if ('project_gid' not in params or - params['project_gid'] is None): - raise ValueError("Missing the required parameter `project_gid` when calling `update_project`") # noqa: E501 - - collection_formats = {} - - path_params = {} - if 'project_gid' in params: - path_params['project_gid'] = params['project_gid'] # noqa: E501 - - query_params = [] - if 'opt_fields' in params: - query_params.append(('opt_fields', params['opt_fields'])) # noqa: E501 - collection_formats['opt_fields'] = 'csv' # noqa: E501 - - header_params = {} - - form_params = [] - local_var_files = {} - - body_params = None - if 'body' in params: - body_params = params['body'] - # HTTP header `Accept` - header_params['Accept'] = self.api_client.select_header_accept( - ['application/json; charset=UTF-8']) # noqa: E501 - - # HTTP header `Content-Type` - header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 - ['application/json; charset=UTF-8']) # noqa: E501 - - # Authentication setting - auth_settings = ['oauth2'] # noqa: E501 - - return self.api_client.call_api( - '/projects/{project_gid}', 'PUT', - path_params, - query_params, - header_params, - body=body_params, - post_params=form_params, - files=local_var_files, - response_type='ProjectResponseData', # noqa: E501 - auth_settings=auth_settings, - async_req=params.get('async_req'), - _return_http_data_only=params.get('_return_http_data_only'), - _preload_content=params.get('_preload_content', True), - _request_timeout=params.get('_request_timeout'), - collection_formats=collection_formats) + all_params = ['body', 'project_gid', 'opt_fields'] # noqa: E501 + all_params.append('async_req') + all_params.append('header_params') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + params = locals() + for key, val in six.iteritems(params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method update_project" % key + ) + params[key] = val + del params['kwargs'] + # verify the required parameter 'body' is set + if ('body' not in params or + params['body'] is None): + raise ValueError("Missing the required parameter `body` when calling `update_project`") # noqa: E501 + # verify the required parameter 'project_gid' is set + if ('project_gid' not in params or + params['project_gid'] is None): + raise ValueError("Missing the required parameter `project_gid` when calling `update_project`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'project_gid' in params: + path_params['project_gid'] = params['project_gid'] # noqa: E501 + + query_params = [] + if 'opt_fields' in params: + query_params.append(('opt_fields', params['opt_fields'])) # noqa: E501 + collection_formats['opt_fields'] = 'csv' # noqa: E501 + + header_params = kwargs.get("header_params", {}) + + form_params = [] + local_var_files = {} + + body_params = None + if 'body' in params: + body_params = params['body'] + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['application/json; charset=UTF-8']) # noqa: E501 + + # HTTP header `Content-Type` + header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 + ['application/json; charset=UTF-8']) # noqa: E501 + + # Authentication setting + auth_settings = ['oauth2'] # noqa: E501 + + return self.api_client.call_api( + '/projects/{project_gid}', 'PUT', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='ProjectResponseData', # noqa: E501 + auth_settings=auth_settings, + async_req=params.get('async_req'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) diff --git a/asana/api/rules_api.py b/asana/api/rules_api.py index 88d91b7b..f7ffc231 100644 --- a/asana/api/rules_api.py +++ b/asana/api/rules_api.py @@ -21,120 +21,121 @@ class RulesApi(object): - """NOTE: This class is auto generated by the swagger code generator program. +"""NOTE: This class is auto generated by the swagger code generator program. - Do not edit the class manually. - Ref: https://github.com/swagger-api/swagger-codegen +Do not edit the class manually. +Ref: https://github.com/swagger-api/swagger-codegen +""" + +def __init__(self, api_client=None): + if api_client is None: + api_client = ApiClient() + self.api_client = api_client + +def trigger_rule(self, body, rule_trigger_gid, **kwargs): # noqa: E501 + """Trigger a rule # noqa: E501 + + Trigger a rule which uses an [\"incoming web request\"](/docs/incoming-web-requests) trigger. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.trigger_rule(body, rule_trigger_gid, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param RuleTriggerGidRunBody body: A dictionary of variables accessible from within the rule. (required) + :param str rule_trigger_gid: The ID of the incoming web request trigger. This value is a path parameter that is automatically generated for the API endpoint. (required) + :return: RuleTriggerResponseData + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = kwargs.get("_return_http_data_only", True) + if kwargs.get('async_req'): + return self.trigger_rule_with_http_info(body, rule_trigger_gid, **kwargs) # noqa: E501 + else: + (data) = self.trigger_rule_with_http_info(body, rule_trigger_gid, **kwargs) # noqa: E501 + return data + +def trigger_rule_with_http_info(self, body, rule_trigger_gid, **kwargs): # noqa: E501 + """Trigger a rule # noqa: E501 + + Trigger a rule which uses an [\"incoming web request\"](/docs/incoming-web-requests) trigger. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.trigger_rule_with_http_info(body, rule_trigger_gid, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param RuleTriggerGidRunBody body: A dictionary of variables accessible from within the rule. (required) + :param str rule_trigger_gid: The ID of the incoming web request trigger. This value is a path parameter that is automatically generated for the API endpoint. (required) + :return: RuleTriggerResponseData + If the method is called asynchronously, + returns the request thread. """ - def __init__(self, api_client=None): - if api_client is None: - api_client = ApiClient() - self.api_client = api_client - - def trigger_rule(self, body, rule_trigger_gid, **kwargs): # noqa: E501 - """Trigger a rule # noqa: E501 - - Trigger a rule which uses an [\"incoming web request\"](/docs/incoming-web-requests) trigger. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.trigger_rule(body, rule_trigger_gid, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param RuleTriggerGidRunBody body: A dictionary of variables accessible from within the rule. (required) - :param str rule_trigger_gid: The ID of the incoming web request trigger. This value is a path parameter that is automatically generated for the API endpoint. (required) - :return: RuleTriggerResponseData - If the method is called asynchronously, - returns the request thread. - """ - kwargs['_return_http_data_only'] = True - if kwargs.get('async_req'): - return self.trigger_rule_with_http_info(body, rule_trigger_gid, **kwargs) # noqa: E501 - else: - (data) = self.trigger_rule_with_http_info(body, rule_trigger_gid, **kwargs) # noqa: E501 - return data - - def trigger_rule_with_http_info(self, body, rule_trigger_gid, **kwargs): # noqa: E501 - """Trigger a rule # noqa: E501 - - Trigger a rule which uses an [\"incoming web request\"](/docs/incoming-web-requests) trigger. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.trigger_rule_with_http_info(body, rule_trigger_gid, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param RuleTriggerGidRunBody body: A dictionary of variables accessible from within the rule. (required) - :param str rule_trigger_gid: The ID of the incoming web request trigger. This value is a path parameter that is automatically generated for the API endpoint. (required) - :return: RuleTriggerResponseData - If the method is called asynchronously, - returns the request thread. - """ - - all_params = ['body', 'rule_trigger_gid'] # noqa: E501 - all_params.append('async_req') - all_params.append('_return_http_data_only') - all_params.append('_preload_content') - all_params.append('_request_timeout') - - params = locals() - for key, val in six.iteritems(params['kwargs']): - if key not in all_params: - raise TypeError( - "Got an unexpected keyword argument '%s'" - " to method trigger_rule" % key - ) - params[key] = val - del params['kwargs'] - # verify the required parameter 'body' is set - if ('body' not in params or - params['body'] is None): - raise ValueError("Missing the required parameter `body` when calling `trigger_rule`") # noqa: E501 - # verify the required parameter 'rule_trigger_gid' is set - if ('rule_trigger_gid' not in params or - params['rule_trigger_gid'] is None): - raise ValueError("Missing the required parameter `rule_trigger_gid` when calling `trigger_rule`") # noqa: E501 - - collection_formats = {} - - path_params = {} - if 'rule_trigger_gid' in params: - path_params['rule_trigger_gid'] = params['rule_trigger_gid'] # noqa: E501 - - query_params = [] - - header_params = {} - - form_params = [] - local_var_files = {} - - body_params = None - if 'body' in params: - body_params = params['body'] - # HTTP header `Accept` - header_params['Accept'] = self.api_client.select_header_accept( - ['application/json; charset=UTF-8']) # noqa: E501 - - # HTTP header `Content-Type` - header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 - ['application/json; charset=UTF-8']) # noqa: E501 - - # Authentication setting - auth_settings = ['oauth2'] # noqa: E501 - - return self.api_client.call_api( - '/rule_triggers/{rule_trigger_gid}/run', 'POST', - path_params, - query_params, - header_params, - body=body_params, - post_params=form_params, - files=local_var_files, - response_type='RuleTriggerResponseData', # noqa: E501 - auth_settings=auth_settings, - async_req=params.get('async_req'), - _return_http_data_only=params.get('_return_http_data_only'), - _preload_content=params.get('_preload_content', True), - _request_timeout=params.get('_request_timeout'), - collection_formats=collection_formats) + all_params = ['body', 'rule_trigger_gid'] # noqa: E501 + all_params.append('async_req') + all_params.append('header_params') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + params = locals() + for key, val in six.iteritems(params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method trigger_rule" % key + ) + params[key] = val + del params['kwargs'] + # verify the required parameter 'body' is set + if ('body' not in params or + params['body'] is None): + raise ValueError("Missing the required parameter `body` when calling `trigger_rule`") # noqa: E501 + # verify the required parameter 'rule_trigger_gid' is set + if ('rule_trigger_gid' not in params or + params['rule_trigger_gid'] is None): + raise ValueError("Missing the required parameter `rule_trigger_gid` when calling `trigger_rule`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'rule_trigger_gid' in params: + path_params['rule_trigger_gid'] = params['rule_trigger_gid'] # noqa: E501 + + query_params = [] + + header_params = kwargs.get("header_params", {}) + + form_params = [] + local_var_files = {} + + body_params = None + if 'body' in params: + body_params = params['body'] + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['application/json; charset=UTF-8']) # noqa: E501 + + # HTTP header `Content-Type` + header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 + ['application/json; charset=UTF-8']) # noqa: E501 + + # Authentication setting + auth_settings = ['oauth2'] # noqa: E501 + + return self.api_client.call_api( + '/rule_triggers/{rule_trigger_gid}/run', 'POST', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='RuleTriggerResponseData', # noqa: E501 + auth_settings=auth_settings, + async_req=params.get('async_req'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) diff --git a/asana/api/sections_api.py b/asana/api/sections_api.py index 6927320b..bb213197 100644 --- a/asana/api/sections_api.py +++ b/asana/api/sections_api.py @@ -21,738 +21,745 @@ class SectionsApi(object): - """NOTE: This class is auto generated by the swagger code generator program. +"""NOTE: This class is auto generated by the swagger code generator program. - Do not edit the class manually. - Ref: https://github.com/swagger-api/swagger-codegen +Do not edit the class manually. +Ref: https://github.com/swagger-api/swagger-codegen +""" + +def __init__(self, api_client=None): + if api_client is None: + api_client = ApiClient() + self.api_client = api_client + +def add_task_for_section(self, section_gid, **kwargs): # noqa: E501 + """Add task to section # noqa: E501 + + Add a task to a specific, existing section. This will remove the task from other sections of the project. The task will be inserted at the top of a section unless an insert_before or insert_after parameter is declared. This does not work for separators (tasks with the resource_subtype of section). # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.add_task_for_section(section_gid, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str section_gid: The globally unique identifier for the section. (required) + :param SectionGidAddTaskBody body: The task and optionally the insert location. + :return: EmptyResponseData + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = kwargs.get("_return_http_data_only", True) + if kwargs.get('async_req'): + return self.add_task_for_section_with_http_info(section_gid, **kwargs) # noqa: E501 + else: + (data) = self.add_task_for_section_with_http_info(section_gid, **kwargs) # noqa: E501 + return data + +def add_task_for_section_with_http_info(self, section_gid, **kwargs): # noqa: E501 + """Add task to section # noqa: E501 + + Add a task to a specific, existing section. This will remove the task from other sections of the project. The task will be inserted at the top of a section unless an insert_before or insert_after parameter is declared. This does not work for separators (tasks with the resource_subtype of section). # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.add_task_for_section_with_http_info(section_gid, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str section_gid: The globally unique identifier for the section. (required) + :param SectionGidAddTaskBody body: The task and optionally the insert location. + :return: EmptyResponseData + If the method is called asynchronously, + returns the request thread. + """ + + all_params = ['section_gid', 'body'] # noqa: E501 + all_params.append('async_req') + all_params.append('header_params') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + params = locals() + for key, val in six.iteritems(params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method add_task_for_section" % key + ) + params[key] = val + del params['kwargs'] + # verify the required parameter 'section_gid' is set + if ('section_gid' not in params or + params['section_gid'] is None): + raise ValueError("Missing the required parameter `section_gid` when calling `add_task_for_section`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'section_gid' in params: + path_params['section_gid'] = params['section_gid'] # noqa: E501 + + query_params = [] + + header_params = kwargs.get("header_params", {}) + + form_params = [] + local_var_files = {} + + body_params = None + if 'body' in params: + body_params = params['body'] + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['application/json; charset=UTF-8']) # noqa: E501 + + # HTTP header `Content-Type` + header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 + ['application/json; charset=UTF-8']) # noqa: E501 + + # Authentication setting + auth_settings = ['oauth2'] # noqa: E501 + + return self.api_client.call_api( + '/sections/{section_gid}/addTask', 'POST', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='EmptyResponseData', # noqa: E501 + auth_settings=auth_settings, + async_req=params.get('async_req'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) + +def create_section_for_project(self, project_gid, **kwargs): # noqa: E501 + """Create a section in a project # noqa: E501 + + Creates a new section in a project. Returns the full record of the newly created section. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.create_section_for_project(project_gid, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str project_gid: Globally unique identifier for the project. (required) + :param ProjectGidSectionsBody body: The section to create. + :param list[str] opt_fields: This endpoint returns a compact resource, which excludes some properties by default. To include those optional properties, set this query parameter to a comma-separated list of the properties you wish to include. + :return: SectionResponseData + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = kwargs.get("_return_http_data_only", True) + if kwargs.get('async_req'): + return self.create_section_for_project_with_http_info(project_gid, **kwargs) # noqa: E501 + else: + (data) = self.create_section_for_project_with_http_info(project_gid, **kwargs) # noqa: E501 + return data + +def create_section_for_project_with_http_info(self, project_gid, **kwargs): # noqa: E501 + """Create a section in a project # noqa: E501 + + Creates a new section in a project. Returns the full record of the newly created section. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.create_section_for_project_with_http_info(project_gid, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str project_gid: Globally unique identifier for the project. (required) + :param ProjectGidSectionsBody body: The section to create. + :param list[str] opt_fields: This endpoint returns a compact resource, which excludes some properties by default. To include those optional properties, set this query parameter to a comma-separated list of the properties you wish to include. + :return: SectionResponseData + If the method is called asynchronously, + returns the request thread. + """ + + all_params = ['project_gid', 'body', 'opt_fields'] # noqa: E501 + all_params.append('async_req') + all_params.append('header_params') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + params = locals() + for key, val in six.iteritems(params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method create_section_for_project" % key + ) + params[key] = val + del params['kwargs'] + # verify the required parameter 'project_gid' is set + if ('project_gid' not in params or + params['project_gid'] is None): + raise ValueError("Missing the required parameter `project_gid` when calling `create_section_for_project`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'project_gid' in params: + path_params['project_gid'] = params['project_gid'] # noqa: E501 + + query_params = [] + if 'opt_fields' in params: + query_params.append(('opt_fields', params['opt_fields'])) # noqa: E501 + collection_formats['opt_fields'] = 'csv' # noqa: E501 + + header_params = kwargs.get("header_params", {}) + + form_params = [] + local_var_files = {} + + body_params = None + if 'body' in params: + body_params = params['body'] + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['application/json; charset=UTF-8']) # noqa: E501 + + # HTTP header `Content-Type` + header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 + ['application/json; charset=UTF-8']) # noqa: E501 + + # Authentication setting + auth_settings = ['oauth2'] # noqa: E501 + + return self.api_client.call_api( + '/projects/{project_gid}/sections', 'POST', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='SectionResponseData', # noqa: E501 + auth_settings=auth_settings, + async_req=params.get('async_req'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) + +def delete_section(self, section_gid, **kwargs): # noqa: E501 + """Delete a section # noqa: E501 + + A specific, existing section can be deleted by making a DELETE request on the URL for that section. Note that sections must be empty to be deleted. The last remaining section cannot be deleted. Returns an empty data block. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.delete_section(section_gid, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str section_gid: The globally unique identifier for the section. (required) + :return: EmptyResponseData + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = kwargs.get("_return_http_data_only", True) + if kwargs.get('async_req'): + return self.delete_section_with_http_info(section_gid, **kwargs) # noqa: E501 + else: + (data) = self.delete_section_with_http_info(section_gid, **kwargs) # noqa: E501 + return data + +def delete_section_with_http_info(self, section_gid, **kwargs): # noqa: E501 + """Delete a section # noqa: E501 + + A specific, existing section can be deleted by making a DELETE request on the URL for that section. Note that sections must be empty to be deleted. The last remaining section cannot be deleted. Returns an empty data block. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.delete_section_with_http_info(section_gid, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str section_gid: The globally unique identifier for the section. (required) + :return: EmptyResponseData + If the method is called asynchronously, + returns the request thread. + """ + + all_params = ['section_gid'] # noqa: E501 + all_params.append('async_req') + all_params.append('header_params') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + params = locals() + for key, val in six.iteritems(params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method delete_section" % key + ) + params[key] = val + del params['kwargs'] + # verify the required parameter 'section_gid' is set + if ('section_gid' not in params or + params['section_gid'] is None): + raise ValueError("Missing the required parameter `section_gid` when calling `delete_section`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'section_gid' in params: + path_params['section_gid'] = params['section_gid'] # noqa: E501 + + query_params = [] + + header_params = kwargs.get("header_params", {}) + + form_params = [] + local_var_files = {} + + body_params = None + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['application/json; charset=UTF-8']) # noqa: E501 + + # Authentication setting + auth_settings = ['oauth2'] # noqa: E501 + + return self.api_client.call_api( + '/sections/{section_gid}', 'DELETE', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='EmptyResponseData', # noqa: E501 + auth_settings=auth_settings, + async_req=params.get('async_req'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) + +def get_section(self, section_gid, **kwargs): # noqa: E501 + """Get a section # noqa: E501 + + Returns the complete record for a single section. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.get_section(section_gid, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str section_gid: The globally unique identifier for the section. (required) + :param list[str] opt_fields: This endpoint returns a compact resource, which excludes some properties by default. To include those optional properties, set this query parameter to a comma-separated list of the properties you wish to include. + :return: SectionResponseData + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = kwargs.get("_return_http_data_only", True) + if kwargs.get('async_req'): + return self.get_section_with_http_info(section_gid, **kwargs) # noqa: E501 + else: + (data) = self.get_section_with_http_info(section_gid, **kwargs) # noqa: E501 + return data + +def get_section_with_http_info(self, section_gid, **kwargs): # noqa: E501 + """Get a section # noqa: E501 + + Returns the complete record for a single section. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.get_section_with_http_info(section_gid, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str section_gid: The globally unique identifier for the section. (required) + :param list[str] opt_fields: This endpoint returns a compact resource, which excludes some properties by default. To include those optional properties, set this query parameter to a comma-separated list of the properties you wish to include. + :return: SectionResponseData + If the method is called asynchronously, + returns the request thread. + """ + + all_params = ['section_gid', 'opt_fields'] # noqa: E501 + all_params.append('async_req') + all_params.append('header_params') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + params = locals() + for key, val in six.iteritems(params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method get_section" % key + ) + params[key] = val + del params['kwargs'] + # verify the required parameter 'section_gid' is set + if ('section_gid' not in params or + params['section_gid'] is None): + raise ValueError("Missing the required parameter `section_gid` when calling `get_section`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'section_gid' in params: + path_params['section_gid'] = params['section_gid'] # noqa: E501 + + query_params = [] + if 'opt_fields' in params: + query_params.append(('opt_fields', params['opt_fields'])) # noqa: E501 + collection_formats['opt_fields'] = 'csv' # noqa: E501 + + header_params = kwargs.get("header_params", {}) + + form_params = [] + local_var_files = {} + + body_params = None + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['application/json; charset=UTF-8']) # noqa: E501 + + # Authentication setting + auth_settings = ['oauth2'] # noqa: E501 + + return self.api_client.call_api( + '/sections/{section_gid}', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='SectionResponseData', # noqa: E501 + auth_settings=auth_settings, + async_req=params.get('async_req'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) + +def get_sections_for_project(self, project_gid, **kwargs): # noqa: E501 + """Get sections in a project # noqa: E501 + + Returns the compact records for all sections in the specified project. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.get_sections_for_project(project_gid, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str project_gid: Globally unique identifier for the project. (required) + :param int limit: Results per page. The number of objects to return per page. The value must be between 1 and 100. + :param str offset: 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 list[str] opt_fields: This endpoint returns a compact resource, which excludes some properties by default. To include those optional properties, set this query parameter to a comma-separated list of the properties you wish to include. + :return: SectionResponseArray + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = kwargs.get("_return_http_data_only", True) + if kwargs.get('async_req'): + return self.get_sections_for_project_with_http_info(project_gid, **kwargs) # noqa: E501 + else: + (data) = self.get_sections_for_project_with_http_info(project_gid, **kwargs) # noqa: E501 + return data + +def get_sections_for_project_with_http_info(self, project_gid, **kwargs): # noqa: E501 + """Get sections in a project # noqa: E501 + + Returns the compact records for all sections in the specified project. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.get_sections_for_project_with_http_info(project_gid, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str project_gid: Globally unique identifier for the project. (required) + :param int limit: Results per page. The number of objects to return per page. The value must be between 1 and 100. + :param str offset: 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 list[str] opt_fields: This endpoint returns a compact resource, which excludes some properties by default. To include those optional properties, set this query parameter to a comma-separated list of the properties you wish to include. + :return: SectionResponseArray + If the method is called asynchronously, + returns the request thread. + """ + + all_params = ['project_gid', 'limit', 'offset', 'opt_fields'] # noqa: E501 + all_params.append('async_req') + all_params.append('header_params') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + params = locals() + for key, val in six.iteritems(params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method get_sections_for_project" % key + ) + params[key] = val + del params['kwargs'] + # verify the required parameter 'project_gid' is set + if ('project_gid' not in params or + params['project_gid'] is None): + raise ValueError("Missing the required parameter `project_gid` when calling `get_sections_for_project`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'project_gid' in params: + path_params['project_gid'] = params['project_gid'] # noqa: E501 + + query_params = [] + if 'limit' in params: + query_params.append(('limit', params['limit'])) # noqa: E501 + if 'offset' in params: + query_params.append(('offset', params['offset'])) # noqa: E501 + if 'opt_fields' in params: + query_params.append(('opt_fields', params['opt_fields'])) # noqa: E501 + collection_formats['opt_fields'] = 'csv' # noqa: E501 + + header_params = kwargs.get("header_params", {}) + + form_params = [] + local_var_files = {} + + body_params = None + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['application/json; charset=UTF-8']) # noqa: E501 + + # Authentication setting + auth_settings = ['oauth2'] # noqa: E501 + + return self.api_client.call_api( + '/projects/{project_gid}/sections', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='SectionResponseArray', # noqa: E501 + auth_settings=auth_settings, + async_req=params.get('async_req'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) + +def insert_section_for_project(self, project_gid, **kwargs): # noqa: E501 + """Move or Insert sections # noqa: E501 + + Move sections relative to each other. One of `before_section` or `after_section` is required. Sections cannot be moved between projects. Returns an empty data block. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.insert_section_for_project(project_gid, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str project_gid: Globally unique identifier for the project. (required) + :param SectionsInsertBody body: The section's move action. + :return: EmptyResponseData + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = kwargs.get("_return_http_data_only", True) + if kwargs.get('async_req'): + return self.insert_section_for_project_with_http_info(project_gid, **kwargs) # noqa: E501 + else: + (data) = self.insert_section_for_project_with_http_info(project_gid, **kwargs) # noqa: E501 + return data + +def insert_section_for_project_with_http_info(self, project_gid, **kwargs): # noqa: E501 + """Move or Insert sections # noqa: E501 + + Move sections relative to each other. One of `before_section` or `after_section` is required. Sections cannot be moved between projects. Returns an empty data block. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.insert_section_for_project_with_http_info(project_gid, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str project_gid: Globally unique identifier for the project. (required) + :param SectionsInsertBody body: The section's move action. + :return: EmptyResponseData + If the method is called asynchronously, + returns the request thread. + """ + + all_params = ['project_gid', 'body'] # noqa: E501 + all_params.append('async_req') + all_params.append('header_params') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + params = locals() + for key, val in six.iteritems(params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method insert_section_for_project" % key + ) + params[key] = val + del params['kwargs'] + # verify the required parameter 'project_gid' is set + if ('project_gid' not in params or + params['project_gid'] is None): + raise ValueError("Missing the required parameter `project_gid` when calling `insert_section_for_project`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'project_gid' in params: + path_params['project_gid'] = params['project_gid'] # noqa: E501 + + query_params = [] + + header_params = kwargs.get("header_params", {}) + + form_params = [] + local_var_files = {} + + body_params = None + if 'body' in params: + body_params = params['body'] + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['application/json; charset=UTF-8']) # noqa: E501 + + # HTTP header `Content-Type` + header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 + ['application/json; charset=UTF-8']) # noqa: E501 + + # Authentication setting + auth_settings = ['oauth2'] # noqa: E501 + + return self.api_client.call_api( + '/projects/{project_gid}/sections/insert', 'POST', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='EmptyResponseData', # noqa: E501 + auth_settings=auth_settings, + async_req=params.get('async_req'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) + +def update_section(self, section_gid, **kwargs): # noqa: E501 + """Update a section # noqa: E501 + + A specific, existing section can be updated by making a PUT request on the URL for that project. Only the fields provided in the `data` block will be updated; any unspecified fields will remain unchanged. (note that at this time, the only field that can be updated is the `name` field.) When using this method, it is best to specify only those fields you wish to change, or else you may overwrite changes made by another user since you last retrieved the task. Returns the complete updated section record. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.update_section(section_gid, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str section_gid: The globally unique identifier for the section. (required) + :param SectionsSectionGidBody body: The section to create. + :param list[str] opt_fields: This endpoint returns a compact resource, which excludes some properties by default. To include those optional properties, set this query parameter to a comma-separated list of the properties you wish to include. + :return: SectionResponseData + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = kwargs.get("_return_http_data_only", True) + if kwargs.get('async_req'): + return self.update_section_with_http_info(section_gid, **kwargs) # noqa: E501 + else: + (data) = self.update_section_with_http_info(section_gid, **kwargs) # noqa: E501 + return data + +def update_section_with_http_info(self, section_gid, **kwargs): # noqa: E501 + """Update a section # noqa: E501 + + A specific, existing section can be updated by making a PUT request on the URL for that project. Only the fields provided in the `data` block will be updated; any unspecified fields will remain unchanged. (note that at this time, the only field that can be updated is the `name` field.) When using this method, it is best to specify only those fields you wish to change, or else you may overwrite changes made by another user since you last retrieved the task. Returns the complete updated section record. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.update_section_with_http_info(section_gid, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str section_gid: The globally unique identifier for the section. (required) + :param SectionsSectionGidBody body: The section to create. + :param list[str] opt_fields: This endpoint returns a compact resource, which excludes some properties by default. To include those optional properties, set this query parameter to a comma-separated list of the properties you wish to include. + :return: SectionResponseData + If the method is called asynchronously, + returns the request thread. """ - def __init__(self, api_client=None): - if api_client is None: - api_client = ApiClient() - self.api_client = api_client - - def add_task_for_section(self, section_gid, **kwargs): # noqa: E501 - """Add task to section # noqa: E501 - - Add a task to a specific, existing section. This will remove the task from other sections of the project. The task will be inserted at the top of a section unless an insert_before or insert_after parameter is declared. This does not work for separators (tasks with the resource_subtype of section). # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.add_task_for_section(section_gid, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param str section_gid: The globally unique identifier for the section. (required) - :param SectionGidAddTaskBody body: The task and optionally the insert location. - :return: EmptyResponseData - If the method is called asynchronously, - returns the request thread. - """ - kwargs['_return_http_data_only'] = True - if kwargs.get('async_req'): - return self.add_task_for_section_with_http_info(section_gid, **kwargs) # noqa: E501 - else: - (data) = self.add_task_for_section_with_http_info(section_gid, **kwargs) # noqa: E501 - return data - - def add_task_for_section_with_http_info(self, section_gid, **kwargs): # noqa: E501 - """Add task to section # noqa: E501 - - Add a task to a specific, existing section. This will remove the task from other sections of the project. The task will be inserted at the top of a section unless an insert_before or insert_after parameter is declared. This does not work for separators (tasks with the resource_subtype of section). # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.add_task_for_section_with_http_info(section_gid, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param str section_gid: The globally unique identifier for the section. (required) - :param SectionGidAddTaskBody body: The task and optionally the insert location. - :return: EmptyResponseData - If the method is called asynchronously, - returns the request thread. - """ - - all_params = ['section_gid', 'body'] # noqa: E501 - all_params.append('async_req') - all_params.append('_return_http_data_only') - all_params.append('_preload_content') - all_params.append('_request_timeout') - - params = locals() - for key, val in six.iteritems(params['kwargs']): - if key not in all_params: - raise TypeError( - "Got an unexpected keyword argument '%s'" - " to method add_task_for_section" % key - ) - params[key] = val - del params['kwargs'] - # verify the required parameter 'section_gid' is set - if ('section_gid' not in params or - params['section_gid'] is None): - raise ValueError("Missing the required parameter `section_gid` when calling `add_task_for_section`") # noqa: E501 - - collection_formats = {} - - path_params = {} - if 'section_gid' in params: - path_params['section_gid'] = params['section_gid'] # noqa: E501 - - query_params = [] - - header_params = {} - - form_params = [] - local_var_files = {} - - body_params = None - if 'body' in params: - body_params = params['body'] - # HTTP header `Accept` - header_params['Accept'] = self.api_client.select_header_accept( - ['application/json; charset=UTF-8']) # noqa: E501 - - # HTTP header `Content-Type` - header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 - ['application/json; charset=UTF-8']) # noqa: E501 - - # Authentication setting - auth_settings = ['oauth2'] # noqa: E501 - - return self.api_client.call_api( - '/sections/{section_gid}/addTask', 'POST', - path_params, - query_params, - header_params, - body=body_params, - post_params=form_params, - files=local_var_files, - response_type='EmptyResponseData', # noqa: E501 - auth_settings=auth_settings, - async_req=params.get('async_req'), - _return_http_data_only=params.get('_return_http_data_only'), - _preload_content=params.get('_preload_content', True), - _request_timeout=params.get('_request_timeout'), - collection_formats=collection_formats) - - def create_section_for_project(self, project_gid, **kwargs): # noqa: E501 - """Create a section in a project # noqa: E501 - - Creates a new section in a project. Returns the full record of the newly created section. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.create_section_for_project(project_gid, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param str project_gid: Globally unique identifier for the project. (required) - :param ProjectGidSectionsBody body: The section to create. - :param list[str] opt_fields: This endpoint returns a compact resource, which excludes some properties by default. To include those optional properties, set this query parameter to a comma-separated list of the properties you wish to include. - :return: SectionResponseData - If the method is called asynchronously, - returns the request thread. - """ - kwargs['_return_http_data_only'] = True - if kwargs.get('async_req'): - return self.create_section_for_project_with_http_info(project_gid, **kwargs) # noqa: E501 - else: - (data) = self.create_section_for_project_with_http_info(project_gid, **kwargs) # noqa: E501 - return data - - def create_section_for_project_with_http_info(self, project_gid, **kwargs): # noqa: E501 - """Create a section in a project # noqa: E501 - - Creates a new section in a project. Returns the full record of the newly created section. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.create_section_for_project_with_http_info(project_gid, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param str project_gid: Globally unique identifier for the project. (required) - :param ProjectGidSectionsBody body: The section to create. - :param list[str] opt_fields: This endpoint returns a compact resource, which excludes some properties by default. To include those optional properties, set this query parameter to a comma-separated list of the properties you wish to include. - :return: SectionResponseData - If the method is called asynchronously, - returns the request thread. - """ - - all_params = ['project_gid', 'body', 'opt_fields'] # noqa: E501 - all_params.append('async_req') - all_params.append('_return_http_data_only') - all_params.append('_preload_content') - all_params.append('_request_timeout') - - params = locals() - for key, val in six.iteritems(params['kwargs']): - if key not in all_params: - raise TypeError( - "Got an unexpected keyword argument '%s'" - " to method create_section_for_project" % key - ) - params[key] = val - del params['kwargs'] - # verify the required parameter 'project_gid' is set - if ('project_gid' not in params or - params['project_gid'] is None): - raise ValueError("Missing the required parameter `project_gid` when calling `create_section_for_project`") # noqa: E501 - - collection_formats = {} - - path_params = {} - if 'project_gid' in params: - path_params['project_gid'] = params['project_gid'] # noqa: E501 - - query_params = [] - if 'opt_fields' in params: - query_params.append(('opt_fields', params['opt_fields'])) # noqa: E501 - collection_formats['opt_fields'] = 'csv' # noqa: E501 - - header_params = {} - - form_params = [] - local_var_files = {} - - body_params = None - if 'body' in params: - body_params = params['body'] - # HTTP header `Accept` - header_params['Accept'] = self.api_client.select_header_accept( - ['application/json; charset=UTF-8']) # noqa: E501 - - # HTTP header `Content-Type` - header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 - ['application/json; charset=UTF-8']) # noqa: E501 - - # Authentication setting - auth_settings = ['oauth2'] # noqa: E501 - - return self.api_client.call_api( - '/projects/{project_gid}/sections', 'POST', - path_params, - query_params, - header_params, - body=body_params, - post_params=form_params, - files=local_var_files, - response_type='SectionResponseData', # noqa: E501 - auth_settings=auth_settings, - async_req=params.get('async_req'), - _return_http_data_only=params.get('_return_http_data_only'), - _preload_content=params.get('_preload_content', True), - _request_timeout=params.get('_request_timeout'), - collection_formats=collection_formats) - - def delete_section(self, section_gid, **kwargs): # noqa: E501 - """Delete a section # noqa: E501 - - A specific, existing section can be deleted by making a DELETE request on the URL for that section. Note that sections must be empty to be deleted. The last remaining section cannot be deleted. Returns an empty data block. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.delete_section(section_gid, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param str section_gid: The globally unique identifier for the section. (required) - :return: EmptyResponseData - If the method is called asynchronously, - returns the request thread. - """ - kwargs['_return_http_data_only'] = True - if kwargs.get('async_req'): - return self.delete_section_with_http_info(section_gid, **kwargs) # noqa: E501 - else: - (data) = self.delete_section_with_http_info(section_gid, **kwargs) # noqa: E501 - return data - - def delete_section_with_http_info(self, section_gid, **kwargs): # noqa: E501 - """Delete a section # noqa: E501 - - A specific, existing section can be deleted by making a DELETE request on the URL for that section. Note that sections must be empty to be deleted. The last remaining section cannot be deleted. Returns an empty data block. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.delete_section_with_http_info(section_gid, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param str section_gid: The globally unique identifier for the section. (required) - :return: EmptyResponseData - If the method is called asynchronously, - returns the request thread. - """ - - all_params = ['section_gid'] # noqa: E501 - all_params.append('async_req') - all_params.append('_return_http_data_only') - all_params.append('_preload_content') - all_params.append('_request_timeout') - - params = locals() - for key, val in six.iteritems(params['kwargs']): - if key not in all_params: - raise TypeError( - "Got an unexpected keyword argument '%s'" - " to method delete_section" % key - ) - params[key] = val - del params['kwargs'] - # verify the required parameter 'section_gid' is set - if ('section_gid' not in params or - params['section_gid'] is None): - raise ValueError("Missing the required parameter `section_gid` when calling `delete_section`") # noqa: E501 - - collection_formats = {} - - path_params = {} - if 'section_gid' in params: - path_params['section_gid'] = params['section_gid'] # noqa: E501 - - query_params = [] - - header_params = {} - - form_params = [] - local_var_files = {} - - body_params = None - # HTTP header `Accept` - header_params['Accept'] = self.api_client.select_header_accept( - ['application/json; charset=UTF-8']) # noqa: E501 - - # Authentication setting - auth_settings = ['oauth2'] # noqa: E501 - - return self.api_client.call_api( - '/sections/{section_gid}', 'DELETE', - path_params, - query_params, - header_params, - body=body_params, - post_params=form_params, - files=local_var_files, - response_type='EmptyResponseData', # noqa: E501 - auth_settings=auth_settings, - async_req=params.get('async_req'), - _return_http_data_only=params.get('_return_http_data_only'), - _preload_content=params.get('_preload_content', True), - _request_timeout=params.get('_request_timeout'), - collection_formats=collection_formats) - - def get_section(self, section_gid, **kwargs): # noqa: E501 - """Get a section # noqa: E501 - - Returns the complete record for a single section. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.get_section(section_gid, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param str section_gid: The globally unique identifier for the section. (required) - :param list[str] opt_fields: This endpoint returns a compact resource, which excludes some properties by default. To include those optional properties, set this query parameter to a comma-separated list of the properties you wish to include. - :return: SectionResponseData - If the method is called asynchronously, - returns the request thread. - """ - kwargs['_return_http_data_only'] = True - if kwargs.get('async_req'): - return self.get_section_with_http_info(section_gid, **kwargs) # noqa: E501 - else: - (data) = self.get_section_with_http_info(section_gid, **kwargs) # noqa: E501 - return data - - def get_section_with_http_info(self, section_gid, **kwargs): # noqa: E501 - """Get a section # noqa: E501 - - Returns the complete record for a single section. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.get_section_with_http_info(section_gid, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param str section_gid: The globally unique identifier for the section. (required) - :param list[str] opt_fields: This endpoint returns a compact resource, which excludes some properties by default. To include those optional properties, set this query parameter to a comma-separated list of the properties you wish to include. - :return: SectionResponseData - If the method is called asynchronously, - returns the request thread. - """ - - all_params = ['section_gid', 'opt_fields'] # noqa: E501 - all_params.append('async_req') - all_params.append('_return_http_data_only') - all_params.append('_preload_content') - all_params.append('_request_timeout') - - params = locals() - for key, val in six.iteritems(params['kwargs']): - if key not in all_params: - raise TypeError( - "Got an unexpected keyword argument '%s'" - " to method get_section" % key - ) - params[key] = val - del params['kwargs'] - # verify the required parameter 'section_gid' is set - if ('section_gid' not in params or - params['section_gid'] is None): - raise ValueError("Missing the required parameter `section_gid` when calling `get_section`") # noqa: E501 - - collection_formats = {} - - path_params = {} - if 'section_gid' in params: - path_params['section_gid'] = params['section_gid'] # noqa: E501 - - query_params = [] - if 'opt_fields' in params: - query_params.append(('opt_fields', params['opt_fields'])) # noqa: E501 - collection_formats['opt_fields'] = 'csv' # noqa: E501 - - header_params = {} - - form_params = [] - local_var_files = {} - - body_params = None - # HTTP header `Accept` - header_params['Accept'] = self.api_client.select_header_accept( - ['application/json; charset=UTF-8']) # noqa: E501 - - # Authentication setting - auth_settings = ['oauth2'] # noqa: E501 - - return self.api_client.call_api( - '/sections/{section_gid}', 'GET', - path_params, - query_params, - header_params, - body=body_params, - post_params=form_params, - files=local_var_files, - response_type='SectionResponseData', # noqa: E501 - auth_settings=auth_settings, - async_req=params.get('async_req'), - _return_http_data_only=params.get('_return_http_data_only'), - _preload_content=params.get('_preload_content', True), - _request_timeout=params.get('_request_timeout'), - collection_formats=collection_formats) - - def get_sections_for_project(self, project_gid, **kwargs): # noqa: E501 - """Get sections in a project # noqa: E501 - - Returns the compact records for all sections in the specified project. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.get_sections_for_project(project_gid, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param str project_gid: Globally unique identifier for the project. (required) - :param int limit: Results per page. The number of objects to return per page. The value must be between 1 and 100. - :param str offset: 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 list[str] opt_fields: This endpoint returns a compact resource, which excludes some properties by default. To include those optional properties, set this query parameter to a comma-separated list of the properties you wish to include. - :return: SectionResponseArray - If the method is called asynchronously, - returns the request thread. - """ - kwargs['_return_http_data_only'] = True - if kwargs.get('async_req'): - return self.get_sections_for_project_with_http_info(project_gid, **kwargs) # noqa: E501 - else: - (data) = self.get_sections_for_project_with_http_info(project_gid, **kwargs) # noqa: E501 - return data - - def get_sections_for_project_with_http_info(self, project_gid, **kwargs): # noqa: E501 - """Get sections in a project # noqa: E501 - - Returns the compact records for all sections in the specified project. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.get_sections_for_project_with_http_info(project_gid, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param str project_gid: Globally unique identifier for the project. (required) - :param int limit: Results per page. The number of objects to return per page. The value must be between 1 and 100. - :param str offset: 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 list[str] opt_fields: This endpoint returns a compact resource, which excludes some properties by default. To include those optional properties, set this query parameter to a comma-separated list of the properties you wish to include. - :return: SectionResponseArray - If the method is called asynchronously, - returns the request thread. - """ - - all_params = ['project_gid', 'limit', 'offset', 'opt_fields'] # noqa: E501 - all_params.append('async_req') - all_params.append('_return_http_data_only') - all_params.append('_preload_content') - all_params.append('_request_timeout') - - params = locals() - for key, val in six.iteritems(params['kwargs']): - if key not in all_params: - raise TypeError( - "Got an unexpected keyword argument '%s'" - " to method get_sections_for_project" % key - ) - params[key] = val - del params['kwargs'] - # verify the required parameter 'project_gid' is set - if ('project_gid' not in params or - params['project_gid'] is None): - raise ValueError("Missing the required parameter `project_gid` when calling `get_sections_for_project`") # noqa: E501 - - collection_formats = {} - - path_params = {} - if 'project_gid' in params: - path_params['project_gid'] = params['project_gid'] # noqa: E501 - - query_params = [] - if 'limit' in params: - query_params.append(('limit', params['limit'])) # noqa: E501 - if 'offset' in params: - query_params.append(('offset', params['offset'])) # noqa: E501 - if 'opt_fields' in params: - query_params.append(('opt_fields', params['opt_fields'])) # noqa: E501 - collection_formats['opt_fields'] = 'csv' # noqa: E501 - - header_params = {} - - form_params = [] - local_var_files = {} - - body_params = None - # HTTP header `Accept` - header_params['Accept'] = self.api_client.select_header_accept( - ['application/json; charset=UTF-8']) # noqa: E501 - - # Authentication setting - auth_settings = ['oauth2'] # noqa: E501 - - return self.api_client.call_api( - '/projects/{project_gid}/sections', 'GET', - path_params, - query_params, - header_params, - body=body_params, - post_params=form_params, - files=local_var_files, - response_type='SectionResponseArray', # noqa: E501 - auth_settings=auth_settings, - async_req=params.get('async_req'), - _return_http_data_only=params.get('_return_http_data_only'), - _preload_content=params.get('_preload_content', True), - _request_timeout=params.get('_request_timeout'), - collection_formats=collection_formats) - - def insert_section_for_project(self, project_gid, **kwargs): # noqa: E501 - """Move or Insert sections # noqa: E501 - - Move sections relative to each other. One of `before_section` or `after_section` is required. Sections cannot be moved between projects. Returns an empty data block. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.insert_section_for_project(project_gid, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param str project_gid: Globally unique identifier for the project. (required) - :param SectionsInsertBody body: The section's move action. - :return: EmptyResponseData - If the method is called asynchronously, - returns the request thread. - """ - kwargs['_return_http_data_only'] = True - if kwargs.get('async_req'): - return self.insert_section_for_project_with_http_info(project_gid, **kwargs) # noqa: E501 - else: - (data) = self.insert_section_for_project_with_http_info(project_gid, **kwargs) # noqa: E501 - return data - - def insert_section_for_project_with_http_info(self, project_gid, **kwargs): # noqa: E501 - """Move or Insert sections # noqa: E501 - - Move sections relative to each other. One of `before_section` or `after_section` is required. Sections cannot be moved between projects. Returns an empty data block. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.insert_section_for_project_with_http_info(project_gid, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param str project_gid: Globally unique identifier for the project. (required) - :param SectionsInsertBody body: The section's move action. - :return: EmptyResponseData - If the method is called asynchronously, - returns the request thread. - """ - - all_params = ['project_gid', 'body'] # noqa: E501 - all_params.append('async_req') - all_params.append('_return_http_data_only') - all_params.append('_preload_content') - all_params.append('_request_timeout') - - params = locals() - for key, val in six.iteritems(params['kwargs']): - if key not in all_params: - raise TypeError( - "Got an unexpected keyword argument '%s'" - " to method insert_section_for_project" % key - ) - params[key] = val - del params['kwargs'] - # verify the required parameter 'project_gid' is set - if ('project_gid' not in params or - params['project_gid'] is None): - raise ValueError("Missing the required parameter `project_gid` when calling `insert_section_for_project`") # noqa: E501 - - collection_formats = {} - - path_params = {} - if 'project_gid' in params: - path_params['project_gid'] = params['project_gid'] # noqa: E501 - - query_params = [] - - header_params = {} - - form_params = [] - local_var_files = {} - - body_params = None - if 'body' in params: - body_params = params['body'] - # HTTP header `Accept` - header_params['Accept'] = self.api_client.select_header_accept( - ['application/json; charset=UTF-8']) # noqa: E501 - - # HTTP header `Content-Type` - header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 - ['application/json; charset=UTF-8']) # noqa: E501 - - # Authentication setting - auth_settings = ['oauth2'] # noqa: E501 - - return self.api_client.call_api( - '/projects/{project_gid}/sections/insert', 'POST', - path_params, - query_params, - header_params, - body=body_params, - post_params=form_params, - files=local_var_files, - response_type='EmptyResponseData', # noqa: E501 - auth_settings=auth_settings, - async_req=params.get('async_req'), - _return_http_data_only=params.get('_return_http_data_only'), - _preload_content=params.get('_preload_content', True), - _request_timeout=params.get('_request_timeout'), - collection_formats=collection_formats) - - def update_section(self, section_gid, **kwargs): # noqa: E501 - """Update a section # noqa: E501 - - A specific, existing section can be updated by making a PUT request on the URL for that project. Only the fields provided in the `data` block will be updated; any unspecified fields will remain unchanged. (note that at this time, the only field that can be updated is the `name` field.) When using this method, it is best to specify only those fields you wish to change, or else you may overwrite changes made by another user since you last retrieved the task. Returns the complete updated section record. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.update_section(section_gid, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param str section_gid: The globally unique identifier for the section. (required) - :param SectionsSectionGidBody body: The section to create. - :param list[str] opt_fields: This endpoint returns a compact resource, which excludes some properties by default. To include those optional properties, set this query parameter to a comma-separated list of the properties you wish to include. - :return: SectionResponseData - If the method is called asynchronously, - returns the request thread. - """ - kwargs['_return_http_data_only'] = True - if kwargs.get('async_req'): - return self.update_section_with_http_info(section_gid, **kwargs) # noqa: E501 - else: - (data) = self.update_section_with_http_info(section_gid, **kwargs) # noqa: E501 - return data - - def update_section_with_http_info(self, section_gid, **kwargs): # noqa: E501 - """Update a section # noqa: E501 - - A specific, existing section can be updated by making a PUT request on the URL for that project. Only the fields provided in the `data` block will be updated; any unspecified fields will remain unchanged. (note that at this time, the only field that can be updated is the `name` field.) When using this method, it is best to specify only those fields you wish to change, or else you may overwrite changes made by another user since you last retrieved the task. Returns the complete updated section record. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.update_section_with_http_info(section_gid, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param str section_gid: The globally unique identifier for the section. (required) - :param SectionsSectionGidBody body: The section to create. - :param list[str] opt_fields: This endpoint returns a compact resource, which excludes some properties by default. To include those optional properties, set this query parameter to a comma-separated list of the properties you wish to include. - :return: SectionResponseData - If the method is called asynchronously, - returns the request thread. - """ - - all_params = ['section_gid', 'body', 'opt_fields'] # noqa: E501 - all_params.append('async_req') - all_params.append('_return_http_data_only') - all_params.append('_preload_content') - all_params.append('_request_timeout') - - params = locals() - for key, val in six.iteritems(params['kwargs']): - if key not in all_params: - raise TypeError( - "Got an unexpected keyword argument '%s'" - " to method update_section" % key - ) - params[key] = val - del params['kwargs'] - # verify the required parameter 'section_gid' is set - if ('section_gid' not in params or - params['section_gid'] is None): - raise ValueError("Missing the required parameter `section_gid` when calling `update_section`") # noqa: E501 - - collection_formats = {} - - path_params = {} - if 'section_gid' in params: - path_params['section_gid'] = params['section_gid'] # noqa: E501 - - query_params = [] - if 'opt_fields' in params: - query_params.append(('opt_fields', params['opt_fields'])) # noqa: E501 - collection_formats['opt_fields'] = 'csv' # noqa: E501 - - header_params = {} - - form_params = [] - local_var_files = {} - - body_params = None - if 'body' in params: - body_params = params['body'] - # HTTP header `Accept` - header_params['Accept'] = self.api_client.select_header_accept( - ['application/json; charset=UTF-8']) # noqa: E501 - - # HTTP header `Content-Type` - header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 - ['application/json; charset=UTF-8']) # noqa: E501 - - # Authentication setting - auth_settings = ['oauth2'] # noqa: E501 - - return self.api_client.call_api( - '/sections/{section_gid}', 'PUT', - path_params, - query_params, - header_params, - body=body_params, - post_params=form_params, - files=local_var_files, - response_type='SectionResponseData', # noqa: E501 - auth_settings=auth_settings, - async_req=params.get('async_req'), - _return_http_data_only=params.get('_return_http_data_only'), - _preload_content=params.get('_preload_content', True), - _request_timeout=params.get('_request_timeout'), - collection_formats=collection_formats) + all_params = ['section_gid', 'body', 'opt_fields'] # noqa: E501 + all_params.append('async_req') + all_params.append('header_params') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + params = locals() + for key, val in six.iteritems(params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method update_section" % key + ) + params[key] = val + del params['kwargs'] + # verify the required parameter 'section_gid' is set + if ('section_gid' not in params or + params['section_gid'] is None): + raise ValueError("Missing the required parameter `section_gid` when calling `update_section`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'section_gid' in params: + path_params['section_gid'] = params['section_gid'] # noqa: E501 + + query_params = [] + if 'opt_fields' in params: + query_params.append(('opt_fields', params['opt_fields'])) # noqa: E501 + collection_formats['opt_fields'] = 'csv' # noqa: E501 + + header_params = kwargs.get("header_params", {}) + + form_params = [] + local_var_files = {} + + body_params = None + if 'body' in params: + body_params = params['body'] + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['application/json; charset=UTF-8']) # noqa: E501 + + # HTTP header `Content-Type` + header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 + ['application/json; charset=UTF-8']) # noqa: E501 + + # Authentication setting + auth_settings = ['oauth2'] # noqa: E501 + + return self.api_client.call_api( + '/sections/{section_gid}', 'PUT', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='SectionResponseData', # noqa: E501 + auth_settings=auth_settings, + async_req=params.get('async_req'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) diff --git a/asana/api/status_updates_api.py b/asana/api/status_updates_api.py index cd7e3dec..dd50b443 100644 --- a/asana/api/status_updates_api.py +++ b/asana/api/status_updates_api.py @@ -21,432 +21,436 @@ class StatusUpdatesApi(object): - """NOTE: This class is auto generated by the swagger code generator program. +"""NOTE: This class is auto generated by the swagger code generator program. - Do not edit the class manually. - Ref: https://github.com/swagger-api/swagger-codegen +Do not edit the class manually. +Ref: https://github.com/swagger-api/swagger-codegen +""" + +def __init__(self, api_client=None): + if api_client is None: + api_client = ApiClient() + self.api_client = api_client + +def create_status_for_object(self, body, **kwargs): # noqa: E501 + """Create a status update # noqa: E501 + + Creates a new status update on an object. Returns the full record of the newly created status update. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.create_status_for_object(body, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param StatusUpdatesBody body: The status update to create. (required) + :param int limit: Results per page. The number of objects to return per page. The value must be between 1 and 100. + :param str offset: 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 list[str] opt_fields: This endpoint returns a compact resource, which excludes some properties by default. To include those optional properties, set this query parameter to a comma-separated list of the properties you wish to include. + :return: StatusUpdateResponseData + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = kwargs.get("_return_http_data_only", True) + if kwargs.get('async_req'): + return self.create_status_for_object_with_http_info(body, **kwargs) # noqa: E501 + else: + (data) = self.create_status_for_object_with_http_info(body, **kwargs) # noqa: E501 + return data + +def create_status_for_object_with_http_info(self, body, **kwargs): # noqa: E501 + """Create a status update # noqa: E501 + + Creates a new status update on an object. Returns the full record of the newly created status update. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.create_status_for_object_with_http_info(body, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param StatusUpdatesBody body: The status update to create. (required) + :param int limit: Results per page. The number of objects to return per page. The value must be between 1 and 100. + :param str offset: 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 list[str] opt_fields: This endpoint returns a compact resource, which excludes some properties by default. To include those optional properties, set this query parameter to a comma-separated list of the properties you wish to include. + :return: StatusUpdateResponseData + If the method is called asynchronously, + returns the request thread. + """ + + all_params = ['body', 'limit', 'offset', 'opt_fields'] # noqa: E501 + all_params.append('async_req') + all_params.append('header_params') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + params = locals() + for key, val in six.iteritems(params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method create_status_for_object" % key + ) + params[key] = val + del params['kwargs'] + # verify the required parameter 'body' is set + if ('body' not in params or + params['body'] is None): + raise ValueError("Missing the required parameter `body` when calling `create_status_for_object`") # noqa: E501 + + collection_formats = {} + + path_params = {} + + query_params = [] + if 'limit' in params: + query_params.append(('limit', params['limit'])) # noqa: E501 + if 'offset' in params: + query_params.append(('offset', params['offset'])) # noqa: E501 + if 'opt_fields' in params: + query_params.append(('opt_fields', params['opt_fields'])) # noqa: E501 + collection_formats['opt_fields'] = 'csv' # noqa: E501 + + header_params = kwargs.get("header_params", {}) + + form_params = [] + local_var_files = {} + + body_params = None + if 'body' in params: + body_params = params['body'] + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['application/json; charset=UTF-8']) # noqa: E501 + + # HTTP header `Content-Type` + header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 + ['application/json; charset=UTF-8']) # noqa: E501 + + # Authentication setting + auth_settings = ['oauth2'] # noqa: E501 + + return self.api_client.call_api( + '/status_updates', 'POST', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='StatusUpdateResponseData', # noqa: E501 + auth_settings=auth_settings, + async_req=params.get('async_req'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) + +def delete_status(self, status_update_gid, **kwargs): # noqa: E501 + """Delete a status update # noqa: E501 + + Deletes a specific, existing status update. Returns an empty data record. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.delete_status(status_update_gid, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str status_update_gid: The status update to get. (required) + :return: EmptyResponseData + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = kwargs.get("_return_http_data_only", True) + if kwargs.get('async_req'): + return self.delete_status_with_http_info(status_update_gid, **kwargs) # noqa: E501 + else: + (data) = self.delete_status_with_http_info(status_update_gid, **kwargs) # noqa: E501 + return data + +def delete_status_with_http_info(self, status_update_gid, **kwargs): # noqa: E501 + """Delete a status update # noqa: E501 + + Deletes a specific, existing status update. Returns an empty data record. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.delete_status_with_http_info(status_update_gid, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str status_update_gid: The status update to get. (required) + :return: EmptyResponseData + If the method is called asynchronously, + returns the request thread. + """ + + all_params = ['status_update_gid'] # noqa: E501 + all_params.append('async_req') + all_params.append('header_params') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + params = locals() + for key, val in six.iteritems(params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method delete_status" % key + ) + params[key] = val + del params['kwargs'] + # verify the required parameter 'status_update_gid' is set + if ('status_update_gid' not in params or + params['status_update_gid'] is None): + raise ValueError("Missing the required parameter `status_update_gid` when calling `delete_status`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'status_update_gid' in params: + path_params['status_update_gid'] = params['status_update_gid'] # noqa: E501 + + query_params = [] + + header_params = kwargs.get("header_params", {}) + + form_params = [] + local_var_files = {} + + body_params = None + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['application/json; charset=UTF-8']) # noqa: E501 + + # Authentication setting + auth_settings = ['oauth2'] # noqa: E501 + + return self.api_client.call_api( + '/status_updates/{status_update_gid}', 'DELETE', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='EmptyResponseData', # noqa: E501 + auth_settings=auth_settings, + async_req=params.get('async_req'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) + +def get_status(self, status_update_gid, **kwargs): # noqa: E501 + """Get a status update # noqa: E501 + + Returns the complete record for a single status update. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.get_status(status_update_gid, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str status_update_gid: The status update to get. (required) + :param list[str] opt_fields: This endpoint returns a compact resource, which excludes some properties by default. To include those optional properties, set this query parameter to a comma-separated list of the properties you wish to include. + :return: StatusUpdateResponseData + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = kwargs.get("_return_http_data_only", True) + if kwargs.get('async_req'): + return self.get_status_with_http_info(status_update_gid, **kwargs) # noqa: E501 + else: + (data) = self.get_status_with_http_info(status_update_gid, **kwargs) # noqa: E501 + return data + +def get_status_with_http_info(self, status_update_gid, **kwargs): # noqa: E501 + """Get a status update # noqa: E501 + + Returns the complete record for a single status update. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.get_status_with_http_info(status_update_gid, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str status_update_gid: The status update to get. (required) + :param list[str] opt_fields: This endpoint returns a compact resource, which excludes some properties by default. To include those optional properties, set this query parameter to a comma-separated list of the properties you wish to include. + :return: StatusUpdateResponseData + If the method is called asynchronously, + returns the request thread. + """ + + all_params = ['status_update_gid', 'opt_fields'] # noqa: E501 + all_params.append('async_req') + all_params.append('header_params') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + params = locals() + for key, val in six.iteritems(params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method get_status" % key + ) + params[key] = val + del params['kwargs'] + # verify the required parameter 'status_update_gid' is set + if ('status_update_gid' not in params or + params['status_update_gid'] is None): + raise ValueError("Missing the required parameter `status_update_gid` when calling `get_status`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'status_update_gid' in params: + path_params['status_update_gid'] = params['status_update_gid'] # noqa: E501 + + query_params = [] + if 'opt_fields' in params: + query_params.append(('opt_fields', params['opt_fields'])) # noqa: E501 + collection_formats['opt_fields'] = 'csv' # noqa: E501 + + header_params = kwargs.get("header_params", {}) + + form_params = [] + local_var_files = {} + + body_params = None + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['application/json; charset=UTF-8']) # noqa: E501 + + # Authentication setting + auth_settings = ['oauth2'] # noqa: E501 + + return self.api_client.call_api( + '/status_updates/{status_update_gid}', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='StatusUpdateResponseData', # noqa: E501 + auth_settings=auth_settings, + async_req=params.get('async_req'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) + +def get_statuses_for_object(self, parent, **kwargs): # noqa: E501 + """Get status updates from an object # noqa: E501 + + Returns the compact status update records for all updates on the object. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.get_statuses_for_object(parent, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str parent: Globally unique identifier for object to fetch statuses from. Must be a GID for a project, portfolio, or goal. (required) + :param int limit: Results per page. The number of objects to return per page. The value must be between 1 and 100. + :param str offset: 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 datetime created_since: Only return statuses that have been created since the given time. + :param list[str] opt_fields: This endpoint returns a compact resource, which excludes some properties by default. To include those optional properties, set this query parameter to a comma-separated list of the properties you wish to include. + :return: StatusUpdateResponseArray + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = kwargs.get("_return_http_data_only", True) + if kwargs.get('async_req'): + return self.get_statuses_for_object_with_http_info(parent, **kwargs) # noqa: E501 + else: + (data) = self.get_statuses_for_object_with_http_info(parent, **kwargs) # noqa: E501 + return data + +def get_statuses_for_object_with_http_info(self, parent, **kwargs): # noqa: E501 + """Get status updates from an object # noqa: E501 + + Returns the compact status update records for all updates on the object. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.get_statuses_for_object_with_http_info(parent, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str parent: Globally unique identifier for object to fetch statuses from. Must be a GID for a project, portfolio, or goal. (required) + :param int limit: Results per page. The number of objects to return per page. The value must be between 1 and 100. + :param str offset: 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 datetime created_since: Only return statuses that have been created since the given time. + :param list[str] opt_fields: This endpoint returns a compact resource, which excludes some properties by default. To include those optional properties, set this query parameter to a comma-separated list of the properties you wish to include. + :return: StatusUpdateResponseArray + If the method is called asynchronously, + returns the request thread. """ - def __init__(self, api_client=None): - if api_client is None: - api_client = ApiClient() - self.api_client = api_client - - def create_status_for_object(self, body, **kwargs): # noqa: E501 - """Create a status update # noqa: E501 - - Creates a new status update on an object. Returns the full record of the newly created status update. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.create_status_for_object(body, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param StatusUpdatesBody body: The status update to create. (required) - :param int limit: Results per page. The number of objects to return per page. The value must be between 1 and 100. - :param str offset: 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 list[str] opt_fields: This endpoint returns a compact resource, which excludes some properties by default. To include those optional properties, set this query parameter to a comma-separated list of the properties you wish to include. - :return: StatusUpdateResponseData - If the method is called asynchronously, - returns the request thread. - """ - kwargs['_return_http_data_only'] = True - if kwargs.get('async_req'): - return self.create_status_for_object_with_http_info(body, **kwargs) # noqa: E501 - else: - (data) = self.create_status_for_object_with_http_info(body, **kwargs) # noqa: E501 - return data - - def create_status_for_object_with_http_info(self, body, **kwargs): # noqa: E501 - """Create a status update # noqa: E501 - - Creates a new status update on an object. Returns the full record of the newly created status update. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.create_status_for_object_with_http_info(body, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param StatusUpdatesBody body: The status update to create. (required) - :param int limit: Results per page. The number of objects to return per page. The value must be between 1 and 100. - :param str offset: 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 list[str] opt_fields: This endpoint returns a compact resource, which excludes some properties by default. To include those optional properties, set this query parameter to a comma-separated list of the properties you wish to include. - :return: StatusUpdateResponseData - If the method is called asynchronously, - returns the request thread. - """ - - all_params = ['body', 'limit', 'offset', 'opt_fields'] # noqa: E501 - all_params.append('async_req') - all_params.append('_return_http_data_only') - all_params.append('_preload_content') - all_params.append('_request_timeout') - - params = locals() - for key, val in six.iteritems(params['kwargs']): - if key not in all_params: - raise TypeError( - "Got an unexpected keyword argument '%s'" - " to method create_status_for_object" % key - ) - params[key] = val - del params['kwargs'] - # verify the required parameter 'body' is set - if ('body' not in params or - params['body'] is None): - raise ValueError("Missing the required parameter `body` when calling `create_status_for_object`") # noqa: E501 - - collection_formats = {} - - path_params = {} - - query_params = [] - if 'limit' in params: - query_params.append(('limit', params['limit'])) # noqa: E501 - if 'offset' in params: - query_params.append(('offset', params['offset'])) # noqa: E501 - if 'opt_fields' in params: - query_params.append(('opt_fields', params['opt_fields'])) # noqa: E501 - collection_formats['opt_fields'] = 'csv' # noqa: E501 - - header_params = {} - - form_params = [] - local_var_files = {} - - body_params = None - if 'body' in params: - body_params = params['body'] - # HTTP header `Accept` - header_params['Accept'] = self.api_client.select_header_accept( - ['application/json; charset=UTF-8']) # noqa: E501 - - # HTTP header `Content-Type` - header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 - ['application/json; charset=UTF-8']) # noqa: E501 - - # Authentication setting - auth_settings = ['oauth2'] # noqa: E501 - - return self.api_client.call_api( - '/status_updates', 'POST', - path_params, - query_params, - header_params, - body=body_params, - post_params=form_params, - files=local_var_files, - response_type='StatusUpdateResponseData', # noqa: E501 - auth_settings=auth_settings, - async_req=params.get('async_req'), - _return_http_data_only=params.get('_return_http_data_only'), - _preload_content=params.get('_preload_content', True), - _request_timeout=params.get('_request_timeout'), - collection_formats=collection_formats) - - def delete_status(self, status_update_gid, **kwargs): # noqa: E501 - """Delete a status update # noqa: E501 - - Deletes a specific, existing status update. Returns an empty data record. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.delete_status(status_update_gid, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param str status_update_gid: The status update to get. (required) - :return: EmptyResponseData - If the method is called asynchronously, - returns the request thread. - """ - kwargs['_return_http_data_only'] = True - if kwargs.get('async_req'): - return self.delete_status_with_http_info(status_update_gid, **kwargs) # noqa: E501 - else: - (data) = self.delete_status_with_http_info(status_update_gid, **kwargs) # noqa: E501 - return data - - def delete_status_with_http_info(self, status_update_gid, **kwargs): # noqa: E501 - """Delete a status update # noqa: E501 - - Deletes a specific, existing status update. Returns an empty data record. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.delete_status_with_http_info(status_update_gid, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param str status_update_gid: The status update to get. (required) - :return: EmptyResponseData - If the method is called asynchronously, - returns the request thread. - """ - - all_params = ['status_update_gid'] # noqa: E501 - all_params.append('async_req') - all_params.append('_return_http_data_only') - all_params.append('_preload_content') - all_params.append('_request_timeout') - - params = locals() - for key, val in six.iteritems(params['kwargs']): - if key not in all_params: - raise TypeError( - "Got an unexpected keyword argument '%s'" - " to method delete_status" % key - ) - params[key] = val - del params['kwargs'] - # verify the required parameter 'status_update_gid' is set - if ('status_update_gid' not in params or - params['status_update_gid'] is None): - raise ValueError("Missing the required parameter `status_update_gid` when calling `delete_status`") # noqa: E501 - - collection_formats = {} - - path_params = {} - if 'status_update_gid' in params: - path_params['status_update_gid'] = params['status_update_gid'] # noqa: E501 - - query_params = [] - - header_params = {} - - form_params = [] - local_var_files = {} - - body_params = None - # HTTP header `Accept` - header_params['Accept'] = self.api_client.select_header_accept( - ['application/json; charset=UTF-8']) # noqa: E501 - - # Authentication setting - auth_settings = ['oauth2'] # noqa: E501 - - return self.api_client.call_api( - '/status_updates/{status_update_gid}', 'DELETE', - path_params, - query_params, - header_params, - body=body_params, - post_params=form_params, - files=local_var_files, - response_type='EmptyResponseData', # noqa: E501 - auth_settings=auth_settings, - async_req=params.get('async_req'), - _return_http_data_only=params.get('_return_http_data_only'), - _preload_content=params.get('_preload_content', True), - _request_timeout=params.get('_request_timeout'), - collection_formats=collection_formats) - - def get_status(self, status_update_gid, **kwargs): # noqa: E501 - """Get a status update # noqa: E501 - - Returns the complete record for a single status update. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.get_status(status_update_gid, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param str status_update_gid: The status update to get. (required) - :param list[str] opt_fields: This endpoint returns a compact resource, which excludes some properties by default. To include those optional properties, set this query parameter to a comma-separated list of the properties you wish to include. - :return: StatusUpdateResponseData - If the method is called asynchronously, - returns the request thread. - """ - kwargs['_return_http_data_only'] = True - if kwargs.get('async_req'): - return self.get_status_with_http_info(status_update_gid, **kwargs) # noqa: E501 - else: - (data) = self.get_status_with_http_info(status_update_gid, **kwargs) # noqa: E501 - return data - - def get_status_with_http_info(self, status_update_gid, **kwargs): # noqa: E501 - """Get a status update # noqa: E501 - - Returns the complete record for a single status update. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.get_status_with_http_info(status_update_gid, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param str status_update_gid: The status update to get. (required) - :param list[str] opt_fields: This endpoint returns a compact resource, which excludes some properties by default. To include those optional properties, set this query parameter to a comma-separated list of the properties you wish to include. - :return: StatusUpdateResponseData - If the method is called asynchronously, - returns the request thread. - """ - - all_params = ['status_update_gid', 'opt_fields'] # noqa: E501 - all_params.append('async_req') - all_params.append('_return_http_data_only') - all_params.append('_preload_content') - all_params.append('_request_timeout') - - params = locals() - for key, val in six.iteritems(params['kwargs']): - if key not in all_params: - raise TypeError( - "Got an unexpected keyword argument '%s'" - " to method get_status" % key - ) - params[key] = val - del params['kwargs'] - # verify the required parameter 'status_update_gid' is set - if ('status_update_gid' not in params or - params['status_update_gid'] is None): - raise ValueError("Missing the required parameter `status_update_gid` when calling `get_status`") # noqa: E501 - - collection_formats = {} - - path_params = {} - if 'status_update_gid' in params: - path_params['status_update_gid'] = params['status_update_gid'] # noqa: E501 - - query_params = [] - if 'opt_fields' in params: - query_params.append(('opt_fields', params['opt_fields'])) # noqa: E501 - collection_formats['opt_fields'] = 'csv' # noqa: E501 - - header_params = {} - - form_params = [] - local_var_files = {} - - body_params = None - # HTTP header `Accept` - header_params['Accept'] = self.api_client.select_header_accept( - ['application/json; charset=UTF-8']) # noqa: E501 - - # Authentication setting - auth_settings = ['oauth2'] # noqa: E501 - - return self.api_client.call_api( - '/status_updates/{status_update_gid}', 'GET', - path_params, - query_params, - header_params, - body=body_params, - post_params=form_params, - files=local_var_files, - response_type='StatusUpdateResponseData', # noqa: E501 - auth_settings=auth_settings, - async_req=params.get('async_req'), - _return_http_data_only=params.get('_return_http_data_only'), - _preload_content=params.get('_preload_content', True), - _request_timeout=params.get('_request_timeout'), - collection_formats=collection_formats) - - def get_statuses_for_object(self, parent, **kwargs): # noqa: E501 - """Get status updates from an object # noqa: E501 - - Returns the compact status update records for all updates on the object. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.get_statuses_for_object(parent, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param str parent: Globally unique identifier for object to fetch statuses from. Must be a GID for a project, portfolio, or goal. (required) - :param int limit: Results per page. The number of objects to return per page. The value must be between 1 and 100. - :param str offset: 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 datetime created_since: Only return statuses that have been created since the given time. - :param list[str] opt_fields: This endpoint returns a compact resource, which excludes some properties by default. To include those optional properties, set this query parameter to a comma-separated list of the properties you wish to include. - :return: StatusUpdateResponseArray - If the method is called asynchronously, - returns the request thread. - """ - kwargs['_return_http_data_only'] = True - if kwargs.get('async_req'): - return self.get_statuses_for_object_with_http_info(parent, **kwargs) # noqa: E501 - else: - (data) = self.get_statuses_for_object_with_http_info(parent, **kwargs) # noqa: E501 - return data - - def get_statuses_for_object_with_http_info(self, parent, **kwargs): # noqa: E501 - """Get status updates from an object # noqa: E501 - - Returns the compact status update records for all updates on the object. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.get_statuses_for_object_with_http_info(parent, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param str parent: Globally unique identifier for object to fetch statuses from. Must be a GID for a project, portfolio, or goal. (required) - :param int limit: Results per page. The number of objects to return per page. The value must be between 1 and 100. - :param str offset: 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 datetime created_since: Only return statuses that have been created since the given time. - :param list[str] opt_fields: This endpoint returns a compact resource, which excludes some properties by default. To include those optional properties, set this query parameter to a comma-separated list of the properties you wish to include. - :return: StatusUpdateResponseArray - If the method is called asynchronously, - returns the request thread. - """ - - all_params = ['parent', 'limit', 'offset', 'created_since', 'opt_fields'] # noqa: E501 - all_params.append('async_req') - all_params.append('_return_http_data_only') - all_params.append('_preload_content') - all_params.append('_request_timeout') - - params = locals() - for key, val in six.iteritems(params['kwargs']): - if key not in all_params: - raise TypeError( - "Got an unexpected keyword argument '%s'" - " to method get_statuses_for_object" % key - ) - params[key] = val - del params['kwargs'] - # verify the required parameter 'parent' is set - if ('parent' not in params or - params['parent'] is None): - raise ValueError("Missing the required parameter `parent` when calling `get_statuses_for_object`") # noqa: E501 - - collection_formats = {} - - path_params = {} - - query_params = [] - if 'limit' in params: - query_params.append(('limit', params['limit'])) # noqa: E501 - if 'offset' in params: - query_params.append(('offset', params['offset'])) # noqa: E501 - if 'parent' in params: - query_params.append(('parent', params['parent'])) # noqa: E501 - if 'created_since' in params: - query_params.append(('created_since', params['created_since'])) # noqa: E501 - if 'opt_fields' in params: - query_params.append(('opt_fields', params['opt_fields'])) # noqa: E501 - collection_formats['opt_fields'] = 'csv' # noqa: E501 - - header_params = {} - - form_params = [] - local_var_files = {} - - body_params = None - # HTTP header `Accept` - header_params['Accept'] = self.api_client.select_header_accept( - ['application/json; charset=UTF-8']) # noqa: E501 - - # Authentication setting - auth_settings = ['oauth2'] # noqa: E501 - - return self.api_client.call_api( - '/status_updates', 'GET', - path_params, - query_params, - header_params, - body=body_params, - post_params=form_params, - files=local_var_files, - response_type='StatusUpdateResponseArray', # noqa: E501 - auth_settings=auth_settings, - async_req=params.get('async_req'), - _return_http_data_only=params.get('_return_http_data_only'), - _preload_content=params.get('_preload_content', True), - _request_timeout=params.get('_request_timeout'), - collection_formats=collection_formats) + all_params = ['parent', 'limit', 'offset', 'created_since', 'opt_fields'] # noqa: E501 + all_params.append('async_req') + all_params.append('header_params') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + params = locals() + for key, val in six.iteritems(params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method get_statuses_for_object" % key + ) + params[key] = val + del params['kwargs'] + # verify the required parameter 'parent' is set + if ('parent' not in params or + params['parent'] is None): + raise ValueError("Missing the required parameter `parent` when calling `get_statuses_for_object`") # noqa: E501 + + collection_formats = {} + + path_params = {} + + query_params = [] + if 'limit' in params: + query_params.append(('limit', params['limit'])) # noqa: E501 + if 'offset' in params: + query_params.append(('offset', params['offset'])) # noqa: E501 + if 'parent' in params: + query_params.append(('parent', params['parent'])) # noqa: E501 + if 'created_since' in params: + query_params.append(('created_since', params['created_since'])) # noqa: E501 + if 'opt_fields' in params: + query_params.append(('opt_fields', params['opt_fields'])) # noqa: E501 + collection_formats['opt_fields'] = 'csv' # noqa: E501 + + header_params = kwargs.get("header_params", {}) + + form_params = [] + local_var_files = {} + + body_params = None + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['application/json; charset=UTF-8']) # noqa: E501 + + # Authentication setting + auth_settings = ['oauth2'] # noqa: E501 + + return self.api_client.call_api( + '/status_updates', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='StatusUpdateResponseArray', # noqa: E501 + auth_settings=auth_settings, + async_req=params.get('async_req'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) diff --git a/asana/api/stories_api.py b/asana/api/stories_api.py index f9b5ba57..e5d4bc0a 100644 --- a/asana/api/stories_api.py +++ b/asana/api/stories_api.py @@ -21,540 +21,545 @@ class StoriesApi(object): - """NOTE: This class is auto generated by the swagger code generator program. +"""NOTE: This class is auto generated by the swagger code generator program. - Do not edit the class manually. - Ref: https://github.com/swagger-api/swagger-codegen +Do not edit the class manually. +Ref: https://github.com/swagger-api/swagger-codegen +""" + +def __init__(self, api_client=None): + if api_client is None: + api_client = ApiClient() + self.api_client = api_client + +def create_story_for_task(self, body, task_gid, **kwargs): # noqa: E501 + """Create a story on a task # noqa: E501 + + Adds a story to a task. This endpoint currently only allows for comment stories to be created. The comment will be authored by the currently authenticated user, and timestamped when the server receives the request. Returns the full record for the new story added to the task. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.create_story_for_task(body, task_gid, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param TaskGidStoriesBody body: The story to create. (required) + :param str task_gid: The task to operate on. (required) + :param list[str] opt_fields: This endpoint returns a compact resource, which excludes some properties by default. To include those optional properties, set this query parameter to a comma-separated list of the properties you wish to include. + :return: StoryResponseData + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = kwargs.get("_return_http_data_only", True) + if kwargs.get('async_req'): + return self.create_story_for_task_with_http_info(body, task_gid, **kwargs) # noqa: E501 + else: + (data) = self.create_story_for_task_with_http_info(body, task_gid, **kwargs) # noqa: E501 + return data + +def create_story_for_task_with_http_info(self, body, task_gid, **kwargs): # noqa: E501 + """Create a story on a task # noqa: E501 + + Adds a story to a task. This endpoint currently only allows for comment stories to be created. The comment will be authored by the currently authenticated user, and timestamped when the server receives the request. Returns the full record for the new story added to the task. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.create_story_for_task_with_http_info(body, task_gid, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param TaskGidStoriesBody body: The story to create. (required) + :param str task_gid: The task to operate on. (required) + :param list[str] opt_fields: This endpoint returns a compact resource, which excludes some properties by default. To include those optional properties, set this query parameter to a comma-separated list of the properties you wish to include. + :return: StoryResponseData + If the method is called asynchronously, + returns the request thread. + """ + + all_params = ['body', 'task_gid', 'opt_fields'] # noqa: E501 + all_params.append('async_req') + all_params.append('header_params') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + params = locals() + for key, val in six.iteritems(params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method create_story_for_task" % key + ) + params[key] = val + del params['kwargs'] + # verify the required parameter 'body' is set + if ('body' not in params or + params['body'] is None): + raise ValueError("Missing the required parameter `body` when calling `create_story_for_task`") # noqa: E501 + # verify the required parameter 'task_gid' is set + if ('task_gid' not in params or + params['task_gid'] is None): + raise ValueError("Missing the required parameter `task_gid` when calling `create_story_for_task`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'task_gid' in params: + path_params['task_gid'] = params['task_gid'] # noqa: E501 + + query_params = [] + if 'opt_fields' in params: + query_params.append(('opt_fields', params['opt_fields'])) # noqa: E501 + collection_formats['opt_fields'] = 'csv' # noqa: E501 + + header_params = kwargs.get("header_params", {}) + + form_params = [] + local_var_files = {} + + body_params = None + if 'body' in params: + body_params = params['body'] + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['application/json; charset=UTF-8']) # noqa: E501 + + # HTTP header `Content-Type` + header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 + ['application/json; charset=UTF-8']) # noqa: E501 + + # Authentication setting + auth_settings = ['oauth2'] # noqa: E501 + + return self.api_client.call_api( + '/tasks/{task_gid}/stories', 'POST', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='StoryResponseData', # noqa: E501 + auth_settings=auth_settings, + async_req=params.get('async_req'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) + +def delete_story(self, story_gid, **kwargs): # noqa: E501 + """Delete a story # noqa: E501 + + Deletes a story. A user can only delete stories they have created. Returns an empty data record. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.delete_story(story_gid, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str story_gid: Globally unique identifier for the story. (required) + :return: EmptyResponseData + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = kwargs.get("_return_http_data_only", True) + if kwargs.get('async_req'): + return self.delete_story_with_http_info(story_gid, **kwargs) # noqa: E501 + else: + (data) = self.delete_story_with_http_info(story_gid, **kwargs) # noqa: E501 + return data + +def delete_story_with_http_info(self, story_gid, **kwargs): # noqa: E501 + """Delete a story # noqa: E501 + + Deletes a story. A user can only delete stories they have created. Returns an empty data record. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.delete_story_with_http_info(story_gid, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str story_gid: Globally unique identifier for the story. (required) + :return: EmptyResponseData + If the method is called asynchronously, + returns the request thread. + """ + + all_params = ['story_gid'] # noqa: E501 + all_params.append('async_req') + all_params.append('header_params') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + params = locals() + for key, val in six.iteritems(params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method delete_story" % key + ) + params[key] = val + del params['kwargs'] + # verify the required parameter 'story_gid' is set + if ('story_gid' not in params or + params['story_gid'] is None): + raise ValueError("Missing the required parameter `story_gid` when calling `delete_story`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'story_gid' in params: + path_params['story_gid'] = params['story_gid'] # noqa: E501 + + query_params = [] + + header_params = kwargs.get("header_params", {}) + + form_params = [] + local_var_files = {} + + body_params = None + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['application/json; charset=UTF-8']) # noqa: E501 + + # Authentication setting + auth_settings = ['oauth2'] # noqa: E501 + + return self.api_client.call_api( + '/stories/{story_gid}', 'DELETE', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='EmptyResponseData', # noqa: E501 + auth_settings=auth_settings, + async_req=params.get('async_req'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) + +def get_stories_for_task(self, task_gid, **kwargs): # noqa: E501 + """Get stories from a task # noqa: E501 + + Returns the compact records for all stories on the task. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.get_stories_for_task(task_gid, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str task_gid: The task to operate on. (required) + :param int limit: Results per page. The number of objects to return per page. The value must be between 1 and 100. + :param str offset: 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 list[str] opt_fields: This endpoint returns a compact resource, which excludes some properties by default. To include those optional properties, set this query parameter to a comma-separated list of the properties you wish to include. + :return: StoryResponseArray + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = kwargs.get("_return_http_data_only", True) + if kwargs.get('async_req'): + return self.get_stories_for_task_with_http_info(task_gid, **kwargs) # noqa: E501 + else: + (data) = self.get_stories_for_task_with_http_info(task_gid, **kwargs) # noqa: E501 + return data + +def get_stories_for_task_with_http_info(self, task_gid, **kwargs): # noqa: E501 + """Get stories from a task # noqa: E501 + + Returns the compact records for all stories on the task. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.get_stories_for_task_with_http_info(task_gid, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str task_gid: The task to operate on. (required) + :param int limit: Results per page. The number of objects to return per page. The value must be between 1 and 100. + :param str offset: 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 list[str] opt_fields: This endpoint returns a compact resource, which excludes some properties by default. To include those optional properties, set this query parameter to a comma-separated list of the properties you wish to include. + :return: StoryResponseArray + If the method is called asynchronously, + returns the request thread. + """ + + all_params = ['task_gid', 'limit', 'offset', 'opt_fields'] # noqa: E501 + all_params.append('async_req') + all_params.append('header_params') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + params = locals() + for key, val in six.iteritems(params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method get_stories_for_task" % key + ) + params[key] = val + del params['kwargs'] + # verify the required parameter 'task_gid' is set + if ('task_gid' not in params or + params['task_gid'] is None): + raise ValueError("Missing the required parameter `task_gid` when calling `get_stories_for_task`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'task_gid' in params: + path_params['task_gid'] = params['task_gid'] # noqa: E501 + + query_params = [] + if 'limit' in params: + query_params.append(('limit', params['limit'])) # noqa: E501 + if 'offset' in params: + query_params.append(('offset', params['offset'])) # noqa: E501 + if 'opt_fields' in params: + query_params.append(('opt_fields', params['opt_fields'])) # noqa: E501 + collection_formats['opt_fields'] = 'csv' # noqa: E501 + + header_params = kwargs.get("header_params", {}) + + form_params = [] + local_var_files = {} + + body_params = None + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['application/json; charset=UTF-8']) # noqa: E501 + + # Authentication setting + auth_settings = ['oauth2'] # noqa: E501 + + return self.api_client.call_api( + '/tasks/{task_gid}/stories', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='StoryResponseArray', # noqa: E501 + auth_settings=auth_settings, + async_req=params.get('async_req'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) + +def get_story(self, story_gid, **kwargs): # noqa: E501 + """Get a story # noqa: E501 + + Returns the full record for a single story. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.get_story(story_gid, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str story_gid: Globally unique identifier for the story. (required) + :param list[str] opt_fields: This endpoint returns a compact resource, which excludes some properties by default. To include those optional properties, set this query parameter to a comma-separated list of the properties you wish to include. + :return: StoryResponseData + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = kwargs.get("_return_http_data_only", True) + if kwargs.get('async_req'): + return self.get_story_with_http_info(story_gid, **kwargs) # noqa: E501 + else: + (data) = self.get_story_with_http_info(story_gid, **kwargs) # noqa: E501 + return data + +def get_story_with_http_info(self, story_gid, **kwargs): # noqa: E501 + """Get a story # noqa: E501 + + Returns the full record for a single story. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.get_story_with_http_info(story_gid, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str story_gid: Globally unique identifier for the story. (required) + :param list[str] opt_fields: This endpoint returns a compact resource, which excludes some properties by default. To include those optional properties, set this query parameter to a comma-separated list of the properties you wish to include. + :return: StoryResponseData + If the method is called asynchronously, + returns the request thread. + """ + + all_params = ['story_gid', 'opt_fields'] # noqa: E501 + all_params.append('async_req') + all_params.append('header_params') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + params = locals() + for key, val in six.iteritems(params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method get_story" % key + ) + params[key] = val + del params['kwargs'] + # verify the required parameter 'story_gid' is set + if ('story_gid' not in params or + params['story_gid'] is None): + raise ValueError("Missing the required parameter `story_gid` when calling `get_story`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'story_gid' in params: + path_params['story_gid'] = params['story_gid'] # noqa: E501 + + query_params = [] + if 'opt_fields' in params: + query_params.append(('opt_fields', params['opt_fields'])) # noqa: E501 + collection_formats['opt_fields'] = 'csv' # noqa: E501 + + header_params = kwargs.get("header_params", {}) + + form_params = [] + local_var_files = {} + + body_params = None + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['application/json; charset=UTF-8']) # noqa: E501 + + # Authentication setting + auth_settings = ['oauth2'] # noqa: E501 + + return self.api_client.call_api( + '/stories/{story_gid}', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='StoryResponseData', # noqa: E501 + auth_settings=auth_settings, + async_req=params.get('async_req'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) + +def update_story(self, body, story_gid, **kwargs): # noqa: E501 + """Update a story # noqa: E501 + + Updates the story and returns the full record for the updated story. Only comment stories can have their text updated, and only comment stories and attachment stories can be pinned. Only one of `text` and `html_text` can be specified. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.update_story(body, story_gid, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param StoriesStoryGidBody body: The comment story to update. (required) + :param str story_gid: Globally unique identifier for the story. (required) + :param list[str] opt_fields: This endpoint returns a compact resource, which excludes some properties by default. To include those optional properties, set this query parameter to a comma-separated list of the properties you wish to include. + :return: StoryResponseData + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = kwargs.get("_return_http_data_only", True) + if kwargs.get('async_req'): + return self.update_story_with_http_info(body, story_gid, **kwargs) # noqa: E501 + else: + (data) = self.update_story_with_http_info(body, story_gid, **kwargs) # noqa: E501 + return data + +def update_story_with_http_info(self, body, story_gid, **kwargs): # noqa: E501 + """Update a story # noqa: E501 + + Updates the story and returns the full record for the updated story. Only comment stories can have their text updated, and only comment stories and attachment stories can be pinned. Only one of `text` and `html_text` can be specified. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.update_story_with_http_info(body, story_gid, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param StoriesStoryGidBody body: The comment story to update. (required) + :param str story_gid: Globally unique identifier for the story. (required) + :param list[str] opt_fields: This endpoint returns a compact resource, which excludes some properties by default. To include those optional properties, set this query parameter to a comma-separated list of the properties you wish to include. + :return: StoryResponseData + If the method is called asynchronously, + returns the request thread. """ - def __init__(self, api_client=None): - if api_client is None: - api_client = ApiClient() - self.api_client = api_client - - def create_story_for_task(self, body, task_gid, **kwargs): # noqa: E501 - """Create a story on a task # noqa: E501 - - Adds a story to a task. This endpoint currently only allows for comment stories to be created. The comment will be authored by the currently authenticated user, and timestamped when the server receives the request. Returns the full record for the new story added to the task. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.create_story_for_task(body, task_gid, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param TaskGidStoriesBody body: The story to create. (required) - :param str task_gid: The task to operate on. (required) - :param list[str] opt_fields: This endpoint returns a compact resource, which excludes some properties by default. To include those optional properties, set this query parameter to a comma-separated list of the properties you wish to include. - :return: StoryResponseData - If the method is called asynchronously, - returns the request thread. - """ - kwargs['_return_http_data_only'] = True - if kwargs.get('async_req'): - return self.create_story_for_task_with_http_info(body, task_gid, **kwargs) # noqa: E501 - else: - (data) = self.create_story_for_task_with_http_info(body, task_gid, **kwargs) # noqa: E501 - return data - - def create_story_for_task_with_http_info(self, body, task_gid, **kwargs): # noqa: E501 - """Create a story on a task # noqa: E501 - - Adds a story to a task. This endpoint currently only allows for comment stories to be created. The comment will be authored by the currently authenticated user, and timestamped when the server receives the request. Returns the full record for the new story added to the task. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.create_story_for_task_with_http_info(body, task_gid, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param TaskGidStoriesBody body: The story to create. (required) - :param str task_gid: The task to operate on. (required) - :param list[str] opt_fields: This endpoint returns a compact resource, which excludes some properties by default. To include those optional properties, set this query parameter to a comma-separated list of the properties you wish to include. - :return: StoryResponseData - If the method is called asynchronously, - returns the request thread. - """ - - all_params = ['body', 'task_gid', 'opt_fields'] # noqa: E501 - all_params.append('async_req') - all_params.append('_return_http_data_only') - all_params.append('_preload_content') - all_params.append('_request_timeout') - - params = locals() - for key, val in six.iteritems(params['kwargs']): - if key not in all_params: - raise TypeError( - "Got an unexpected keyword argument '%s'" - " to method create_story_for_task" % key - ) - params[key] = val - del params['kwargs'] - # verify the required parameter 'body' is set - if ('body' not in params or - params['body'] is None): - raise ValueError("Missing the required parameter `body` when calling `create_story_for_task`") # noqa: E501 - # verify the required parameter 'task_gid' is set - if ('task_gid' not in params or - params['task_gid'] is None): - raise ValueError("Missing the required parameter `task_gid` when calling `create_story_for_task`") # noqa: E501 - - collection_formats = {} - - path_params = {} - if 'task_gid' in params: - path_params['task_gid'] = params['task_gid'] # noqa: E501 - - query_params = [] - if 'opt_fields' in params: - query_params.append(('opt_fields', params['opt_fields'])) # noqa: E501 - collection_formats['opt_fields'] = 'csv' # noqa: E501 - - header_params = {} - - form_params = [] - local_var_files = {} - - body_params = None - if 'body' in params: - body_params = params['body'] - # HTTP header `Accept` - header_params['Accept'] = self.api_client.select_header_accept( - ['application/json; charset=UTF-8']) # noqa: E501 - - # HTTP header `Content-Type` - header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 - ['application/json; charset=UTF-8']) # noqa: E501 - - # Authentication setting - auth_settings = ['oauth2'] # noqa: E501 - - return self.api_client.call_api( - '/tasks/{task_gid}/stories', 'POST', - path_params, - query_params, - header_params, - body=body_params, - post_params=form_params, - files=local_var_files, - response_type='StoryResponseData', # noqa: E501 - auth_settings=auth_settings, - async_req=params.get('async_req'), - _return_http_data_only=params.get('_return_http_data_only'), - _preload_content=params.get('_preload_content', True), - _request_timeout=params.get('_request_timeout'), - collection_formats=collection_formats) - - def delete_story(self, story_gid, **kwargs): # noqa: E501 - """Delete a story # noqa: E501 - - Deletes a story. A user can only delete stories they have created. Returns an empty data record. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.delete_story(story_gid, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param str story_gid: Globally unique identifier for the story. (required) - :return: EmptyResponseData - If the method is called asynchronously, - returns the request thread. - """ - kwargs['_return_http_data_only'] = True - if kwargs.get('async_req'): - return self.delete_story_with_http_info(story_gid, **kwargs) # noqa: E501 - else: - (data) = self.delete_story_with_http_info(story_gid, **kwargs) # noqa: E501 - return data - - def delete_story_with_http_info(self, story_gid, **kwargs): # noqa: E501 - """Delete a story # noqa: E501 - - Deletes a story. A user can only delete stories they have created. Returns an empty data record. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.delete_story_with_http_info(story_gid, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param str story_gid: Globally unique identifier for the story. (required) - :return: EmptyResponseData - If the method is called asynchronously, - returns the request thread. - """ - - all_params = ['story_gid'] # noqa: E501 - all_params.append('async_req') - all_params.append('_return_http_data_only') - all_params.append('_preload_content') - all_params.append('_request_timeout') - - params = locals() - for key, val in six.iteritems(params['kwargs']): - if key not in all_params: - raise TypeError( - "Got an unexpected keyword argument '%s'" - " to method delete_story" % key - ) - params[key] = val - del params['kwargs'] - # verify the required parameter 'story_gid' is set - if ('story_gid' not in params or - params['story_gid'] is None): - raise ValueError("Missing the required parameter `story_gid` when calling `delete_story`") # noqa: E501 - - collection_formats = {} - - path_params = {} - if 'story_gid' in params: - path_params['story_gid'] = params['story_gid'] # noqa: E501 - - query_params = [] - - header_params = {} - - form_params = [] - local_var_files = {} - - body_params = None - # HTTP header `Accept` - header_params['Accept'] = self.api_client.select_header_accept( - ['application/json; charset=UTF-8']) # noqa: E501 - - # Authentication setting - auth_settings = ['oauth2'] # noqa: E501 - - return self.api_client.call_api( - '/stories/{story_gid}', 'DELETE', - path_params, - query_params, - header_params, - body=body_params, - post_params=form_params, - files=local_var_files, - response_type='EmptyResponseData', # noqa: E501 - auth_settings=auth_settings, - async_req=params.get('async_req'), - _return_http_data_only=params.get('_return_http_data_only'), - _preload_content=params.get('_preload_content', True), - _request_timeout=params.get('_request_timeout'), - collection_formats=collection_formats) - - def get_stories_for_task(self, task_gid, **kwargs): # noqa: E501 - """Get stories from a task # noqa: E501 - - Returns the compact records for all stories on the task. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.get_stories_for_task(task_gid, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param str task_gid: The task to operate on. (required) - :param int limit: Results per page. The number of objects to return per page. The value must be between 1 and 100. - :param str offset: 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 list[str] opt_fields: This endpoint returns a compact resource, which excludes some properties by default. To include those optional properties, set this query parameter to a comma-separated list of the properties you wish to include. - :return: StoryResponseArray - If the method is called asynchronously, - returns the request thread. - """ - kwargs['_return_http_data_only'] = True - if kwargs.get('async_req'): - return self.get_stories_for_task_with_http_info(task_gid, **kwargs) # noqa: E501 - else: - (data) = self.get_stories_for_task_with_http_info(task_gid, **kwargs) # noqa: E501 - return data - - def get_stories_for_task_with_http_info(self, task_gid, **kwargs): # noqa: E501 - """Get stories from a task # noqa: E501 - - Returns the compact records for all stories on the task. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.get_stories_for_task_with_http_info(task_gid, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param str task_gid: The task to operate on. (required) - :param int limit: Results per page. The number of objects to return per page. The value must be between 1 and 100. - :param str offset: 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 list[str] opt_fields: This endpoint returns a compact resource, which excludes some properties by default. To include those optional properties, set this query parameter to a comma-separated list of the properties you wish to include. - :return: StoryResponseArray - If the method is called asynchronously, - returns the request thread. - """ - - all_params = ['task_gid', 'limit', 'offset', 'opt_fields'] # noqa: E501 - all_params.append('async_req') - all_params.append('_return_http_data_only') - all_params.append('_preload_content') - all_params.append('_request_timeout') - - params = locals() - for key, val in six.iteritems(params['kwargs']): - if key not in all_params: - raise TypeError( - "Got an unexpected keyword argument '%s'" - " to method get_stories_for_task" % key - ) - params[key] = val - del params['kwargs'] - # verify the required parameter 'task_gid' is set - if ('task_gid' not in params or - params['task_gid'] is None): - raise ValueError("Missing the required parameter `task_gid` when calling `get_stories_for_task`") # noqa: E501 - - collection_formats = {} - - path_params = {} - if 'task_gid' in params: - path_params['task_gid'] = params['task_gid'] # noqa: E501 - - query_params = [] - if 'limit' in params: - query_params.append(('limit', params['limit'])) # noqa: E501 - if 'offset' in params: - query_params.append(('offset', params['offset'])) # noqa: E501 - if 'opt_fields' in params: - query_params.append(('opt_fields', params['opt_fields'])) # noqa: E501 - collection_formats['opt_fields'] = 'csv' # noqa: E501 - - header_params = {} - - form_params = [] - local_var_files = {} - - body_params = None - # HTTP header `Accept` - header_params['Accept'] = self.api_client.select_header_accept( - ['application/json; charset=UTF-8']) # noqa: E501 - - # Authentication setting - auth_settings = ['oauth2'] # noqa: E501 - - return self.api_client.call_api( - '/tasks/{task_gid}/stories', 'GET', - path_params, - query_params, - header_params, - body=body_params, - post_params=form_params, - files=local_var_files, - response_type='StoryResponseArray', # noqa: E501 - auth_settings=auth_settings, - async_req=params.get('async_req'), - _return_http_data_only=params.get('_return_http_data_only'), - _preload_content=params.get('_preload_content', True), - _request_timeout=params.get('_request_timeout'), - collection_formats=collection_formats) - - def get_story(self, story_gid, **kwargs): # noqa: E501 - """Get a story # noqa: E501 - - Returns the full record for a single story. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.get_story(story_gid, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param str story_gid: Globally unique identifier for the story. (required) - :param list[str] opt_fields: This endpoint returns a compact resource, which excludes some properties by default. To include those optional properties, set this query parameter to a comma-separated list of the properties you wish to include. - :return: StoryResponseData - If the method is called asynchronously, - returns the request thread. - """ - kwargs['_return_http_data_only'] = True - if kwargs.get('async_req'): - return self.get_story_with_http_info(story_gid, **kwargs) # noqa: E501 - else: - (data) = self.get_story_with_http_info(story_gid, **kwargs) # noqa: E501 - return data - - def get_story_with_http_info(self, story_gid, **kwargs): # noqa: E501 - """Get a story # noqa: E501 - - Returns the full record for a single story. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.get_story_with_http_info(story_gid, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param str story_gid: Globally unique identifier for the story. (required) - :param list[str] opt_fields: This endpoint returns a compact resource, which excludes some properties by default. To include those optional properties, set this query parameter to a comma-separated list of the properties you wish to include. - :return: StoryResponseData - If the method is called asynchronously, - returns the request thread. - """ - - all_params = ['story_gid', 'opt_fields'] # noqa: E501 - all_params.append('async_req') - all_params.append('_return_http_data_only') - all_params.append('_preload_content') - all_params.append('_request_timeout') - - params = locals() - for key, val in six.iteritems(params['kwargs']): - if key not in all_params: - raise TypeError( - "Got an unexpected keyword argument '%s'" - " to method get_story" % key - ) - params[key] = val - del params['kwargs'] - # verify the required parameter 'story_gid' is set - if ('story_gid' not in params or - params['story_gid'] is None): - raise ValueError("Missing the required parameter `story_gid` when calling `get_story`") # noqa: E501 - - collection_formats = {} - - path_params = {} - if 'story_gid' in params: - path_params['story_gid'] = params['story_gid'] # noqa: E501 - - query_params = [] - if 'opt_fields' in params: - query_params.append(('opt_fields', params['opt_fields'])) # noqa: E501 - collection_formats['opt_fields'] = 'csv' # noqa: E501 - - header_params = {} - - form_params = [] - local_var_files = {} - - body_params = None - # HTTP header `Accept` - header_params['Accept'] = self.api_client.select_header_accept( - ['application/json; charset=UTF-8']) # noqa: E501 - - # Authentication setting - auth_settings = ['oauth2'] # noqa: E501 - - return self.api_client.call_api( - '/stories/{story_gid}', 'GET', - path_params, - query_params, - header_params, - body=body_params, - post_params=form_params, - files=local_var_files, - response_type='StoryResponseData', # noqa: E501 - auth_settings=auth_settings, - async_req=params.get('async_req'), - _return_http_data_only=params.get('_return_http_data_only'), - _preload_content=params.get('_preload_content', True), - _request_timeout=params.get('_request_timeout'), - collection_formats=collection_formats) - - def update_story(self, body, story_gid, **kwargs): # noqa: E501 - """Update a story # noqa: E501 - - Updates the story and returns the full record for the updated story. Only comment stories can have their text updated, and only comment stories and attachment stories can be pinned. Only one of `text` and `html_text` can be specified. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.update_story(body, story_gid, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param StoriesStoryGidBody body: The comment story to update. (required) - :param str story_gid: Globally unique identifier for the story. (required) - :param list[str] opt_fields: This endpoint returns a compact resource, which excludes some properties by default. To include those optional properties, set this query parameter to a comma-separated list of the properties you wish to include. - :return: StoryResponseData - If the method is called asynchronously, - returns the request thread. - """ - kwargs['_return_http_data_only'] = True - if kwargs.get('async_req'): - return self.update_story_with_http_info(body, story_gid, **kwargs) # noqa: E501 - else: - (data) = self.update_story_with_http_info(body, story_gid, **kwargs) # noqa: E501 - return data - - def update_story_with_http_info(self, body, story_gid, **kwargs): # noqa: E501 - """Update a story # noqa: E501 - - Updates the story and returns the full record for the updated story. Only comment stories can have their text updated, and only comment stories and attachment stories can be pinned. Only one of `text` and `html_text` can be specified. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.update_story_with_http_info(body, story_gid, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param StoriesStoryGidBody body: The comment story to update. (required) - :param str story_gid: Globally unique identifier for the story. (required) - :param list[str] opt_fields: This endpoint returns a compact resource, which excludes some properties by default. To include those optional properties, set this query parameter to a comma-separated list of the properties you wish to include. - :return: StoryResponseData - If the method is called asynchronously, - returns the request thread. - """ - - all_params = ['body', 'story_gid', 'opt_fields'] # noqa: E501 - all_params.append('async_req') - all_params.append('_return_http_data_only') - all_params.append('_preload_content') - all_params.append('_request_timeout') - - params = locals() - for key, val in six.iteritems(params['kwargs']): - if key not in all_params: - raise TypeError( - "Got an unexpected keyword argument '%s'" - " to method update_story" % key - ) - params[key] = val - del params['kwargs'] - # verify the required parameter 'body' is set - if ('body' not in params or - params['body'] is None): - raise ValueError("Missing the required parameter `body` when calling `update_story`") # noqa: E501 - # verify the required parameter 'story_gid' is set - if ('story_gid' not in params or - params['story_gid'] is None): - raise ValueError("Missing the required parameter `story_gid` when calling `update_story`") # noqa: E501 - - collection_formats = {} - - path_params = {} - if 'story_gid' in params: - path_params['story_gid'] = params['story_gid'] # noqa: E501 - - query_params = [] - if 'opt_fields' in params: - query_params.append(('opt_fields', params['opt_fields'])) # noqa: E501 - collection_formats['opt_fields'] = 'csv' # noqa: E501 - - header_params = {} - - form_params = [] - local_var_files = {} - - body_params = None - if 'body' in params: - body_params = params['body'] - # HTTP header `Accept` - header_params['Accept'] = self.api_client.select_header_accept( - ['application/json; charset=UTF-8']) # noqa: E501 - - # HTTP header `Content-Type` - header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 - ['application/json; charset=UTF-8']) # noqa: E501 - - # Authentication setting - auth_settings = ['oauth2'] # noqa: E501 - - return self.api_client.call_api( - '/stories/{story_gid}', 'PUT', - path_params, - query_params, - header_params, - body=body_params, - post_params=form_params, - files=local_var_files, - response_type='StoryResponseData', # noqa: E501 - auth_settings=auth_settings, - async_req=params.get('async_req'), - _return_http_data_only=params.get('_return_http_data_only'), - _preload_content=params.get('_preload_content', True), - _request_timeout=params.get('_request_timeout'), - collection_formats=collection_formats) + all_params = ['body', 'story_gid', 'opt_fields'] # noqa: E501 + all_params.append('async_req') + all_params.append('header_params') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + params = locals() + for key, val in six.iteritems(params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method update_story" % key + ) + params[key] = val + del params['kwargs'] + # verify the required parameter 'body' is set + if ('body' not in params or + params['body'] is None): + raise ValueError("Missing the required parameter `body` when calling `update_story`") # noqa: E501 + # verify the required parameter 'story_gid' is set + if ('story_gid' not in params or + params['story_gid'] is None): + raise ValueError("Missing the required parameter `story_gid` when calling `update_story`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'story_gid' in params: + path_params['story_gid'] = params['story_gid'] # noqa: E501 + + query_params = [] + if 'opt_fields' in params: + query_params.append(('opt_fields', params['opt_fields'])) # noqa: E501 + collection_formats['opt_fields'] = 'csv' # noqa: E501 + + header_params = kwargs.get("header_params", {}) + + form_params = [] + local_var_files = {} + + body_params = None + if 'body' in params: + body_params = params['body'] + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['application/json; charset=UTF-8']) # noqa: E501 + + # HTTP header `Content-Type` + header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 + ['application/json; charset=UTF-8']) # noqa: E501 + + # Authentication setting + auth_settings = ['oauth2'] # noqa: E501 + + return self.api_client.call_api( + '/stories/{story_gid}', 'PUT', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='StoryResponseData', # noqa: E501 + auth_settings=auth_settings, + async_req=params.get('async_req'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) diff --git a/asana/api/tags_api.py b/asana/api/tags_api.py index 25efece0..d169d05b 100644 --- a/asana/api/tags_api.py +++ b/asana/api/tags_api.py @@ -21,844 +21,852 @@ class TagsApi(object): - """NOTE: This class is auto generated by the swagger code generator program. +"""NOTE: This class is auto generated by the swagger code generator program. - Do not edit the class manually. - Ref: https://github.com/swagger-api/swagger-codegen +Do not edit the class manually. +Ref: https://github.com/swagger-api/swagger-codegen +""" + +def __init__(self, api_client=None): + if api_client is None: + api_client = ApiClient() + self.api_client = api_client + +def create_tag(self, body, **kwargs): # noqa: E501 + """Create a tag # noqa: E501 + + Creates a new tag in a workspace or organization. Every tag is required to be created in a specific workspace or organization, and this cannot be changed once set. Note that you can use the workspace parameter regardless of whether or not it is an organization. Returns the full record of the newly created tag. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.create_tag(body, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param TagsBody body: The tag to create. (required) + :param list[str] opt_fields: This endpoint returns a compact resource, which excludes some properties by default. To include those optional properties, set this query parameter to a comma-separated list of the properties you wish to include. + :return: TagResponseData + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = kwargs.get("_return_http_data_only", True) + if kwargs.get('async_req'): + return self.create_tag_with_http_info(body, **kwargs) # noqa: E501 + else: + (data) = self.create_tag_with_http_info(body, **kwargs) # noqa: E501 + return data + +def create_tag_with_http_info(self, body, **kwargs): # noqa: E501 + """Create a tag # noqa: E501 + + Creates a new tag in a workspace or organization. Every tag is required to be created in a specific workspace or organization, and this cannot be changed once set. Note that you can use the workspace parameter regardless of whether or not it is an organization. Returns the full record of the newly created tag. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.create_tag_with_http_info(body, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param TagsBody body: The tag to create. (required) + :param list[str] opt_fields: This endpoint returns a compact resource, which excludes some properties by default. To include those optional properties, set this query parameter to a comma-separated list of the properties you wish to include. + :return: TagResponseData + If the method is called asynchronously, + returns the request thread. + """ + + all_params = ['body', 'opt_fields'] # noqa: E501 + all_params.append('async_req') + all_params.append('header_params') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + params = locals() + for key, val in six.iteritems(params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method create_tag" % key + ) + params[key] = val + del params['kwargs'] + # verify the required parameter 'body' is set + if ('body' not in params or + params['body'] is None): + raise ValueError("Missing the required parameter `body` when calling `create_tag`") # noqa: E501 + + collection_formats = {} + + path_params = {} + + query_params = [] + if 'opt_fields' in params: + query_params.append(('opt_fields', params['opt_fields'])) # noqa: E501 + collection_formats['opt_fields'] = 'csv' # noqa: E501 + + header_params = kwargs.get("header_params", {}) + + form_params = [] + local_var_files = {} + + body_params = None + if 'body' in params: + body_params = params['body'] + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['application/json; charset=UTF-8']) # noqa: E501 + + # HTTP header `Content-Type` + header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 + ['application/json; charset=UTF-8']) # noqa: E501 + + # Authentication setting + auth_settings = ['oauth2'] # noqa: E501 + + return self.api_client.call_api( + '/tags', 'POST', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='TagResponseData', # noqa: E501 + auth_settings=auth_settings, + async_req=params.get('async_req'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) + +def create_tag_for_workspace(self, body, workspace_gid, **kwargs): # noqa: E501 + """Create a tag in a workspace # noqa: E501 + + Creates a new tag in a workspace or organization. Every tag is required to be created in a specific workspace or organization, and this cannot be changed once set. Note that you can use the workspace parameter regardless of whether or not it is an organization. Returns the full record of the newly created tag. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.create_tag_for_workspace(body, workspace_gid, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param WorkspaceGidTagsBody body: The tag to create. (required) + :param str workspace_gid: Globally unique identifier for the workspace or organization. (required) + :param list[str] opt_fields: This endpoint returns a compact resource, which excludes some properties by default. To include those optional properties, set this query parameter to a comma-separated list of the properties you wish to include. + :return: TagResponseData + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = kwargs.get("_return_http_data_only", True) + if kwargs.get('async_req'): + return self.create_tag_for_workspace_with_http_info(body, workspace_gid, **kwargs) # noqa: E501 + else: + (data) = self.create_tag_for_workspace_with_http_info(body, workspace_gid, **kwargs) # noqa: E501 + return data + +def create_tag_for_workspace_with_http_info(self, body, workspace_gid, **kwargs): # noqa: E501 + """Create a tag in a workspace # noqa: E501 + + Creates a new tag in a workspace or organization. Every tag is required to be created in a specific workspace or organization, and this cannot be changed once set. Note that you can use the workspace parameter regardless of whether or not it is an organization. Returns the full record of the newly created tag. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.create_tag_for_workspace_with_http_info(body, workspace_gid, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param WorkspaceGidTagsBody body: The tag to create. (required) + :param str workspace_gid: Globally unique identifier for the workspace or organization. (required) + :param list[str] opt_fields: This endpoint returns a compact resource, which excludes some properties by default. To include those optional properties, set this query parameter to a comma-separated list of the properties you wish to include. + :return: TagResponseData + If the method is called asynchronously, + returns the request thread. + """ + + all_params = ['body', 'workspace_gid', 'opt_fields'] # noqa: E501 + all_params.append('async_req') + all_params.append('header_params') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + params = locals() + for key, val in six.iteritems(params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method create_tag_for_workspace" % key + ) + params[key] = val + del params['kwargs'] + # verify the required parameter 'body' is set + if ('body' not in params or + params['body'] is None): + raise ValueError("Missing the required parameter `body` when calling `create_tag_for_workspace`") # noqa: E501 + # verify the required parameter 'workspace_gid' is set + if ('workspace_gid' not in params or + params['workspace_gid'] is None): + raise ValueError("Missing the required parameter `workspace_gid` when calling `create_tag_for_workspace`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'workspace_gid' in params: + path_params['workspace_gid'] = params['workspace_gid'] # noqa: E501 + + query_params = [] + if 'opt_fields' in params: + query_params.append(('opt_fields', params['opt_fields'])) # noqa: E501 + collection_formats['opt_fields'] = 'csv' # noqa: E501 + + header_params = kwargs.get("header_params", {}) + + form_params = [] + local_var_files = {} + + body_params = None + if 'body' in params: + body_params = params['body'] + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['application/json; charset=UTF-8']) # noqa: E501 + + # HTTP header `Content-Type` + header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 + ['application/json; charset=UTF-8']) # noqa: E501 + + # Authentication setting + auth_settings = ['oauth2'] # noqa: E501 + + return self.api_client.call_api( + '/workspaces/{workspace_gid}/tags', 'POST', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='TagResponseData', # noqa: E501 + auth_settings=auth_settings, + async_req=params.get('async_req'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) + +def delete_tag(self, tag_gid, **kwargs): # noqa: E501 + """Delete a tag # noqa: E501 + + A specific, existing tag can be deleted by making a DELETE request on the URL for that tag. Returns an empty data record. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.delete_tag(tag_gid, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str tag_gid: Globally unique identifier for the tag. (required) + :return: EmptyResponseData + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = kwargs.get("_return_http_data_only", True) + if kwargs.get('async_req'): + return self.delete_tag_with_http_info(tag_gid, **kwargs) # noqa: E501 + else: + (data) = self.delete_tag_with_http_info(tag_gid, **kwargs) # noqa: E501 + return data + +def delete_tag_with_http_info(self, tag_gid, **kwargs): # noqa: E501 + """Delete a tag # noqa: E501 + + A specific, existing tag can be deleted by making a DELETE request on the URL for that tag. Returns an empty data record. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.delete_tag_with_http_info(tag_gid, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str tag_gid: Globally unique identifier for the tag. (required) + :return: EmptyResponseData + If the method is called asynchronously, + returns the request thread. + """ + + all_params = ['tag_gid'] # noqa: E501 + all_params.append('async_req') + all_params.append('header_params') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + params = locals() + for key, val in six.iteritems(params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method delete_tag" % key + ) + params[key] = val + del params['kwargs'] + # verify the required parameter 'tag_gid' is set + if ('tag_gid' not in params or + params['tag_gid'] is None): + raise ValueError("Missing the required parameter `tag_gid` when calling `delete_tag`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'tag_gid' in params: + path_params['tag_gid'] = params['tag_gid'] # noqa: E501 + + query_params = [] + + header_params = kwargs.get("header_params", {}) + + form_params = [] + local_var_files = {} + + body_params = None + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['application/json; charset=UTF-8']) # noqa: E501 + + # Authentication setting + auth_settings = ['oauth2'] # noqa: E501 + + return self.api_client.call_api( + '/tags/{tag_gid}', 'DELETE', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='EmptyResponseData', # noqa: E501 + auth_settings=auth_settings, + async_req=params.get('async_req'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) + +def get_tag(self, tag_gid, **kwargs): # noqa: E501 + """Get a tag # noqa: E501 + + Returns the complete tag record for a single tag. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.get_tag(tag_gid, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str tag_gid: Globally unique identifier for the tag. (required) + :param list[str] opt_fields: This endpoint returns a compact resource, which excludes some properties by default. To include those optional properties, set this query parameter to a comma-separated list of the properties you wish to include. + :return: TagResponseData + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = kwargs.get("_return_http_data_only", True) + if kwargs.get('async_req'): + return self.get_tag_with_http_info(tag_gid, **kwargs) # noqa: E501 + else: + (data) = self.get_tag_with_http_info(tag_gid, **kwargs) # noqa: E501 + return data + +def get_tag_with_http_info(self, tag_gid, **kwargs): # noqa: E501 + """Get a tag # noqa: E501 + + Returns the complete tag record for a single tag. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.get_tag_with_http_info(tag_gid, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str tag_gid: Globally unique identifier for the tag. (required) + :param list[str] opt_fields: This endpoint returns a compact resource, which excludes some properties by default. To include those optional properties, set this query parameter to a comma-separated list of the properties you wish to include. + :return: TagResponseData + If the method is called asynchronously, + returns the request thread. + """ + + all_params = ['tag_gid', 'opt_fields'] # noqa: E501 + all_params.append('async_req') + all_params.append('header_params') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + params = locals() + for key, val in six.iteritems(params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method get_tag" % key + ) + params[key] = val + del params['kwargs'] + # verify the required parameter 'tag_gid' is set + if ('tag_gid' not in params or + params['tag_gid'] is None): + raise ValueError("Missing the required parameter `tag_gid` when calling `get_tag`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'tag_gid' in params: + path_params['tag_gid'] = params['tag_gid'] # noqa: E501 + + query_params = [] + if 'opt_fields' in params: + query_params.append(('opt_fields', params['opt_fields'])) # noqa: E501 + collection_formats['opt_fields'] = 'csv' # noqa: E501 + + header_params = kwargs.get("header_params", {}) + + form_params = [] + local_var_files = {} + + body_params = None + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['application/json; charset=UTF-8']) # noqa: E501 + + # Authentication setting + auth_settings = ['oauth2'] # noqa: E501 + + return self.api_client.call_api( + '/tags/{tag_gid}', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='TagResponseData', # noqa: E501 + auth_settings=auth_settings, + async_req=params.get('async_req'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) + +def get_tags(self, **kwargs): # noqa: E501 + """Get multiple tags # noqa: E501 + + Returns the compact tag records for some filtered set of tags. Use one or more of the parameters provided to filter the tags returned. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.get_tags(async_req=True) + >>> result = thread.get() + + :param async_req bool + :param int limit: Results per page. The number of objects to return per page. The value must be between 1 and 100. + :param str offset: 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 str workspace: The workspace to filter tags on. + :param list[str] opt_fields: This endpoint returns a compact resource, which excludes some properties by default. To include those optional properties, set this query parameter to a comma-separated list of the properties you wish to include. + :return: TagResponseArray + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = kwargs.get("_return_http_data_only", True) + if kwargs.get('async_req'): + return self.get_tags_with_http_info(**kwargs) # noqa: E501 + else: + (data) = self.get_tags_with_http_info(**kwargs) # noqa: E501 + return data + +def get_tags_with_http_info(self, **kwargs): # noqa: E501 + """Get multiple tags # noqa: E501 + + Returns the compact tag records for some filtered set of tags. Use one or more of the parameters provided to filter the tags returned. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.get_tags_with_http_info(async_req=True) + >>> result = thread.get() + + :param async_req bool + :param int limit: Results per page. The number of objects to return per page. The value must be between 1 and 100. + :param str offset: 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 str workspace: The workspace to filter tags on. + :param list[str] opt_fields: This endpoint returns a compact resource, which excludes some properties by default. To include those optional properties, set this query parameter to a comma-separated list of the properties you wish to include. + :return: TagResponseArray + If the method is called asynchronously, + returns the request thread. + """ + + all_params = ['limit', 'offset', 'workspace', 'opt_fields'] # noqa: E501 + all_params.append('async_req') + all_params.append('header_params') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + params = locals() + for key, val in six.iteritems(params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method get_tags" % key + ) + params[key] = val + del params['kwargs'] + + collection_formats = {} + + path_params = {} + + query_params = [] + if 'limit' in params: + query_params.append(('limit', params['limit'])) # noqa: E501 + if 'offset' in params: + query_params.append(('offset', params['offset'])) # noqa: E501 + if 'workspace' in params: + query_params.append(('workspace', params['workspace'])) # noqa: E501 + if 'opt_fields' in params: + query_params.append(('opt_fields', params['opt_fields'])) # noqa: E501 + collection_formats['opt_fields'] = 'csv' # noqa: E501 + + header_params = kwargs.get("header_params", {}) + + form_params = [] + local_var_files = {} + + body_params = None + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['application/json; charset=UTF-8']) # noqa: E501 + + # Authentication setting + auth_settings = ['oauth2'] # noqa: E501 + + return self.api_client.call_api( + '/tags', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='TagResponseArray', # noqa: E501 + auth_settings=auth_settings, + async_req=params.get('async_req'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) + +def get_tags_for_task(self, task_gid, **kwargs): # noqa: E501 + """Get a task's tags # noqa: E501 + + Get a compact representation of all of the tags the task has. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.get_tags_for_task(task_gid, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str task_gid: The task to operate on. (required) + :param int limit: Results per page. The number of objects to return per page. The value must be between 1 and 100. + :param str offset: 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 list[str] opt_fields: This endpoint returns a compact resource, which excludes some properties by default. To include those optional properties, set this query parameter to a comma-separated list of the properties you wish to include. + :return: TagResponseArray + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = kwargs.get("_return_http_data_only", True) + if kwargs.get('async_req'): + return self.get_tags_for_task_with_http_info(task_gid, **kwargs) # noqa: E501 + else: + (data) = self.get_tags_for_task_with_http_info(task_gid, **kwargs) # noqa: E501 + return data + +def get_tags_for_task_with_http_info(self, task_gid, **kwargs): # noqa: E501 + """Get a task's tags # noqa: E501 + + Get a compact representation of all of the tags the task has. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.get_tags_for_task_with_http_info(task_gid, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str task_gid: The task to operate on. (required) + :param int limit: Results per page. The number of objects to return per page. The value must be between 1 and 100. + :param str offset: 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 list[str] opt_fields: This endpoint returns a compact resource, which excludes some properties by default. To include those optional properties, set this query parameter to a comma-separated list of the properties you wish to include. + :return: TagResponseArray + If the method is called asynchronously, + returns the request thread. + """ + + all_params = ['task_gid', 'limit', 'offset', 'opt_fields'] # noqa: E501 + all_params.append('async_req') + all_params.append('header_params') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + params = locals() + for key, val in six.iteritems(params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method get_tags_for_task" % key + ) + params[key] = val + del params['kwargs'] + # verify the required parameter 'task_gid' is set + if ('task_gid' not in params or + params['task_gid'] is None): + raise ValueError("Missing the required parameter `task_gid` when calling `get_tags_for_task`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'task_gid' in params: + path_params['task_gid'] = params['task_gid'] # noqa: E501 + + query_params = [] + if 'limit' in params: + query_params.append(('limit', params['limit'])) # noqa: E501 + if 'offset' in params: + query_params.append(('offset', params['offset'])) # noqa: E501 + if 'opt_fields' in params: + query_params.append(('opt_fields', params['opt_fields'])) # noqa: E501 + collection_formats['opt_fields'] = 'csv' # noqa: E501 + + header_params = kwargs.get("header_params", {}) + + form_params = [] + local_var_files = {} + + body_params = None + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['application/json; charset=UTF-8']) # noqa: E501 + + # Authentication setting + auth_settings = ['oauth2'] # noqa: E501 + + return self.api_client.call_api( + '/tasks/{task_gid}/tags', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='TagResponseArray', # noqa: E501 + auth_settings=auth_settings, + async_req=params.get('async_req'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) + +def get_tags_for_workspace(self, workspace_gid, **kwargs): # noqa: E501 + """Get tags in a workspace # noqa: E501 + + Returns the compact tag records for some filtered set of tags. Use one or more of the parameters provided to filter the tags returned. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.get_tags_for_workspace(workspace_gid, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str workspace_gid: Globally unique identifier for the workspace or organization. (required) + :param int limit: Results per page. The number of objects to return per page. The value must be between 1 and 100. + :param str offset: 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 list[str] opt_fields: This endpoint returns a compact resource, which excludes some properties by default. To include those optional properties, set this query parameter to a comma-separated list of the properties you wish to include. + :return: TagResponseArray + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = kwargs.get("_return_http_data_only", True) + if kwargs.get('async_req'): + return self.get_tags_for_workspace_with_http_info(workspace_gid, **kwargs) # noqa: E501 + else: + (data) = self.get_tags_for_workspace_with_http_info(workspace_gid, **kwargs) # noqa: E501 + return data + +def get_tags_for_workspace_with_http_info(self, workspace_gid, **kwargs): # noqa: E501 + """Get tags in a workspace # noqa: E501 + + Returns the compact tag records for some filtered set of tags. Use one or more of the parameters provided to filter the tags returned. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.get_tags_for_workspace_with_http_info(workspace_gid, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str workspace_gid: Globally unique identifier for the workspace or organization. (required) + :param int limit: Results per page. The number of objects to return per page. The value must be between 1 and 100. + :param str offset: 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 list[str] opt_fields: This endpoint returns a compact resource, which excludes some properties by default. To include those optional properties, set this query parameter to a comma-separated list of the properties you wish to include. + :return: TagResponseArray + If the method is called asynchronously, + returns the request thread. + """ + + all_params = ['workspace_gid', 'limit', 'offset', 'opt_fields'] # noqa: E501 + all_params.append('async_req') + all_params.append('header_params') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + params = locals() + for key, val in six.iteritems(params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method get_tags_for_workspace" % key + ) + params[key] = val + del params['kwargs'] + # verify the required parameter 'workspace_gid' is set + if ('workspace_gid' not in params or + params['workspace_gid'] is None): + raise ValueError("Missing the required parameter `workspace_gid` when calling `get_tags_for_workspace`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'workspace_gid' in params: + path_params['workspace_gid'] = params['workspace_gid'] # noqa: E501 + + query_params = [] + if 'limit' in params: + query_params.append(('limit', params['limit'])) # noqa: E501 + if 'offset' in params: + query_params.append(('offset', params['offset'])) # noqa: E501 + if 'opt_fields' in params: + query_params.append(('opt_fields', params['opt_fields'])) # noqa: E501 + collection_formats['opt_fields'] = 'csv' # noqa: E501 + + header_params = kwargs.get("header_params", {}) + + form_params = [] + local_var_files = {} + + body_params = None + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['application/json; charset=UTF-8']) # noqa: E501 + + # Authentication setting + auth_settings = ['oauth2'] # noqa: E501 + + return self.api_client.call_api( + '/workspaces/{workspace_gid}/tags', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='TagResponseArray', # noqa: E501 + auth_settings=auth_settings, + async_req=params.get('async_req'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) + +def update_tag(self, tag_gid, **kwargs): # noqa: E501 + """Update a tag # noqa: E501 + + Updates the properties of a tag. Only the fields provided in the `data` block will be updated; any unspecified fields will remain unchanged. When using this method, it is best to specify only those fields you wish to change, or else you may overwrite changes made by another user since you last retrieved the tag. Returns the complete updated tag record. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.update_tag(tag_gid, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str tag_gid: Globally unique identifier for the tag. (required) + :param list[str] opt_fields: This endpoint returns a compact resource, which excludes some properties by default. To include those optional properties, set this query parameter to a comma-separated list of the properties you wish to include. + :return: TagResponseData + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = kwargs.get("_return_http_data_only", True) + if kwargs.get('async_req'): + return self.update_tag_with_http_info(tag_gid, **kwargs) # noqa: E501 + else: + (data) = self.update_tag_with_http_info(tag_gid, **kwargs) # noqa: E501 + return data + +def update_tag_with_http_info(self, tag_gid, **kwargs): # noqa: E501 + """Update a tag # noqa: E501 + + Updates the properties of a tag. Only the fields provided in the `data` block will be updated; any unspecified fields will remain unchanged. When using this method, it is best to specify only those fields you wish to change, or else you may overwrite changes made by another user since you last retrieved the tag. Returns the complete updated tag record. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.update_tag_with_http_info(tag_gid, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str tag_gid: Globally unique identifier for the tag. (required) + :param list[str] opt_fields: This endpoint returns a compact resource, which excludes some properties by default. To include those optional properties, set this query parameter to a comma-separated list of the properties you wish to include. + :return: TagResponseData + If the method is called asynchronously, + returns the request thread. """ - def __init__(self, api_client=None): - if api_client is None: - api_client = ApiClient() - self.api_client = api_client - - def create_tag(self, body, **kwargs): # noqa: E501 - """Create a tag # noqa: E501 - - Creates a new tag in a workspace or organization. Every tag is required to be created in a specific workspace or organization, and this cannot be changed once set. Note that you can use the workspace parameter regardless of whether or not it is an organization. Returns the full record of the newly created tag. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.create_tag(body, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param TagsBody body: The tag to create. (required) - :param list[str] opt_fields: This endpoint returns a compact resource, which excludes some properties by default. To include those optional properties, set this query parameter to a comma-separated list of the properties you wish to include. - :return: TagResponseData - If the method is called asynchronously, - returns the request thread. - """ - kwargs['_return_http_data_only'] = True - if kwargs.get('async_req'): - return self.create_tag_with_http_info(body, **kwargs) # noqa: E501 - else: - (data) = self.create_tag_with_http_info(body, **kwargs) # noqa: E501 - return data - - def create_tag_with_http_info(self, body, **kwargs): # noqa: E501 - """Create a tag # noqa: E501 - - Creates a new tag in a workspace or organization. Every tag is required to be created in a specific workspace or organization, and this cannot be changed once set. Note that you can use the workspace parameter regardless of whether or not it is an organization. Returns the full record of the newly created tag. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.create_tag_with_http_info(body, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param TagsBody body: The tag to create. (required) - :param list[str] opt_fields: This endpoint returns a compact resource, which excludes some properties by default. To include those optional properties, set this query parameter to a comma-separated list of the properties you wish to include. - :return: TagResponseData - If the method is called asynchronously, - returns the request thread. - """ - - all_params = ['body', 'opt_fields'] # noqa: E501 - all_params.append('async_req') - all_params.append('_return_http_data_only') - all_params.append('_preload_content') - all_params.append('_request_timeout') - - params = locals() - for key, val in six.iteritems(params['kwargs']): - if key not in all_params: - raise TypeError( - "Got an unexpected keyword argument '%s'" - " to method create_tag" % key - ) - params[key] = val - del params['kwargs'] - # verify the required parameter 'body' is set - if ('body' not in params or - params['body'] is None): - raise ValueError("Missing the required parameter `body` when calling `create_tag`") # noqa: E501 - - collection_formats = {} - - path_params = {} - - query_params = [] - if 'opt_fields' in params: - query_params.append(('opt_fields', params['opt_fields'])) # noqa: E501 - collection_formats['opt_fields'] = 'csv' # noqa: E501 - - header_params = {} - - form_params = [] - local_var_files = {} - - body_params = None - if 'body' in params: - body_params = params['body'] - # HTTP header `Accept` - header_params['Accept'] = self.api_client.select_header_accept( - ['application/json; charset=UTF-8']) # noqa: E501 - - # HTTP header `Content-Type` - header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 - ['application/json; charset=UTF-8']) # noqa: E501 - - # Authentication setting - auth_settings = ['oauth2'] # noqa: E501 - - return self.api_client.call_api( - '/tags', 'POST', - path_params, - query_params, - header_params, - body=body_params, - post_params=form_params, - files=local_var_files, - response_type='TagResponseData', # noqa: E501 - auth_settings=auth_settings, - async_req=params.get('async_req'), - _return_http_data_only=params.get('_return_http_data_only'), - _preload_content=params.get('_preload_content', True), - _request_timeout=params.get('_request_timeout'), - collection_formats=collection_formats) - - def create_tag_for_workspace(self, body, workspace_gid, **kwargs): # noqa: E501 - """Create a tag in a workspace # noqa: E501 - - Creates a new tag in a workspace or organization. Every tag is required to be created in a specific workspace or organization, and this cannot be changed once set. Note that you can use the workspace parameter regardless of whether or not it is an organization. Returns the full record of the newly created tag. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.create_tag_for_workspace(body, workspace_gid, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param WorkspaceGidTagsBody body: The tag to create. (required) - :param str workspace_gid: Globally unique identifier for the workspace or organization. (required) - :param list[str] opt_fields: This endpoint returns a compact resource, which excludes some properties by default. To include those optional properties, set this query parameter to a comma-separated list of the properties you wish to include. - :return: TagResponseData - If the method is called asynchronously, - returns the request thread. - """ - kwargs['_return_http_data_only'] = True - if kwargs.get('async_req'): - return self.create_tag_for_workspace_with_http_info(body, workspace_gid, **kwargs) # noqa: E501 - else: - (data) = self.create_tag_for_workspace_with_http_info(body, workspace_gid, **kwargs) # noqa: E501 - return data - - def create_tag_for_workspace_with_http_info(self, body, workspace_gid, **kwargs): # noqa: E501 - """Create a tag in a workspace # noqa: E501 - - Creates a new tag in a workspace or organization. Every tag is required to be created in a specific workspace or organization, and this cannot be changed once set. Note that you can use the workspace parameter regardless of whether or not it is an organization. Returns the full record of the newly created tag. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.create_tag_for_workspace_with_http_info(body, workspace_gid, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param WorkspaceGidTagsBody body: The tag to create. (required) - :param str workspace_gid: Globally unique identifier for the workspace or organization. (required) - :param list[str] opt_fields: This endpoint returns a compact resource, which excludes some properties by default. To include those optional properties, set this query parameter to a comma-separated list of the properties you wish to include. - :return: TagResponseData - If the method is called asynchronously, - returns the request thread. - """ - - all_params = ['body', 'workspace_gid', 'opt_fields'] # noqa: E501 - all_params.append('async_req') - all_params.append('_return_http_data_only') - all_params.append('_preload_content') - all_params.append('_request_timeout') - - params = locals() - for key, val in six.iteritems(params['kwargs']): - if key not in all_params: - raise TypeError( - "Got an unexpected keyword argument '%s'" - " to method create_tag_for_workspace" % key - ) - params[key] = val - del params['kwargs'] - # verify the required parameter 'body' is set - if ('body' not in params or - params['body'] is None): - raise ValueError("Missing the required parameter `body` when calling `create_tag_for_workspace`") # noqa: E501 - # verify the required parameter 'workspace_gid' is set - if ('workspace_gid' not in params or - params['workspace_gid'] is None): - raise ValueError("Missing the required parameter `workspace_gid` when calling `create_tag_for_workspace`") # noqa: E501 - - collection_formats = {} - - path_params = {} - if 'workspace_gid' in params: - path_params['workspace_gid'] = params['workspace_gid'] # noqa: E501 - - query_params = [] - if 'opt_fields' in params: - query_params.append(('opt_fields', params['opt_fields'])) # noqa: E501 - collection_formats['opt_fields'] = 'csv' # noqa: E501 - - header_params = {} - - form_params = [] - local_var_files = {} - - body_params = None - if 'body' in params: - body_params = params['body'] - # HTTP header `Accept` - header_params['Accept'] = self.api_client.select_header_accept( - ['application/json; charset=UTF-8']) # noqa: E501 - - # HTTP header `Content-Type` - header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 - ['application/json; charset=UTF-8']) # noqa: E501 - - # Authentication setting - auth_settings = ['oauth2'] # noqa: E501 - - return self.api_client.call_api( - '/workspaces/{workspace_gid}/tags', 'POST', - path_params, - query_params, - header_params, - body=body_params, - post_params=form_params, - files=local_var_files, - response_type='TagResponseData', # noqa: E501 - auth_settings=auth_settings, - async_req=params.get('async_req'), - _return_http_data_only=params.get('_return_http_data_only'), - _preload_content=params.get('_preload_content', True), - _request_timeout=params.get('_request_timeout'), - collection_formats=collection_formats) - - def delete_tag(self, tag_gid, **kwargs): # noqa: E501 - """Delete a tag # noqa: E501 - - A specific, existing tag can be deleted by making a DELETE request on the URL for that tag. Returns an empty data record. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.delete_tag(tag_gid, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param str tag_gid: Globally unique identifier for the tag. (required) - :return: EmptyResponseData - If the method is called asynchronously, - returns the request thread. - """ - kwargs['_return_http_data_only'] = True - if kwargs.get('async_req'): - return self.delete_tag_with_http_info(tag_gid, **kwargs) # noqa: E501 - else: - (data) = self.delete_tag_with_http_info(tag_gid, **kwargs) # noqa: E501 - return data - - def delete_tag_with_http_info(self, tag_gid, **kwargs): # noqa: E501 - """Delete a tag # noqa: E501 - - A specific, existing tag can be deleted by making a DELETE request on the URL for that tag. Returns an empty data record. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.delete_tag_with_http_info(tag_gid, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param str tag_gid: Globally unique identifier for the tag. (required) - :return: EmptyResponseData - If the method is called asynchronously, - returns the request thread. - """ - - all_params = ['tag_gid'] # noqa: E501 - all_params.append('async_req') - all_params.append('_return_http_data_only') - all_params.append('_preload_content') - all_params.append('_request_timeout') - - params = locals() - for key, val in six.iteritems(params['kwargs']): - if key not in all_params: - raise TypeError( - "Got an unexpected keyword argument '%s'" - " to method delete_tag" % key - ) - params[key] = val - del params['kwargs'] - # verify the required parameter 'tag_gid' is set - if ('tag_gid' not in params or - params['tag_gid'] is None): - raise ValueError("Missing the required parameter `tag_gid` when calling `delete_tag`") # noqa: E501 - - collection_formats = {} - - path_params = {} - if 'tag_gid' in params: - path_params['tag_gid'] = params['tag_gid'] # noqa: E501 - - query_params = [] - - header_params = {} - - form_params = [] - local_var_files = {} - - body_params = None - # HTTP header `Accept` - header_params['Accept'] = self.api_client.select_header_accept( - ['application/json; charset=UTF-8']) # noqa: E501 - - # Authentication setting - auth_settings = ['oauth2'] # noqa: E501 - - return self.api_client.call_api( - '/tags/{tag_gid}', 'DELETE', - path_params, - query_params, - header_params, - body=body_params, - post_params=form_params, - files=local_var_files, - response_type='EmptyResponseData', # noqa: E501 - auth_settings=auth_settings, - async_req=params.get('async_req'), - _return_http_data_only=params.get('_return_http_data_only'), - _preload_content=params.get('_preload_content', True), - _request_timeout=params.get('_request_timeout'), - collection_formats=collection_formats) - - def get_tag(self, tag_gid, **kwargs): # noqa: E501 - """Get a tag # noqa: E501 - - Returns the complete tag record for a single tag. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.get_tag(tag_gid, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param str tag_gid: Globally unique identifier for the tag. (required) - :param list[str] opt_fields: This endpoint returns a compact resource, which excludes some properties by default. To include those optional properties, set this query parameter to a comma-separated list of the properties you wish to include. - :return: TagResponseData - If the method is called asynchronously, - returns the request thread. - """ - kwargs['_return_http_data_only'] = True - if kwargs.get('async_req'): - return self.get_tag_with_http_info(tag_gid, **kwargs) # noqa: E501 - else: - (data) = self.get_tag_with_http_info(tag_gid, **kwargs) # noqa: E501 - return data - - def get_tag_with_http_info(self, tag_gid, **kwargs): # noqa: E501 - """Get a tag # noqa: E501 - - Returns the complete tag record for a single tag. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.get_tag_with_http_info(tag_gid, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param str tag_gid: Globally unique identifier for the tag. (required) - :param list[str] opt_fields: This endpoint returns a compact resource, which excludes some properties by default. To include those optional properties, set this query parameter to a comma-separated list of the properties you wish to include. - :return: TagResponseData - If the method is called asynchronously, - returns the request thread. - """ - - all_params = ['tag_gid', 'opt_fields'] # noqa: E501 - all_params.append('async_req') - all_params.append('_return_http_data_only') - all_params.append('_preload_content') - all_params.append('_request_timeout') - - params = locals() - for key, val in six.iteritems(params['kwargs']): - if key not in all_params: - raise TypeError( - "Got an unexpected keyword argument '%s'" - " to method get_tag" % key - ) - params[key] = val - del params['kwargs'] - # verify the required parameter 'tag_gid' is set - if ('tag_gid' not in params or - params['tag_gid'] is None): - raise ValueError("Missing the required parameter `tag_gid` when calling `get_tag`") # noqa: E501 - - collection_formats = {} - - path_params = {} - if 'tag_gid' in params: - path_params['tag_gid'] = params['tag_gid'] # noqa: E501 - - query_params = [] - if 'opt_fields' in params: - query_params.append(('opt_fields', params['opt_fields'])) # noqa: E501 - collection_formats['opt_fields'] = 'csv' # noqa: E501 - - header_params = {} - - form_params = [] - local_var_files = {} - - body_params = None - # HTTP header `Accept` - header_params['Accept'] = self.api_client.select_header_accept( - ['application/json; charset=UTF-8']) # noqa: E501 - - # Authentication setting - auth_settings = ['oauth2'] # noqa: E501 - - return self.api_client.call_api( - '/tags/{tag_gid}', 'GET', - path_params, - query_params, - header_params, - body=body_params, - post_params=form_params, - files=local_var_files, - response_type='TagResponseData', # noqa: E501 - auth_settings=auth_settings, - async_req=params.get('async_req'), - _return_http_data_only=params.get('_return_http_data_only'), - _preload_content=params.get('_preload_content', True), - _request_timeout=params.get('_request_timeout'), - collection_formats=collection_formats) - - def get_tags(self, **kwargs): # noqa: E501 - """Get multiple tags # noqa: E501 - - Returns the compact tag records for some filtered set of tags. Use one or more of the parameters provided to filter the tags returned. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.get_tags(async_req=True) - >>> result = thread.get() - - :param async_req bool - :param int limit: Results per page. The number of objects to return per page. The value must be between 1 and 100. - :param str offset: 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 str workspace: The workspace to filter tags on. - :param list[str] opt_fields: This endpoint returns a compact resource, which excludes some properties by default. To include those optional properties, set this query parameter to a comma-separated list of the properties you wish to include. - :return: TagResponseArray - If the method is called asynchronously, - returns the request thread. - """ - kwargs['_return_http_data_only'] = True - if kwargs.get('async_req'): - return self.get_tags_with_http_info(**kwargs) # noqa: E501 - else: - (data) = self.get_tags_with_http_info(**kwargs) # noqa: E501 - return data - - def get_tags_with_http_info(self, **kwargs): # noqa: E501 - """Get multiple tags # noqa: E501 - - Returns the compact tag records for some filtered set of tags. Use one or more of the parameters provided to filter the tags returned. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.get_tags_with_http_info(async_req=True) - >>> result = thread.get() - - :param async_req bool - :param int limit: Results per page. The number of objects to return per page. The value must be between 1 and 100. - :param str offset: 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 str workspace: The workspace to filter tags on. - :param list[str] opt_fields: This endpoint returns a compact resource, which excludes some properties by default. To include those optional properties, set this query parameter to a comma-separated list of the properties you wish to include. - :return: TagResponseArray - If the method is called asynchronously, - returns the request thread. - """ - - all_params = ['limit', 'offset', 'workspace', 'opt_fields'] # noqa: E501 - all_params.append('async_req') - all_params.append('_return_http_data_only') - all_params.append('_preload_content') - all_params.append('_request_timeout') - - params = locals() - for key, val in six.iteritems(params['kwargs']): - if key not in all_params: - raise TypeError( - "Got an unexpected keyword argument '%s'" - " to method get_tags" % key - ) - params[key] = val - del params['kwargs'] - - collection_formats = {} - - path_params = {} - - query_params = [] - if 'limit' in params: - query_params.append(('limit', params['limit'])) # noqa: E501 - if 'offset' in params: - query_params.append(('offset', params['offset'])) # noqa: E501 - if 'workspace' in params: - query_params.append(('workspace', params['workspace'])) # noqa: E501 - if 'opt_fields' in params: - query_params.append(('opt_fields', params['opt_fields'])) # noqa: E501 - collection_formats['opt_fields'] = 'csv' # noqa: E501 - - header_params = {} - - form_params = [] - local_var_files = {} - - body_params = None - # HTTP header `Accept` - header_params['Accept'] = self.api_client.select_header_accept( - ['application/json; charset=UTF-8']) # noqa: E501 - - # Authentication setting - auth_settings = ['oauth2'] # noqa: E501 - - return self.api_client.call_api( - '/tags', 'GET', - path_params, - query_params, - header_params, - body=body_params, - post_params=form_params, - files=local_var_files, - response_type='TagResponseArray', # noqa: E501 - auth_settings=auth_settings, - async_req=params.get('async_req'), - _return_http_data_only=params.get('_return_http_data_only'), - _preload_content=params.get('_preload_content', True), - _request_timeout=params.get('_request_timeout'), - collection_formats=collection_formats) - - def get_tags_for_task(self, task_gid, **kwargs): # noqa: E501 - """Get a task's tags # noqa: E501 - - Get a compact representation of all of the tags the task has. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.get_tags_for_task(task_gid, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param str task_gid: The task to operate on. (required) - :param int limit: Results per page. The number of objects to return per page. The value must be between 1 and 100. - :param str offset: 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 list[str] opt_fields: This endpoint returns a compact resource, which excludes some properties by default. To include those optional properties, set this query parameter to a comma-separated list of the properties you wish to include. - :return: TagResponseArray - If the method is called asynchronously, - returns the request thread. - """ - kwargs['_return_http_data_only'] = True - if kwargs.get('async_req'): - return self.get_tags_for_task_with_http_info(task_gid, **kwargs) # noqa: E501 - else: - (data) = self.get_tags_for_task_with_http_info(task_gid, **kwargs) # noqa: E501 - return data - - def get_tags_for_task_with_http_info(self, task_gid, **kwargs): # noqa: E501 - """Get a task's tags # noqa: E501 - - Get a compact representation of all of the tags the task has. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.get_tags_for_task_with_http_info(task_gid, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param str task_gid: The task to operate on. (required) - :param int limit: Results per page. The number of objects to return per page. The value must be between 1 and 100. - :param str offset: 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 list[str] opt_fields: This endpoint returns a compact resource, which excludes some properties by default. To include those optional properties, set this query parameter to a comma-separated list of the properties you wish to include. - :return: TagResponseArray - If the method is called asynchronously, - returns the request thread. - """ - - all_params = ['task_gid', 'limit', 'offset', 'opt_fields'] # noqa: E501 - all_params.append('async_req') - all_params.append('_return_http_data_only') - all_params.append('_preload_content') - all_params.append('_request_timeout') - - params = locals() - for key, val in six.iteritems(params['kwargs']): - if key not in all_params: - raise TypeError( - "Got an unexpected keyword argument '%s'" - " to method get_tags_for_task" % key - ) - params[key] = val - del params['kwargs'] - # verify the required parameter 'task_gid' is set - if ('task_gid' not in params or - params['task_gid'] is None): - raise ValueError("Missing the required parameter `task_gid` when calling `get_tags_for_task`") # noqa: E501 - - collection_formats = {} - - path_params = {} - if 'task_gid' in params: - path_params['task_gid'] = params['task_gid'] # noqa: E501 - - query_params = [] - if 'limit' in params: - query_params.append(('limit', params['limit'])) # noqa: E501 - if 'offset' in params: - query_params.append(('offset', params['offset'])) # noqa: E501 - if 'opt_fields' in params: - query_params.append(('opt_fields', params['opt_fields'])) # noqa: E501 - collection_formats['opt_fields'] = 'csv' # noqa: E501 - - header_params = {} - - form_params = [] - local_var_files = {} - - body_params = None - # HTTP header `Accept` - header_params['Accept'] = self.api_client.select_header_accept( - ['application/json; charset=UTF-8']) # noqa: E501 - - # Authentication setting - auth_settings = ['oauth2'] # noqa: E501 - - return self.api_client.call_api( - '/tasks/{task_gid}/tags', 'GET', - path_params, - query_params, - header_params, - body=body_params, - post_params=form_params, - files=local_var_files, - response_type='TagResponseArray', # noqa: E501 - auth_settings=auth_settings, - async_req=params.get('async_req'), - _return_http_data_only=params.get('_return_http_data_only'), - _preload_content=params.get('_preload_content', True), - _request_timeout=params.get('_request_timeout'), - collection_formats=collection_formats) - - def get_tags_for_workspace(self, workspace_gid, **kwargs): # noqa: E501 - """Get tags in a workspace # noqa: E501 - - Returns the compact tag records for some filtered set of tags. Use one or more of the parameters provided to filter the tags returned. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.get_tags_for_workspace(workspace_gid, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param str workspace_gid: Globally unique identifier for the workspace or organization. (required) - :param int limit: Results per page. The number of objects to return per page. The value must be between 1 and 100. - :param str offset: 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 list[str] opt_fields: This endpoint returns a compact resource, which excludes some properties by default. To include those optional properties, set this query parameter to a comma-separated list of the properties you wish to include. - :return: TagResponseArray - If the method is called asynchronously, - returns the request thread. - """ - kwargs['_return_http_data_only'] = True - if kwargs.get('async_req'): - return self.get_tags_for_workspace_with_http_info(workspace_gid, **kwargs) # noqa: E501 - else: - (data) = self.get_tags_for_workspace_with_http_info(workspace_gid, **kwargs) # noqa: E501 - return data - - def get_tags_for_workspace_with_http_info(self, workspace_gid, **kwargs): # noqa: E501 - """Get tags in a workspace # noqa: E501 - - Returns the compact tag records for some filtered set of tags. Use one or more of the parameters provided to filter the tags returned. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.get_tags_for_workspace_with_http_info(workspace_gid, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param str workspace_gid: Globally unique identifier for the workspace or organization. (required) - :param int limit: Results per page. The number of objects to return per page. The value must be between 1 and 100. - :param str offset: 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 list[str] opt_fields: This endpoint returns a compact resource, which excludes some properties by default. To include those optional properties, set this query parameter to a comma-separated list of the properties you wish to include. - :return: TagResponseArray - If the method is called asynchronously, - returns the request thread. - """ - - all_params = ['workspace_gid', 'limit', 'offset', 'opt_fields'] # noqa: E501 - all_params.append('async_req') - all_params.append('_return_http_data_only') - all_params.append('_preload_content') - all_params.append('_request_timeout') - - params = locals() - for key, val in six.iteritems(params['kwargs']): - if key not in all_params: - raise TypeError( - "Got an unexpected keyword argument '%s'" - " to method get_tags_for_workspace" % key - ) - params[key] = val - del params['kwargs'] - # verify the required parameter 'workspace_gid' is set - if ('workspace_gid' not in params or - params['workspace_gid'] is None): - raise ValueError("Missing the required parameter `workspace_gid` when calling `get_tags_for_workspace`") # noqa: E501 - - collection_formats = {} - - path_params = {} - if 'workspace_gid' in params: - path_params['workspace_gid'] = params['workspace_gid'] # noqa: E501 - - query_params = [] - if 'limit' in params: - query_params.append(('limit', params['limit'])) # noqa: E501 - if 'offset' in params: - query_params.append(('offset', params['offset'])) # noqa: E501 - if 'opt_fields' in params: - query_params.append(('opt_fields', params['opt_fields'])) # noqa: E501 - collection_formats['opt_fields'] = 'csv' # noqa: E501 - - header_params = {} - - form_params = [] - local_var_files = {} - - body_params = None - # HTTP header `Accept` - header_params['Accept'] = self.api_client.select_header_accept( - ['application/json; charset=UTF-8']) # noqa: E501 - - # Authentication setting - auth_settings = ['oauth2'] # noqa: E501 - - return self.api_client.call_api( - '/workspaces/{workspace_gid}/tags', 'GET', - path_params, - query_params, - header_params, - body=body_params, - post_params=form_params, - files=local_var_files, - response_type='TagResponseArray', # noqa: E501 - auth_settings=auth_settings, - async_req=params.get('async_req'), - _return_http_data_only=params.get('_return_http_data_only'), - _preload_content=params.get('_preload_content', True), - _request_timeout=params.get('_request_timeout'), - collection_formats=collection_formats) - - def update_tag(self, tag_gid, **kwargs): # noqa: E501 - """Update a tag # noqa: E501 - - Updates the properties of a tag. Only the fields provided in the `data` block will be updated; any unspecified fields will remain unchanged. When using this method, it is best to specify only those fields you wish to change, or else you may overwrite changes made by another user since you last retrieved the tag. Returns the complete updated tag record. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.update_tag(tag_gid, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param str tag_gid: Globally unique identifier for the tag. (required) - :param list[str] opt_fields: This endpoint returns a compact resource, which excludes some properties by default. To include those optional properties, set this query parameter to a comma-separated list of the properties you wish to include. - :return: TagResponseData - If the method is called asynchronously, - returns the request thread. - """ - kwargs['_return_http_data_only'] = True - if kwargs.get('async_req'): - return self.update_tag_with_http_info(tag_gid, **kwargs) # noqa: E501 - else: - (data) = self.update_tag_with_http_info(tag_gid, **kwargs) # noqa: E501 - return data - - def update_tag_with_http_info(self, tag_gid, **kwargs): # noqa: E501 - """Update a tag # noqa: E501 - - Updates the properties of a tag. Only the fields provided in the `data` block will be updated; any unspecified fields will remain unchanged. When using this method, it is best to specify only those fields you wish to change, or else you may overwrite changes made by another user since you last retrieved the tag. Returns the complete updated tag record. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.update_tag_with_http_info(tag_gid, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param str tag_gid: Globally unique identifier for the tag. (required) - :param list[str] opt_fields: This endpoint returns a compact resource, which excludes some properties by default. To include those optional properties, set this query parameter to a comma-separated list of the properties you wish to include. - :return: TagResponseData - If the method is called asynchronously, - returns the request thread. - """ - - all_params = ['tag_gid', 'opt_fields'] # noqa: E501 - all_params.append('async_req') - all_params.append('_return_http_data_only') - all_params.append('_preload_content') - all_params.append('_request_timeout') - - params = locals() - for key, val in six.iteritems(params['kwargs']): - if key not in all_params: - raise TypeError( - "Got an unexpected keyword argument '%s'" - " to method update_tag" % key - ) - params[key] = val - del params['kwargs'] - # verify the required parameter 'tag_gid' is set - if ('tag_gid' not in params or - params['tag_gid'] is None): - raise ValueError("Missing the required parameter `tag_gid` when calling `update_tag`") # noqa: E501 - - collection_formats = {} - - path_params = {} - if 'tag_gid' in params: - path_params['tag_gid'] = params['tag_gid'] # noqa: E501 - - query_params = [] - if 'opt_fields' in params: - query_params.append(('opt_fields', params['opt_fields'])) # noqa: E501 - collection_formats['opt_fields'] = 'csv' # noqa: E501 - - header_params = {} - - form_params = [] - local_var_files = {} - - body_params = None - # HTTP header `Accept` - header_params['Accept'] = self.api_client.select_header_accept( - ['application/json; charset=UTF-8']) # noqa: E501 - - # Authentication setting - auth_settings = ['oauth2'] # noqa: E501 - - return self.api_client.call_api( - '/tags/{tag_gid}', 'PUT', - path_params, - query_params, - header_params, - body=body_params, - post_params=form_params, - files=local_var_files, - response_type='TagResponseData', # noqa: E501 - auth_settings=auth_settings, - async_req=params.get('async_req'), - _return_http_data_only=params.get('_return_http_data_only'), - _preload_content=params.get('_preload_content', True), - _request_timeout=params.get('_request_timeout'), - collection_formats=collection_formats) + all_params = ['tag_gid', 'opt_fields'] # noqa: E501 + all_params.append('async_req') + all_params.append('header_params') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + params = locals() + for key, val in six.iteritems(params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method update_tag" % key + ) + params[key] = val + del params['kwargs'] + # verify the required parameter 'tag_gid' is set + if ('tag_gid' not in params or + params['tag_gid'] is None): + raise ValueError("Missing the required parameter `tag_gid` when calling `update_tag`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'tag_gid' in params: + path_params['tag_gid'] = params['tag_gid'] # noqa: E501 + + query_params = [] + if 'opt_fields' in params: + query_params.append(('opt_fields', params['opt_fields'])) # noqa: E501 + collection_formats['opt_fields'] = 'csv' # noqa: E501 + + header_params = kwargs.get("header_params", {}) + + form_params = [] + local_var_files = {} + + body_params = None + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['application/json; charset=UTF-8']) # noqa: E501 + + # Authentication setting + auth_settings = ['oauth2'] # noqa: E501 + + return self.api_client.call_api( + '/tags/{tag_gid}', 'PUT', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='TagResponseData', # noqa: E501 + auth_settings=auth_settings, + async_req=params.get('async_req'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) diff --git a/asana/api/tasks_api.py b/asana/api/tasks_api.py index ab709d3f..42fa3695 100644 --- a/asana/api/tasks_api.py +++ b/asana/api/tasks_api.py @@ -21,3036 +21,3062 @@ class TasksApi(object): - """NOTE: This class is auto generated by the swagger code generator program. +"""NOTE: This class is auto generated by the swagger code generator program. - Do not edit the class manually. - Ref: https://github.com/swagger-api/swagger-codegen +Do not edit the class manually. +Ref: https://github.com/swagger-api/swagger-codegen +""" + +def __init__(self, api_client=None): + if api_client is None: + api_client = ApiClient() + self.api_client = api_client + +def add_dependencies_for_task(self, body, task_gid, **kwargs): # noqa: E501 + """Set dependencies for a task # noqa: E501 + + Marks a set of tasks as dependencies of this task, if they are not already dependencies. *A task can have at most 30 dependents and dependencies combined*. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.add_dependencies_for_task(body, task_gid, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param TaskGidAddDependenciesBody body: The list of tasks to set as dependencies. (required) + :param str task_gid: The task to operate on. (required) + :return: EmptyResponseData + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = kwargs.get("_return_http_data_only", True) + if kwargs.get('async_req'): + return self.add_dependencies_for_task_with_http_info(body, task_gid, **kwargs) # noqa: E501 + else: + (data) = self.add_dependencies_for_task_with_http_info(body, task_gid, **kwargs) # noqa: E501 + return data + +def add_dependencies_for_task_with_http_info(self, body, task_gid, **kwargs): # noqa: E501 + """Set dependencies for a task # noqa: E501 + + Marks a set of tasks as dependencies of this task, if they are not already dependencies. *A task can have at most 30 dependents and dependencies combined*. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.add_dependencies_for_task_with_http_info(body, task_gid, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param TaskGidAddDependenciesBody body: The list of tasks to set as dependencies. (required) + :param str task_gid: The task to operate on. (required) + :return: EmptyResponseData + If the method is called asynchronously, + returns the request thread. + """ + + all_params = ['body', 'task_gid'] # noqa: E501 + all_params.append('async_req') + all_params.append('header_params') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + params = locals() + for key, val in six.iteritems(params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method add_dependencies_for_task" % key + ) + params[key] = val + del params['kwargs'] + # verify the required parameter 'body' is set + if ('body' not in params or + params['body'] is None): + raise ValueError("Missing the required parameter `body` when calling `add_dependencies_for_task`") # noqa: E501 + # verify the required parameter 'task_gid' is set + if ('task_gid' not in params or + params['task_gid'] is None): + raise ValueError("Missing the required parameter `task_gid` when calling `add_dependencies_for_task`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'task_gid' in params: + path_params['task_gid'] = params['task_gid'] # noqa: E501 + + query_params = [] + + header_params = kwargs.get("header_params", {}) + + form_params = [] + local_var_files = {} + + body_params = None + if 'body' in params: + body_params = params['body'] + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['application/json; charset=UTF-8']) # noqa: E501 + + # HTTP header `Content-Type` + header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 + ['application/json; charset=UTF-8']) # noqa: E501 + + # Authentication setting + auth_settings = ['oauth2'] # noqa: E501 + + return self.api_client.call_api( + '/tasks/{task_gid}/addDependencies', 'POST', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='EmptyResponseData', # noqa: E501 + auth_settings=auth_settings, + async_req=params.get('async_req'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) + +def add_dependents_for_task(self, body, task_gid, **kwargs): # noqa: E501 + """Set dependents for a task # noqa: E501 + + Marks a set of tasks as dependents of this task, if they are not already dependents. *A task can have at most 30 dependents and dependencies combined*. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.add_dependents_for_task(body, task_gid, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param TaskGidAddDependentsBody body: The list of tasks to add as dependents. (required) + :param str task_gid: The task to operate on. (required) + :return: EmptyResponseData + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = kwargs.get("_return_http_data_only", True) + if kwargs.get('async_req'): + return self.add_dependents_for_task_with_http_info(body, task_gid, **kwargs) # noqa: E501 + else: + (data) = self.add_dependents_for_task_with_http_info(body, task_gid, **kwargs) # noqa: E501 + return data + +def add_dependents_for_task_with_http_info(self, body, task_gid, **kwargs): # noqa: E501 + """Set dependents for a task # noqa: E501 + + Marks a set of tasks as dependents of this task, if they are not already dependents. *A task can have at most 30 dependents and dependencies combined*. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.add_dependents_for_task_with_http_info(body, task_gid, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param TaskGidAddDependentsBody body: The list of tasks to add as dependents. (required) + :param str task_gid: The task to operate on. (required) + :return: EmptyResponseData + If the method is called asynchronously, + returns the request thread. + """ + + all_params = ['body', 'task_gid'] # noqa: E501 + all_params.append('async_req') + all_params.append('header_params') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + params = locals() + for key, val in six.iteritems(params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method add_dependents_for_task" % key + ) + params[key] = val + del params['kwargs'] + # verify the required parameter 'body' is set + if ('body' not in params or + params['body'] is None): + raise ValueError("Missing the required parameter `body` when calling `add_dependents_for_task`") # noqa: E501 + # verify the required parameter 'task_gid' is set + if ('task_gid' not in params or + params['task_gid'] is None): + raise ValueError("Missing the required parameter `task_gid` when calling `add_dependents_for_task`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'task_gid' in params: + path_params['task_gid'] = params['task_gid'] # noqa: E501 + + query_params = [] + + header_params = kwargs.get("header_params", {}) + + form_params = [] + local_var_files = {} + + body_params = None + if 'body' in params: + body_params = params['body'] + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['application/json; charset=UTF-8']) # noqa: E501 + + # HTTP header `Content-Type` + header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 + ['application/json; charset=UTF-8']) # noqa: E501 + + # Authentication setting + auth_settings = ['oauth2'] # noqa: E501 + + return self.api_client.call_api( + '/tasks/{task_gid}/addDependents', 'POST', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='EmptyResponseData', # noqa: E501 + auth_settings=auth_settings, + async_req=params.get('async_req'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) + +def add_followers_for_task(self, body, task_gid, **kwargs): # noqa: E501 + """Add followers to a task # noqa: E501 + + Adds followers to a task. Returns an empty data block. Each task can be associated with zero or more followers in the system. Requests to add/remove followers, if successful, will return the complete updated task record, described above. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.add_followers_for_task(body, task_gid, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param TaskGidAddFollowersBody body: The followers to add to the task. (required) + :param str task_gid: The task to operate on. (required) + :param list[str] opt_fields: This endpoint returns a compact resource, which excludes some properties by default. To include those optional properties, set this query parameter to a comma-separated list of the properties you wish to include. + :return: TaskResponseData + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = kwargs.get("_return_http_data_only", True) + if kwargs.get('async_req'): + return self.add_followers_for_task_with_http_info(body, task_gid, **kwargs) # noqa: E501 + else: + (data) = self.add_followers_for_task_with_http_info(body, task_gid, **kwargs) # noqa: E501 + return data + +def add_followers_for_task_with_http_info(self, body, task_gid, **kwargs): # noqa: E501 + """Add followers to a task # noqa: E501 + + Adds followers to a task. Returns an empty data block. Each task can be associated with zero or more followers in the system. Requests to add/remove followers, if successful, will return the complete updated task record, described above. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.add_followers_for_task_with_http_info(body, task_gid, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param TaskGidAddFollowersBody body: The followers to add to the task. (required) + :param str task_gid: The task to operate on. (required) + :param list[str] opt_fields: This endpoint returns a compact resource, which excludes some properties by default. To include those optional properties, set this query parameter to a comma-separated list of the properties you wish to include. + :return: TaskResponseData + If the method is called asynchronously, + returns the request thread. + """ + + all_params = ['body', 'task_gid', 'opt_fields'] # noqa: E501 + all_params.append('async_req') + all_params.append('header_params') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + params = locals() + for key, val in six.iteritems(params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method add_followers_for_task" % key + ) + params[key] = val + del params['kwargs'] + # verify the required parameter 'body' is set + if ('body' not in params or + params['body'] is None): + raise ValueError("Missing the required parameter `body` when calling `add_followers_for_task`") # noqa: E501 + # verify the required parameter 'task_gid' is set + if ('task_gid' not in params or + params['task_gid'] is None): + raise ValueError("Missing the required parameter `task_gid` when calling `add_followers_for_task`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'task_gid' in params: + path_params['task_gid'] = params['task_gid'] # noqa: E501 + + query_params = [] + if 'opt_fields' in params: + query_params.append(('opt_fields', params['opt_fields'])) # noqa: E501 + collection_formats['opt_fields'] = 'csv' # noqa: E501 + + header_params = kwargs.get("header_params", {}) + + form_params = [] + local_var_files = {} + + body_params = None + if 'body' in params: + body_params = params['body'] + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['application/json; charset=UTF-8']) # noqa: E501 + + # HTTP header `Content-Type` + header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 + ['application/json; charset=UTF-8']) # noqa: E501 + + # Authentication setting + auth_settings = ['oauth2'] # noqa: E501 + + return self.api_client.call_api( + '/tasks/{task_gid}/addFollowers', 'POST', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='TaskResponseData', # noqa: E501 + auth_settings=auth_settings, + async_req=params.get('async_req'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) + +def add_project_for_task(self, body, task_gid, **kwargs): # noqa: E501 + """Add a project to a task # noqa: E501 + + Adds the task to the specified project, in the optional location specified. If no location arguments are given, the task will be added to the end of the project. `addProject` can also be used to reorder a task within a project or section that already contains it. At most one of `insert_before`, `insert_after`, or `section` should be specified. Inserting into a section in an non-order-dependent way can be done by specifying section, otherwise, to insert within a section in a particular place, specify `insert_before` or `insert_after` and a task within the section to anchor the position of this task. Returns an empty data block. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.add_project_for_task(body, task_gid, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param TaskGidAddProjectBody body: The project to add the task to. (required) + :param str task_gid: The task to operate on. (required) + :return: EmptyResponseData + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = kwargs.get("_return_http_data_only", True) + if kwargs.get('async_req'): + return self.add_project_for_task_with_http_info(body, task_gid, **kwargs) # noqa: E501 + else: + (data) = self.add_project_for_task_with_http_info(body, task_gid, **kwargs) # noqa: E501 + return data + +def add_project_for_task_with_http_info(self, body, task_gid, **kwargs): # noqa: E501 + """Add a project to a task # noqa: E501 + + Adds the task to the specified project, in the optional location specified. If no location arguments are given, the task will be added to the end of the project. `addProject` can also be used to reorder a task within a project or section that already contains it. At most one of `insert_before`, `insert_after`, or `section` should be specified. Inserting into a section in an non-order-dependent way can be done by specifying section, otherwise, to insert within a section in a particular place, specify `insert_before` or `insert_after` and a task within the section to anchor the position of this task. Returns an empty data block. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.add_project_for_task_with_http_info(body, task_gid, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param TaskGidAddProjectBody body: The project to add the task to. (required) + :param str task_gid: The task to operate on. (required) + :return: EmptyResponseData + If the method is called asynchronously, + returns the request thread. + """ + + all_params = ['body', 'task_gid'] # noqa: E501 + all_params.append('async_req') + all_params.append('header_params') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + params = locals() + for key, val in six.iteritems(params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method add_project_for_task" % key + ) + params[key] = val + del params['kwargs'] + # verify the required parameter 'body' is set + if ('body' not in params or + params['body'] is None): + raise ValueError("Missing the required parameter `body` when calling `add_project_for_task`") # noqa: E501 + # verify the required parameter 'task_gid' is set + if ('task_gid' not in params or + params['task_gid'] is None): + raise ValueError("Missing the required parameter `task_gid` when calling `add_project_for_task`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'task_gid' in params: + path_params['task_gid'] = params['task_gid'] # noqa: E501 + + query_params = [] + + header_params = kwargs.get("header_params", {}) + + form_params = [] + local_var_files = {} + + body_params = None + if 'body' in params: + body_params = params['body'] + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['application/json; charset=UTF-8']) # noqa: E501 + + # HTTP header `Content-Type` + header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 + ['application/json; charset=UTF-8']) # noqa: E501 + + # Authentication setting + auth_settings = ['oauth2'] # noqa: E501 + + return self.api_client.call_api( + '/tasks/{task_gid}/addProject', 'POST', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='EmptyResponseData', # noqa: E501 + auth_settings=auth_settings, + async_req=params.get('async_req'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) + +def add_tag_for_task(self, body, task_gid, **kwargs): # noqa: E501 + """Add a tag to a task # noqa: E501 + + Adds a tag to a task. Returns an empty data block. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.add_tag_for_task(body, task_gid, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param TaskGidAddTagBody body: The tag to add to the task. (required) + :param str task_gid: The task to operate on. (required) + :return: EmptyResponseData + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = kwargs.get("_return_http_data_only", True) + if kwargs.get('async_req'): + return self.add_tag_for_task_with_http_info(body, task_gid, **kwargs) # noqa: E501 + else: + (data) = self.add_tag_for_task_with_http_info(body, task_gid, **kwargs) # noqa: E501 + return data + +def add_tag_for_task_with_http_info(self, body, task_gid, **kwargs): # noqa: E501 + """Add a tag to a task # noqa: E501 + + Adds a tag to a task. Returns an empty data block. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.add_tag_for_task_with_http_info(body, task_gid, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param TaskGidAddTagBody body: The tag to add to the task. (required) + :param str task_gid: The task to operate on. (required) + :return: EmptyResponseData + If the method is called asynchronously, + returns the request thread. + """ + + all_params = ['body', 'task_gid'] # noqa: E501 + all_params.append('async_req') + all_params.append('header_params') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + params = locals() + for key, val in six.iteritems(params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method add_tag_for_task" % key + ) + params[key] = val + del params['kwargs'] + # verify the required parameter 'body' is set + if ('body' not in params or + params['body'] is None): + raise ValueError("Missing the required parameter `body` when calling `add_tag_for_task`") # noqa: E501 + # verify the required parameter 'task_gid' is set + if ('task_gid' not in params or + params['task_gid'] is None): + raise ValueError("Missing the required parameter `task_gid` when calling `add_tag_for_task`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'task_gid' in params: + path_params['task_gid'] = params['task_gid'] # noqa: E501 + + query_params = [] + + header_params = kwargs.get("header_params", {}) + + form_params = [] + local_var_files = {} + + body_params = None + if 'body' in params: + body_params = params['body'] + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['application/json; charset=UTF-8']) # noqa: E501 + + # HTTP header `Content-Type` + header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 + ['application/json; charset=UTF-8']) # noqa: E501 + + # Authentication setting + auth_settings = ['oauth2'] # noqa: E501 + + return self.api_client.call_api( + '/tasks/{task_gid}/addTag', 'POST', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='EmptyResponseData', # noqa: E501 + auth_settings=auth_settings, + async_req=params.get('async_req'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) + +def create_subtask_for_task(self, body, task_gid, **kwargs): # noqa: E501 + """Create a subtask # noqa: E501 + + Creates a new subtask and adds it to the parent task. Returns the full record for the newly created subtask. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.create_subtask_for_task(body, task_gid, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param TaskGidSubtasksBody body: The new subtask to create. (required) + :param str task_gid: The task to operate on. (required) + :param list[str] opt_fields: This endpoint returns a compact resource, which excludes some properties by default. To include those optional properties, set this query parameter to a comma-separated list of the properties you wish to include. + :return: TaskResponseData + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = kwargs.get("_return_http_data_only", True) + if kwargs.get('async_req'): + return self.create_subtask_for_task_with_http_info(body, task_gid, **kwargs) # noqa: E501 + else: + (data) = self.create_subtask_for_task_with_http_info(body, task_gid, **kwargs) # noqa: E501 + return data + +def create_subtask_for_task_with_http_info(self, body, task_gid, **kwargs): # noqa: E501 + """Create a subtask # noqa: E501 + + Creates a new subtask and adds it to the parent task. Returns the full record for the newly created subtask. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.create_subtask_for_task_with_http_info(body, task_gid, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param TaskGidSubtasksBody body: The new subtask to create. (required) + :param str task_gid: The task to operate on. (required) + :param list[str] opt_fields: This endpoint returns a compact resource, which excludes some properties by default. To include those optional properties, set this query parameter to a comma-separated list of the properties you wish to include. + :return: TaskResponseData + If the method is called asynchronously, + returns the request thread. + """ + + all_params = ['body', 'task_gid', 'opt_fields'] # noqa: E501 + all_params.append('async_req') + all_params.append('header_params') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + params = locals() + for key, val in six.iteritems(params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method create_subtask_for_task" % key + ) + params[key] = val + del params['kwargs'] + # verify the required parameter 'body' is set + if ('body' not in params or + params['body'] is None): + raise ValueError("Missing the required parameter `body` when calling `create_subtask_for_task`") # noqa: E501 + # verify the required parameter 'task_gid' is set + if ('task_gid' not in params or + params['task_gid'] is None): + raise ValueError("Missing the required parameter `task_gid` when calling `create_subtask_for_task`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'task_gid' in params: + path_params['task_gid'] = params['task_gid'] # noqa: E501 + + query_params = [] + if 'opt_fields' in params: + query_params.append(('opt_fields', params['opt_fields'])) # noqa: E501 + collection_formats['opt_fields'] = 'csv' # noqa: E501 + + header_params = kwargs.get("header_params", {}) + + form_params = [] + local_var_files = {} + + body_params = None + if 'body' in params: + body_params = params['body'] + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['application/json; charset=UTF-8']) # noqa: E501 + + # HTTP header `Content-Type` + header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 + ['application/json; charset=UTF-8']) # noqa: E501 + + # Authentication setting + auth_settings = ['oauth2'] # noqa: E501 + + return self.api_client.call_api( + '/tasks/{task_gid}/subtasks', 'POST', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='TaskResponseData', # noqa: E501 + auth_settings=auth_settings, + async_req=params.get('async_req'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) + +def create_task(self, body, **kwargs): # noqa: E501 + """Create a task # noqa: E501 + + Creating a new task is as easy as POSTing to the `/tasks` endpoint with a data block containing the fields you’d like to set on the task. Any unspecified fields will take on default values. Every task is required to be created in a specific workspace, and this workspace cannot be changed once set. The workspace need not be set explicitly if you specify `projects` or a `parent` task instead. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.create_task(body, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param TasksBody body: The task to create. (required) + :param list[str] opt_fields: This endpoint returns a compact resource, which excludes some properties by default. To include those optional properties, set this query parameter to a comma-separated list of the properties you wish to include. + :return: TaskResponseData + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = kwargs.get("_return_http_data_only", True) + if kwargs.get('async_req'): + return self.create_task_with_http_info(body, **kwargs) # noqa: E501 + else: + (data) = self.create_task_with_http_info(body, **kwargs) # noqa: E501 + return data + +def create_task_with_http_info(self, body, **kwargs): # noqa: E501 + """Create a task # noqa: E501 + + Creating a new task is as easy as POSTing to the `/tasks` endpoint with a data block containing the fields you’d like to set on the task. Any unspecified fields will take on default values. Every task is required to be created in a specific workspace, and this workspace cannot be changed once set. The workspace need not be set explicitly if you specify `projects` or a `parent` task instead. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.create_task_with_http_info(body, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param TasksBody body: The task to create. (required) + :param list[str] opt_fields: This endpoint returns a compact resource, which excludes some properties by default. To include those optional properties, set this query parameter to a comma-separated list of the properties you wish to include. + :return: TaskResponseData + If the method is called asynchronously, + returns the request thread. + """ + + all_params = ['body', 'opt_fields'] # noqa: E501 + all_params.append('async_req') + all_params.append('header_params') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + params = locals() + for key, val in six.iteritems(params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method create_task" % key + ) + params[key] = val + del params['kwargs'] + # verify the required parameter 'body' is set + if ('body' not in params or + params['body'] is None): + raise ValueError("Missing the required parameter `body` when calling `create_task`") # noqa: E501 + + collection_formats = {} + + path_params = {} + + query_params = [] + if 'opt_fields' in params: + query_params.append(('opt_fields', params['opt_fields'])) # noqa: E501 + collection_formats['opt_fields'] = 'csv' # noqa: E501 + + header_params = kwargs.get("header_params", {}) + + form_params = [] + local_var_files = {} + + body_params = None + if 'body' in params: + body_params = params['body'] + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['application/json; charset=UTF-8']) # noqa: E501 + + # HTTP header `Content-Type` + header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 + ['application/json; charset=UTF-8']) # noqa: E501 + + # Authentication setting + auth_settings = ['oauth2'] # noqa: E501 + + return self.api_client.call_api( + '/tasks', 'POST', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='TaskResponseData', # noqa: E501 + auth_settings=auth_settings, + async_req=params.get('async_req'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) + +def delete_task(self, task_gid, **kwargs): # noqa: E501 + """Delete a task # noqa: E501 + + A specific, existing task can be deleted by making a DELETE request on the URL for that task. Deleted tasks go into the “trash” of the user making the delete request. Tasks can be recovered from the trash within a period of 30 days; afterward they are completely removed from the system. Returns an empty data record. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.delete_task(task_gid, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str task_gid: The task to operate on. (required) + :return: EmptyResponseData + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = kwargs.get("_return_http_data_only", True) + if kwargs.get('async_req'): + return self.delete_task_with_http_info(task_gid, **kwargs) # noqa: E501 + else: + (data) = self.delete_task_with_http_info(task_gid, **kwargs) # noqa: E501 + return data + +def delete_task_with_http_info(self, task_gid, **kwargs): # noqa: E501 + """Delete a task # noqa: E501 + + A specific, existing task can be deleted by making a DELETE request on the URL for that task. Deleted tasks go into the “trash” of the user making the delete request. Tasks can be recovered from the trash within a period of 30 days; afterward they are completely removed from the system. Returns an empty data record. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.delete_task_with_http_info(task_gid, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str task_gid: The task to operate on. (required) + :return: EmptyResponseData + If the method is called asynchronously, + returns the request thread. + """ + + all_params = ['task_gid'] # noqa: E501 + all_params.append('async_req') + all_params.append('header_params') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + params = locals() + for key, val in six.iteritems(params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method delete_task" % key + ) + params[key] = val + del params['kwargs'] + # verify the required parameter 'task_gid' is set + if ('task_gid' not in params or + params['task_gid'] is None): + raise ValueError("Missing the required parameter `task_gid` when calling `delete_task`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'task_gid' in params: + path_params['task_gid'] = params['task_gid'] # noqa: E501 + + query_params = [] + + header_params = kwargs.get("header_params", {}) + + form_params = [] + local_var_files = {} + + body_params = None + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['application/json; charset=UTF-8']) # noqa: E501 + + # Authentication setting + auth_settings = ['oauth2'] # noqa: E501 + + return self.api_client.call_api( + '/tasks/{task_gid}', 'DELETE', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='EmptyResponseData', # noqa: E501 + auth_settings=auth_settings, + async_req=params.get('async_req'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) + +def duplicate_task(self, body, task_gid, **kwargs): # noqa: E501 + """Duplicate a task # noqa: E501 + + Creates and returns a job that will asynchronously handle the duplication. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.duplicate_task(body, task_gid, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param TaskGidDuplicateBody body: Describes the duplicate's name and the fields that will be duplicated. (required) + :param str task_gid: The task to operate on. (required) + :param list[str] opt_fields: This endpoint returns a compact resource, which excludes some properties by default. To include those optional properties, set this query parameter to a comma-separated list of the properties you wish to include. + :return: JobResponseData + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = kwargs.get("_return_http_data_only", True) + if kwargs.get('async_req'): + return self.duplicate_task_with_http_info(body, task_gid, **kwargs) # noqa: E501 + else: + (data) = self.duplicate_task_with_http_info(body, task_gid, **kwargs) # noqa: E501 + return data + +def duplicate_task_with_http_info(self, body, task_gid, **kwargs): # noqa: E501 + """Duplicate a task # noqa: E501 + + Creates and returns a job that will asynchronously handle the duplication. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.duplicate_task_with_http_info(body, task_gid, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param TaskGidDuplicateBody body: Describes the duplicate's name and the fields that will be duplicated. (required) + :param str task_gid: The task to operate on. (required) + :param list[str] opt_fields: This endpoint returns a compact resource, which excludes some properties by default. To include those optional properties, set this query parameter to a comma-separated list of the properties you wish to include. + :return: JobResponseData + If the method is called asynchronously, + returns the request thread. + """ + + all_params = ['body', 'task_gid', 'opt_fields'] # noqa: E501 + all_params.append('async_req') + all_params.append('header_params') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + params = locals() + for key, val in six.iteritems(params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method duplicate_task" % key + ) + params[key] = val + del params['kwargs'] + # verify the required parameter 'body' is set + if ('body' not in params or + params['body'] is None): + raise ValueError("Missing the required parameter `body` when calling `duplicate_task`") # noqa: E501 + # verify the required parameter 'task_gid' is set + if ('task_gid' not in params or + params['task_gid'] is None): + raise ValueError("Missing the required parameter `task_gid` when calling `duplicate_task`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'task_gid' in params: + path_params['task_gid'] = params['task_gid'] # noqa: E501 + + query_params = [] + if 'opt_fields' in params: + query_params.append(('opt_fields', params['opt_fields'])) # noqa: E501 + collection_formats['opt_fields'] = 'csv' # noqa: E501 + + header_params = kwargs.get("header_params", {}) + + form_params = [] + local_var_files = {} + + body_params = None + if 'body' in params: + body_params = params['body'] + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['application/json; charset=UTF-8']) # noqa: E501 + + # HTTP header `Content-Type` + header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 + ['application/json; charset=UTF-8']) # noqa: E501 + + # Authentication setting + auth_settings = ['oauth2'] # noqa: E501 + + return self.api_client.call_api( + '/tasks/{task_gid}/duplicate', 'POST', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='JobResponseData', # noqa: E501 + auth_settings=auth_settings, + async_req=params.get('async_req'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) + +def get_dependencies_for_task(self, task_gid, **kwargs): # noqa: E501 + """Get dependencies from a task # noqa: E501 + + Returns the compact representations of all of the dependencies of a task. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.get_dependencies_for_task(task_gid, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str task_gid: The task to operate on. (required) + :param int limit: Results per page. The number of objects to return per page. The value must be between 1 and 100. + :param str offset: 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 list[str] opt_fields: This endpoint returns a compact resource, which excludes some properties by default. To include those optional properties, set this query parameter to a comma-separated list of the properties you wish to include. + :return: TaskResponseArray + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = kwargs.get("_return_http_data_only", True) + if kwargs.get('async_req'): + return self.get_dependencies_for_task_with_http_info(task_gid, **kwargs) # noqa: E501 + else: + (data) = self.get_dependencies_for_task_with_http_info(task_gid, **kwargs) # noqa: E501 + return data + +def get_dependencies_for_task_with_http_info(self, task_gid, **kwargs): # noqa: E501 + """Get dependencies from a task # noqa: E501 + + Returns the compact representations of all of the dependencies of a task. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.get_dependencies_for_task_with_http_info(task_gid, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str task_gid: The task to operate on. (required) + :param int limit: Results per page. The number of objects to return per page. The value must be between 1 and 100. + :param str offset: 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 list[str] opt_fields: This endpoint returns a compact resource, which excludes some properties by default. To include those optional properties, set this query parameter to a comma-separated list of the properties you wish to include. + :return: TaskResponseArray + If the method is called asynchronously, + returns the request thread. + """ + + all_params = ['task_gid', 'limit', 'offset', 'opt_fields'] # noqa: E501 + all_params.append('async_req') + all_params.append('header_params') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + params = locals() + for key, val in six.iteritems(params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method get_dependencies_for_task" % key + ) + params[key] = val + del params['kwargs'] + # verify the required parameter 'task_gid' is set + if ('task_gid' not in params or + params['task_gid'] is None): + raise ValueError("Missing the required parameter `task_gid` when calling `get_dependencies_for_task`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'task_gid' in params: + path_params['task_gid'] = params['task_gid'] # noqa: E501 + + query_params = [] + if 'limit' in params: + query_params.append(('limit', params['limit'])) # noqa: E501 + if 'offset' in params: + query_params.append(('offset', params['offset'])) # noqa: E501 + if 'opt_fields' in params: + query_params.append(('opt_fields', params['opt_fields'])) # noqa: E501 + collection_formats['opt_fields'] = 'csv' # noqa: E501 + + header_params = kwargs.get("header_params", {}) + + form_params = [] + local_var_files = {} + + body_params = None + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['application/json; charset=UTF-8']) # noqa: E501 + + # Authentication setting + auth_settings = ['oauth2'] # noqa: E501 + + return self.api_client.call_api( + '/tasks/{task_gid}/dependencies', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='TaskResponseArray', # noqa: E501 + auth_settings=auth_settings, + async_req=params.get('async_req'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) + +def get_dependents_for_task(self, task_gid, **kwargs): # noqa: E501 + """Get dependents from a task # noqa: E501 + + Returns the compact representations of all of the dependents of a task. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.get_dependents_for_task(task_gid, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str task_gid: The task to operate on. (required) + :param int limit: Results per page. The number of objects to return per page. The value must be between 1 and 100. + :param str offset: 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 list[str] opt_fields: This endpoint returns a compact resource, which excludes some properties by default. To include those optional properties, set this query parameter to a comma-separated list of the properties you wish to include. + :return: TaskResponseArray + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = kwargs.get("_return_http_data_only", True) + if kwargs.get('async_req'): + return self.get_dependents_for_task_with_http_info(task_gid, **kwargs) # noqa: E501 + else: + (data) = self.get_dependents_for_task_with_http_info(task_gid, **kwargs) # noqa: E501 + return data + +def get_dependents_for_task_with_http_info(self, task_gid, **kwargs): # noqa: E501 + """Get dependents from a task # noqa: E501 + + Returns the compact representations of all of the dependents of a task. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.get_dependents_for_task_with_http_info(task_gid, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str task_gid: The task to operate on. (required) + :param int limit: Results per page. The number of objects to return per page. The value must be between 1 and 100. + :param str offset: 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 list[str] opt_fields: This endpoint returns a compact resource, which excludes some properties by default. To include those optional properties, set this query parameter to a comma-separated list of the properties you wish to include. + :return: TaskResponseArray + If the method is called asynchronously, + returns the request thread. + """ + + all_params = ['task_gid', 'limit', 'offset', 'opt_fields'] # noqa: E501 + all_params.append('async_req') + all_params.append('header_params') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + params = locals() + for key, val in six.iteritems(params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method get_dependents_for_task" % key + ) + params[key] = val + del params['kwargs'] + # verify the required parameter 'task_gid' is set + if ('task_gid' not in params or + params['task_gid'] is None): + raise ValueError("Missing the required parameter `task_gid` when calling `get_dependents_for_task`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'task_gid' in params: + path_params['task_gid'] = params['task_gid'] # noqa: E501 + + query_params = [] + if 'limit' in params: + query_params.append(('limit', params['limit'])) # noqa: E501 + if 'offset' in params: + query_params.append(('offset', params['offset'])) # noqa: E501 + if 'opt_fields' in params: + query_params.append(('opt_fields', params['opt_fields'])) # noqa: E501 + collection_formats['opt_fields'] = 'csv' # noqa: E501 + + header_params = kwargs.get("header_params", {}) + + form_params = [] + local_var_files = {} + + body_params = None + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['application/json; charset=UTF-8']) # noqa: E501 + + # Authentication setting + auth_settings = ['oauth2'] # noqa: E501 + + return self.api_client.call_api( + '/tasks/{task_gid}/dependents', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='TaskResponseArray', # noqa: E501 + auth_settings=auth_settings, + async_req=params.get('async_req'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) + +def get_subtasks_for_task(self, task_gid, **kwargs): # noqa: E501 + """Get subtasks from a task # noqa: E501 + + Returns a compact representation of all of the subtasks of a task. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.get_subtasks_for_task(task_gid, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str task_gid: The task to operate on. (required) + :param int limit: Results per page. The number of objects to return per page. The value must be between 1 and 100. + :param str offset: 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 list[str] opt_fields: This endpoint returns a compact resource, which excludes some properties by default. To include those optional properties, set this query parameter to a comma-separated list of the properties you wish to include. + :return: TaskResponseArray + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = kwargs.get("_return_http_data_only", True) + if kwargs.get('async_req'): + return self.get_subtasks_for_task_with_http_info(task_gid, **kwargs) # noqa: E501 + else: + (data) = self.get_subtasks_for_task_with_http_info(task_gid, **kwargs) # noqa: E501 + return data + +def get_subtasks_for_task_with_http_info(self, task_gid, **kwargs): # noqa: E501 + """Get subtasks from a task # noqa: E501 + + Returns a compact representation of all of the subtasks of a task. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.get_subtasks_for_task_with_http_info(task_gid, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str task_gid: The task to operate on. (required) + :param int limit: Results per page. The number of objects to return per page. The value must be between 1 and 100. + :param str offset: 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 list[str] opt_fields: This endpoint returns a compact resource, which excludes some properties by default. To include those optional properties, set this query parameter to a comma-separated list of the properties you wish to include. + :return: TaskResponseArray + If the method is called asynchronously, + returns the request thread. + """ + + all_params = ['task_gid', 'limit', 'offset', 'opt_fields'] # noqa: E501 + all_params.append('async_req') + all_params.append('header_params') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + params = locals() + for key, val in six.iteritems(params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method get_subtasks_for_task" % key + ) + params[key] = val + del params['kwargs'] + # verify the required parameter 'task_gid' is set + if ('task_gid' not in params or + params['task_gid'] is None): + raise ValueError("Missing the required parameter `task_gid` when calling `get_subtasks_for_task`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'task_gid' in params: + path_params['task_gid'] = params['task_gid'] # noqa: E501 + + query_params = [] + if 'limit' in params: + query_params.append(('limit', params['limit'])) # noqa: E501 + if 'offset' in params: + query_params.append(('offset', params['offset'])) # noqa: E501 + if 'opt_fields' in params: + query_params.append(('opt_fields', params['opt_fields'])) # noqa: E501 + collection_formats['opt_fields'] = 'csv' # noqa: E501 + + header_params = kwargs.get("header_params", {}) + + form_params = [] + local_var_files = {} + + body_params = None + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['application/json; charset=UTF-8']) # noqa: E501 + + # Authentication setting + auth_settings = ['oauth2'] # noqa: E501 + + return self.api_client.call_api( + '/tasks/{task_gid}/subtasks', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='TaskResponseArray', # noqa: E501 + auth_settings=auth_settings, + async_req=params.get('async_req'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) + +def get_task(self, task_gid, **kwargs): # noqa: E501 + """Get a task # noqa: E501 + + Returns the complete task record for a single task. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.get_task(task_gid, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str task_gid: The task to operate on. (required) + :param list[str] opt_fields: This endpoint returns a compact resource, which excludes some properties by default. To include those optional properties, set this query parameter to a comma-separated list of the properties you wish to include. + :return: TaskResponseData + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = kwargs.get("_return_http_data_only", True) + if kwargs.get('async_req'): + return self.get_task_with_http_info(task_gid, **kwargs) # noqa: E501 + else: + (data) = self.get_task_with_http_info(task_gid, **kwargs) # noqa: E501 + return data + +def get_task_with_http_info(self, task_gid, **kwargs): # noqa: E501 + """Get a task # noqa: E501 + + Returns the complete task record for a single task. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.get_task_with_http_info(task_gid, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str task_gid: The task to operate on. (required) + :param list[str] opt_fields: This endpoint returns a compact resource, which excludes some properties by default. To include those optional properties, set this query parameter to a comma-separated list of the properties you wish to include. + :return: TaskResponseData + If the method is called asynchronously, + returns the request thread. + """ + + all_params = ['task_gid', 'opt_fields'] # noqa: E501 + all_params.append('async_req') + all_params.append('header_params') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + params = locals() + for key, val in six.iteritems(params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method get_task" % key + ) + params[key] = val + del params['kwargs'] + # verify the required parameter 'task_gid' is set + if ('task_gid' not in params or + params['task_gid'] is None): + raise ValueError("Missing the required parameter `task_gid` when calling `get_task`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'task_gid' in params: + path_params['task_gid'] = params['task_gid'] # noqa: E501 + + query_params = [] + if 'opt_fields' in params: + query_params.append(('opt_fields', params['opt_fields'])) # noqa: E501 + collection_formats['opt_fields'] = 'csv' # noqa: E501 + + header_params = kwargs.get("header_params", {}) + + form_params = [] + local_var_files = {} + + body_params = None + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['application/json; charset=UTF-8']) # noqa: E501 + + # Authentication setting + auth_settings = ['oauth2'] # noqa: E501 + + return self.api_client.call_api( + '/tasks/{task_gid}', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='TaskResponseData', # noqa: E501 + auth_settings=auth_settings, + async_req=params.get('async_req'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) + +def get_tasks(self, **kwargs): # noqa: E501 + """Get multiple tasks # noqa: E501 + + Returns the compact task records for some filtered set of tasks. Use one or more of the parameters provided to filter the tasks returned. You must specify a `project` or `tag` if you do not specify `assignee` and `workspace`. For more complex task retrieval, use [workspaces/{workspace_gid}/tasks/search](/reference/searchtasksforworkspace). # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.get_tasks(async_req=True) + >>> result = thread.get() + + :param async_req bool + :param int limit: Results per page. The number of objects to return per page. The value must be between 1 and 100. + :param str offset: 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 str assignee: 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.* + :param str project: The project to filter tasks on. + :param str section: The section to filter tasks on. + :param str workspace: The workspace to filter tasks on. *Note: If you specify `workspace`, you must also specify the `assignee` to filter on.* + :param datetime completed_since: Only return tasks that are either incomplete or that have been completed since this time. + :param datetime modified_since: 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 list[str] opt_fields: This endpoint returns a compact resource, which excludes some properties by default. To include those optional properties, set this query parameter to a comma-separated list of the properties you wish to include. + :return: TaskResponseArray + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = kwargs.get("_return_http_data_only", True) + if kwargs.get('async_req'): + return self.get_tasks_with_http_info(**kwargs) # noqa: E501 + else: + (data) = self.get_tasks_with_http_info(**kwargs) # noqa: E501 + return data + +def get_tasks_with_http_info(self, **kwargs): # noqa: E501 + """Get multiple tasks # noqa: E501 + + Returns the compact task records for some filtered set of tasks. Use one or more of the parameters provided to filter the tasks returned. You must specify a `project` or `tag` if you do not specify `assignee` and `workspace`. For more complex task retrieval, use [workspaces/{workspace_gid}/tasks/search](/reference/searchtasksforworkspace). # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.get_tasks_with_http_info(async_req=True) + >>> result = thread.get() + + :param async_req bool + :param int limit: Results per page. The number of objects to return per page. The value must be between 1 and 100. + :param str offset: 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 str assignee: 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.* + :param str project: The project to filter tasks on. + :param str section: The section to filter tasks on. + :param str workspace: The workspace to filter tasks on. *Note: If you specify `workspace`, you must also specify the `assignee` to filter on.* + :param datetime completed_since: Only return tasks that are either incomplete or that have been completed since this time. + :param datetime modified_since: 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 list[str] opt_fields: This endpoint returns a compact resource, which excludes some properties by default. To include those optional properties, set this query parameter to a comma-separated list of the properties you wish to include. + :return: TaskResponseArray + If the method is called asynchronously, + returns the request thread. + """ + + all_params = ['limit', 'offset', 'assignee', 'project', 'section', 'workspace', 'completed_since', 'modified_since', 'opt_fields'] # noqa: E501 + all_params.append('async_req') + all_params.append('header_params') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + params = locals() + for key, val in six.iteritems(params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method get_tasks" % key + ) + params[key] = val + del params['kwargs'] + + collection_formats = {} + + path_params = {} + + query_params = [] + if 'limit' in params: + query_params.append(('limit', params['limit'])) # noqa: E501 + if 'offset' in params: + query_params.append(('offset', params['offset'])) # noqa: E501 + if 'assignee' in params: + query_params.append(('assignee', params['assignee'])) # noqa: E501 + if 'project' in params: + query_params.append(('project', params['project'])) # noqa: E501 + if 'section' in params: + query_params.append(('section', params['section'])) # noqa: E501 + if 'workspace' in params: + query_params.append(('workspace', params['workspace'])) # noqa: E501 + if 'completed_since' in params: + query_params.append(('completed_since', params['completed_since'])) # noqa: E501 + if 'modified_since' in params: + query_params.append(('modified_since', params['modified_since'])) # noqa: E501 + if 'opt_fields' in params: + query_params.append(('opt_fields', params['opt_fields'])) # noqa: E501 + collection_formats['opt_fields'] = 'csv' # noqa: E501 + + header_params = kwargs.get("header_params", {}) + + form_params = [] + local_var_files = {} + + body_params = None + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['application/json; charset=UTF-8']) # noqa: E501 + + # Authentication setting + auth_settings = ['oauth2'] # noqa: E501 + + return self.api_client.call_api( + '/tasks', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='TaskResponseArray', # noqa: E501 + auth_settings=auth_settings, + async_req=params.get('async_req'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) + +def get_tasks_for_project(self, project_gid, **kwargs): # noqa: E501 + """Get tasks from a project # noqa: E501 + + Returns the compact task records for all tasks within the given project, ordered by their priority within the project. Tasks can exist in more than one project at a time. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.get_tasks_for_project(project_gid, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str project_gid: Globally unique identifier for the project. (required) + :param str completed_since: 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 int limit: Results per page. The number of objects to return per page. The value must be between 1 and 100. + :param str offset: 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 list[str] opt_fields: This endpoint returns a compact resource, which excludes some properties by default. To include those optional properties, set this query parameter to a comma-separated list of the properties you wish to include. + :return: TaskResponseArray + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = kwargs.get("_return_http_data_only", True) + if kwargs.get('async_req'): + return self.get_tasks_for_project_with_http_info(project_gid, **kwargs) # noqa: E501 + else: + (data) = self.get_tasks_for_project_with_http_info(project_gid, **kwargs) # noqa: E501 + return data + +def get_tasks_for_project_with_http_info(self, project_gid, **kwargs): # noqa: E501 + """Get tasks from a project # noqa: E501 + + Returns the compact task records for all tasks within the given project, ordered by their priority within the project. Tasks can exist in more than one project at a time. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.get_tasks_for_project_with_http_info(project_gid, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str project_gid: Globally unique identifier for the project. (required) + :param str completed_since: 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 int limit: Results per page. The number of objects to return per page. The value must be between 1 and 100. + :param str offset: 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 list[str] opt_fields: This endpoint returns a compact resource, which excludes some properties by default. To include those optional properties, set this query parameter to a comma-separated list of the properties you wish to include. + :return: TaskResponseArray + If the method is called asynchronously, + returns the request thread. + """ + + all_params = ['project_gid', 'completed_since', 'limit', 'offset', 'opt_fields'] # noqa: E501 + all_params.append('async_req') + all_params.append('header_params') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + params = locals() + for key, val in six.iteritems(params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method get_tasks_for_project" % key + ) + params[key] = val + del params['kwargs'] + # verify the required parameter 'project_gid' is set + if ('project_gid' not in params or + params['project_gid'] is None): + raise ValueError("Missing the required parameter `project_gid` when calling `get_tasks_for_project`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'project_gid' in params: + path_params['project_gid'] = params['project_gid'] # noqa: E501 + + query_params = [] + if 'completed_since' in params: + query_params.append(('completed_since', params['completed_since'])) # noqa: E501 + if 'limit' in params: + query_params.append(('limit', params['limit'])) # noqa: E501 + if 'offset' in params: + query_params.append(('offset', params['offset'])) # noqa: E501 + if 'opt_fields' in params: + query_params.append(('opt_fields', params['opt_fields'])) # noqa: E501 + collection_formats['opt_fields'] = 'csv' # noqa: E501 + + header_params = kwargs.get("header_params", {}) + + form_params = [] + local_var_files = {} + + body_params = None + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['application/json; charset=UTF-8']) # noqa: E501 + + # Authentication setting + auth_settings = ['oauth2'] # noqa: E501 + + return self.api_client.call_api( + '/projects/{project_gid}/tasks', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='TaskResponseArray', # noqa: E501 + auth_settings=auth_settings, + async_req=params.get('async_req'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) + +def get_tasks_for_section(self, section_gid, **kwargs): # noqa: E501 + """Get tasks from a section # noqa: E501 + + *Board view only*: Returns the compact section records for all tasks within the given section. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.get_tasks_for_section(section_gid, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str section_gid: The globally unique identifier for the section. (required) + :param int limit: Results per page. The number of objects to return per page. The value must be between 1 and 100. + :param str offset: 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 list[str] opt_fields: This endpoint returns a compact resource, which excludes some properties by default. To include those optional properties, set this query parameter to a comma-separated list of the properties you wish to include. + :return: TaskResponseArray + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = kwargs.get("_return_http_data_only", True) + if kwargs.get('async_req'): + return self.get_tasks_for_section_with_http_info(section_gid, **kwargs) # noqa: E501 + else: + (data) = self.get_tasks_for_section_with_http_info(section_gid, **kwargs) # noqa: E501 + return data + +def get_tasks_for_section_with_http_info(self, section_gid, **kwargs): # noqa: E501 + """Get tasks from a section # noqa: E501 + + *Board view only*: Returns the compact section records for all tasks within the given section. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.get_tasks_for_section_with_http_info(section_gid, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str section_gid: The globally unique identifier for the section. (required) + :param int limit: Results per page. The number of objects to return per page. The value must be between 1 and 100. + :param str offset: 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 list[str] opt_fields: This endpoint returns a compact resource, which excludes some properties by default. To include those optional properties, set this query parameter to a comma-separated list of the properties you wish to include. + :return: TaskResponseArray + If the method is called asynchronously, + returns the request thread. + """ + + all_params = ['section_gid', 'limit', 'offset', 'opt_fields'] # noqa: E501 + all_params.append('async_req') + all_params.append('header_params') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + params = locals() + for key, val in six.iteritems(params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method get_tasks_for_section" % key + ) + params[key] = val + del params['kwargs'] + # verify the required parameter 'section_gid' is set + if ('section_gid' not in params or + params['section_gid'] is None): + raise ValueError("Missing the required parameter `section_gid` when calling `get_tasks_for_section`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'section_gid' in params: + path_params['section_gid'] = params['section_gid'] # noqa: E501 + + query_params = [] + if 'limit' in params: + query_params.append(('limit', params['limit'])) # noqa: E501 + if 'offset' in params: + query_params.append(('offset', params['offset'])) # noqa: E501 + if 'opt_fields' in params: + query_params.append(('opt_fields', params['opt_fields'])) # noqa: E501 + collection_formats['opt_fields'] = 'csv' # noqa: E501 + + header_params = kwargs.get("header_params", {}) + + form_params = [] + local_var_files = {} + + body_params = None + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['application/json; charset=UTF-8']) # noqa: E501 + + # Authentication setting + auth_settings = ['oauth2'] # noqa: E501 + + return self.api_client.call_api( + '/sections/{section_gid}/tasks', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='TaskResponseArray', # noqa: E501 + auth_settings=auth_settings, + async_req=params.get('async_req'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) + +def get_tasks_for_tag(self, tag_gid, **kwargs): # noqa: E501 + """Get tasks from a tag # noqa: E501 + + Returns the compact task records for all tasks with the given tag. Tasks can have more than one tag at a time. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.get_tasks_for_tag(tag_gid, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str tag_gid: Globally unique identifier for the tag. (required) + :param int limit: Results per page. The number of objects to return per page. The value must be between 1 and 100. + :param str offset: 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 list[str] opt_fields: This endpoint returns a compact resource, which excludes some properties by default. To include those optional properties, set this query parameter to a comma-separated list of the properties you wish to include. + :return: TaskResponseArray + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = kwargs.get("_return_http_data_only", True) + if kwargs.get('async_req'): + return self.get_tasks_for_tag_with_http_info(tag_gid, **kwargs) # noqa: E501 + else: + (data) = self.get_tasks_for_tag_with_http_info(tag_gid, **kwargs) # noqa: E501 + return data + +def get_tasks_for_tag_with_http_info(self, tag_gid, **kwargs): # noqa: E501 + """Get tasks from a tag # noqa: E501 + + Returns the compact task records for all tasks with the given tag. Tasks can have more than one tag at a time. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.get_tasks_for_tag_with_http_info(tag_gid, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str tag_gid: Globally unique identifier for the tag. (required) + :param int limit: Results per page. The number of objects to return per page. The value must be between 1 and 100. + :param str offset: 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 list[str] opt_fields: This endpoint returns a compact resource, which excludes some properties by default. To include those optional properties, set this query parameter to a comma-separated list of the properties you wish to include. + :return: TaskResponseArray + If the method is called asynchronously, + returns the request thread. + """ + + all_params = ['tag_gid', 'limit', 'offset', 'opt_fields'] # noqa: E501 + all_params.append('async_req') + all_params.append('header_params') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + params = locals() + for key, val in six.iteritems(params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method get_tasks_for_tag" % key + ) + params[key] = val + del params['kwargs'] + # verify the required parameter 'tag_gid' is set + if ('tag_gid' not in params or + params['tag_gid'] is None): + raise ValueError("Missing the required parameter `tag_gid` when calling `get_tasks_for_tag`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'tag_gid' in params: + path_params['tag_gid'] = params['tag_gid'] # noqa: E501 + + query_params = [] + if 'limit' in params: + query_params.append(('limit', params['limit'])) # noqa: E501 + if 'offset' in params: + query_params.append(('offset', params['offset'])) # noqa: E501 + if 'opt_fields' in params: + query_params.append(('opt_fields', params['opt_fields'])) # noqa: E501 + collection_formats['opt_fields'] = 'csv' # noqa: E501 + + header_params = kwargs.get("header_params", {}) + + form_params = [] + local_var_files = {} + + body_params = None + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['application/json; charset=UTF-8']) # noqa: E501 + + # Authentication setting + auth_settings = ['oauth2'] # noqa: E501 + + return self.api_client.call_api( + '/tags/{tag_gid}/tasks', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='TaskResponseArray', # noqa: E501 + auth_settings=auth_settings, + async_req=params.get('async_req'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) + +def get_tasks_for_user_task_list(self, user_task_list_gid, **kwargs): # noqa: E501 + """Get tasks from a user task list # noqa: E501 + + Returns the compact list of tasks in a user’s My Tasks list. *Note: Access control is enforced for this endpoint as with all Asana API endpoints, meaning a user’s private tasks will be filtered out if the API-authenticated user does not have access to them.* *Note: Both complete and incomplete tasks are returned by default unless they are filtered out (for example, setting `completed_since=now` will return only incomplete tasks, which is the default view for “My Tasks” in Asana.)* # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.get_tasks_for_user_task_list(user_task_list_gid, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str user_task_list_gid: Globally unique identifier for the user task list. (required) + :param str completed_since: 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 int limit: Results per page. The number of objects to return per page. The value must be between 1 and 100. + :param str offset: 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 list[str] opt_fields: This endpoint returns a compact resource, which excludes some properties by default. To include those optional properties, set this query parameter to a comma-separated list of the properties you wish to include. + :return: TaskResponseArray + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = kwargs.get("_return_http_data_only", True) + if kwargs.get('async_req'): + return self.get_tasks_for_user_task_list_with_http_info(user_task_list_gid, **kwargs) # noqa: E501 + else: + (data) = self.get_tasks_for_user_task_list_with_http_info(user_task_list_gid, **kwargs) # noqa: E501 + return data + +def get_tasks_for_user_task_list_with_http_info(self, user_task_list_gid, **kwargs): # noqa: E501 + """Get tasks from a user task list # noqa: E501 + + Returns the compact list of tasks in a user’s My Tasks list. *Note: Access control is enforced for this endpoint as with all Asana API endpoints, meaning a user’s private tasks will be filtered out if the API-authenticated user does not have access to them.* *Note: Both complete and incomplete tasks are returned by default unless they are filtered out (for example, setting `completed_since=now` will return only incomplete tasks, which is the default view for “My Tasks” in Asana.)* # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.get_tasks_for_user_task_list_with_http_info(user_task_list_gid, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str user_task_list_gid: Globally unique identifier for the user task list. (required) + :param str completed_since: 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 int limit: Results per page. The number of objects to return per page. The value must be between 1 and 100. + :param str offset: 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 list[str] opt_fields: This endpoint returns a compact resource, which excludes some properties by default. To include those optional properties, set this query parameter to a comma-separated list of the properties you wish to include. + :return: TaskResponseArray + If the method is called asynchronously, + returns the request thread. + """ + + all_params = ['user_task_list_gid', 'completed_since', 'limit', 'offset', 'opt_fields'] # noqa: E501 + all_params.append('async_req') + all_params.append('header_params') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + params = locals() + for key, val in six.iteritems(params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method get_tasks_for_user_task_list" % key + ) + params[key] = val + del params['kwargs'] + # verify the required parameter 'user_task_list_gid' is set + if ('user_task_list_gid' not in params or + params['user_task_list_gid'] is None): + raise ValueError("Missing the required parameter `user_task_list_gid` when calling `get_tasks_for_user_task_list`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'user_task_list_gid' in params: + path_params['user_task_list_gid'] = params['user_task_list_gid'] # noqa: E501 + + query_params = [] + if 'completed_since' in params: + query_params.append(('completed_since', params['completed_since'])) # noqa: E501 + if 'limit' in params: + query_params.append(('limit', params['limit'])) # noqa: E501 + if 'offset' in params: + query_params.append(('offset', params['offset'])) # noqa: E501 + if 'opt_fields' in params: + query_params.append(('opt_fields', params['opt_fields'])) # noqa: E501 + collection_formats['opt_fields'] = 'csv' # noqa: E501 + + header_params = kwargs.get("header_params", {}) + + form_params = [] + local_var_files = {} + + body_params = None + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['application/json; charset=UTF-8']) # noqa: E501 + + # Authentication setting + auth_settings = ['oauth2'] # noqa: E501 + + return self.api_client.call_api( + '/user_task_lists/{user_task_list_gid}/tasks', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='TaskResponseArray', # noqa: E501 + auth_settings=auth_settings, + async_req=params.get('async_req'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) + +def remove_dependencies_for_task(self, body, task_gid, **kwargs): # noqa: E501 + """Unlink dependencies from a task # noqa: E501 + + Unlinks a set of dependencies from this task. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.remove_dependencies_for_task(body, task_gid, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param TaskGidRemoveDependenciesBody body: The list of tasks to unlink as dependencies. (required) + :param str task_gid: The task to operate on. (required) + :return: EmptyResponseData + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = kwargs.get("_return_http_data_only", True) + if kwargs.get('async_req'): + return self.remove_dependencies_for_task_with_http_info(body, task_gid, **kwargs) # noqa: E501 + else: + (data) = self.remove_dependencies_for_task_with_http_info(body, task_gid, **kwargs) # noqa: E501 + return data + +def remove_dependencies_for_task_with_http_info(self, body, task_gid, **kwargs): # noqa: E501 + """Unlink dependencies from a task # noqa: E501 + + Unlinks a set of dependencies from this task. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.remove_dependencies_for_task_with_http_info(body, task_gid, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param TaskGidRemoveDependenciesBody body: The list of tasks to unlink as dependencies. (required) + :param str task_gid: The task to operate on. (required) + :return: EmptyResponseData + If the method is called asynchronously, + returns the request thread. + """ + + all_params = ['body', 'task_gid'] # noqa: E501 + all_params.append('async_req') + all_params.append('header_params') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + params = locals() + for key, val in six.iteritems(params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method remove_dependencies_for_task" % key + ) + params[key] = val + del params['kwargs'] + # verify the required parameter 'body' is set + if ('body' not in params or + params['body'] is None): + raise ValueError("Missing the required parameter `body` when calling `remove_dependencies_for_task`") # noqa: E501 + # verify the required parameter 'task_gid' is set + if ('task_gid' not in params or + params['task_gid'] is None): + raise ValueError("Missing the required parameter `task_gid` when calling `remove_dependencies_for_task`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'task_gid' in params: + path_params['task_gid'] = params['task_gid'] # noqa: E501 + + query_params = [] + + header_params = kwargs.get("header_params", {}) + + form_params = [] + local_var_files = {} + + body_params = None + if 'body' in params: + body_params = params['body'] + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['application/json; charset=UTF-8']) # noqa: E501 + + # HTTP header `Content-Type` + header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 + ['application/json; charset=UTF-8']) # noqa: E501 + + # Authentication setting + auth_settings = ['oauth2'] # noqa: E501 + + return self.api_client.call_api( + '/tasks/{task_gid}/removeDependencies', 'POST', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='EmptyResponseData', # noqa: E501 + auth_settings=auth_settings, + async_req=params.get('async_req'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) + +def remove_dependents_for_task(self, body, task_gid, **kwargs): # noqa: E501 + """Unlink dependents from a task # noqa: E501 + + Unlinks a set of dependents from this task. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.remove_dependents_for_task(body, task_gid, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param TaskGidRemoveDependentsBody body: The list of tasks to remove as dependents. (required) + :param str task_gid: The task to operate on. (required) + :return: EmptyResponseData + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = kwargs.get("_return_http_data_only", True) + if kwargs.get('async_req'): + return self.remove_dependents_for_task_with_http_info(body, task_gid, **kwargs) # noqa: E501 + else: + (data) = self.remove_dependents_for_task_with_http_info(body, task_gid, **kwargs) # noqa: E501 + return data + +def remove_dependents_for_task_with_http_info(self, body, task_gid, **kwargs): # noqa: E501 + """Unlink dependents from a task # noqa: E501 + + Unlinks a set of dependents from this task. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.remove_dependents_for_task_with_http_info(body, task_gid, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param TaskGidRemoveDependentsBody body: The list of tasks to remove as dependents. (required) + :param str task_gid: The task to operate on. (required) + :return: EmptyResponseData + If the method is called asynchronously, + returns the request thread. + """ + + all_params = ['body', 'task_gid'] # noqa: E501 + all_params.append('async_req') + all_params.append('header_params') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + params = locals() + for key, val in six.iteritems(params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method remove_dependents_for_task" % key + ) + params[key] = val + del params['kwargs'] + # verify the required parameter 'body' is set + if ('body' not in params or + params['body'] is None): + raise ValueError("Missing the required parameter `body` when calling `remove_dependents_for_task`") # noqa: E501 + # verify the required parameter 'task_gid' is set + if ('task_gid' not in params or + params['task_gid'] is None): + raise ValueError("Missing the required parameter `task_gid` when calling `remove_dependents_for_task`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'task_gid' in params: + path_params['task_gid'] = params['task_gid'] # noqa: E501 + + query_params = [] + + header_params = kwargs.get("header_params", {}) + + form_params = [] + local_var_files = {} + + body_params = None + if 'body' in params: + body_params = params['body'] + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['application/json; charset=UTF-8']) # noqa: E501 + + # HTTP header `Content-Type` + header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 + ['application/json; charset=UTF-8']) # noqa: E501 + + # Authentication setting + auth_settings = ['oauth2'] # noqa: E501 + + return self.api_client.call_api( + '/tasks/{task_gid}/removeDependents', 'POST', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='EmptyResponseData', # noqa: E501 + auth_settings=auth_settings, + async_req=params.get('async_req'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) + +def remove_follower_for_task(self, body, task_gid, **kwargs): # noqa: E501 + """Remove followers from a task # noqa: E501 + + Removes each of the specified followers from the task if they are following. Returns the complete, updated record for the affected task. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.remove_follower_for_task(body, task_gid, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param TaskGidRemoveFollowersBody body: The followers to remove from the task. (required) + :param str task_gid: The task to operate on. (required) + :param list[str] opt_fields: This endpoint returns a compact resource, which excludes some properties by default. To include those optional properties, set this query parameter to a comma-separated list of the properties you wish to include. + :return: TaskResponseData + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = kwargs.get("_return_http_data_only", True) + if kwargs.get('async_req'): + return self.remove_follower_for_task_with_http_info(body, task_gid, **kwargs) # noqa: E501 + else: + (data) = self.remove_follower_for_task_with_http_info(body, task_gid, **kwargs) # noqa: E501 + return data + +def remove_follower_for_task_with_http_info(self, body, task_gid, **kwargs): # noqa: E501 + """Remove followers from a task # noqa: E501 + + Removes each of the specified followers from the task if they are following. Returns the complete, updated record for the affected task. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.remove_follower_for_task_with_http_info(body, task_gid, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param TaskGidRemoveFollowersBody body: The followers to remove from the task. (required) + :param str task_gid: The task to operate on. (required) + :param list[str] opt_fields: This endpoint returns a compact resource, which excludes some properties by default. To include those optional properties, set this query parameter to a comma-separated list of the properties you wish to include. + :return: TaskResponseData + If the method is called asynchronously, + returns the request thread. + """ + + all_params = ['body', 'task_gid', 'opt_fields'] # noqa: E501 + all_params.append('async_req') + all_params.append('header_params') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + params = locals() + for key, val in six.iteritems(params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method remove_follower_for_task" % key + ) + params[key] = val + del params['kwargs'] + # verify the required parameter 'body' is set + if ('body' not in params or + params['body'] is None): + raise ValueError("Missing the required parameter `body` when calling `remove_follower_for_task`") # noqa: E501 + # verify the required parameter 'task_gid' is set + if ('task_gid' not in params or + params['task_gid'] is None): + raise ValueError("Missing the required parameter `task_gid` when calling `remove_follower_for_task`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'task_gid' in params: + path_params['task_gid'] = params['task_gid'] # noqa: E501 + + query_params = [] + if 'opt_fields' in params: + query_params.append(('opt_fields', params['opt_fields'])) # noqa: E501 + collection_formats['opt_fields'] = 'csv' # noqa: E501 + + header_params = kwargs.get("header_params", {}) + + form_params = [] + local_var_files = {} + + body_params = None + if 'body' in params: + body_params = params['body'] + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['application/json; charset=UTF-8']) # noqa: E501 + + # HTTP header `Content-Type` + header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 + ['application/json; charset=UTF-8']) # noqa: E501 + + # Authentication setting + auth_settings = ['oauth2'] # noqa: E501 + + return self.api_client.call_api( + '/tasks/{task_gid}/removeFollowers', 'POST', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='TaskResponseData', # noqa: E501 + auth_settings=auth_settings, + async_req=params.get('async_req'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) + +def remove_project_for_task(self, body, task_gid, **kwargs): # noqa: E501 + """Remove a project from a task # noqa: E501 + + Removes the task from the specified project. The task will still exist in the system, but it will not be in the project anymore. Returns an empty data block. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.remove_project_for_task(body, task_gid, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param TaskGidRemoveProjectBody body: The project to remove the task from. (required) + :param str task_gid: The task to operate on. (required) + :return: EmptyResponseData + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = kwargs.get("_return_http_data_only", True) + if kwargs.get('async_req'): + return self.remove_project_for_task_with_http_info(body, task_gid, **kwargs) # noqa: E501 + else: + (data) = self.remove_project_for_task_with_http_info(body, task_gid, **kwargs) # noqa: E501 + return data + +def remove_project_for_task_with_http_info(self, body, task_gid, **kwargs): # noqa: E501 + """Remove a project from a task # noqa: E501 + + Removes the task from the specified project. The task will still exist in the system, but it will not be in the project anymore. Returns an empty data block. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.remove_project_for_task_with_http_info(body, task_gid, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param TaskGidRemoveProjectBody body: The project to remove the task from. (required) + :param str task_gid: The task to operate on. (required) + :return: EmptyResponseData + If the method is called asynchronously, + returns the request thread. + """ + + all_params = ['body', 'task_gid'] # noqa: E501 + all_params.append('async_req') + all_params.append('header_params') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + params = locals() + for key, val in six.iteritems(params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method remove_project_for_task" % key + ) + params[key] = val + del params['kwargs'] + # verify the required parameter 'body' is set + if ('body' not in params or + params['body'] is None): + raise ValueError("Missing the required parameter `body` when calling `remove_project_for_task`") # noqa: E501 + # verify the required parameter 'task_gid' is set + if ('task_gid' not in params or + params['task_gid'] is None): + raise ValueError("Missing the required parameter `task_gid` when calling `remove_project_for_task`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'task_gid' in params: + path_params['task_gid'] = params['task_gid'] # noqa: E501 + + query_params = [] + + header_params = kwargs.get("header_params", {}) + + form_params = [] + local_var_files = {} + + body_params = None + if 'body' in params: + body_params = params['body'] + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['application/json; charset=UTF-8']) # noqa: E501 + + # HTTP header `Content-Type` + header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 + ['application/json; charset=UTF-8']) # noqa: E501 + + # Authentication setting + auth_settings = ['oauth2'] # noqa: E501 + + return self.api_client.call_api( + '/tasks/{task_gid}/removeProject', 'POST', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='EmptyResponseData', # noqa: E501 + auth_settings=auth_settings, + async_req=params.get('async_req'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) + +def remove_tag_for_task(self, body, task_gid, **kwargs): # noqa: E501 + """Remove a tag from a task # noqa: E501 + + Removes a tag from a task. Returns an empty data block. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.remove_tag_for_task(body, task_gid, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param TaskGidRemoveTagBody body: The tag to remove from the task. (required) + :param str task_gid: The task to operate on. (required) + :return: EmptyResponseData + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = kwargs.get("_return_http_data_only", True) + if kwargs.get('async_req'): + return self.remove_tag_for_task_with_http_info(body, task_gid, **kwargs) # noqa: E501 + else: + (data) = self.remove_tag_for_task_with_http_info(body, task_gid, **kwargs) # noqa: E501 + return data + +def remove_tag_for_task_with_http_info(self, body, task_gid, **kwargs): # noqa: E501 + """Remove a tag from a task # noqa: E501 + + Removes a tag from a task. Returns an empty data block. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.remove_tag_for_task_with_http_info(body, task_gid, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param TaskGidRemoveTagBody body: The tag to remove from the task. (required) + :param str task_gid: The task to operate on. (required) + :return: EmptyResponseData + If the method is called asynchronously, + returns the request thread. + """ + + all_params = ['body', 'task_gid'] # noqa: E501 + all_params.append('async_req') + all_params.append('header_params') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + params = locals() + for key, val in six.iteritems(params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method remove_tag_for_task" % key + ) + params[key] = val + del params['kwargs'] + # verify the required parameter 'body' is set + if ('body' not in params or + params['body'] is None): + raise ValueError("Missing the required parameter `body` when calling `remove_tag_for_task`") # noqa: E501 + # verify the required parameter 'task_gid' is set + if ('task_gid' not in params or + params['task_gid'] is None): + raise ValueError("Missing the required parameter `task_gid` when calling `remove_tag_for_task`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'task_gid' in params: + path_params['task_gid'] = params['task_gid'] # noqa: E501 + + query_params = [] + + header_params = kwargs.get("header_params", {}) + + form_params = [] + local_var_files = {} + + body_params = None + if 'body' in params: + body_params = params['body'] + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['application/json; charset=UTF-8']) # noqa: E501 + + # HTTP header `Content-Type` + header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 + ['application/json; charset=UTF-8']) # noqa: E501 + + # Authentication setting + auth_settings = ['oauth2'] # noqa: E501 + + return self.api_client.call_api( + '/tasks/{task_gid}/removeTag', 'POST', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='EmptyResponseData', # noqa: E501 + auth_settings=auth_settings, + async_req=params.get('async_req'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) + +def search_tasks_for_workspace(self, workspace_gid, **kwargs): # noqa: E501 + """Search tasks in a workspace # noqa: E501 + + To mirror the functionality of the Asana web app's advanced search feature, the Asana API has a task search endpoint that allows you to build complex filters to find and retrieve the exact data you need. #### Premium access Like the Asana web product's advance search feature, this search endpoint will only be available to premium Asana users. A user is premium if any of the following is true: - The workspace in which the search is being performed is a premium workspace - The user is a member of a premium team inside the workspace Even if a user is only a member of a premium team inside a non-premium workspace, search will allow them to find data anywhere in the workspace, not just inside the premium team. Making a search request using credentials of a non-premium user will result in a `402 Payment Required` error. #### Pagination Search results are not stable; repeating the same query multiple times may return the data in a different order, even if the data do not change. Because of this, the traditional [pagination](https://developers.asana.com/docs/#pagination) available elsewhere in the Asana API is not available here. However, you can paginate manually by sorting the search results by their creation time and then modifying each subsequent query to exclude data you have already seen. Page sizes are limited to a maximum of 100 items, and can be specified by the `limit` query parameter. #### Eventual consistency Changes in Asana (regardless of whether they’re made though the web product or the API) are forwarded to our search infrastructure to be indexed. This process can take between 10 and 60 seconds to complete under normal operation, and longer during some production incidents. Making a change to a task that would alter its presence in a particular search query will not be reflected immediately. This is also true of the advanced search feature in the web product. #### Rate limits You may receive a `429 Too Many Requests` response if you hit any of our [rate limits](https://developers.asana.com/docs/#rate-limits). #### Custom field parameters | Parameter name | Custom field type | Accepted type | |---|---|---| | custom_fields.{gid}.is_set | All | Boolean | | custom_fields.{gid}.value | Text | String | | custom_fields.{gid}.value | Number | Number | | custom_fields.{gid}.value | Enum | Enum option ID | | custom_fields.{gid}.starts_with | Text only | String | | custom_fields.{gid}.ends_with | Text only | String | | custom_fields.{gid}.contains | Text only | String | | custom_fields.{gid}.less_than | Number only | Number | | custom_fields.{gid}.greater_than | Number only | Number | For example, if the gid of the custom field is 12345, these query parameter to find tasks where it is set would be `custom_fields.12345.is_set=true`. To match an exact value for an enum custom field, use the gid of the desired enum option and not the name of the enum option: `custom_fields.12345.value=67890`. **Not Supported**: searching for multiple exact matches of a custom field, searching for multi-enum custom field *Note: If you specify `projects.any` and `sections.any`, you will receive tasks for the project **and** tasks for the section. If you're looking for only tasks in a section, omit the `projects.any` from the request.* # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.search_tasks_for_workspace(workspace_gid, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str workspace_gid: Globally unique identifier for the workspace or organization. (required) + :param str text: Performs full-text search on both task name and description + :param str resource_subtype: Filters results by the task's resource_subtype + :param str assignee_any: Comma-separated list of user identifiers + :param str assignee_not: Comma-separated list of user identifiers + :param str portfolios_any: Comma-separated list of portfolio IDs + :param str projects_any: Comma-separated list of project IDs + :param str projects_not: Comma-separated list of project IDs + :param str projects_all: Comma-separated list of project IDs + :param str sections_any: Comma-separated list of section or column IDs + :param str sections_not: Comma-separated list of section or column IDs + :param str sections_all: Comma-separated list of section or column IDs + :param str tags_any: Comma-separated list of tag IDs + :param str tags_not: Comma-separated list of tag IDs + :param str tags_all: Comma-separated list of tag IDs + :param str teams_any: Comma-separated list of team IDs + :param str followers_not: Comma-separated list of user identifiers + :param str created_by_any: Comma-separated list of user identifiers + :param str created_by_not: Comma-separated list of user identifiers + :param str assigned_by_any: Comma-separated list of user identifiers + :param str assigned_by_not: Comma-separated list of user identifiers + :param str liked_by_not: Comma-separated list of user identifiers + :param str commented_on_by_not: Comma-separated list of user identifiers + :param date due_on_before: ISO 8601 date string + :param date due_on_after: ISO 8601 date string + :param date due_on: ISO 8601 date string or `null` + :param datetime due_at_before: ISO 8601 datetime string + :param datetime due_at_after: ISO 8601 datetime string + :param date start_on_before: ISO 8601 date string + :param date start_on_after: ISO 8601 date string + :param date start_on: ISO 8601 date string or `null` + :param date created_on_before: ISO 8601 date string + :param date created_on_after: ISO 8601 date string + :param date created_on: ISO 8601 date string or `null` + :param datetime created_at_before: ISO 8601 datetime string + :param datetime created_at_after: ISO 8601 datetime string + :param date completed_on_before: ISO 8601 date string + :param date completed_on_after: ISO 8601 date string + :param date completed_on: ISO 8601 date string or `null` + :param datetime completed_at_before: ISO 8601 datetime string + :param datetime completed_at_after: ISO 8601 datetime string + :param date modified_on_before: ISO 8601 date string + :param date modified_on_after: ISO 8601 date string + :param date modified_on: ISO 8601 date string or `null` + :param datetime modified_at_before: ISO 8601 datetime string + :param datetime modified_at_after: ISO 8601 datetime string + :param bool is_blocking: Filter to incomplete tasks with dependents + :param bool is_blocked: Filter to tasks with incomplete dependencies + :param bool has_attachment: Filter to tasks with attachments + :param bool completed: Filter to completed tasks + :param bool is_subtask: Filter to subtasks + :param str sort_by: One of `due_date`, `created_at`, `completed_at`, `likes`, or `modified_at`, defaults to `modified_at` + :param bool sort_ascending: Default `false` + :param list[str] opt_fields: This endpoint returns a compact resource, which excludes some properties by default. To include those optional properties, set this query parameter to a comma-separated list of the properties you wish to include. + :return: TaskResponseArray + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = kwargs.get("_return_http_data_only", True) + if kwargs.get('async_req'): + return self.search_tasks_for_workspace_with_http_info(workspace_gid, **kwargs) # noqa: E501 + else: + (data) = self.search_tasks_for_workspace_with_http_info(workspace_gid, **kwargs) # noqa: E501 + return data + +def search_tasks_for_workspace_with_http_info(self, workspace_gid, **kwargs): # noqa: E501 + """Search tasks in a workspace # noqa: E501 + + To mirror the functionality of the Asana web app's advanced search feature, the Asana API has a task search endpoint that allows you to build complex filters to find and retrieve the exact data you need. #### Premium access Like the Asana web product's advance search feature, this search endpoint will only be available to premium Asana users. A user is premium if any of the following is true: - The workspace in which the search is being performed is a premium workspace - The user is a member of a premium team inside the workspace Even if a user is only a member of a premium team inside a non-premium workspace, search will allow them to find data anywhere in the workspace, not just inside the premium team. Making a search request using credentials of a non-premium user will result in a `402 Payment Required` error. #### Pagination Search results are not stable; repeating the same query multiple times may return the data in a different order, even if the data do not change. Because of this, the traditional [pagination](https://developers.asana.com/docs/#pagination) available elsewhere in the Asana API is not available here. However, you can paginate manually by sorting the search results by their creation time and then modifying each subsequent query to exclude data you have already seen. Page sizes are limited to a maximum of 100 items, and can be specified by the `limit` query parameter. #### Eventual consistency Changes in Asana (regardless of whether they’re made though the web product or the API) are forwarded to our search infrastructure to be indexed. This process can take between 10 and 60 seconds to complete under normal operation, and longer during some production incidents. Making a change to a task that would alter its presence in a particular search query will not be reflected immediately. This is also true of the advanced search feature in the web product. #### Rate limits You may receive a `429 Too Many Requests` response if you hit any of our [rate limits](https://developers.asana.com/docs/#rate-limits). #### Custom field parameters | Parameter name | Custom field type | Accepted type | |---|---|---| | custom_fields.{gid}.is_set | All | Boolean | | custom_fields.{gid}.value | Text | String | | custom_fields.{gid}.value | Number | Number | | custom_fields.{gid}.value | Enum | Enum option ID | | custom_fields.{gid}.starts_with | Text only | String | | custom_fields.{gid}.ends_with | Text only | String | | custom_fields.{gid}.contains | Text only | String | | custom_fields.{gid}.less_than | Number only | Number | | custom_fields.{gid}.greater_than | Number only | Number | For example, if the gid of the custom field is 12345, these query parameter to find tasks where it is set would be `custom_fields.12345.is_set=true`. To match an exact value for an enum custom field, use the gid of the desired enum option and not the name of the enum option: `custom_fields.12345.value=67890`. **Not Supported**: searching for multiple exact matches of a custom field, searching for multi-enum custom field *Note: If you specify `projects.any` and `sections.any`, you will receive tasks for the project **and** tasks for the section. If you're looking for only tasks in a section, omit the `projects.any` from the request.* # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.search_tasks_for_workspace_with_http_info(workspace_gid, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str workspace_gid: Globally unique identifier for the workspace or organization. (required) + :param str text: Performs full-text search on both task name and description + :param str resource_subtype: Filters results by the task's resource_subtype + :param str assignee_any: Comma-separated list of user identifiers + :param str assignee_not: Comma-separated list of user identifiers + :param str portfolios_any: Comma-separated list of portfolio IDs + :param str projects_any: Comma-separated list of project IDs + :param str projects_not: Comma-separated list of project IDs + :param str projects_all: Comma-separated list of project IDs + :param str sections_any: Comma-separated list of section or column IDs + :param str sections_not: Comma-separated list of section or column IDs + :param str sections_all: Comma-separated list of section or column IDs + :param str tags_any: Comma-separated list of tag IDs + :param str tags_not: Comma-separated list of tag IDs + :param str tags_all: Comma-separated list of tag IDs + :param str teams_any: Comma-separated list of team IDs + :param str followers_not: Comma-separated list of user identifiers + :param str created_by_any: Comma-separated list of user identifiers + :param str created_by_not: Comma-separated list of user identifiers + :param str assigned_by_any: Comma-separated list of user identifiers + :param str assigned_by_not: Comma-separated list of user identifiers + :param str liked_by_not: Comma-separated list of user identifiers + :param str commented_on_by_not: Comma-separated list of user identifiers + :param date due_on_before: ISO 8601 date string + :param date due_on_after: ISO 8601 date string + :param date due_on: ISO 8601 date string or `null` + :param datetime due_at_before: ISO 8601 datetime string + :param datetime due_at_after: ISO 8601 datetime string + :param date start_on_before: ISO 8601 date string + :param date start_on_after: ISO 8601 date string + :param date start_on: ISO 8601 date string or `null` + :param date created_on_before: ISO 8601 date string + :param date created_on_after: ISO 8601 date string + :param date created_on: ISO 8601 date string or `null` + :param datetime created_at_before: ISO 8601 datetime string + :param datetime created_at_after: ISO 8601 datetime string + :param date completed_on_before: ISO 8601 date string + :param date completed_on_after: ISO 8601 date string + :param date completed_on: ISO 8601 date string or `null` + :param datetime completed_at_before: ISO 8601 datetime string + :param datetime completed_at_after: ISO 8601 datetime string + :param date modified_on_before: ISO 8601 date string + :param date modified_on_after: ISO 8601 date string + :param date modified_on: ISO 8601 date string or `null` + :param datetime modified_at_before: ISO 8601 datetime string + :param datetime modified_at_after: ISO 8601 datetime string + :param bool is_blocking: Filter to incomplete tasks with dependents + :param bool is_blocked: Filter to tasks with incomplete dependencies + :param bool has_attachment: Filter to tasks with attachments + :param bool completed: Filter to completed tasks + :param bool is_subtask: Filter to subtasks + :param str sort_by: One of `due_date`, `created_at`, `completed_at`, `likes`, or `modified_at`, defaults to `modified_at` + :param bool sort_ascending: Default `false` + :param list[str] opt_fields: This endpoint returns a compact resource, which excludes some properties by default. To include those optional properties, set this query parameter to a comma-separated list of the properties you wish to include. + :return: TaskResponseArray + If the method is called asynchronously, + returns the request thread. + """ + + all_params = ['workspace_gid', 'text', 'resource_subtype', 'assignee_any', 'assignee_not', 'portfolios_any', 'projects_any', 'projects_not', 'projects_all', 'sections_any', 'sections_not', 'sections_all', 'tags_any', 'tags_not', 'tags_all', 'teams_any', 'followers_not', 'created_by_any', 'created_by_not', 'assigned_by_any', 'assigned_by_not', 'liked_by_not', 'commented_on_by_not', 'due_on_before', 'due_on_after', 'due_on', 'due_at_before', 'due_at_after', 'start_on_before', 'start_on_after', 'start_on', 'created_on_before', 'created_on_after', 'created_on', 'created_at_before', 'created_at_after', 'completed_on_before', 'completed_on_after', 'completed_on', 'completed_at_before', 'completed_at_after', 'modified_on_before', 'modified_on_after', 'modified_on', 'modified_at_before', 'modified_at_after', 'is_blocking', 'is_blocked', 'has_attachment', 'completed', 'is_subtask', 'sort_by', 'sort_ascending', 'opt_fields'] # noqa: E501 + all_params.append('async_req') + all_params.append('header_params') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + params = locals() + for key, val in six.iteritems(params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method search_tasks_for_workspace" % key + ) + params[key] = val + del params['kwargs'] + # verify the required parameter 'workspace_gid' is set + if ('workspace_gid' not in params or + params['workspace_gid'] is None): + raise ValueError("Missing the required parameter `workspace_gid` when calling `search_tasks_for_workspace`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'workspace_gid' in params: + path_params['workspace_gid'] = params['workspace_gid'] # noqa: E501 + + query_params = [] + if 'text' in params: + query_params.append(('text', params['text'])) # noqa: E501 + if 'resource_subtype' in params: + query_params.append(('resource_subtype', params['resource_subtype'])) # noqa: E501 + if 'assignee_any' in params: + query_params.append(('assignee.any', params['assignee_any'])) # noqa: E501 + if 'assignee_not' in params: + query_params.append(('assignee.not', params['assignee_not'])) # noqa: E501 + if 'portfolios_any' in params: + query_params.append(('portfolios.any', params['portfolios_any'])) # noqa: E501 + if 'projects_any' in params: + query_params.append(('projects.any', params['projects_any'])) # noqa: E501 + if 'projects_not' in params: + query_params.append(('projects.not', params['projects_not'])) # noqa: E501 + if 'projects_all' in params: + query_params.append(('projects.all', params['projects_all'])) # noqa: E501 + if 'sections_any' in params: + query_params.append(('sections.any', params['sections_any'])) # noqa: E501 + if 'sections_not' in params: + query_params.append(('sections.not', params['sections_not'])) # noqa: E501 + if 'sections_all' in params: + query_params.append(('sections.all', params['sections_all'])) # noqa: E501 + if 'tags_any' in params: + query_params.append(('tags.any', params['tags_any'])) # noqa: E501 + if 'tags_not' in params: + query_params.append(('tags.not', params['tags_not'])) # noqa: E501 + if 'tags_all' in params: + query_params.append(('tags.all', params['tags_all'])) # noqa: E501 + if 'teams_any' in params: + query_params.append(('teams.any', params['teams_any'])) # noqa: E501 + if 'followers_not' in params: + query_params.append(('followers.not', params['followers_not'])) # noqa: E501 + if 'created_by_any' in params: + query_params.append(('created_by.any', params['created_by_any'])) # noqa: E501 + if 'created_by_not' in params: + query_params.append(('created_by.not', params['created_by_not'])) # noqa: E501 + if 'assigned_by_any' in params: + query_params.append(('assigned_by.any', params['assigned_by_any'])) # noqa: E501 + if 'assigned_by_not' in params: + query_params.append(('assigned_by.not', params['assigned_by_not'])) # noqa: E501 + if 'liked_by_not' in params: + query_params.append(('liked_by.not', params['liked_by_not'])) # noqa: E501 + if 'commented_on_by_not' in params: + query_params.append(('commented_on_by.not', params['commented_on_by_not'])) # noqa: E501 + if 'due_on_before' in params: + query_params.append(('due_on.before', params['due_on_before'])) # noqa: E501 + if 'due_on_after' in params: + query_params.append(('due_on.after', params['due_on_after'])) # noqa: E501 + if 'due_on' in params: + query_params.append(('due_on', params['due_on'])) # noqa: E501 + if 'due_at_before' in params: + query_params.append(('due_at.before', params['due_at_before'])) # noqa: E501 + if 'due_at_after' in params: + query_params.append(('due_at.after', params['due_at_after'])) # noqa: E501 + if 'start_on_before' in params: + query_params.append(('start_on.before', params['start_on_before'])) # noqa: E501 + if 'start_on_after' in params: + query_params.append(('start_on.after', params['start_on_after'])) # noqa: E501 + if 'start_on' in params: + query_params.append(('start_on', params['start_on'])) # noqa: E501 + if 'created_on_before' in params: + query_params.append(('created_on.before', params['created_on_before'])) # noqa: E501 + if 'created_on_after' in params: + query_params.append(('created_on.after', params['created_on_after'])) # noqa: E501 + if 'created_on' in params: + query_params.append(('created_on', params['created_on'])) # noqa: E501 + if 'created_at_before' in params: + query_params.append(('created_at.before', params['created_at_before'])) # noqa: E501 + if 'created_at_after' in params: + query_params.append(('created_at.after', params['created_at_after'])) # noqa: E501 + if 'completed_on_before' in params: + query_params.append(('completed_on.before', params['completed_on_before'])) # noqa: E501 + if 'completed_on_after' in params: + query_params.append(('completed_on.after', params['completed_on_after'])) # noqa: E501 + if 'completed_on' in params: + query_params.append(('completed_on', params['completed_on'])) # noqa: E501 + if 'completed_at_before' in params: + query_params.append(('completed_at.before', params['completed_at_before'])) # noqa: E501 + if 'completed_at_after' in params: + query_params.append(('completed_at.after', params['completed_at_after'])) # noqa: E501 + if 'modified_on_before' in params: + query_params.append(('modified_on.before', params['modified_on_before'])) # noqa: E501 + if 'modified_on_after' in params: + query_params.append(('modified_on.after', params['modified_on_after'])) # noqa: E501 + if 'modified_on' in params: + query_params.append(('modified_on', params['modified_on'])) # noqa: E501 + if 'modified_at_before' in params: + query_params.append(('modified_at.before', params['modified_at_before'])) # noqa: E501 + if 'modified_at_after' in params: + query_params.append(('modified_at.after', params['modified_at_after'])) # noqa: E501 + if 'is_blocking' in params: + query_params.append(('is_blocking', params['is_blocking'])) # noqa: E501 + if 'is_blocked' in params: + query_params.append(('is_blocked', params['is_blocked'])) # noqa: E501 + if 'has_attachment' in params: + query_params.append(('has_attachment', params['has_attachment'])) # noqa: E501 + if 'completed' in params: + query_params.append(('completed', params['completed'])) # noqa: E501 + if 'is_subtask' in params: + query_params.append(('is_subtask', params['is_subtask'])) # noqa: E501 + if 'sort_by' in params: + query_params.append(('sort_by', params['sort_by'])) # noqa: E501 + if 'sort_ascending' in params: + query_params.append(('sort_ascending', params['sort_ascending'])) # noqa: E501 + if 'opt_fields' in params: + query_params.append(('opt_fields', params['opt_fields'])) # noqa: E501 + collection_formats['opt_fields'] = 'csv' # noqa: E501 + + header_params = kwargs.get("header_params", {}) + + form_params = [] + local_var_files = {} + + body_params = None + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['application/json; charset=UTF-8']) # noqa: E501 + + # Authentication setting + auth_settings = ['oauth2'] # noqa: E501 + + return self.api_client.call_api( + '/workspaces/{workspace_gid}/tasks/search', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='TaskResponseArray', # noqa: E501 + auth_settings=auth_settings, + async_req=params.get('async_req'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) + +def set_parent_for_task(self, body, task_gid, **kwargs): # noqa: E501 + """Set the parent of a task # noqa: E501 + + parent, or no parent task at all. Returns an empty data block. When using `insert_before` and `insert_after`, at most one of those two options can be specified, and they must already be subtasks of the parent. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.set_parent_for_task(body, task_gid, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param TaskGidSetParentBody body: The new parent of the subtask. (required) + :param str task_gid: The task to operate on. (required) + :param list[str] opt_fields: This endpoint returns a compact resource, which excludes some properties by default. To include those optional properties, set this query parameter to a comma-separated list of the properties you wish to include. + :return: TaskResponseData + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = kwargs.get("_return_http_data_only", True) + if kwargs.get('async_req'): + return self.set_parent_for_task_with_http_info(body, task_gid, **kwargs) # noqa: E501 + else: + (data) = self.set_parent_for_task_with_http_info(body, task_gid, **kwargs) # noqa: E501 + return data + +def set_parent_for_task_with_http_info(self, body, task_gid, **kwargs): # noqa: E501 + """Set the parent of a task # noqa: E501 + + parent, or no parent task at all. Returns an empty data block. When using `insert_before` and `insert_after`, at most one of those two options can be specified, and they must already be subtasks of the parent. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.set_parent_for_task_with_http_info(body, task_gid, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param TaskGidSetParentBody body: The new parent of the subtask. (required) + :param str task_gid: The task to operate on. (required) + :param list[str] opt_fields: This endpoint returns a compact resource, which excludes some properties by default. To include those optional properties, set this query parameter to a comma-separated list of the properties you wish to include. + :return: TaskResponseData + If the method is called asynchronously, + returns the request thread. + """ + + all_params = ['body', 'task_gid', 'opt_fields'] # noqa: E501 + all_params.append('async_req') + all_params.append('header_params') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + params = locals() + for key, val in six.iteritems(params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method set_parent_for_task" % key + ) + params[key] = val + del params['kwargs'] + # verify the required parameter 'body' is set + if ('body' not in params or + params['body'] is None): + raise ValueError("Missing the required parameter `body` when calling `set_parent_for_task`") # noqa: E501 + # verify the required parameter 'task_gid' is set + if ('task_gid' not in params or + params['task_gid'] is None): + raise ValueError("Missing the required parameter `task_gid` when calling `set_parent_for_task`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'task_gid' in params: + path_params['task_gid'] = params['task_gid'] # noqa: E501 + + query_params = [] + if 'opt_fields' in params: + query_params.append(('opt_fields', params['opt_fields'])) # noqa: E501 + collection_formats['opt_fields'] = 'csv' # noqa: E501 + + header_params = kwargs.get("header_params", {}) + + form_params = [] + local_var_files = {} + + body_params = None + if 'body' in params: + body_params = params['body'] + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['application/json; charset=UTF-8']) # noqa: E501 + + # HTTP header `Content-Type` + header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 + ['application/json; charset=UTF-8']) # noqa: E501 + + # Authentication setting + auth_settings = ['oauth2'] # noqa: E501 + + return self.api_client.call_api( + '/tasks/{task_gid}/setParent', 'POST', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='TaskResponseData', # noqa: E501 + auth_settings=auth_settings, + async_req=params.get('async_req'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) + +def update_task(self, body, task_gid, **kwargs): # noqa: E501 + """Update a task # noqa: E501 + + A specific, existing task can be updated by making a PUT request on the URL for that task. Only the fields provided in the `data` block will be updated; any unspecified fields will remain unchanged. When using this method, it is best to specify only those fields you wish to change, or else you may overwrite changes made by another user since you last retrieved the task. Returns the complete updated task record. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.update_task(body, task_gid, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param TasksTaskGidBody body: The task to update. (required) + :param str task_gid: The task to operate on. (required) + :param list[str] opt_fields: This endpoint returns a compact resource, which excludes some properties by default. To include those optional properties, set this query parameter to a comma-separated list of the properties you wish to include. + :return: TaskResponseData + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = kwargs.get("_return_http_data_only", True) + if kwargs.get('async_req'): + return self.update_task_with_http_info(body, task_gid, **kwargs) # noqa: E501 + else: + (data) = self.update_task_with_http_info(body, task_gid, **kwargs) # noqa: E501 + return data + +def update_task_with_http_info(self, body, task_gid, **kwargs): # noqa: E501 + """Update a task # noqa: E501 + + A specific, existing task can be updated by making a PUT request on the URL for that task. Only the fields provided in the `data` block will be updated; any unspecified fields will remain unchanged. When using this method, it is best to specify only those fields you wish to change, or else you may overwrite changes made by another user since you last retrieved the task. Returns the complete updated task record. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.update_task_with_http_info(body, task_gid, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param TasksTaskGidBody body: The task to update. (required) + :param str task_gid: The task to operate on. (required) + :param list[str] opt_fields: This endpoint returns a compact resource, which excludes some properties by default. To include those optional properties, set this query parameter to a comma-separated list of the properties you wish to include. + :return: TaskResponseData + If the method is called asynchronously, + returns the request thread. """ - def __init__(self, api_client=None): - if api_client is None: - api_client = ApiClient() - self.api_client = api_client - - def add_dependencies_for_task(self, body, task_gid, **kwargs): # noqa: E501 - """Set dependencies for a task # noqa: E501 - - Marks a set of tasks as dependencies of this task, if they are not already dependencies. *A task can have at most 30 dependents and dependencies combined*. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.add_dependencies_for_task(body, task_gid, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param TaskGidAddDependenciesBody body: The list of tasks to set as dependencies. (required) - :param str task_gid: The task to operate on. (required) - :return: EmptyResponseData - If the method is called asynchronously, - returns the request thread. - """ - kwargs['_return_http_data_only'] = True - if kwargs.get('async_req'): - return self.add_dependencies_for_task_with_http_info(body, task_gid, **kwargs) # noqa: E501 - else: - (data) = self.add_dependencies_for_task_with_http_info(body, task_gid, **kwargs) # noqa: E501 - return data - - def add_dependencies_for_task_with_http_info(self, body, task_gid, **kwargs): # noqa: E501 - """Set dependencies for a task # noqa: E501 - - Marks a set of tasks as dependencies of this task, if they are not already dependencies. *A task can have at most 30 dependents and dependencies combined*. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.add_dependencies_for_task_with_http_info(body, task_gid, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param TaskGidAddDependenciesBody body: The list of tasks to set as dependencies. (required) - :param str task_gid: The task to operate on. (required) - :return: EmptyResponseData - If the method is called asynchronously, - returns the request thread. - """ - - all_params = ['body', 'task_gid'] # noqa: E501 - all_params.append('async_req') - all_params.append('_return_http_data_only') - all_params.append('_preload_content') - all_params.append('_request_timeout') - - params = locals() - for key, val in six.iteritems(params['kwargs']): - if key not in all_params: - raise TypeError( - "Got an unexpected keyword argument '%s'" - " to method add_dependencies_for_task" % key - ) - params[key] = val - del params['kwargs'] - # verify the required parameter 'body' is set - if ('body' not in params or - params['body'] is None): - raise ValueError("Missing the required parameter `body` when calling `add_dependencies_for_task`") # noqa: E501 - # verify the required parameter 'task_gid' is set - if ('task_gid' not in params or - params['task_gid'] is None): - raise ValueError("Missing the required parameter `task_gid` when calling `add_dependencies_for_task`") # noqa: E501 - - collection_formats = {} - - path_params = {} - if 'task_gid' in params: - path_params['task_gid'] = params['task_gid'] # noqa: E501 - - query_params = [] - - header_params = {} - - form_params = [] - local_var_files = {} - - body_params = None - if 'body' in params: - body_params = params['body'] - # HTTP header `Accept` - header_params['Accept'] = self.api_client.select_header_accept( - ['application/json; charset=UTF-8']) # noqa: E501 - - # HTTP header `Content-Type` - header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 - ['application/json; charset=UTF-8']) # noqa: E501 - - # Authentication setting - auth_settings = ['oauth2'] # noqa: E501 - - return self.api_client.call_api( - '/tasks/{task_gid}/addDependencies', 'POST', - path_params, - query_params, - header_params, - body=body_params, - post_params=form_params, - files=local_var_files, - response_type='EmptyResponseData', # noqa: E501 - auth_settings=auth_settings, - async_req=params.get('async_req'), - _return_http_data_only=params.get('_return_http_data_only'), - _preload_content=params.get('_preload_content', True), - _request_timeout=params.get('_request_timeout'), - collection_formats=collection_formats) - - def add_dependents_for_task(self, body, task_gid, **kwargs): # noqa: E501 - """Set dependents for a task # noqa: E501 - - Marks a set of tasks as dependents of this task, if they are not already dependents. *A task can have at most 30 dependents and dependencies combined*. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.add_dependents_for_task(body, task_gid, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param TaskGidAddDependentsBody body: The list of tasks to add as dependents. (required) - :param str task_gid: The task to operate on. (required) - :return: EmptyResponseData - If the method is called asynchronously, - returns the request thread. - """ - kwargs['_return_http_data_only'] = True - if kwargs.get('async_req'): - return self.add_dependents_for_task_with_http_info(body, task_gid, **kwargs) # noqa: E501 - else: - (data) = self.add_dependents_for_task_with_http_info(body, task_gid, **kwargs) # noqa: E501 - return data - - def add_dependents_for_task_with_http_info(self, body, task_gid, **kwargs): # noqa: E501 - """Set dependents for a task # noqa: E501 - - Marks a set of tasks as dependents of this task, if they are not already dependents. *A task can have at most 30 dependents and dependencies combined*. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.add_dependents_for_task_with_http_info(body, task_gid, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param TaskGidAddDependentsBody body: The list of tasks to add as dependents. (required) - :param str task_gid: The task to operate on. (required) - :return: EmptyResponseData - If the method is called asynchronously, - returns the request thread. - """ - - all_params = ['body', 'task_gid'] # noqa: E501 - all_params.append('async_req') - all_params.append('_return_http_data_only') - all_params.append('_preload_content') - all_params.append('_request_timeout') - - params = locals() - for key, val in six.iteritems(params['kwargs']): - if key not in all_params: - raise TypeError( - "Got an unexpected keyword argument '%s'" - " to method add_dependents_for_task" % key - ) - params[key] = val - del params['kwargs'] - # verify the required parameter 'body' is set - if ('body' not in params or - params['body'] is None): - raise ValueError("Missing the required parameter `body` when calling `add_dependents_for_task`") # noqa: E501 - # verify the required parameter 'task_gid' is set - if ('task_gid' not in params or - params['task_gid'] is None): - raise ValueError("Missing the required parameter `task_gid` when calling `add_dependents_for_task`") # noqa: E501 - - collection_formats = {} - - path_params = {} - if 'task_gid' in params: - path_params['task_gid'] = params['task_gid'] # noqa: E501 - - query_params = [] - - header_params = {} - - form_params = [] - local_var_files = {} - - body_params = None - if 'body' in params: - body_params = params['body'] - # HTTP header `Accept` - header_params['Accept'] = self.api_client.select_header_accept( - ['application/json; charset=UTF-8']) # noqa: E501 - - # HTTP header `Content-Type` - header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 - ['application/json; charset=UTF-8']) # noqa: E501 - - # Authentication setting - auth_settings = ['oauth2'] # noqa: E501 - - return self.api_client.call_api( - '/tasks/{task_gid}/addDependents', 'POST', - path_params, - query_params, - header_params, - body=body_params, - post_params=form_params, - files=local_var_files, - response_type='EmptyResponseData', # noqa: E501 - auth_settings=auth_settings, - async_req=params.get('async_req'), - _return_http_data_only=params.get('_return_http_data_only'), - _preload_content=params.get('_preload_content', True), - _request_timeout=params.get('_request_timeout'), - collection_formats=collection_formats) - - def add_followers_for_task(self, body, task_gid, **kwargs): # noqa: E501 - """Add followers to a task # noqa: E501 - - Adds followers to a task. Returns an empty data block. Each task can be associated with zero or more followers in the system. Requests to add/remove followers, if successful, will return the complete updated task record, described above. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.add_followers_for_task(body, task_gid, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param TaskGidAddFollowersBody body: The followers to add to the task. (required) - :param str task_gid: The task to operate on. (required) - :param list[str] opt_fields: This endpoint returns a compact resource, which excludes some properties by default. To include those optional properties, set this query parameter to a comma-separated list of the properties you wish to include. - :return: TaskResponseData - If the method is called asynchronously, - returns the request thread. - """ - kwargs['_return_http_data_only'] = True - if kwargs.get('async_req'): - return self.add_followers_for_task_with_http_info(body, task_gid, **kwargs) # noqa: E501 - else: - (data) = self.add_followers_for_task_with_http_info(body, task_gid, **kwargs) # noqa: E501 - return data - - def add_followers_for_task_with_http_info(self, body, task_gid, **kwargs): # noqa: E501 - """Add followers to a task # noqa: E501 - - Adds followers to a task. Returns an empty data block. Each task can be associated with zero or more followers in the system. Requests to add/remove followers, if successful, will return the complete updated task record, described above. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.add_followers_for_task_with_http_info(body, task_gid, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param TaskGidAddFollowersBody body: The followers to add to the task. (required) - :param str task_gid: The task to operate on. (required) - :param list[str] opt_fields: This endpoint returns a compact resource, which excludes some properties by default. To include those optional properties, set this query parameter to a comma-separated list of the properties you wish to include. - :return: TaskResponseData - If the method is called asynchronously, - returns the request thread. - """ - - all_params = ['body', 'task_gid', 'opt_fields'] # noqa: E501 - all_params.append('async_req') - all_params.append('_return_http_data_only') - all_params.append('_preload_content') - all_params.append('_request_timeout') - - params = locals() - for key, val in six.iteritems(params['kwargs']): - if key not in all_params: - raise TypeError( - "Got an unexpected keyword argument '%s'" - " to method add_followers_for_task" % key - ) - params[key] = val - del params['kwargs'] - # verify the required parameter 'body' is set - if ('body' not in params or - params['body'] is None): - raise ValueError("Missing the required parameter `body` when calling `add_followers_for_task`") # noqa: E501 - # verify the required parameter 'task_gid' is set - if ('task_gid' not in params or - params['task_gid'] is None): - raise ValueError("Missing the required parameter `task_gid` when calling `add_followers_for_task`") # noqa: E501 - - collection_formats = {} - - path_params = {} - if 'task_gid' in params: - path_params['task_gid'] = params['task_gid'] # noqa: E501 - - query_params = [] - if 'opt_fields' in params: - query_params.append(('opt_fields', params['opt_fields'])) # noqa: E501 - collection_formats['opt_fields'] = 'csv' # noqa: E501 - - header_params = {} - - form_params = [] - local_var_files = {} - - body_params = None - if 'body' in params: - body_params = params['body'] - # HTTP header `Accept` - header_params['Accept'] = self.api_client.select_header_accept( - ['application/json; charset=UTF-8']) # noqa: E501 - - # HTTP header `Content-Type` - header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 - ['application/json; charset=UTF-8']) # noqa: E501 - - # Authentication setting - auth_settings = ['oauth2'] # noqa: E501 - - return self.api_client.call_api( - '/tasks/{task_gid}/addFollowers', 'POST', - path_params, - query_params, - header_params, - body=body_params, - post_params=form_params, - files=local_var_files, - response_type='TaskResponseData', # noqa: E501 - auth_settings=auth_settings, - async_req=params.get('async_req'), - _return_http_data_only=params.get('_return_http_data_only'), - _preload_content=params.get('_preload_content', True), - _request_timeout=params.get('_request_timeout'), - collection_formats=collection_formats) - - def add_project_for_task(self, body, task_gid, **kwargs): # noqa: E501 - """Add a project to a task # noqa: E501 - - Adds the task to the specified project, in the optional location specified. If no location arguments are given, the task will be added to the end of the project. `addProject` can also be used to reorder a task within a project or section that already contains it. At most one of `insert_before`, `insert_after`, or `section` should be specified. Inserting into a section in an non-order-dependent way can be done by specifying section, otherwise, to insert within a section in a particular place, specify `insert_before` or `insert_after` and a task within the section to anchor the position of this task. Returns an empty data block. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.add_project_for_task(body, task_gid, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param TaskGidAddProjectBody body: The project to add the task to. (required) - :param str task_gid: The task to operate on. (required) - :return: EmptyResponseData - If the method is called asynchronously, - returns the request thread. - """ - kwargs['_return_http_data_only'] = True - if kwargs.get('async_req'): - return self.add_project_for_task_with_http_info(body, task_gid, **kwargs) # noqa: E501 - else: - (data) = self.add_project_for_task_with_http_info(body, task_gid, **kwargs) # noqa: E501 - return data - - def add_project_for_task_with_http_info(self, body, task_gid, **kwargs): # noqa: E501 - """Add a project to a task # noqa: E501 - - Adds the task to the specified project, in the optional location specified. If no location arguments are given, the task will be added to the end of the project. `addProject` can also be used to reorder a task within a project or section that already contains it. At most one of `insert_before`, `insert_after`, or `section` should be specified. Inserting into a section in an non-order-dependent way can be done by specifying section, otherwise, to insert within a section in a particular place, specify `insert_before` or `insert_after` and a task within the section to anchor the position of this task. Returns an empty data block. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.add_project_for_task_with_http_info(body, task_gid, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param TaskGidAddProjectBody body: The project to add the task to. (required) - :param str task_gid: The task to operate on. (required) - :return: EmptyResponseData - If the method is called asynchronously, - returns the request thread. - """ - - all_params = ['body', 'task_gid'] # noqa: E501 - all_params.append('async_req') - all_params.append('_return_http_data_only') - all_params.append('_preload_content') - all_params.append('_request_timeout') - - params = locals() - for key, val in six.iteritems(params['kwargs']): - if key not in all_params: - raise TypeError( - "Got an unexpected keyword argument '%s'" - " to method add_project_for_task" % key - ) - params[key] = val - del params['kwargs'] - # verify the required parameter 'body' is set - if ('body' not in params or - params['body'] is None): - raise ValueError("Missing the required parameter `body` when calling `add_project_for_task`") # noqa: E501 - # verify the required parameter 'task_gid' is set - if ('task_gid' not in params or - params['task_gid'] is None): - raise ValueError("Missing the required parameter `task_gid` when calling `add_project_for_task`") # noqa: E501 - - collection_formats = {} - - path_params = {} - if 'task_gid' in params: - path_params['task_gid'] = params['task_gid'] # noqa: E501 - - query_params = [] - - header_params = {} - - form_params = [] - local_var_files = {} - - body_params = None - if 'body' in params: - body_params = params['body'] - # HTTP header `Accept` - header_params['Accept'] = self.api_client.select_header_accept( - ['application/json; charset=UTF-8']) # noqa: E501 - - # HTTP header `Content-Type` - header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 - ['application/json; charset=UTF-8']) # noqa: E501 - - # Authentication setting - auth_settings = ['oauth2'] # noqa: E501 - - return self.api_client.call_api( - '/tasks/{task_gid}/addProject', 'POST', - path_params, - query_params, - header_params, - body=body_params, - post_params=form_params, - files=local_var_files, - response_type='EmptyResponseData', # noqa: E501 - auth_settings=auth_settings, - async_req=params.get('async_req'), - _return_http_data_only=params.get('_return_http_data_only'), - _preload_content=params.get('_preload_content', True), - _request_timeout=params.get('_request_timeout'), - collection_formats=collection_formats) - - def add_tag_for_task(self, body, task_gid, **kwargs): # noqa: E501 - """Add a tag to a task # noqa: E501 - - Adds a tag to a task. Returns an empty data block. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.add_tag_for_task(body, task_gid, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param TaskGidAddTagBody body: The tag to add to the task. (required) - :param str task_gid: The task to operate on. (required) - :return: EmptyResponseData - If the method is called asynchronously, - returns the request thread. - """ - kwargs['_return_http_data_only'] = True - if kwargs.get('async_req'): - return self.add_tag_for_task_with_http_info(body, task_gid, **kwargs) # noqa: E501 - else: - (data) = self.add_tag_for_task_with_http_info(body, task_gid, **kwargs) # noqa: E501 - return data - - def add_tag_for_task_with_http_info(self, body, task_gid, **kwargs): # noqa: E501 - """Add a tag to a task # noqa: E501 - - Adds a tag to a task. Returns an empty data block. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.add_tag_for_task_with_http_info(body, task_gid, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param TaskGidAddTagBody body: The tag to add to the task. (required) - :param str task_gid: The task to operate on. (required) - :return: EmptyResponseData - If the method is called asynchronously, - returns the request thread. - """ - - all_params = ['body', 'task_gid'] # noqa: E501 - all_params.append('async_req') - all_params.append('_return_http_data_only') - all_params.append('_preload_content') - all_params.append('_request_timeout') - - params = locals() - for key, val in six.iteritems(params['kwargs']): - if key not in all_params: - raise TypeError( - "Got an unexpected keyword argument '%s'" - " to method add_tag_for_task" % key - ) - params[key] = val - del params['kwargs'] - # verify the required parameter 'body' is set - if ('body' not in params or - params['body'] is None): - raise ValueError("Missing the required parameter `body` when calling `add_tag_for_task`") # noqa: E501 - # verify the required parameter 'task_gid' is set - if ('task_gid' not in params or - params['task_gid'] is None): - raise ValueError("Missing the required parameter `task_gid` when calling `add_tag_for_task`") # noqa: E501 - - collection_formats = {} - - path_params = {} - if 'task_gid' in params: - path_params['task_gid'] = params['task_gid'] # noqa: E501 - - query_params = [] - - header_params = {} - - form_params = [] - local_var_files = {} - - body_params = None - if 'body' in params: - body_params = params['body'] - # HTTP header `Accept` - header_params['Accept'] = self.api_client.select_header_accept( - ['application/json; charset=UTF-8']) # noqa: E501 - - # HTTP header `Content-Type` - header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 - ['application/json; charset=UTF-8']) # noqa: E501 - - # Authentication setting - auth_settings = ['oauth2'] # noqa: E501 - - return self.api_client.call_api( - '/tasks/{task_gid}/addTag', 'POST', - path_params, - query_params, - header_params, - body=body_params, - post_params=form_params, - files=local_var_files, - response_type='EmptyResponseData', # noqa: E501 - auth_settings=auth_settings, - async_req=params.get('async_req'), - _return_http_data_only=params.get('_return_http_data_only'), - _preload_content=params.get('_preload_content', True), - _request_timeout=params.get('_request_timeout'), - collection_formats=collection_formats) - - def create_subtask_for_task(self, body, task_gid, **kwargs): # noqa: E501 - """Create a subtask # noqa: E501 - - Creates a new subtask and adds it to the parent task. Returns the full record for the newly created subtask. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.create_subtask_for_task(body, task_gid, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param TaskGidSubtasksBody body: The new subtask to create. (required) - :param str task_gid: The task to operate on. (required) - :param list[str] opt_fields: This endpoint returns a compact resource, which excludes some properties by default. To include those optional properties, set this query parameter to a comma-separated list of the properties you wish to include. - :return: TaskResponseData - If the method is called asynchronously, - returns the request thread. - """ - kwargs['_return_http_data_only'] = True - if kwargs.get('async_req'): - return self.create_subtask_for_task_with_http_info(body, task_gid, **kwargs) # noqa: E501 - else: - (data) = self.create_subtask_for_task_with_http_info(body, task_gid, **kwargs) # noqa: E501 - return data - - def create_subtask_for_task_with_http_info(self, body, task_gid, **kwargs): # noqa: E501 - """Create a subtask # noqa: E501 - - Creates a new subtask and adds it to the parent task. Returns the full record for the newly created subtask. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.create_subtask_for_task_with_http_info(body, task_gid, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param TaskGidSubtasksBody body: The new subtask to create. (required) - :param str task_gid: The task to operate on. (required) - :param list[str] opt_fields: This endpoint returns a compact resource, which excludes some properties by default. To include those optional properties, set this query parameter to a comma-separated list of the properties you wish to include. - :return: TaskResponseData - If the method is called asynchronously, - returns the request thread. - """ - - all_params = ['body', 'task_gid', 'opt_fields'] # noqa: E501 - all_params.append('async_req') - all_params.append('_return_http_data_only') - all_params.append('_preload_content') - all_params.append('_request_timeout') - - params = locals() - for key, val in six.iteritems(params['kwargs']): - if key not in all_params: - raise TypeError( - "Got an unexpected keyword argument '%s'" - " to method create_subtask_for_task" % key - ) - params[key] = val - del params['kwargs'] - # verify the required parameter 'body' is set - if ('body' not in params or - params['body'] is None): - raise ValueError("Missing the required parameter `body` when calling `create_subtask_for_task`") # noqa: E501 - # verify the required parameter 'task_gid' is set - if ('task_gid' not in params or - params['task_gid'] is None): - raise ValueError("Missing the required parameter `task_gid` when calling `create_subtask_for_task`") # noqa: E501 - - collection_formats = {} - - path_params = {} - if 'task_gid' in params: - path_params['task_gid'] = params['task_gid'] # noqa: E501 - - query_params = [] - if 'opt_fields' in params: - query_params.append(('opt_fields', params['opt_fields'])) # noqa: E501 - collection_formats['opt_fields'] = 'csv' # noqa: E501 - - header_params = {} - - form_params = [] - local_var_files = {} - - body_params = None - if 'body' in params: - body_params = params['body'] - # HTTP header `Accept` - header_params['Accept'] = self.api_client.select_header_accept( - ['application/json; charset=UTF-8']) # noqa: E501 - - # HTTP header `Content-Type` - header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 - ['application/json; charset=UTF-8']) # noqa: E501 - - # Authentication setting - auth_settings = ['oauth2'] # noqa: E501 - - return self.api_client.call_api( - '/tasks/{task_gid}/subtasks', 'POST', - path_params, - query_params, - header_params, - body=body_params, - post_params=form_params, - files=local_var_files, - response_type='TaskResponseData', # noqa: E501 - auth_settings=auth_settings, - async_req=params.get('async_req'), - _return_http_data_only=params.get('_return_http_data_only'), - _preload_content=params.get('_preload_content', True), - _request_timeout=params.get('_request_timeout'), - collection_formats=collection_formats) - - def create_task(self, body, **kwargs): # noqa: E501 - """Create a task # noqa: E501 - - Creating a new task is as easy as POSTing to the `/tasks` endpoint with a data block containing the fields you’d like to set on the task. Any unspecified fields will take on default values. Every task is required to be created in a specific workspace, and this workspace cannot be changed once set. The workspace need not be set explicitly if you specify `projects` or a `parent` task instead. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.create_task(body, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param TasksBody body: The task to create. (required) - :param list[str] opt_fields: This endpoint returns a compact resource, which excludes some properties by default. To include those optional properties, set this query parameter to a comma-separated list of the properties you wish to include. - :return: TaskResponseData - If the method is called asynchronously, - returns the request thread. - """ - kwargs['_return_http_data_only'] = True - if kwargs.get('async_req'): - return self.create_task_with_http_info(body, **kwargs) # noqa: E501 - else: - (data) = self.create_task_with_http_info(body, **kwargs) # noqa: E501 - return data - - def create_task_with_http_info(self, body, **kwargs): # noqa: E501 - """Create a task # noqa: E501 - - Creating a new task is as easy as POSTing to the `/tasks` endpoint with a data block containing the fields you’d like to set on the task. Any unspecified fields will take on default values. Every task is required to be created in a specific workspace, and this workspace cannot be changed once set. The workspace need not be set explicitly if you specify `projects` or a `parent` task instead. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.create_task_with_http_info(body, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param TasksBody body: The task to create. (required) - :param list[str] opt_fields: This endpoint returns a compact resource, which excludes some properties by default. To include those optional properties, set this query parameter to a comma-separated list of the properties you wish to include. - :return: TaskResponseData - If the method is called asynchronously, - returns the request thread. - """ - - all_params = ['body', 'opt_fields'] # noqa: E501 - all_params.append('async_req') - all_params.append('_return_http_data_only') - all_params.append('_preload_content') - all_params.append('_request_timeout') - - params = locals() - for key, val in six.iteritems(params['kwargs']): - if key not in all_params: - raise TypeError( - "Got an unexpected keyword argument '%s'" - " to method create_task" % key - ) - params[key] = val - del params['kwargs'] - # verify the required parameter 'body' is set - if ('body' not in params or - params['body'] is None): - raise ValueError("Missing the required parameter `body` when calling `create_task`") # noqa: E501 - - collection_formats = {} - - path_params = {} - - query_params = [] - if 'opt_fields' in params: - query_params.append(('opt_fields', params['opt_fields'])) # noqa: E501 - collection_formats['opt_fields'] = 'csv' # noqa: E501 - - header_params = {} - - form_params = [] - local_var_files = {} - - body_params = None - if 'body' in params: - body_params = params['body'] - # HTTP header `Accept` - header_params['Accept'] = self.api_client.select_header_accept( - ['application/json; charset=UTF-8']) # noqa: E501 - - # HTTP header `Content-Type` - header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 - ['application/json; charset=UTF-8']) # noqa: E501 - - # Authentication setting - auth_settings = ['oauth2'] # noqa: E501 - - return self.api_client.call_api( - '/tasks', 'POST', - path_params, - query_params, - header_params, - body=body_params, - post_params=form_params, - files=local_var_files, - response_type='TaskResponseData', # noqa: E501 - auth_settings=auth_settings, - async_req=params.get('async_req'), - _return_http_data_only=params.get('_return_http_data_only'), - _preload_content=params.get('_preload_content', True), - _request_timeout=params.get('_request_timeout'), - collection_formats=collection_formats) - - def delete_task(self, task_gid, **kwargs): # noqa: E501 - """Delete a task # noqa: E501 - - A specific, existing task can be deleted by making a DELETE request on the URL for that task. Deleted tasks go into the “trash” of the user making the delete request. Tasks can be recovered from the trash within a period of 30 days; afterward they are completely removed from the system. Returns an empty data record. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.delete_task(task_gid, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param str task_gid: The task to operate on. (required) - :return: EmptyResponseData - If the method is called asynchronously, - returns the request thread. - """ - kwargs['_return_http_data_only'] = True - if kwargs.get('async_req'): - return self.delete_task_with_http_info(task_gid, **kwargs) # noqa: E501 - else: - (data) = self.delete_task_with_http_info(task_gid, **kwargs) # noqa: E501 - return data - - def delete_task_with_http_info(self, task_gid, **kwargs): # noqa: E501 - """Delete a task # noqa: E501 - - A specific, existing task can be deleted by making a DELETE request on the URL for that task. Deleted tasks go into the “trash” of the user making the delete request. Tasks can be recovered from the trash within a period of 30 days; afterward they are completely removed from the system. Returns an empty data record. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.delete_task_with_http_info(task_gid, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param str task_gid: The task to operate on. (required) - :return: EmptyResponseData - If the method is called asynchronously, - returns the request thread. - """ - - all_params = ['task_gid'] # noqa: E501 - all_params.append('async_req') - all_params.append('_return_http_data_only') - all_params.append('_preload_content') - all_params.append('_request_timeout') - - params = locals() - for key, val in six.iteritems(params['kwargs']): - if key not in all_params: - raise TypeError( - "Got an unexpected keyword argument '%s'" - " to method delete_task" % key - ) - params[key] = val - del params['kwargs'] - # verify the required parameter 'task_gid' is set - if ('task_gid' not in params or - params['task_gid'] is None): - raise ValueError("Missing the required parameter `task_gid` when calling `delete_task`") # noqa: E501 - - collection_formats = {} - - path_params = {} - if 'task_gid' in params: - path_params['task_gid'] = params['task_gid'] # noqa: E501 - - query_params = [] - - header_params = {} - - form_params = [] - local_var_files = {} - - body_params = None - # HTTP header `Accept` - header_params['Accept'] = self.api_client.select_header_accept( - ['application/json; charset=UTF-8']) # noqa: E501 - - # Authentication setting - auth_settings = ['oauth2'] # noqa: E501 - - return self.api_client.call_api( - '/tasks/{task_gid}', 'DELETE', - path_params, - query_params, - header_params, - body=body_params, - post_params=form_params, - files=local_var_files, - response_type='EmptyResponseData', # noqa: E501 - auth_settings=auth_settings, - async_req=params.get('async_req'), - _return_http_data_only=params.get('_return_http_data_only'), - _preload_content=params.get('_preload_content', True), - _request_timeout=params.get('_request_timeout'), - collection_formats=collection_formats) - - def duplicate_task(self, body, task_gid, **kwargs): # noqa: E501 - """Duplicate a task # noqa: E501 - - Creates and returns a job that will asynchronously handle the duplication. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.duplicate_task(body, task_gid, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param TaskGidDuplicateBody body: Describes the duplicate's name and the fields that will be duplicated. (required) - :param str task_gid: The task to operate on. (required) - :param list[str] opt_fields: This endpoint returns a compact resource, which excludes some properties by default. To include those optional properties, set this query parameter to a comma-separated list of the properties you wish to include. - :return: JobResponseData - If the method is called asynchronously, - returns the request thread. - """ - kwargs['_return_http_data_only'] = True - if kwargs.get('async_req'): - return self.duplicate_task_with_http_info(body, task_gid, **kwargs) # noqa: E501 - else: - (data) = self.duplicate_task_with_http_info(body, task_gid, **kwargs) # noqa: E501 - return data - - def duplicate_task_with_http_info(self, body, task_gid, **kwargs): # noqa: E501 - """Duplicate a task # noqa: E501 - - Creates and returns a job that will asynchronously handle the duplication. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.duplicate_task_with_http_info(body, task_gid, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param TaskGidDuplicateBody body: Describes the duplicate's name and the fields that will be duplicated. (required) - :param str task_gid: The task to operate on. (required) - :param list[str] opt_fields: This endpoint returns a compact resource, which excludes some properties by default. To include those optional properties, set this query parameter to a comma-separated list of the properties you wish to include. - :return: JobResponseData - If the method is called asynchronously, - returns the request thread. - """ - - all_params = ['body', 'task_gid', 'opt_fields'] # noqa: E501 - all_params.append('async_req') - all_params.append('_return_http_data_only') - all_params.append('_preload_content') - all_params.append('_request_timeout') - - params = locals() - for key, val in six.iteritems(params['kwargs']): - if key not in all_params: - raise TypeError( - "Got an unexpected keyword argument '%s'" - " to method duplicate_task" % key - ) - params[key] = val - del params['kwargs'] - # verify the required parameter 'body' is set - if ('body' not in params or - params['body'] is None): - raise ValueError("Missing the required parameter `body` when calling `duplicate_task`") # noqa: E501 - # verify the required parameter 'task_gid' is set - if ('task_gid' not in params or - params['task_gid'] is None): - raise ValueError("Missing the required parameter `task_gid` when calling `duplicate_task`") # noqa: E501 - - collection_formats = {} - - path_params = {} - if 'task_gid' in params: - path_params['task_gid'] = params['task_gid'] # noqa: E501 - - query_params = [] - if 'opt_fields' in params: - query_params.append(('opt_fields', params['opt_fields'])) # noqa: E501 - collection_formats['opt_fields'] = 'csv' # noqa: E501 - - header_params = {} - - form_params = [] - local_var_files = {} - - body_params = None - if 'body' in params: - body_params = params['body'] - # HTTP header `Accept` - header_params['Accept'] = self.api_client.select_header_accept( - ['application/json; charset=UTF-8']) # noqa: E501 - - # HTTP header `Content-Type` - header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 - ['application/json; charset=UTF-8']) # noqa: E501 - - # Authentication setting - auth_settings = ['oauth2'] # noqa: E501 - - return self.api_client.call_api( - '/tasks/{task_gid}/duplicate', 'POST', - path_params, - query_params, - header_params, - body=body_params, - post_params=form_params, - files=local_var_files, - response_type='JobResponseData', # noqa: E501 - auth_settings=auth_settings, - async_req=params.get('async_req'), - _return_http_data_only=params.get('_return_http_data_only'), - _preload_content=params.get('_preload_content', True), - _request_timeout=params.get('_request_timeout'), - collection_formats=collection_formats) - - def get_dependencies_for_task(self, task_gid, **kwargs): # noqa: E501 - """Get dependencies from a task # noqa: E501 - - Returns the compact representations of all of the dependencies of a task. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.get_dependencies_for_task(task_gid, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param str task_gid: The task to operate on. (required) - :param int limit: Results per page. The number of objects to return per page. The value must be between 1 and 100. - :param str offset: 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 list[str] opt_fields: This endpoint returns a compact resource, which excludes some properties by default. To include those optional properties, set this query parameter to a comma-separated list of the properties you wish to include. - :return: TaskResponseArray - If the method is called asynchronously, - returns the request thread. - """ - kwargs['_return_http_data_only'] = True - if kwargs.get('async_req'): - return self.get_dependencies_for_task_with_http_info(task_gid, **kwargs) # noqa: E501 - else: - (data) = self.get_dependencies_for_task_with_http_info(task_gid, **kwargs) # noqa: E501 - return data - - def get_dependencies_for_task_with_http_info(self, task_gid, **kwargs): # noqa: E501 - """Get dependencies from a task # noqa: E501 - - Returns the compact representations of all of the dependencies of a task. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.get_dependencies_for_task_with_http_info(task_gid, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param str task_gid: The task to operate on. (required) - :param int limit: Results per page. The number of objects to return per page. The value must be between 1 and 100. - :param str offset: 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 list[str] opt_fields: This endpoint returns a compact resource, which excludes some properties by default. To include those optional properties, set this query parameter to a comma-separated list of the properties you wish to include. - :return: TaskResponseArray - If the method is called asynchronously, - returns the request thread. - """ - - all_params = ['task_gid', 'limit', 'offset', 'opt_fields'] # noqa: E501 - all_params.append('async_req') - all_params.append('_return_http_data_only') - all_params.append('_preload_content') - all_params.append('_request_timeout') - - params = locals() - for key, val in six.iteritems(params['kwargs']): - if key not in all_params: - raise TypeError( - "Got an unexpected keyword argument '%s'" - " to method get_dependencies_for_task" % key - ) - params[key] = val - del params['kwargs'] - # verify the required parameter 'task_gid' is set - if ('task_gid' not in params or - params['task_gid'] is None): - raise ValueError("Missing the required parameter `task_gid` when calling `get_dependencies_for_task`") # noqa: E501 - - collection_formats = {} - - path_params = {} - if 'task_gid' in params: - path_params['task_gid'] = params['task_gid'] # noqa: E501 - - query_params = [] - if 'limit' in params: - query_params.append(('limit', params['limit'])) # noqa: E501 - if 'offset' in params: - query_params.append(('offset', params['offset'])) # noqa: E501 - if 'opt_fields' in params: - query_params.append(('opt_fields', params['opt_fields'])) # noqa: E501 - collection_formats['opt_fields'] = 'csv' # noqa: E501 - - header_params = {} - - form_params = [] - local_var_files = {} - - body_params = None - # HTTP header `Accept` - header_params['Accept'] = self.api_client.select_header_accept( - ['application/json; charset=UTF-8']) # noqa: E501 - - # Authentication setting - auth_settings = ['oauth2'] # noqa: E501 - - return self.api_client.call_api( - '/tasks/{task_gid}/dependencies', 'GET', - path_params, - query_params, - header_params, - body=body_params, - post_params=form_params, - files=local_var_files, - response_type='TaskResponseArray', # noqa: E501 - auth_settings=auth_settings, - async_req=params.get('async_req'), - _return_http_data_only=params.get('_return_http_data_only'), - _preload_content=params.get('_preload_content', True), - _request_timeout=params.get('_request_timeout'), - collection_formats=collection_formats) - - def get_dependents_for_task(self, task_gid, **kwargs): # noqa: E501 - """Get dependents from a task # noqa: E501 - - Returns the compact representations of all of the dependents of a task. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.get_dependents_for_task(task_gid, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param str task_gid: The task to operate on. (required) - :param int limit: Results per page. The number of objects to return per page. The value must be between 1 and 100. - :param str offset: 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 list[str] opt_fields: This endpoint returns a compact resource, which excludes some properties by default. To include those optional properties, set this query parameter to a comma-separated list of the properties you wish to include. - :return: TaskResponseArray - If the method is called asynchronously, - returns the request thread. - """ - kwargs['_return_http_data_only'] = True - if kwargs.get('async_req'): - return self.get_dependents_for_task_with_http_info(task_gid, **kwargs) # noqa: E501 - else: - (data) = self.get_dependents_for_task_with_http_info(task_gid, **kwargs) # noqa: E501 - return data - - def get_dependents_for_task_with_http_info(self, task_gid, **kwargs): # noqa: E501 - """Get dependents from a task # noqa: E501 - - Returns the compact representations of all of the dependents of a task. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.get_dependents_for_task_with_http_info(task_gid, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param str task_gid: The task to operate on. (required) - :param int limit: Results per page. The number of objects to return per page. The value must be between 1 and 100. - :param str offset: 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 list[str] opt_fields: This endpoint returns a compact resource, which excludes some properties by default. To include those optional properties, set this query parameter to a comma-separated list of the properties you wish to include. - :return: TaskResponseArray - If the method is called asynchronously, - returns the request thread. - """ - - all_params = ['task_gid', 'limit', 'offset', 'opt_fields'] # noqa: E501 - all_params.append('async_req') - all_params.append('_return_http_data_only') - all_params.append('_preload_content') - all_params.append('_request_timeout') - - params = locals() - for key, val in six.iteritems(params['kwargs']): - if key not in all_params: - raise TypeError( - "Got an unexpected keyword argument '%s'" - " to method get_dependents_for_task" % key - ) - params[key] = val - del params['kwargs'] - # verify the required parameter 'task_gid' is set - if ('task_gid' not in params or - params['task_gid'] is None): - raise ValueError("Missing the required parameter `task_gid` when calling `get_dependents_for_task`") # noqa: E501 - - collection_formats = {} - - path_params = {} - if 'task_gid' in params: - path_params['task_gid'] = params['task_gid'] # noqa: E501 - - query_params = [] - if 'limit' in params: - query_params.append(('limit', params['limit'])) # noqa: E501 - if 'offset' in params: - query_params.append(('offset', params['offset'])) # noqa: E501 - if 'opt_fields' in params: - query_params.append(('opt_fields', params['opt_fields'])) # noqa: E501 - collection_formats['opt_fields'] = 'csv' # noqa: E501 - - header_params = {} - - form_params = [] - local_var_files = {} - - body_params = None - # HTTP header `Accept` - header_params['Accept'] = self.api_client.select_header_accept( - ['application/json; charset=UTF-8']) # noqa: E501 - - # Authentication setting - auth_settings = ['oauth2'] # noqa: E501 - - return self.api_client.call_api( - '/tasks/{task_gid}/dependents', 'GET', - path_params, - query_params, - header_params, - body=body_params, - post_params=form_params, - files=local_var_files, - response_type='TaskResponseArray', # noqa: E501 - auth_settings=auth_settings, - async_req=params.get('async_req'), - _return_http_data_only=params.get('_return_http_data_only'), - _preload_content=params.get('_preload_content', True), - _request_timeout=params.get('_request_timeout'), - collection_formats=collection_formats) - - def get_subtasks_for_task(self, task_gid, **kwargs): # noqa: E501 - """Get subtasks from a task # noqa: E501 - - Returns a compact representation of all of the subtasks of a task. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.get_subtasks_for_task(task_gid, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param str task_gid: The task to operate on. (required) - :param int limit: Results per page. The number of objects to return per page. The value must be between 1 and 100. - :param str offset: 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 list[str] opt_fields: This endpoint returns a compact resource, which excludes some properties by default. To include those optional properties, set this query parameter to a comma-separated list of the properties you wish to include. - :return: TaskResponseArray - If the method is called asynchronously, - returns the request thread. - """ - kwargs['_return_http_data_only'] = True - if kwargs.get('async_req'): - return self.get_subtasks_for_task_with_http_info(task_gid, **kwargs) # noqa: E501 - else: - (data) = self.get_subtasks_for_task_with_http_info(task_gid, **kwargs) # noqa: E501 - return data - - def get_subtasks_for_task_with_http_info(self, task_gid, **kwargs): # noqa: E501 - """Get subtasks from a task # noqa: E501 - - Returns a compact representation of all of the subtasks of a task. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.get_subtasks_for_task_with_http_info(task_gid, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param str task_gid: The task to operate on. (required) - :param int limit: Results per page. The number of objects to return per page. The value must be between 1 and 100. - :param str offset: 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 list[str] opt_fields: This endpoint returns a compact resource, which excludes some properties by default. To include those optional properties, set this query parameter to a comma-separated list of the properties you wish to include. - :return: TaskResponseArray - If the method is called asynchronously, - returns the request thread. - """ - - all_params = ['task_gid', 'limit', 'offset', 'opt_fields'] # noqa: E501 - all_params.append('async_req') - all_params.append('_return_http_data_only') - all_params.append('_preload_content') - all_params.append('_request_timeout') - - params = locals() - for key, val in six.iteritems(params['kwargs']): - if key not in all_params: - raise TypeError( - "Got an unexpected keyword argument '%s'" - " to method get_subtasks_for_task" % key - ) - params[key] = val - del params['kwargs'] - # verify the required parameter 'task_gid' is set - if ('task_gid' not in params or - params['task_gid'] is None): - raise ValueError("Missing the required parameter `task_gid` when calling `get_subtasks_for_task`") # noqa: E501 - - collection_formats = {} - - path_params = {} - if 'task_gid' in params: - path_params['task_gid'] = params['task_gid'] # noqa: E501 - - query_params = [] - if 'limit' in params: - query_params.append(('limit', params['limit'])) # noqa: E501 - if 'offset' in params: - query_params.append(('offset', params['offset'])) # noqa: E501 - if 'opt_fields' in params: - query_params.append(('opt_fields', params['opt_fields'])) # noqa: E501 - collection_formats['opt_fields'] = 'csv' # noqa: E501 - - header_params = {} - - form_params = [] - local_var_files = {} - - body_params = None - # HTTP header `Accept` - header_params['Accept'] = self.api_client.select_header_accept( - ['application/json; charset=UTF-8']) # noqa: E501 - - # Authentication setting - auth_settings = ['oauth2'] # noqa: E501 - - return self.api_client.call_api( - '/tasks/{task_gid}/subtasks', 'GET', - path_params, - query_params, - header_params, - body=body_params, - post_params=form_params, - files=local_var_files, - response_type='TaskResponseArray', # noqa: E501 - auth_settings=auth_settings, - async_req=params.get('async_req'), - _return_http_data_only=params.get('_return_http_data_only'), - _preload_content=params.get('_preload_content', True), - _request_timeout=params.get('_request_timeout'), - collection_formats=collection_formats) - - def get_task(self, task_gid, **kwargs): # noqa: E501 - """Get a task # noqa: E501 - - Returns the complete task record for a single task. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.get_task(task_gid, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param str task_gid: The task to operate on. (required) - :param list[str] opt_fields: This endpoint returns a compact resource, which excludes some properties by default. To include those optional properties, set this query parameter to a comma-separated list of the properties you wish to include. - :return: TaskResponseData - If the method is called asynchronously, - returns the request thread. - """ - kwargs['_return_http_data_only'] = True - if kwargs.get('async_req'): - return self.get_task_with_http_info(task_gid, **kwargs) # noqa: E501 - else: - (data) = self.get_task_with_http_info(task_gid, **kwargs) # noqa: E501 - return data - - def get_task_with_http_info(self, task_gid, **kwargs): # noqa: E501 - """Get a task # noqa: E501 - - Returns the complete task record for a single task. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.get_task_with_http_info(task_gid, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param str task_gid: The task to operate on. (required) - :param list[str] opt_fields: This endpoint returns a compact resource, which excludes some properties by default. To include those optional properties, set this query parameter to a comma-separated list of the properties you wish to include. - :return: TaskResponseData - If the method is called asynchronously, - returns the request thread. - """ - - all_params = ['task_gid', 'opt_fields'] # noqa: E501 - all_params.append('async_req') - all_params.append('_return_http_data_only') - all_params.append('_preload_content') - all_params.append('_request_timeout') - - params = locals() - for key, val in six.iteritems(params['kwargs']): - if key not in all_params: - raise TypeError( - "Got an unexpected keyword argument '%s'" - " to method get_task" % key - ) - params[key] = val - del params['kwargs'] - # verify the required parameter 'task_gid' is set - if ('task_gid' not in params or - params['task_gid'] is None): - raise ValueError("Missing the required parameter `task_gid` when calling `get_task`") # noqa: E501 - - collection_formats = {} - - path_params = {} - if 'task_gid' in params: - path_params['task_gid'] = params['task_gid'] # noqa: E501 - - query_params = [] - if 'opt_fields' in params: - query_params.append(('opt_fields', params['opt_fields'])) # noqa: E501 - collection_formats['opt_fields'] = 'csv' # noqa: E501 - - header_params = {} - - form_params = [] - local_var_files = {} - - body_params = None - # HTTP header `Accept` - header_params['Accept'] = self.api_client.select_header_accept( - ['application/json; charset=UTF-8']) # noqa: E501 - - # Authentication setting - auth_settings = ['oauth2'] # noqa: E501 - - return self.api_client.call_api( - '/tasks/{task_gid}', 'GET', - path_params, - query_params, - header_params, - body=body_params, - post_params=form_params, - files=local_var_files, - response_type='TaskResponseData', # noqa: E501 - auth_settings=auth_settings, - async_req=params.get('async_req'), - _return_http_data_only=params.get('_return_http_data_only'), - _preload_content=params.get('_preload_content', True), - _request_timeout=params.get('_request_timeout'), - collection_formats=collection_formats) - - def get_tasks(self, **kwargs): # noqa: E501 - """Get multiple tasks # noqa: E501 - - Returns the compact task records for some filtered set of tasks. Use one or more of the parameters provided to filter the tasks returned. You must specify a `project` or `tag` if you do not specify `assignee` and `workspace`. For more complex task retrieval, use [workspaces/{workspace_gid}/tasks/search](/reference/searchtasksforworkspace). # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.get_tasks(async_req=True) - >>> result = thread.get() - - :param async_req bool - :param int limit: Results per page. The number of objects to return per page. The value must be between 1 and 100. - :param str offset: 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 str assignee: 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.* - :param str project: The project to filter tasks on. - :param str section: The section to filter tasks on. - :param str workspace: The workspace to filter tasks on. *Note: If you specify `workspace`, you must also specify the `assignee` to filter on.* - :param datetime completed_since: Only return tasks that are either incomplete or that have been completed since this time. - :param datetime modified_since: 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 list[str] opt_fields: This endpoint returns a compact resource, which excludes some properties by default. To include those optional properties, set this query parameter to a comma-separated list of the properties you wish to include. - :return: TaskResponseArray - If the method is called asynchronously, - returns the request thread. - """ - kwargs['_return_http_data_only'] = True - if kwargs.get('async_req'): - return self.get_tasks_with_http_info(**kwargs) # noqa: E501 - else: - (data) = self.get_tasks_with_http_info(**kwargs) # noqa: E501 - return data - - def get_tasks_with_http_info(self, **kwargs): # noqa: E501 - """Get multiple tasks # noqa: E501 - - Returns the compact task records for some filtered set of tasks. Use one or more of the parameters provided to filter the tasks returned. You must specify a `project` or `tag` if you do not specify `assignee` and `workspace`. For more complex task retrieval, use [workspaces/{workspace_gid}/tasks/search](/reference/searchtasksforworkspace). # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.get_tasks_with_http_info(async_req=True) - >>> result = thread.get() - - :param async_req bool - :param int limit: Results per page. The number of objects to return per page. The value must be between 1 and 100. - :param str offset: 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 str assignee: 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.* - :param str project: The project to filter tasks on. - :param str section: The section to filter tasks on. - :param str workspace: The workspace to filter tasks on. *Note: If you specify `workspace`, you must also specify the `assignee` to filter on.* - :param datetime completed_since: Only return tasks that are either incomplete or that have been completed since this time. - :param datetime modified_since: 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 list[str] opt_fields: This endpoint returns a compact resource, which excludes some properties by default. To include those optional properties, set this query parameter to a comma-separated list of the properties you wish to include. - :return: TaskResponseArray - If the method is called asynchronously, - returns the request thread. - """ - - all_params = ['limit', 'offset', 'assignee', 'project', 'section', 'workspace', 'completed_since', 'modified_since', 'opt_fields'] # noqa: E501 - all_params.append('async_req') - all_params.append('_return_http_data_only') - all_params.append('_preload_content') - all_params.append('_request_timeout') - - params = locals() - for key, val in six.iteritems(params['kwargs']): - if key not in all_params: - raise TypeError( - "Got an unexpected keyword argument '%s'" - " to method get_tasks" % key - ) - params[key] = val - del params['kwargs'] - - collection_formats = {} - - path_params = {} - - query_params = [] - if 'limit' in params: - query_params.append(('limit', params['limit'])) # noqa: E501 - if 'offset' in params: - query_params.append(('offset', params['offset'])) # noqa: E501 - if 'assignee' in params: - query_params.append(('assignee', params['assignee'])) # noqa: E501 - if 'project' in params: - query_params.append(('project', params['project'])) # noqa: E501 - if 'section' in params: - query_params.append(('section', params['section'])) # noqa: E501 - if 'workspace' in params: - query_params.append(('workspace', params['workspace'])) # noqa: E501 - if 'completed_since' in params: - query_params.append(('completed_since', params['completed_since'])) # noqa: E501 - if 'modified_since' in params: - query_params.append(('modified_since', params['modified_since'])) # noqa: E501 - if 'opt_fields' in params: - query_params.append(('opt_fields', params['opt_fields'])) # noqa: E501 - collection_formats['opt_fields'] = 'csv' # noqa: E501 - - header_params = {} - - form_params = [] - local_var_files = {} - - body_params = None - # HTTP header `Accept` - header_params['Accept'] = self.api_client.select_header_accept( - ['application/json; charset=UTF-8']) # noqa: E501 - - # Authentication setting - auth_settings = ['oauth2'] # noqa: E501 - - return self.api_client.call_api( - '/tasks', 'GET', - path_params, - query_params, - header_params, - body=body_params, - post_params=form_params, - files=local_var_files, - response_type='TaskResponseArray', # noqa: E501 - auth_settings=auth_settings, - async_req=params.get('async_req'), - _return_http_data_only=params.get('_return_http_data_only'), - _preload_content=params.get('_preload_content', True), - _request_timeout=params.get('_request_timeout'), - collection_formats=collection_formats) - - def get_tasks_for_project(self, project_gid, **kwargs): # noqa: E501 - """Get tasks from a project # noqa: E501 - - Returns the compact task records for all tasks within the given project, ordered by their priority within the project. Tasks can exist in more than one project at a time. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.get_tasks_for_project(project_gid, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param str project_gid: Globally unique identifier for the project. (required) - :param str completed_since: 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 int limit: Results per page. The number of objects to return per page. The value must be between 1 and 100. - :param str offset: 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 list[str] opt_fields: This endpoint returns a compact resource, which excludes some properties by default. To include those optional properties, set this query parameter to a comma-separated list of the properties you wish to include. - :return: TaskResponseArray - If the method is called asynchronously, - returns the request thread. - """ - kwargs['_return_http_data_only'] = True - if kwargs.get('async_req'): - return self.get_tasks_for_project_with_http_info(project_gid, **kwargs) # noqa: E501 - else: - (data) = self.get_tasks_for_project_with_http_info(project_gid, **kwargs) # noqa: E501 - return data - - def get_tasks_for_project_with_http_info(self, project_gid, **kwargs): # noqa: E501 - """Get tasks from a project # noqa: E501 - - Returns the compact task records for all tasks within the given project, ordered by their priority within the project. Tasks can exist in more than one project at a time. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.get_tasks_for_project_with_http_info(project_gid, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param str project_gid: Globally unique identifier for the project. (required) - :param str completed_since: 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 int limit: Results per page. The number of objects to return per page. The value must be between 1 and 100. - :param str offset: 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 list[str] opt_fields: This endpoint returns a compact resource, which excludes some properties by default. To include those optional properties, set this query parameter to a comma-separated list of the properties you wish to include. - :return: TaskResponseArray - If the method is called asynchronously, - returns the request thread. - """ - - all_params = ['project_gid', 'completed_since', 'limit', 'offset', 'opt_fields'] # noqa: E501 - all_params.append('async_req') - all_params.append('_return_http_data_only') - all_params.append('_preload_content') - all_params.append('_request_timeout') - - params = locals() - for key, val in six.iteritems(params['kwargs']): - if key not in all_params: - raise TypeError( - "Got an unexpected keyword argument '%s'" - " to method get_tasks_for_project" % key - ) - params[key] = val - del params['kwargs'] - # verify the required parameter 'project_gid' is set - if ('project_gid' not in params or - params['project_gid'] is None): - raise ValueError("Missing the required parameter `project_gid` when calling `get_tasks_for_project`") # noqa: E501 - - collection_formats = {} - - path_params = {} - if 'project_gid' in params: - path_params['project_gid'] = params['project_gid'] # noqa: E501 - - query_params = [] - if 'completed_since' in params: - query_params.append(('completed_since', params['completed_since'])) # noqa: E501 - if 'limit' in params: - query_params.append(('limit', params['limit'])) # noqa: E501 - if 'offset' in params: - query_params.append(('offset', params['offset'])) # noqa: E501 - if 'opt_fields' in params: - query_params.append(('opt_fields', params['opt_fields'])) # noqa: E501 - collection_formats['opt_fields'] = 'csv' # noqa: E501 - - header_params = {} - - form_params = [] - local_var_files = {} - - body_params = None - # HTTP header `Accept` - header_params['Accept'] = self.api_client.select_header_accept( - ['application/json; charset=UTF-8']) # noqa: E501 - - # Authentication setting - auth_settings = ['oauth2'] # noqa: E501 - - return self.api_client.call_api( - '/projects/{project_gid}/tasks', 'GET', - path_params, - query_params, - header_params, - body=body_params, - post_params=form_params, - files=local_var_files, - response_type='TaskResponseArray', # noqa: E501 - auth_settings=auth_settings, - async_req=params.get('async_req'), - _return_http_data_only=params.get('_return_http_data_only'), - _preload_content=params.get('_preload_content', True), - _request_timeout=params.get('_request_timeout'), - collection_formats=collection_formats) - - def get_tasks_for_section(self, section_gid, **kwargs): # noqa: E501 - """Get tasks from a section # noqa: E501 - - *Board view only*: Returns the compact section records for all tasks within the given section. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.get_tasks_for_section(section_gid, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param str section_gid: The globally unique identifier for the section. (required) - :param int limit: Results per page. The number of objects to return per page. The value must be between 1 and 100. - :param str offset: 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 list[str] opt_fields: This endpoint returns a compact resource, which excludes some properties by default. To include those optional properties, set this query parameter to a comma-separated list of the properties you wish to include. - :return: TaskResponseArray - If the method is called asynchronously, - returns the request thread. - """ - kwargs['_return_http_data_only'] = True - if kwargs.get('async_req'): - return self.get_tasks_for_section_with_http_info(section_gid, **kwargs) # noqa: E501 - else: - (data) = self.get_tasks_for_section_with_http_info(section_gid, **kwargs) # noqa: E501 - return data - - def get_tasks_for_section_with_http_info(self, section_gid, **kwargs): # noqa: E501 - """Get tasks from a section # noqa: E501 - - *Board view only*: Returns the compact section records for all tasks within the given section. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.get_tasks_for_section_with_http_info(section_gid, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param str section_gid: The globally unique identifier for the section. (required) - :param int limit: Results per page. The number of objects to return per page. The value must be between 1 and 100. - :param str offset: 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 list[str] opt_fields: This endpoint returns a compact resource, which excludes some properties by default. To include those optional properties, set this query parameter to a comma-separated list of the properties you wish to include. - :return: TaskResponseArray - If the method is called asynchronously, - returns the request thread. - """ - - all_params = ['section_gid', 'limit', 'offset', 'opt_fields'] # noqa: E501 - all_params.append('async_req') - all_params.append('_return_http_data_only') - all_params.append('_preload_content') - all_params.append('_request_timeout') - - params = locals() - for key, val in six.iteritems(params['kwargs']): - if key not in all_params: - raise TypeError( - "Got an unexpected keyword argument '%s'" - " to method get_tasks_for_section" % key - ) - params[key] = val - del params['kwargs'] - # verify the required parameter 'section_gid' is set - if ('section_gid' not in params or - params['section_gid'] is None): - raise ValueError("Missing the required parameter `section_gid` when calling `get_tasks_for_section`") # noqa: E501 - - collection_formats = {} - - path_params = {} - if 'section_gid' in params: - path_params['section_gid'] = params['section_gid'] # noqa: E501 - - query_params = [] - if 'limit' in params: - query_params.append(('limit', params['limit'])) # noqa: E501 - if 'offset' in params: - query_params.append(('offset', params['offset'])) # noqa: E501 - if 'opt_fields' in params: - query_params.append(('opt_fields', params['opt_fields'])) # noqa: E501 - collection_formats['opt_fields'] = 'csv' # noqa: E501 - - header_params = {} - - form_params = [] - local_var_files = {} - - body_params = None - # HTTP header `Accept` - header_params['Accept'] = self.api_client.select_header_accept( - ['application/json; charset=UTF-8']) # noqa: E501 - - # Authentication setting - auth_settings = ['oauth2'] # noqa: E501 - - return self.api_client.call_api( - '/sections/{section_gid}/tasks', 'GET', - path_params, - query_params, - header_params, - body=body_params, - post_params=form_params, - files=local_var_files, - response_type='TaskResponseArray', # noqa: E501 - auth_settings=auth_settings, - async_req=params.get('async_req'), - _return_http_data_only=params.get('_return_http_data_only'), - _preload_content=params.get('_preload_content', True), - _request_timeout=params.get('_request_timeout'), - collection_formats=collection_formats) - - def get_tasks_for_tag(self, tag_gid, **kwargs): # noqa: E501 - """Get tasks from a tag # noqa: E501 - - Returns the compact task records for all tasks with the given tag. Tasks can have more than one tag at a time. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.get_tasks_for_tag(tag_gid, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param str tag_gid: Globally unique identifier for the tag. (required) - :param int limit: Results per page. The number of objects to return per page. The value must be between 1 and 100. - :param str offset: 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 list[str] opt_fields: This endpoint returns a compact resource, which excludes some properties by default. To include those optional properties, set this query parameter to a comma-separated list of the properties you wish to include. - :return: TaskResponseArray - If the method is called asynchronously, - returns the request thread. - """ - kwargs['_return_http_data_only'] = True - if kwargs.get('async_req'): - return self.get_tasks_for_tag_with_http_info(tag_gid, **kwargs) # noqa: E501 - else: - (data) = self.get_tasks_for_tag_with_http_info(tag_gid, **kwargs) # noqa: E501 - return data - - def get_tasks_for_tag_with_http_info(self, tag_gid, **kwargs): # noqa: E501 - """Get tasks from a tag # noqa: E501 - - Returns the compact task records for all tasks with the given tag. Tasks can have more than one tag at a time. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.get_tasks_for_tag_with_http_info(tag_gid, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param str tag_gid: Globally unique identifier for the tag. (required) - :param int limit: Results per page. The number of objects to return per page. The value must be between 1 and 100. - :param str offset: 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 list[str] opt_fields: This endpoint returns a compact resource, which excludes some properties by default. To include those optional properties, set this query parameter to a comma-separated list of the properties you wish to include. - :return: TaskResponseArray - If the method is called asynchronously, - returns the request thread. - """ - - all_params = ['tag_gid', 'limit', 'offset', 'opt_fields'] # noqa: E501 - all_params.append('async_req') - all_params.append('_return_http_data_only') - all_params.append('_preload_content') - all_params.append('_request_timeout') - - params = locals() - for key, val in six.iteritems(params['kwargs']): - if key not in all_params: - raise TypeError( - "Got an unexpected keyword argument '%s'" - " to method get_tasks_for_tag" % key - ) - params[key] = val - del params['kwargs'] - # verify the required parameter 'tag_gid' is set - if ('tag_gid' not in params or - params['tag_gid'] is None): - raise ValueError("Missing the required parameter `tag_gid` when calling `get_tasks_for_tag`") # noqa: E501 - - collection_formats = {} - - path_params = {} - if 'tag_gid' in params: - path_params['tag_gid'] = params['tag_gid'] # noqa: E501 - - query_params = [] - if 'limit' in params: - query_params.append(('limit', params['limit'])) # noqa: E501 - if 'offset' in params: - query_params.append(('offset', params['offset'])) # noqa: E501 - if 'opt_fields' in params: - query_params.append(('opt_fields', params['opt_fields'])) # noqa: E501 - collection_formats['opt_fields'] = 'csv' # noqa: E501 - - header_params = {} - - form_params = [] - local_var_files = {} - - body_params = None - # HTTP header `Accept` - header_params['Accept'] = self.api_client.select_header_accept( - ['application/json; charset=UTF-8']) # noqa: E501 - - # Authentication setting - auth_settings = ['oauth2'] # noqa: E501 - - return self.api_client.call_api( - '/tags/{tag_gid}/tasks', 'GET', - path_params, - query_params, - header_params, - body=body_params, - post_params=form_params, - files=local_var_files, - response_type='TaskResponseArray', # noqa: E501 - auth_settings=auth_settings, - async_req=params.get('async_req'), - _return_http_data_only=params.get('_return_http_data_only'), - _preload_content=params.get('_preload_content', True), - _request_timeout=params.get('_request_timeout'), - collection_formats=collection_formats) - - def get_tasks_for_user_task_list(self, user_task_list_gid, **kwargs): # noqa: E501 - """Get tasks from a user task list # noqa: E501 - - Returns the compact list of tasks in a user’s My Tasks list. *Note: Access control is enforced for this endpoint as with all Asana API endpoints, meaning a user’s private tasks will be filtered out if the API-authenticated user does not have access to them.* *Note: Both complete and incomplete tasks are returned by default unless they are filtered out (for example, setting `completed_since=now` will return only incomplete tasks, which is the default view for “My Tasks” in Asana.)* # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.get_tasks_for_user_task_list(user_task_list_gid, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param str user_task_list_gid: Globally unique identifier for the user task list. (required) - :param str completed_since: 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 int limit: Results per page. The number of objects to return per page. The value must be between 1 and 100. - :param str offset: 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 list[str] opt_fields: This endpoint returns a compact resource, which excludes some properties by default. To include those optional properties, set this query parameter to a comma-separated list of the properties you wish to include. - :return: TaskResponseArray - If the method is called asynchronously, - returns the request thread. - """ - kwargs['_return_http_data_only'] = True - if kwargs.get('async_req'): - return self.get_tasks_for_user_task_list_with_http_info(user_task_list_gid, **kwargs) # noqa: E501 - else: - (data) = self.get_tasks_for_user_task_list_with_http_info(user_task_list_gid, **kwargs) # noqa: E501 - return data - - def get_tasks_for_user_task_list_with_http_info(self, user_task_list_gid, **kwargs): # noqa: E501 - """Get tasks from a user task list # noqa: E501 - - Returns the compact list of tasks in a user’s My Tasks list. *Note: Access control is enforced for this endpoint as with all Asana API endpoints, meaning a user’s private tasks will be filtered out if the API-authenticated user does not have access to them.* *Note: Both complete and incomplete tasks are returned by default unless they are filtered out (for example, setting `completed_since=now` will return only incomplete tasks, which is the default view for “My Tasks” in Asana.)* # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.get_tasks_for_user_task_list_with_http_info(user_task_list_gid, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param str user_task_list_gid: Globally unique identifier for the user task list. (required) - :param str completed_since: 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 int limit: Results per page. The number of objects to return per page. The value must be between 1 and 100. - :param str offset: 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 list[str] opt_fields: This endpoint returns a compact resource, which excludes some properties by default. To include those optional properties, set this query parameter to a comma-separated list of the properties you wish to include. - :return: TaskResponseArray - If the method is called asynchronously, - returns the request thread. - """ - - all_params = ['user_task_list_gid', 'completed_since', 'limit', 'offset', 'opt_fields'] # noqa: E501 - all_params.append('async_req') - all_params.append('_return_http_data_only') - all_params.append('_preload_content') - all_params.append('_request_timeout') - - params = locals() - for key, val in six.iteritems(params['kwargs']): - if key not in all_params: - raise TypeError( - "Got an unexpected keyword argument '%s'" - " to method get_tasks_for_user_task_list" % key - ) - params[key] = val - del params['kwargs'] - # verify the required parameter 'user_task_list_gid' is set - if ('user_task_list_gid' not in params or - params['user_task_list_gid'] is None): - raise ValueError("Missing the required parameter `user_task_list_gid` when calling `get_tasks_for_user_task_list`") # noqa: E501 - - collection_formats = {} - - path_params = {} - if 'user_task_list_gid' in params: - path_params['user_task_list_gid'] = params['user_task_list_gid'] # noqa: E501 - - query_params = [] - if 'completed_since' in params: - query_params.append(('completed_since', params['completed_since'])) # noqa: E501 - if 'limit' in params: - query_params.append(('limit', params['limit'])) # noqa: E501 - if 'offset' in params: - query_params.append(('offset', params['offset'])) # noqa: E501 - if 'opt_fields' in params: - query_params.append(('opt_fields', params['opt_fields'])) # noqa: E501 - collection_formats['opt_fields'] = 'csv' # noqa: E501 - - header_params = {} - - form_params = [] - local_var_files = {} - - body_params = None - # HTTP header `Accept` - header_params['Accept'] = self.api_client.select_header_accept( - ['application/json; charset=UTF-8']) # noqa: E501 - - # Authentication setting - auth_settings = ['oauth2'] # noqa: E501 - - return self.api_client.call_api( - '/user_task_lists/{user_task_list_gid}/tasks', 'GET', - path_params, - query_params, - header_params, - body=body_params, - post_params=form_params, - files=local_var_files, - response_type='TaskResponseArray', # noqa: E501 - auth_settings=auth_settings, - async_req=params.get('async_req'), - _return_http_data_only=params.get('_return_http_data_only'), - _preload_content=params.get('_preload_content', True), - _request_timeout=params.get('_request_timeout'), - collection_formats=collection_formats) - - def remove_dependencies_for_task(self, body, task_gid, **kwargs): # noqa: E501 - """Unlink dependencies from a task # noqa: E501 - - Unlinks a set of dependencies from this task. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.remove_dependencies_for_task(body, task_gid, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param TaskGidRemoveDependenciesBody body: The list of tasks to unlink as dependencies. (required) - :param str task_gid: The task to operate on. (required) - :return: EmptyResponseData - If the method is called asynchronously, - returns the request thread. - """ - kwargs['_return_http_data_only'] = True - if kwargs.get('async_req'): - return self.remove_dependencies_for_task_with_http_info(body, task_gid, **kwargs) # noqa: E501 - else: - (data) = self.remove_dependencies_for_task_with_http_info(body, task_gid, **kwargs) # noqa: E501 - return data - - def remove_dependencies_for_task_with_http_info(self, body, task_gid, **kwargs): # noqa: E501 - """Unlink dependencies from a task # noqa: E501 - - Unlinks a set of dependencies from this task. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.remove_dependencies_for_task_with_http_info(body, task_gid, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param TaskGidRemoveDependenciesBody body: The list of tasks to unlink as dependencies. (required) - :param str task_gid: The task to operate on. (required) - :return: EmptyResponseData - If the method is called asynchronously, - returns the request thread. - """ - - all_params = ['body', 'task_gid'] # noqa: E501 - all_params.append('async_req') - all_params.append('_return_http_data_only') - all_params.append('_preload_content') - all_params.append('_request_timeout') - - params = locals() - for key, val in six.iteritems(params['kwargs']): - if key not in all_params: - raise TypeError( - "Got an unexpected keyword argument '%s'" - " to method remove_dependencies_for_task" % key - ) - params[key] = val - del params['kwargs'] - # verify the required parameter 'body' is set - if ('body' not in params or - params['body'] is None): - raise ValueError("Missing the required parameter `body` when calling `remove_dependencies_for_task`") # noqa: E501 - # verify the required parameter 'task_gid' is set - if ('task_gid' not in params or - params['task_gid'] is None): - raise ValueError("Missing the required parameter `task_gid` when calling `remove_dependencies_for_task`") # noqa: E501 - - collection_formats = {} - - path_params = {} - if 'task_gid' in params: - path_params['task_gid'] = params['task_gid'] # noqa: E501 - - query_params = [] - - header_params = {} - - form_params = [] - local_var_files = {} - - body_params = None - if 'body' in params: - body_params = params['body'] - # HTTP header `Accept` - header_params['Accept'] = self.api_client.select_header_accept( - ['application/json; charset=UTF-8']) # noqa: E501 - - # HTTP header `Content-Type` - header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 - ['application/json; charset=UTF-8']) # noqa: E501 - - # Authentication setting - auth_settings = ['oauth2'] # noqa: E501 - - return self.api_client.call_api( - '/tasks/{task_gid}/removeDependencies', 'POST', - path_params, - query_params, - header_params, - body=body_params, - post_params=form_params, - files=local_var_files, - response_type='EmptyResponseData', # noqa: E501 - auth_settings=auth_settings, - async_req=params.get('async_req'), - _return_http_data_only=params.get('_return_http_data_only'), - _preload_content=params.get('_preload_content', True), - _request_timeout=params.get('_request_timeout'), - collection_formats=collection_formats) - - def remove_dependents_for_task(self, body, task_gid, **kwargs): # noqa: E501 - """Unlink dependents from a task # noqa: E501 - - Unlinks a set of dependents from this task. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.remove_dependents_for_task(body, task_gid, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param TaskGidRemoveDependentsBody body: The list of tasks to remove as dependents. (required) - :param str task_gid: The task to operate on. (required) - :return: EmptyResponseData - If the method is called asynchronously, - returns the request thread. - """ - kwargs['_return_http_data_only'] = True - if kwargs.get('async_req'): - return self.remove_dependents_for_task_with_http_info(body, task_gid, **kwargs) # noqa: E501 - else: - (data) = self.remove_dependents_for_task_with_http_info(body, task_gid, **kwargs) # noqa: E501 - return data - - def remove_dependents_for_task_with_http_info(self, body, task_gid, **kwargs): # noqa: E501 - """Unlink dependents from a task # noqa: E501 - - Unlinks a set of dependents from this task. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.remove_dependents_for_task_with_http_info(body, task_gid, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param TaskGidRemoveDependentsBody body: The list of tasks to remove as dependents. (required) - :param str task_gid: The task to operate on. (required) - :return: EmptyResponseData - If the method is called asynchronously, - returns the request thread. - """ - - all_params = ['body', 'task_gid'] # noqa: E501 - all_params.append('async_req') - all_params.append('_return_http_data_only') - all_params.append('_preload_content') - all_params.append('_request_timeout') - - params = locals() - for key, val in six.iteritems(params['kwargs']): - if key not in all_params: - raise TypeError( - "Got an unexpected keyword argument '%s'" - " to method remove_dependents_for_task" % key - ) - params[key] = val - del params['kwargs'] - # verify the required parameter 'body' is set - if ('body' not in params or - params['body'] is None): - raise ValueError("Missing the required parameter `body` when calling `remove_dependents_for_task`") # noqa: E501 - # verify the required parameter 'task_gid' is set - if ('task_gid' not in params or - params['task_gid'] is None): - raise ValueError("Missing the required parameter `task_gid` when calling `remove_dependents_for_task`") # noqa: E501 - - collection_formats = {} - - path_params = {} - if 'task_gid' in params: - path_params['task_gid'] = params['task_gid'] # noqa: E501 - - query_params = [] - - header_params = {} - - form_params = [] - local_var_files = {} - - body_params = None - if 'body' in params: - body_params = params['body'] - # HTTP header `Accept` - header_params['Accept'] = self.api_client.select_header_accept( - ['application/json; charset=UTF-8']) # noqa: E501 - - # HTTP header `Content-Type` - header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 - ['application/json; charset=UTF-8']) # noqa: E501 - - # Authentication setting - auth_settings = ['oauth2'] # noqa: E501 - - return self.api_client.call_api( - '/tasks/{task_gid}/removeDependents', 'POST', - path_params, - query_params, - header_params, - body=body_params, - post_params=form_params, - files=local_var_files, - response_type='EmptyResponseData', # noqa: E501 - auth_settings=auth_settings, - async_req=params.get('async_req'), - _return_http_data_only=params.get('_return_http_data_only'), - _preload_content=params.get('_preload_content', True), - _request_timeout=params.get('_request_timeout'), - collection_formats=collection_formats) - - def remove_follower_for_task(self, body, task_gid, **kwargs): # noqa: E501 - """Remove followers from a task # noqa: E501 - - Removes each of the specified followers from the task if they are following. Returns the complete, updated record for the affected task. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.remove_follower_for_task(body, task_gid, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param TaskGidRemoveFollowersBody body: The followers to remove from the task. (required) - :param str task_gid: The task to operate on. (required) - :param list[str] opt_fields: This endpoint returns a compact resource, which excludes some properties by default. To include those optional properties, set this query parameter to a comma-separated list of the properties you wish to include. - :return: TaskResponseData - If the method is called asynchronously, - returns the request thread. - """ - kwargs['_return_http_data_only'] = True - if kwargs.get('async_req'): - return self.remove_follower_for_task_with_http_info(body, task_gid, **kwargs) # noqa: E501 - else: - (data) = self.remove_follower_for_task_with_http_info(body, task_gid, **kwargs) # noqa: E501 - return data - - def remove_follower_for_task_with_http_info(self, body, task_gid, **kwargs): # noqa: E501 - """Remove followers from a task # noqa: E501 - - Removes each of the specified followers from the task if they are following. Returns the complete, updated record for the affected task. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.remove_follower_for_task_with_http_info(body, task_gid, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param TaskGidRemoveFollowersBody body: The followers to remove from the task. (required) - :param str task_gid: The task to operate on. (required) - :param list[str] opt_fields: This endpoint returns a compact resource, which excludes some properties by default. To include those optional properties, set this query parameter to a comma-separated list of the properties you wish to include. - :return: TaskResponseData - If the method is called asynchronously, - returns the request thread. - """ - - all_params = ['body', 'task_gid', 'opt_fields'] # noqa: E501 - all_params.append('async_req') - all_params.append('_return_http_data_only') - all_params.append('_preload_content') - all_params.append('_request_timeout') - - params = locals() - for key, val in six.iteritems(params['kwargs']): - if key not in all_params: - raise TypeError( - "Got an unexpected keyword argument '%s'" - " to method remove_follower_for_task" % key - ) - params[key] = val - del params['kwargs'] - # verify the required parameter 'body' is set - if ('body' not in params or - params['body'] is None): - raise ValueError("Missing the required parameter `body` when calling `remove_follower_for_task`") # noqa: E501 - # verify the required parameter 'task_gid' is set - if ('task_gid' not in params or - params['task_gid'] is None): - raise ValueError("Missing the required parameter `task_gid` when calling `remove_follower_for_task`") # noqa: E501 - - collection_formats = {} - - path_params = {} - if 'task_gid' in params: - path_params['task_gid'] = params['task_gid'] # noqa: E501 - - query_params = [] - if 'opt_fields' in params: - query_params.append(('opt_fields', params['opt_fields'])) # noqa: E501 - collection_formats['opt_fields'] = 'csv' # noqa: E501 - - header_params = {} - - form_params = [] - local_var_files = {} - - body_params = None - if 'body' in params: - body_params = params['body'] - # HTTP header `Accept` - header_params['Accept'] = self.api_client.select_header_accept( - ['application/json; charset=UTF-8']) # noqa: E501 - - # HTTP header `Content-Type` - header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 - ['application/json; charset=UTF-8']) # noqa: E501 - - # Authentication setting - auth_settings = ['oauth2'] # noqa: E501 - - return self.api_client.call_api( - '/tasks/{task_gid}/removeFollowers', 'POST', - path_params, - query_params, - header_params, - body=body_params, - post_params=form_params, - files=local_var_files, - response_type='TaskResponseData', # noqa: E501 - auth_settings=auth_settings, - async_req=params.get('async_req'), - _return_http_data_only=params.get('_return_http_data_only'), - _preload_content=params.get('_preload_content', True), - _request_timeout=params.get('_request_timeout'), - collection_formats=collection_formats) - - def remove_project_for_task(self, body, task_gid, **kwargs): # noqa: E501 - """Remove a project from a task # noqa: E501 - - Removes the task from the specified project. The task will still exist in the system, but it will not be in the project anymore. Returns an empty data block. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.remove_project_for_task(body, task_gid, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param TaskGidRemoveProjectBody body: The project to remove the task from. (required) - :param str task_gid: The task to operate on. (required) - :return: EmptyResponseData - If the method is called asynchronously, - returns the request thread. - """ - kwargs['_return_http_data_only'] = True - if kwargs.get('async_req'): - return self.remove_project_for_task_with_http_info(body, task_gid, **kwargs) # noqa: E501 - else: - (data) = self.remove_project_for_task_with_http_info(body, task_gid, **kwargs) # noqa: E501 - return data - - def remove_project_for_task_with_http_info(self, body, task_gid, **kwargs): # noqa: E501 - """Remove a project from a task # noqa: E501 - - Removes the task from the specified project. The task will still exist in the system, but it will not be in the project anymore. Returns an empty data block. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.remove_project_for_task_with_http_info(body, task_gid, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param TaskGidRemoveProjectBody body: The project to remove the task from. (required) - :param str task_gid: The task to operate on. (required) - :return: EmptyResponseData - If the method is called asynchronously, - returns the request thread. - """ - - all_params = ['body', 'task_gid'] # noqa: E501 - all_params.append('async_req') - all_params.append('_return_http_data_only') - all_params.append('_preload_content') - all_params.append('_request_timeout') - - params = locals() - for key, val in six.iteritems(params['kwargs']): - if key not in all_params: - raise TypeError( - "Got an unexpected keyword argument '%s'" - " to method remove_project_for_task" % key - ) - params[key] = val - del params['kwargs'] - # verify the required parameter 'body' is set - if ('body' not in params or - params['body'] is None): - raise ValueError("Missing the required parameter `body` when calling `remove_project_for_task`") # noqa: E501 - # verify the required parameter 'task_gid' is set - if ('task_gid' not in params or - params['task_gid'] is None): - raise ValueError("Missing the required parameter `task_gid` when calling `remove_project_for_task`") # noqa: E501 - - collection_formats = {} - - path_params = {} - if 'task_gid' in params: - path_params['task_gid'] = params['task_gid'] # noqa: E501 - - query_params = [] - - header_params = {} - - form_params = [] - local_var_files = {} - - body_params = None - if 'body' in params: - body_params = params['body'] - # HTTP header `Accept` - header_params['Accept'] = self.api_client.select_header_accept( - ['application/json; charset=UTF-8']) # noqa: E501 - - # HTTP header `Content-Type` - header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 - ['application/json; charset=UTF-8']) # noqa: E501 - - # Authentication setting - auth_settings = ['oauth2'] # noqa: E501 - - return self.api_client.call_api( - '/tasks/{task_gid}/removeProject', 'POST', - path_params, - query_params, - header_params, - body=body_params, - post_params=form_params, - files=local_var_files, - response_type='EmptyResponseData', # noqa: E501 - auth_settings=auth_settings, - async_req=params.get('async_req'), - _return_http_data_only=params.get('_return_http_data_only'), - _preload_content=params.get('_preload_content', True), - _request_timeout=params.get('_request_timeout'), - collection_formats=collection_formats) - - def remove_tag_for_task(self, body, task_gid, **kwargs): # noqa: E501 - """Remove a tag from a task # noqa: E501 - - Removes a tag from a task. Returns an empty data block. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.remove_tag_for_task(body, task_gid, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param TaskGidRemoveTagBody body: The tag to remove from the task. (required) - :param str task_gid: The task to operate on. (required) - :return: EmptyResponseData - If the method is called asynchronously, - returns the request thread. - """ - kwargs['_return_http_data_only'] = True - if kwargs.get('async_req'): - return self.remove_tag_for_task_with_http_info(body, task_gid, **kwargs) # noqa: E501 - else: - (data) = self.remove_tag_for_task_with_http_info(body, task_gid, **kwargs) # noqa: E501 - return data - - def remove_tag_for_task_with_http_info(self, body, task_gid, **kwargs): # noqa: E501 - """Remove a tag from a task # noqa: E501 - - Removes a tag from a task. Returns an empty data block. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.remove_tag_for_task_with_http_info(body, task_gid, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param TaskGidRemoveTagBody body: The tag to remove from the task. (required) - :param str task_gid: The task to operate on. (required) - :return: EmptyResponseData - If the method is called asynchronously, - returns the request thread. - """ - - all_params = ['body', 'task_gid'] # noqa: E501 - all_params.append('async_req') - all_params.append('_return_http_data_only') - all_params.append('_preload_content') - all_params.append('_request_timeout') - - params = locals() - for key, val in six.iteritems(params['kwargs']): - if key not in all_params: - raise TypeError( - "Got an unexpected keyword argument '%s'" - " to method remove_tag_for_task" % key - ) - params[key] = val - del params['kwargs'] - # verify the required parameter 'body' is set - if ('body' not in params or - params['body'] is None): - raise ValueError("Missing the required parameter `body` when calling `remove_tag_for_task`") # noqa: E501 - # verify the required parameter 'task_gid' is set - if ('task_gid' not in params or - params['task_gid'] is None): - raise ValueError("Missing the required parameter `task_gid` when calling `remove_tag_for_task`") # noqa: E501 - - collection_formats = {} - - path_params = {} - if 'task_gid' in params: - path_params['task_gid'] = params['task_gid'] # noqa: E501 - - query_params = [] - - header_params = {} - - form_params = [] - local_var_files = {} - - body_params = None - if 'body' in params: - body_params = params['body'] - # HTTP header `Accept` - header_params['Accept'] = self.api_client.select_header_accept( - ['application/json; charset=UTF-8']) # noqa: E501 - - # HTTP header `Content-Type` - header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 - ['application/json; charset=UTF-8']) # noqa: E501 - - # Authentication setting - auth_settings = ['oauth2'] # noqa: E501 - - return self.api_client.call_api( - '/tasks/{task_gid}/removeTag', 'POST', - path_params, - query_params, - header_params, - body=body_params, - post_params=form_params, - files=local_var_files, - response_type='EmptyResponseData', # noqa: E501 - auth_settings=auth_settings, - async_req=params.get('async_req'), - _return_http_data_only=params.get('_return_http_data_only'), - _preload_content=params.get('_preload_content', True), - _request_timeout=params.get('_request_timeout'), - collection_formats=collection_formats) - - def search_tasks_for_workspace(self, workspace_gid, **kwargs): # noqa: E501 - """Search tasks in a workspace # noqa: E501 - - To mirror the functionality of the Asana web app's advanced search feature, the Asana API has a task search endpoint that allows you to build complex filters to find and retrieve the exact data you need. #### Premium access Like the Asana web product's advance search feature, this search endpoint will only be available to premium Asana users. A user is premium if any of the following is true: - The workspace in which the search is being performed is a premium workspace - The user is a member of a premium team inside the workspace Even if a user is only a member of a premium team inside a non-premium workspace, search will allow them to find data anywhere in the workspace, not just inside the premium team. Making a search request using credentials of a non-premium user will result in a `402 Payment Required` error. #### Pagination Search results are not stable; repeating the same query multiple times may return the data in a different order, even if the data do not change. Because of this, the traditional [pagination](https://developers.asana.com/docs/#pagination) available elsewhere in the Asana API is not available here. However, you can paginate manually by sorting the search results by their creation time and then modifying each subsequent query to exclude data you have already seen. Page sizes are limited to a maximum of 100 items, and can be specified by the `limit` query parameter. #### Eventual consistency Changes in Asana (regardless of whether they’re made though the web product or the API) are forwarded to our search infrastructure to be indexed. This process can take between 10 and 60 seconds to complete under normal operation, and longer during some production incidents. Making a change to a task that would alter its presence in a particular search query will not be reflected immediately. This is also true of the advanced search feature in the web product. #### Rate limits You may receive a `429 Too Many Requests` response if you hit any of our [rate limits](https://developers.asana.com/docs/#rate-limits). #### Custom field parameters | Parameter name | Custom field type | Accepted type | |---|---|---| | custom_fields.{gid}.is_set | All | Boolean | | custom_fields.{gid}.value | Text | String | | custom_fields.{gid}.value | Number | Number | | custom_fields.{gid}.value | Enum | Enum option ID | | custom_fields.{gid}.starts_with | Text only | String | | custom_fields.{gid}.ends_with | Text only | String | | custom_fields.{gid}.contains | Text only | String | | custom_fields.{gid}.less_than | Number only | Number | | custom_fields.{gid}.greater_than | Number only | Number | For example, if the gid of the custom field is 12345, these query parameter to find tasks where it is set would be `custom_fields.12345.is_set=true`. To match an exact value for an enum custom field, use the gid of the desired enum option and not the name of the enum option: `custom_fields.12345.value=67890`. **Not Supported**: searching for multiple exact matches of a custom field, searching for multi-enum custom field *Note: If you specify `projects.any` and `sections.any`, you will receive tasks for the project **and** tasks for the section. If you're looking for only tasks in a section, omit the `projects.any` from the request.* # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.search_tasks_for_workspace(workspace_gid, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param str workspace_gid: Globally unique identifier for the workspace or organization. (required) - :param str text: Performs full-text search on both task name and description - :param str resource_subtype: Filters results by the task's resource_subtype - :param str assignee_any: Comma-separated list of user identifiers - :param str assignee_not: Comma-separated list of user identifiers - :param str portfolios_any: Comma-separated list of portfolio IDs - :param str projects_any: Comma-separated list of project IDs - :param str projects_not: Comma-separated list of project IDs - :param str projects_all: Comma-separated list of project IDs - :param str sections_any: Comma-separated list of section or column IDs - :param str sections_not: Comma-separated list of section or column IDs - :param str sections_all: Comma-separated list of section or column IDs - :param str tags_any: Comma-separated list of tag IDs - :param str tags_not: Comma-separated list of tag IDs - :param str tags_all: Comma-separated list of tag IDs - :param str teams_any: Comma-separated list of team IDs - :param str followers_not: Comma-separated list of user identifiers - :param str created_by_any: Comma-separated list of user identifiers - :param str created_by_not: Comma-separated list of user identifiers - :param str assigned_by_any: Comma-separated list of user identifiers - :param str assigned_by_not: Comma-separated list of user identifiers - :param str liked_by_not: Comma-separated list of user identifiers - :param str commented_on_by_not: Comma-separated list of user identifiers - :param date due_on_before: ISO 8601 date string - :param date due_on_after: ISO 8601 date string - :param date due_on: ISO 8601 date string or `null` - :param datetime due_at_before: ISO 8601 datetime string - :param datetime due_at_after: ISO 8601 datetime string - :param date start_on_before: ISO 8601 date string - :param date start_on_after: ISO 8601 date string - :param date start_on: ISO 8601 date string or `null` - :param date created_on_before: ISO 8601 date string - :param date created_on_after: ISO 8601 date string - :param date created_on: ISO 8601 date string or `null` - :param datetime created_at_before: ISO 8601 datetime string - :param datetime created_at_after: ISO 8601 datetime string - :param date completed_on_before: ISO 8601 date string - :param date completed_on_after: ISO 8601 date string - :param date completed_on: ISO 8601 date string or `null` - :param datetime completed_at_before: ISO 8601 datetime string - :param datetime completed_at_after: ISO 8601 datetime string - :param date modified_on_before: ISO 8601 date string - :param date modified_on_after: ISO 8601 date string - :param date modified_on: ISO 8601 date string or `null` - :param datetime modified_at_before: ISO 8601 datetime string - :param datetime modified_at_after: ISO 8601 datetime string - :param bool is_blocking: Filter to incomplete tasks with dependents - :param bool is_blocked: Filter to tasks with incomplete dependencies - :param bool has_attachment: Filter to tasks with attachments - :param bool completed: Filter to completed tasks - :param bool is_subtask: Filter to subtasks - :param str sort_by: One of `due_date`, `created_at`, `completed_at`, `likes`, or `modified_at`, defaults to `modified_at` - :param bool sort_ascending: Default `false` - :param list[str] opt_fields: This endpoint returns a compact resource, which excludes some properties by default. To include those optional properties, set this query parameter to a comma-separated list of the properties you wish to include. - :return: TaskResponseArray - If the method is called asynchronously, - returns the request thread. - """ - kwargs['_return_http_data_only'] = True - if kwargs.get('async_req'): - return self.search_tasks_for_workspace_with_http_info(workspace_gid, **kwargs) # noqa: E501 - else: - (data) = self.search_tasks_for_workspace_with_http_info(workspace_gid, **kwargs) # noqa: E501 - return data - - def search_tasks_for_workspace_with_http_info(self, workspace_gid, **kwargs): # noqa: E501 - """Search tasks in a workspace # noqa: E501 - - To mirror the functionality of the Asana web app's advanced search feature, the Asana API has a task search endpoint that allows you to build complex filters to find and retrieve the exact data you need. #### Premium access Like the Asana web product's advance search feature, this search endpoint will only be available to premium Asana users. A user is premium if any of the following is true: - The workspace in which the search is being performed is a premium workspace - The user is a member of a premium team inside the workspace Even if a user is only a member of a premium team inside a non-premium workspace, search will allow them to find data anywhere in the workspace, not just inside the premium team. Making a search request using credentials of a non-premium user will result in a `402 Payment Required` error. #### Pagination Search results are not stable; repeating the same query multiple times may return the data in a different order, even if the data do not change. Because of this, the traditional [pagination](https://developers.asana.com/docs/#pagination) available elsewhere in the Asana API is not available here. However, you can paginate manually by sorting the search results by their creation time and then modifying each subsequent query to exclude data you have already seen. Page sizes are limited to a maximum of 100 items, and can be specified by the `limit` query parameter. #### Eventual consistency Changes in Asana (regardless of whether they’re made though the web product or the API) are forwarded to our search infrastructure to be indexed. This process can take between 10 and 60 seconds to complete under normal operation, and longer during some production incidents. Making a change to a task that would alter its presence in a particular search query will not be reflected immediately. This is also true of the advanced search feature in the web product. #### Rate limits You may receive a `429 Too Many Requests` response if you hit any of our [rate limits](https://developers.asana.com/docs/#rate-limits). #### Custom field parameters | Parameter name | Custom field type | Accepted type | |---|---|---| | custom_fields.{gid}.is_set | All | Boolean | | custom_fields.{gid}.value | Text | String | | custom_fields.{gid}.value | Number | Number | | custom_fields.{gid}.value | Enum | Enum option ID | | custom_fields.{gid}.starts_with | Text only | String | | custom_fields.{gid}.ends_with | Text only | String | | custom_fields.{gid}.contains | Text only | String | | custom_fields.{gid}.less_than | Number only | Number | | custom_fields.{gid}.greater_than | Number only | Number | For example, if the gid of the custom field is 12345, these query parameter to find tasks where it is set would be `custom_fields.12345.is_set=true`. To match an exact value for an enum custom field, use the gid of the desired enum option and not the name of the enum option: `custom_fields.12345.value=67890`. **Not Supported**: searching for multiple exact matches of a custom field, searching for multi-enum custom field *Note: If you specify `projects.any` and `sections.any`, you will receive tasks for the project **and** tasks for the section. If you're looking for only tasks in a section, omit the `projects.any` from the request.* # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.search_tasks_for_workspace_with_http_info(workspace_gid, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param str workspace_gid: Globally unique identifier for the workspace or organization. (required) - :param str text: Performs full-text search on both task name and description - :param str resource_subtype: Filters results by the task's resource_subtype - :param str assignee_any: Comma-separated list of user identifiers - :param str assignee_not: Comma-separated list of user identifiers - :param str portfolios_any: Comma-separated list of portfolio IDs - :param str projects_any: Comma-separated list of project IDs - :param str projects_not: Comma-separated list of project IDs - :param str projects_all: Comma-separated list of project IDs - :param str sections_any: Comma-separated list of section or column IDs - :param str sections_not: Comma-separated list of section or column IDs - :param str sections_all: Comma-separated list of section or column IDs - :param str tags_any: Comma-separated list of tag IDs - :param str tags_not: Comma-separated list of tag IDs - :param str tags_all: Comma-separated list of tag IDs - :param str teams_any: Comma-separated list of team IDs - :param str followers_not: Comma-separated list of user identifiers - :param str created_by_any: Comma-separated list of user identifiers - :param str created_by_not: Comma-separated list of user identifiers - :param str assigned_by_any: Comma-separated list of user identifiers - :param str assigned_by_not: Comma-separated list of user identifiers - :param str liked_by_not: Comma-separated list of user identifiers - :param str commented_on_by_not: Comma-separated list of user identifiers - :param date due_on_before: ISO 8601 date string - :param date due_on_after: ISO 8601 date string - :param date due_on: ISO 8601 date string or `null` - :param datetime due_at_before: ISO 8601 datetime string - :param datetime due_at_after: ISO 8601 datetime string - :param date start_on_before: ISO 8601 date string - :param date start_on_after: ISO 8601 date string - :param date start_on: ISO 8601 date string or `null` - :param date created_on_before: ISO 8601 date string - :param date created_on_after: ISO 8601 date string - :param date created_on: ISO 8601 date string or `null` - :param datetime created_at_before: ISO 8601 datetime string - :param datetime created_at_after: ISO 8601 datetime string - :param date completed_on_before: ISO 8601 date string - :param date completed_on_after: ISO 8601 date string - :param date completed_on: ISO 8601 date string or `null` - :param datetime completed_at_before: ISO 8601 datetime string - :param datetime completed_at_after: ISO 8601 datetime string - :param date modified_on_before: ISO 8601 date string - :param date modified_on_after: ISO 8601 date string - :param date modified_on: ISO 8601 date string or `null` - :param datetime modified_at_before: ISO 8601 datetime string - :param datetime modified_at_after: ISO 8601 datetime string - :param bool is_blocking: Filter to incomplete tasks with dependents - :param bool is_blocked: Filter to tasks with incomplete dependencies - :param bool has_attachment: Filter to tasks with attachments - :param bool completed: Filter to completed tasks - :param bool is_subtask: Filter to subtasks - :param str sort_by: One of `due_date`, `created_at`, `completed_at`, `likes`, or `modified_at`, defaults to `modified_at` - :param bool sort_ascending: Default `false` - :param list[str] opt_fields: This endpoint returns a compact resource, which excludes some properties by default. To include those optional properties, set this query parameter to a comma-separated list of the properties you wish to include. - :return: TaskResponseArray - If the method is called asynchronously, - returns the request thread. - """ - - all_params = ['workspace_gid', 'text', 'resource_subtype', 'assignee_any', 'assignee_not', 'portfolios_any', 'projects_any', 'projects_not', 'projects_all', 'sections_any', 'sections_not', 'sections_all', 'tags_any', 'tags_not', 'tags_all', 'teams_any', 'followers_not', 'created_by_any', 'created_by_not', 'assigned_by_any', 'assigned_by_not', 'liked_by_not', 'commented_on_by_not', 'due_on_before', 'due_on_after', 'due_on', 'due_at_before', 'due_at_after', 'start_on_before', 'start_on_after', 'start_on', 'created_on_before', 'created_on_after', 'created_on', 'created_at_before', 'created_at_after', 'completed_on_before', 'completed_on_after', 'completed_on', 'completed_at_before', 'completed_at_after', 'modified_on_before', 'modified_on_after', 'modified_on', 'modified_at_before', 'modified_at_after', 'is_blocking', 'is_blocked', 'has_attachment', 'completed', 'is_subtask', 'sort_by', 'sort_ascending', 'opt_fields'] # noqa: E501 - all_params.append('async_req') - all_params.append('_return_http_data_only') - all_params.append('_preload_content') - all_params.append('_request_timeout') - - params = locals() - for key, val in six.iteritems(params['kwargs']): - if key not in all_params: - raise TypeError( - "Got an unexpected keyword argument '%s'" - " to method search_tasks_for_workspace" % key - ) - params[key] = val - del params['kwargs'] - # verify the required parameter 'workspace_gid' is set - if ('workspace_gid' not in params or - params['workspace_gid'] is None): - raise ValueError("Missing the required parameter `workspace_gid` when calling `search_tasks_for_workspace`") # noqa: E501 - - collection_formats = {} - - path_params = {} - if 'workspace_gid' in params: - path_params['workspace_gid'] = params['workspace_gid'] # noqa: E501 - - query_params = [] - if 'text' in params: - query_params.append(('text', params['text'])) # noqa: E501 - if 'resource_subtype' in params: - query_params.append(('resource_subtype', params['resource_subtype'])) # noqa: E501 - if 'assignee_any' in params: - query_params.append(('assignee.any', params['assignee_any'])) # noqa: E501 - if 'assignee_not' in params: - query_params.append(('assignee.not', params['assignee_not'])) # noqa: E501 - if 'portfolios_any' in params: - query_params.append(('portfolios.any', params['portfolios_any'])) # noqa: E501 - if 'projects_any' in params: - query_params.append(('projects.any', params['projects_any'])) # noqa: E501 - if 'projects_not' in params: - query_params.append(('projects.not', params['projects_not'])) # noqa: E501 - if 'projects_all' in params: - query_params.append(('projects.all', params['projects_all'])) # noqa: E501 - if 'sections_any' in params: - query_params.append(('sections.any', params['sections_any'])) # noqa: E501 - if 'sections_not' in params: - query_params.append(('sections.not', params['sections_not'])) # noqa: E501 - if 'sections_all' in params: - query_params.append(('sections.all', params['sections_all'])) # noqa: E501 - if 'tags_any' in params: - query_params.append(('tags.any', params['tags_any'])) # noqa: E501 - if 'tags_not' in params: - query_params.append(('tags.not', params['tags_not'])) # noqa: E501 - if 'tags_all' in params: - query_params.append(('tags.all', params['tags_all'])) # noqa: E501 - if 'teams_any' in params: - query_params.append(('teams.any', params['teams_any'])) # noqa: E501 - if 'followers_not' in params: - query_params.append(('followers.not', params['followers_not'])) # noqa: E501 - if 'created_by_any' in params: - query_params.append(('created_by.any', params['created_by_any'])) # noqa: E501 - if 'created_by_not' in params: - query_params.append(('created_by.not', params['created_by_not'])) # noqa: E501 - if 'assigned_by_any' in params: - query_params.append(('assigned_by.any', params['assigned_by_any'])) # noqa: E501 - if 'assigned_by_not' in params: - query_params.append(('assigned_by.not', params['assigned_by_not'])) # noqa: E501 - if 'liked_by_not' in params: - query_params.append(('liked_by.not', params['liked_by_not'])) # noqa: E501 - if 'commented_on_by_not' in params: - query_params.append(('commented_on_by.not', params['commented_on_by_not'])) # noqa: E501 - if 'due_on_before' in params: - query_params.append(('due_on.before', params['due_on_before'])) # noqa: E501 - if 'due_on_after' in params: - query_params.append(('due_on.after', params['due_on_after'])) # noqa: E501 - if 'due_on' in params: - query_params.append(('due_on', params['due_on'])) # noqa: E501 - if 'due_at_before' in params: - query_params.append(('due_at.before', params['due_at_before'])) # noqa: E501 - if 'due_at_after' in params: - query_params.append(('due_at.after', params['due_at_after'])) # noqa: E501 - if 'start_on_before' in params: - query_params.append(('start_on.before', params['start_on_before'])) # noqa: E501 - if 'start_on_after' in params: - query_params.append(('start_on.after', params['start_on_after'])) # noqa: E501 - if 'start_on' in params: - query_params.append(('start_on', params['start_on'])) # noqa: E501 - if 'created_on_before' in params: - query_params.append(('created_on.before', params['created_on_before'])) # noqa: E501 - if 'created_on_after' in params: - query_params.append(('created_on.after', params['created_on_after'])) # noqa: E501 - if 'created_on' in params: - query_params.append(('created_on', params['created_on'])) # noqa: E501 - if 'created_at_before' in params: - query_params.append(('created_at.before', params['created_at_before'])) # noqa: E501 - if 'created_at_after' in params: - query_params.append(('created_at.after', params['created_at_after'])) # noqa: E501 - if 'completed_on_before' in params: - query_params.append(('completed_on.before', params['completed_on_before'])) # noqa: E501 - if 'completed_on_after' in params: - query_params.append(('completed_on.after', params['completed_on_after'])) # noqa: E501 - if 'completed_on' in params: - query_params.append(('completed_on', params['completed_on'])) # noqa: E501 - if 'completed_at_before' in params: - query_params.append(('completed_at.before', params['completed_at_before'])) # noqa: E501 - if 'completed_at_after' in params: - query_params.append(('completed_at.after', params['completed_at_after'])) # noqa: E501 - if 'modified_on_before' in params: - query_params.append(('modified_on.before', params['modified_on_before'])) # noqa: E501 - if 'modified_on_after' in params: - query_params.append(('modified_on.after', params['modified_on_after'])) # noqa: E501 - if 'modified_on' in params: - query_params.append(('modified_on', params['modified_on'])) # noqa: E501 - if 'modified_at_before' in params: - query_params.append(('modified_at.before', params['modified_at_before'])) # noqa: E501 - if 'modified_at_after' in params: - query_params.append(('modified_at.after', params['modified_at_after'])) # noqa: E501 - if 'is_blocking' in params: - query_params.append(('is_blocking', params['is_blocking'])) # noqa: E501 - if 'is_blocked' in params: - query_params.append(('is_blocked', params['is_blocked'])) # noqa: E501 - if 'has_attachment' in params: - query_params.append(('has_attachment', params['has_attachment'])) # noqa: E501 - if 'completed' in params: - query_params.append(('completed', params['completed'])) # noqa: E501 - if 'is_subtask' in params: - query_params.append(('is_subtask', params['is_subtask'])) # noqa: E501 - if 'sort_by' in params: - query_params.append(('sort_by', params['sort_by'])) # noqa: E501 - if 'sort_ascending' in params: - query_params.append(('sort_ascending', params['sort_ascending'])) # noqa: E501 - if 'opt_fields' in params: - query_params.append(('opt_fields', params['opt_fields'])) # noqa: E501 - collection_formats['opt_fields'] = 'csv' # noqa: E501 - - header_params = {} - - form_params = [] - local_var_files = {} - - body_params = None - # HTTP header `Accept` - header_params['Accept'] = self.api_client.select_header_accept( - ['application/json; charset=UTF-8']) # noqa: E501 - - # Authentication setting - auth_settings = ['oauth2'] # noqa: E501 - - return self.api_client.call_api( - '/workspaces/{workspace_gid}/tasks/search', 'GET', - path_params, - query_params, - header_params, - body=body_params, - post_params=form_params, - files=local_var_files, - response_type='TaskResponseArray', # noqa: E501 - auth_settings=auth_settings, - async_req=params.get('async_req'), - _return_http_data_only=params.get('_return_http_data_only'), - _preload_content=params.get('_preload_content', True), - _request_timeout=params.get('_request_timeout'), - collection_formats=collection_formats) - - def set_parent_for_task(self, body, task_gid, **kwargs): # noqa: E501 - """Set the parent of a task # noqa: E501 - - parent, or no parent task at all. Returns an empty data block. When using `insert_before` and `insert_after`, at most one of those two options can be specified, and they must already be subtasks of the parent. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.set_parent_for_task(body, task_gid, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param TaskGidSetParentBody body: The new parent of the subtask. (required) - :param str task_gid: The task to operate on. (required) - :param list[str] opt_fields: This endpoint returns a compact resource, which excludes some properties by default. To include those optional properties, set this query parameter to a comma-separated list of the properties you wish to include. - :return: TaskResponseData - If the method is called asynchronously, - returns the request thread. - """ - kwargs['_return_http_data_only'] = True - if kwargs.get('async_req'): - return self.set_parent_for_task_with_http_info(body, task_gid, **kwargs) # noqa: E501 - else: - (data) = self.set_parent_for_task_with_http_info(body, task_gid, **kwargs) # noqa: E501 - return data - - def set_parent_for_task_with_http_info(self, body, task_gid, **kwargs): # noqa: E501 - """Set the parent of a task # noqa: E501 - - parent, or no parent task at all. Returns an empty data block. When using `insert_before` and `insert_after`, at most one of those two options can be specified, and they must already be subtasks of the parent. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.set_parent_for_task_with_http_info(body, task_gid, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param TaskGidSetParentBody body: The new parent of the subtask. (required) - :param str task_gid: The task to operate on. (required) - :param list[str] opt_fields: This endpoint returns a compact resource, which excludes some properties by default. To include those optional properties, set this query parameter to a comma-separated list of the properties you wish to include. - :return: TaskResponseData - If the method is called asynchronously, - returns the request thread. - """ - - all_params = ['body', 'task_gid', 'opt_fields'] # noqa: E501 - all_params.append('async_req') - all_params.append('_return_http_data_only') - all_params.append('_preload_content') - all_params.append('_request_timeout') - - params = locals() - for key, val in six.iteritems(params['kwargs']): - if key not in all_params: - raise TypeError( - "Got an unexpected keyword argument '%s'" - " to method set_parent_for_task" % key - ) - params[key] = val - del params['kwargs'] - # verify the required parameter 'body' is set - if ('body' not in params or - params['body'] is None): - raise ValueError("Missing the required parameter `body` when calling `set_parent_for_task`") # noqa: E501 - # verify the required parameter 'task_gid' is set - if ('task_gid' not in params or - params['task_gid'] is None): - raise ValueError("Missing the required parameter `task_gid` when calling `set_parent_for_task`") # noqa: E501 - - collection_formats = {} - - path_params = {} - if 'task_gid' in params: - path_params['task_gid'] = params['task_gid'] # noqa: E501 - - query_params = [] - if 'opt_fields' in params: - query_params.append(('opt_fields', params['opt_fields'])) # noqa: E501 - collection_formats['opt_fields'] = 'csv' # noqa: E501 - - header_params = {} - - form_params = [] - local_var_files = {} - - body_params = None - if 'body' in params: - body_params = params['body'] - # HTTP header `Accept` - header_params['Accept'] = self.api_client.select_header_accept( - ['application/json; charset=UTF-8']) # noqa: E501 - - # HTTP header `Content-Type` - header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 - ['application/json; charset=UTF-8']) # noqa: E501 - - # Authentication setting - auth_settings = ['oauth2'] # noqa: E501 - - return self.api_client.call_api( - '/tasks/{task_gid}/setParent', 'POST', - path_params, - query_params, - header_params, - body=body_params, - post_params=form_params, - files=local_var_files, - response_type='TaskResponseData', # noqa: E501 - auth_settings=auth_settings, - async_req=params.get('async_req'), - _return_http_data_only=params.get('_return_http_data_only'), - _preload_content=params.get('_preload_content', True), - _request_timeout=params.get('_request_timeout'), - collection_formats=collection_formats) - - def update_task(self, body, task_gid, **kwargs): # noqa: E501 - """Update a task # noqa: E501 - - A specific, existing task can be updated by making a PUT request on the URL for that task. Only the fields provided in the `data` block will be updated; any unspecified fields will remain unchanged. When using this method, it is best to specify only those fields you wish to change, or else you may overwrite changes made by another user since you last retrieved the task. Returns the complete updated task record. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.update_task(body, task_gid, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param TasksTaskGidBody body: The task to update. (required) - :param str task_gid: The task to operate on. (required) - :param list[str] opt_fields: This endpoint returns a compact resource, which excludes some properties by default. To include those optional properties, set this query parameter to a comma-separated list of the properties you wish to include. - :return: TaskResponseData - If the method is called asynchronously, - returns the request thread. - """ - kwargs['_return_http_data_only'] = True - if kwargs.get('async_req'): - return self.update_task_with_http_info(body, task_gid, **kwargs) # noqa: E501 - else: - (data) = self.update_task_with_http_info(body, task_gid, **kwargs) # noqa: E501 - return data - - def update_task_with_http_info(self, body, task_gid, **kwargs): # noqa: E501 - """Update a task # noqa: E501 - - A specific, existing task can be updated by making a PUT request on the URL for that task. Only the fields provided in the `data` block will be updated; any unspecified fields will remain unchanged. When using this method, it is best to specify only those fields you wish to change, or else you may overwrite changes made by another user since you last retrieved the task. Returns the complete updated task record. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.update_task_with_http_info(body, task_gid, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param TasksTaskGidBody body: The task to update. (required) - :param str task_gid: The task to operate on. (required) - :param list[str] opt_fields: This endpoint returns a compact resource, which excludes some properties by default. To include those optional properties, set this query parameter to a comma-separated list of the properties you wish to include. - :return: TaskResponseData - If the method is called asynchronously, - returns the request thread. - """ - - all_params = ['body', 'task_gid', 'opt_fields'] # noqa: E501 - all_params.append('async_req') - all_params.append('_return_http_data_only') - all_params.append('_preload_content') - all_params.append('_request_timeout') - - params = locals() - for key, val in six.iteritems(params['kwargs']): - if key not in all_params: - raise TypeError( - "Got an unexpected keyword argument '%s'" - " to method update_task" % key - ) - params[key] = val - del params['kwargs'] - # verify the required parameter 'body' is set - if ('body' not in params or - params['body'] is None): - raise ValueError("Missing the required parameter `body` when calling `update_task`") # noqa: E501 - # verify the required parameter 'task_gid' is set - if ('task_gid' not in params or - params['task_gid'] is None): - raise ValueError("Missing the required parameter `task_gid` when calling `update_task`") # noqa: E501 - - collection_formats = {} - - path_params = {} - if 'task_gid' in params: - path_params['task_gid'] = params['task_gid'] # noqa: E501 - - query_params = [] - if 'opt_fields' in params: - query_params.append(('opt_fields', params['opt_fields'])) # noqa: E501 - collection_formats['opt_fields'] = 'csv' # noqa: E501 - - header_params = {} - - form_params = [] - local_var_files = {} - - body_params = None - if 'body' in params: - body_params = params['body'] - # HTTP header `Accept` - header_params['Accept'] = self.api_client.select_header_accept( - ['application/json; charset=UTF-8']) # noqa: E501 - - # HTTP header `Content-Type` - header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 - ['application/json; charset=UTF-8']) # noqa: E501 - - # Authentication setting - auth_settings = ['oauth2'] # noqa: E501 - - return self.api_client.call_api( - '/tasks/{task_gid}', 'PUT', - path_params, - query_params, - header_params, - body=body_params, - post_params=form_params, - files=local_var_files, - response_type='TaskResponseData', # noqa: E501 - auth_settings=auth_settings, - async_req=params.get('async_req'), - _return_http_data_only=params.get('_return_http_data_only'), - _preload_content=params.get('_preload_content', True), - _request_timeout=params.get('_request_timeout'), - collection_formats=collection_formats) + all_params = ['body', 'task_gid', 'opt_fields'] # noqa: E501 + all_params.append('async_req') + all_params.append('header_params') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + params = locals() + for key, val in six.iteritems(params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method update_task" % key + ) + params[key] = val + del params['kwargs'] + # verify the required parameter 'body' is set + if ('body' not in params or + params['body'] is None): + raise ValueError("Missing the required parameter `body` when calling `update_task`") # noqa: E501 + # verify the required parameter 'task_gid' is set + if ('task_gid' not in params or + params['task_gid'] is None): + raise ValueError("Missing the required parameter `task_gid` when calling `update_task`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'task_gid' in params: + path_params['task_gid'] = params['task_gid'] # noqa: E501 + + query_params = [] + if 'opt_fields' in params: + query_params.append(('opt_fields', params['opt_fields'])) # noqa: E501 + collection_formats['opt_fields'] = 'csv' # noqa: E501 + + header_params = kwargs.get("header_params", {}) + + form_params = [] + local_var_files = {} + + body_params = None + if 'body' in params: + body_params = params['body'] + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['application/json; charset=UTF-8']) # noqa: E501 + + # HTTP header `Content-Type` + header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 + ['application/json; charset=UTF-8']) # noqa: E501 + + # Authentication setting + auth_settings = ['oauth2'] # noqa: E501 + + return self.api_client.call_api( + '/tasks/{task_gid}', 'PUT', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='TaskResponseData', # noqa: E501 + auth_settings=auth_settings, + async_req=params.get('async_req'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) diff --git a/asana/api/team_memberships_api.py b/asana/api/team_memberships_api.py index a7fed66a..f3008e2d 100644 --- a/asana/api/team_memberships_api.py +++ b/asana/api/team_memberships_api.py @@ -21,449 +21,453 @@ class TeamMembershipsApi(object): - """NOTE: This class is auto generated by the swagger code generator program. +"""NOTE: This class is auto generated by the swagger code generator program. - Do not edit the class manually. - Ref: https://github.com/swagger-api/swagger-codegen +Do not edit the class manually. +Ref: https://github.com/swagger-api/swagger-codegen +""" + +def __init__(self, api_client=None): + if api_client is None: + api_client = ApiClient() + self.api_client = api_client + +def get_team_membership(self, team_membership_gid, **kwargs): # noqa: E501 + """Get a team membership # noqa: E501 + + Returns the complete team membership record for a single team membership. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.get_team_membership(team_membership_gid, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str team_membership_gid: (required) + :param list[str] opt_fields: This endpoint returns a compact resource, which excludes some properties by default. To include those optional properties, set this query parameter to a comma-separated list of the properties you wish to include. + :return: TeamMembershipResponseData + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = kwargs.get("_return_http_data_only", True) + if kwargs.get('async_req'): + return self.get_team_membership_with_http_info(team_membership_gid, **kwargs) # noqa: E501 + else: + (data) = self.get_team_membership_with_http_info(team_membership_gid, **kwargs) # noqa: E501 + return data + +def get_team_membership_with_http_info(self, team_membership_gid, **kwargs): # noqa: E501 + """Get a team membership # noqa: E501 + + Returns the complete team membership record for a single team membership. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.get_team_membership_with_http_info(team_membership_gid, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str team_membership_gid: (required) + :param list[str] opt_fields: This endpoint returns a compact resource, which excludes some properties by default. To include those optional properties, set this query parameter to a comma-separated list of the properties you wish to include. + :return: TeamMembershipResponseData + If the method is called asynchronously, + returns the request thread. + """ + + all_params = ['team_membership_gid', 'opt_fields'] # noqa: E501 + all_params.append('async_req') + all_params.append('header_params') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + params = locals() + for key, val in six.iteritems(params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method get_team_membership" % key + ) + params[key] = val + del params['kwargs'] + # verify the required parameter 'team_membership_gid' is set + if ('team_membership_gid' not in params or + params['team_membership_gid'] is None): + raise ValueError("Missing the required parameter `team_membership_gid` when calling `get_team_membership`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'team_membership_gid' in params: + path_params['team_membership_gid'] = params['team_membership_gid'] # noqa: E501 + + query_params = [] + if 'opt_fields' in params: + query_params.append(('opt_fields', params['opt_fields'])) # noqa: E501 + collection_formats['opt_fields'] = 'csv' # noqa: E501 + + header_params = kwargs.get("header_params", {}) + + form_params = [] + local_var_files = {} + + body_params = None + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['application/json; charset=UTF-8']) # noqa: E501 + + # Authentication setting + auth_settings = ['oauth2'] # noqa: E501 + + return self.api_client.call_api( + '/team_memberships/{team_membership_gid}', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='TeamMembershipResponseData', # noqa: E501 + auth_settings=auth_settings, + async_req=params.get('async_req'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) + +def get_team_memberships(self, **kwargs): # noqa: E501 + """Get team memberships # noqa: E501 + + Returns compact team membership records. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.get_team_memberships(async_req=True) + >>> result = thread.get() + + :param async_req bool + :param int limit: Results per page. The number of objects to return per page. The value must be between 1 and 100. + :param str offset: 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 str team: Globally unique identifier for the team. + :param str user: 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. + :param str workspace: Globally unique identifier for the workspace. This parameter must be used with the user parameter. + :param list[str] opt_fields: This endpoint returns a compact resource, which excludes some properties by default. To include those optional properties, set this query parameter to a comma-separated list of the properties you wish to include. + :return: TeamMembershipResponseArray + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = kwargs.get("_return_http_data_only", True) + if kwargs.get('async_req'): + return self.get_team_memberships_with_http_info(**kwargs) # noqa: E501 + else: + (data) = self.get_team_memberships_with_http_info(**kwargs) # noqa: E501 + return data + +def get_team_memberships_with_http_info(self, **kwargs): # noqa: E501 + """Get team memberships # noqa: E501 + + Returns compact team membership records. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.get_team_memberships_with_http_info(async_req=True) + >>> result = thread.get() + + :param async_req bool + :param int limit: Results per page. The number of objects to return per page. The value must be between 1 and 100. + :param str offset: 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 str team: Globally unique identifier for the team. + :param str user: 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. + :param str workspace: Globally unique identifier for the workspace. This parameter must be used with the user parameter. + :param list[str] opt_fields: This endpoint returns a compact resource, which excludes some properties by default. To include those optional properties, set this query parameter to a comma-separated list of the properties you wish to include. + :return: TeamMembershipResponseArray + If the method is called asynchronously, + returns the request thread. + """ + + all_params = ['limit', 'offset', 'team', 'user', 'workspace', 'opt_fields'] # noqa: E501 + all_params.append('async_req') + all_params.append('header_params') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + params = locals() + for key, val in six.iteritems(params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method get_team_memberships" % key + ) + params[key] = val + del params['kwargs'] + + collection_formats = {} + + path_params = {} + + query_params = [] + if 'limit' in params: + query_params.append(('limit', params['limit'])) # noqa: E501 + if 'offset' in params: + query_params.append(('offset', params['offset'])) # noqa: E501 + if 'team' in params: + query_params.append(('team', params['team'])) # noqa: E501 + if 'user' in params: + query_params.append(('user', params['user'])) # noqa: E501 + if 'workspace' in params: + query_params.append(('workspace', params['workspace'])) # noqa: E501 + if 'opt_fields' in params: + query_params.append(('opt_fields', params['opt_fields'])) # noqa: E501 + collection_formats['opt_fields'] = 'csv' # noqa: E501 + + header_params = kwargs.get("header_params", {}) + + form_params = [] + local_var_files = {} + + body_params = None + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['application/json; charset=UTF-8']) # noqa: E501 + + # Authentication setting + auth_settings = ['oauth2'] # noqa: E501 + + return self.api_client.call_api( + '/team_memberships', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='TeamMembershipResponseArray', # noqa: E501 + auth_settings=auth_settings, + async_req=params.get('async_req'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) + +def get_team_memberships_for_team(self, team_gid, **kwargs): # noqa: E501 + """Get memberships from a team # noqa: E501 + + Returns the compact team memberships for the team. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.get_team_memberships_for_team(team_gid, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str team_gid: Globally unique identifier for the team. (required) + :param int limit: Results per page. The number of objects to return per page. The value must be between 1 and 100. + :param str offset: 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 list[str] opt_fields: This endpoint returns a compact resource, which excludes some properties by default. To include those optional properties, set this query parameter to a comma-separated list of the properties you wish to include. + :return: TeamMembershipResponseArray + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = kwargs.get("_return_http_data_only", True) + if kwargs.get('async_req'): + return self.get_team_memberships_for_team_with_http_info(team_gid, **kwargs) # noqa: E501 + else: + (data) = self.get_team_memberships_for_team_with_http_info(team_gid, **kwargs) # noqa: E501 + return data + +def get_team_memberships_for_team_with_http_info(self, team_gid, **kwargs): # noqa: E501 + """Get memberships from a team # noqa: E501 + + Returns the compact team memberships for the team. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.get_team_memberships_for_team_with_http_info(team_gid, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str team_gid: Globally unique identifier for the team. (required) + :param int limit: Results per page. The number of objects to return per page. The value must be between 1 and 100. + :param str offset: 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 list[str] opt_fields: This endpoint returns a compact resource, which excludes some properties by default. To include those optional properties, set this query parameter to a comma-separated list of the properties you wish to include. + :return: TeamMembershipResponseArray + If the method is called asynchronously, + returns the request thread. + """ + + all_params = ['team_gid', 'limit', 'offset', 'opt_fields'] # noqa: E501 + all_params.append('async_req') + all_params.append('header_params') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + params = locals() + for key, val in six.iteritems(params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method get_team_memberships_for_team" % key + ) + params[key] = val + del params['kwargs'] + # verify the required parameter 'team_gid' is set + if ('team_gid' not in params or + params['team_gid'] is None): + raise ValueError("Missing the required parameter `team_gid` when calling `get_team_memberships_for_team`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'team_gid' in params: + path_params['team_gid'] = params['team_gid'] # noqa: E501 + + query_params = [] + if 'limit' in params: + query_params.append(('limit', params['limit'])) # noqa: E501 + if 'offset' in params: + query_params.append(('offset', params['offset'])) # noqa: E501 + if 'opt_fields' in params: + query_params.append(('opt_fields', params['opt_fields'])) # noqa: E501 + collection_formats['opt_fields'] = 'csv' # noqa: E501 + + header_params = kwargs.get("header_params", {}) + + form_params = [] + local_var_files = {} + + body_params = None + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['application/json; charset=UTF-8']) # noqa: E501 + + # Authentication setting + auth_settings = ['oauth2'] # noqa: E501 + + return self.api_client.call_api( + '/teams/{team_gid}/team_memberships', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='TeamMembershipResponseArray', # noqa: E501 + auth_settings=auth_settings, + async_req=params.get('async_req'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) + +def get_team_memberships_for_user(self, user_gid, workspace, **kwargs): # noqa: E501 + """Get memberships from a user # noqa: E501 + + Returns the compact team membership records for the user. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.get_team_memberships_for_user(user_gid, workspace, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str user_gid: A string identifying a user. This can either be the string \"me\", an email, or the gid of a user. (required) + :param str workspace: Globally unique identifier for the workspace. (required) + :param int limit: Results per page. The number of objects to return per page. The value must be between 1 and 100. + :param str offset: 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 list[str] opt_fields: This endpoint returns a compact resource, which excludes some properties by default. To include those optional properties, set this query parameter to a comma-separated list of the properties you wish to include. + :return: TeamMembershipResponseArray + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = kwargs.get("_return_http_data_only", True) + if kwargs.get('async_req'): + return self.get_team_memberships_for_user_with_http_info(user_gid, workspace, **kwargs) # noqa: E501 + else: + (data) = self.get_team_memberships_for_user_with_http_info(user_gid, workspace, **kwargs) # noqa: E501 + return data + +def get_team_memberships_for_user_with_http_info(self, user_gid, workspace, **kwargs): # noqa: E501 + """Get memberships from a user # noqa: E501 + + Returns the compact team membership records for the user. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.get_team_memberships_for_user_with_http_info(user_gid, workspace, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str user_gid: A string identifying a user. This can either be the string \"me\", an email, or the gid of a user. (required) + :param str workspace: Globally unique identifier for the workspace. (required) + :param int limit: Results per page. The number of objects to return per page. The value must be between 1 and 100. + :param str offset: 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 list[str] opt_fields: This endpoint returns a compact resource, which excludes some properties by default. To include those optional properties, set this query parameter to a comma-separated list of the properties you wish to include. + :return: TeamMembershipResponseArray + If the method is called asynchronously, + returns the request thread. """ - def __init__(self, api_client=None): - if api_client is None: - api_client = ApiClient() - self.api_client = api_client - - def get_team_membership(self, team_membership_gid, **kwargs): # noqa: E501 - """Get a team membership # noqa: E501 - - Returns the complete team membership record for a single team membership. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.get_team_membership(team_membership_gid, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param str team_membership_gid: (required) - :param list[str] opt_fields: This endpoint returns a compact resource, which excludes some properties by default. To include those optional properties, set this query parameter to a comma-separated list of the properties you wish to include. - :return: TeamMembershipResponseData - If the method is called asynchronously, - returns the request thread. - """ - kwargs['_return_http_data_only'] = True - if kwargs.get('async_req'): - return self.get_team_membership_with_http_info(team_membership_gid, **kwargs) # noqa: E501 - else: - (data) = self.get_team_membership_with_http_info(team_membership_gid, **kwargs) # noqa: E501 - return data - - def get_team_membership_with_http_info(self, team_membership_gid, **kwargs): # noqa: E501 - """Get a team membership # noqa: E501 - - Returns the complete team membership record for a single team membership. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.get_team_membership_with_http_info(team_membership_gid, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param str team_membership_gid: (required) - :param list[str] opt_fields: This endpoint returns a compact resource, which excludes some properties by default. To include those optional properties, set this query parameter to a comma-separated list of the properties you wish to include. - :return: TeamMembershipResponseData - If the method is called asynchronously, - returns the request thread. - """ - - all_params = ['team_membership_gid', 'opt_fields'] # noqa: E501 - all_params.append('async_req') - all_params.append('_return_http_data_only') - all_params.append('_preload_content') - all_params.append('_request_timeout') - - params = locals() - for key, val in six.iteritems(params['kwargs']): - if key not in all_params: - raise TypeError( - "Got an unexpected keyword argument '%s'" - " to method get_team_membership" % key - ) - params[key] = val - del params['kwargs'] - # verify the required parameter 'team_membership_gid' is set - if ('team_membership_gid' not in params or - params['team_membership_gid'] is None): - raise ValueError("Missing the required parameter `team_membership_gid` when calling `get_team_membership`") # noqa: E501 - - collection_formats = {} - - path_params = {} - if 'team_membership_gid' in params: - path_params['team_membership_gid'] = params['team_membership_gid'] # noqa: E501 - - query_params = [] - if 'opt_fields' in params: - query_params.append(('opt_fields', params['opt_fields'])) # noqa: E501 - collection_formats['opt_fields'] = 'csv' # noqa: E501 - - header_params = {} - - form_params = [] - local_var_files = {} - - body_params = None - # HTTP header `Accept` - header_params['Accept'] = self.api_client.select_header_accept( - ['application/json; charset=UTF-8']) # noqa: E501 - - # Authentication setting - auth_settings = ['oauth2'] # noqa: E501 - - return self.api_client.call_api( - '/team_memberships/{team_membership_gid}', 'GET', - path_params, - query_params, - header_params, - body=body_params, - post_params=form_params, - files=local_var_files, - response_type='TeamMembershipResponseData', # noqa: E501 - auth_settings=auth_settings, - async_req=params.get('async_req'), - _return_http_data_only=params.get('_return_http_data_only'), - _preload_content=params.get('_preload_content', True), - _request_timeout=params.get('_request_timeout'), - collection_formats=collection_formats) - - def get_team_memberships(self, **kwargs): # noqa: E501 - """Get team memberships # noqa: E501 - - Returns compact team membership records. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.get_team_memberships(async_req=True) - >>> result = thread.get() - - :param async_req bool - :param int limit: Results per page. The number of objects to return per page. The value must be between 1 and 100. - :param str offset: 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 str team: Globally unique identifier for the team. - :param str user: 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. - :param str workspace: Globally unique identifier for the workspace. This parameter must be used with the user parameter. - :param list[str] opt_fields: This endpoint returns a compact resource, which excludes some properties by default. To include those optional properties, set this query parameter to a comma-separated list of the properties you wish to include. - :return: TeamMembershipResponseArray - If the method is called asynchronously, - returns the request thread. - """ - kwargs['_return_http_data_only'] = True - if kwargs.get('async_req'): - return self.get_team_memberships_with_http_info(**kwargs) # noqa: E501 - else: - (data) = self.get_team_memberships_with_http_info(**kwargs) # noqa: E501 - return data - - def get_team_memberships_with_http_info(self, **kwargs): # noqa: E501 - """Get team memberships # noqa: E501 - - Returns compact team membership records. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.get_team_memberships_with_http_info(async_req=True) - >>> result = thread.get() - - :param async_req bool - :param int limit: Results per page. The number of objects to return per page. The value must be between 1 and 100. - :param str offset: 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 str team: Globally unique identifier for the team. - :param str user: 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. - :param str workspace: Globally unique identifier for the workspace. This parameter must be used with the user parameter. - :param list[str] opt_fields: This endpoint returns a compact resource, which excludes some properties by default. To include those optional properties, set this query parameter to a comma-separated list of the properties you wish to include. - :return: TeamMembershipResponseArray - If the method is called asynchronously, - returns the request thread. - """ - - all_params = ['limit', 'offset', 'team', 'user', 'workspace', 'opt_fields'] # noqa: E501 - all_params.append('async_req') - all_params.append('_return_http_data_only') - all_params.append('_preload_content') - all_params.append('_request_timeout') - - params = locals() - for key, val in six.iteritems(params['kwargs']): - if key not in all_params: - raise TypeError( - "Got an unexpected keyword argument '%s'" - " to method get_team_memberships" % key - ) - params[key] = val - del params['kwargs'] - - collection_formats = {} - - path_params = {} - - query_params = [] - if 'limit' in params: - query_params.append(('limit', params['limit'])) # noqa: E501 - if 'offset' in params: - query_params.append(('offset', params['offset'])) # noqa: E501 - if 'team' in params: - query_params.append(('team', params['team'])) # noqa: E501 - if 'user' in params: - query_params.append(('user', params['user'])) # noqa: E501 - if 'workspace' in params: - query_params.append(('workspace', params['workspace'])) # noqa: E501 - if 'opt_fields' in params: - query_params.append(('opt_fields', params['opt_fields'])) # noqa: E501 - collection_formats['opt_fields'] = 'csv' # noqa: E501 - - header_params = {} - - form_params = [] - local_var_files = {} - - body_params = None - # HTTP header `Accept` - header_params['Accept'] = self.api_client.select_header_accept( - ['application/json; charset=UTF-8']) # noqa: E501 - - # Authentication setting - auth_settings = ['oauth2'] # noqa: E501 - - return self.api_client.call_api( - '/team_memberships', 'GET', - path_params, - query_params, - header_params, - body=body_params, - post_params=form_params, - files=local_var_files, - response_type='TeamMembershipResponseArray', # noqa: E501 - auth_settings=auth_settings, - async_req=params.get('async_req'), - _return_http_data_only=params.get('_return_http_data_only'), - _preload_content=params.get('_preload_content', True), - _request_timeout=params.get('_request_timeout'), - collection_formats=collection_formats) - - def get_team_memberships_for_team(self, team_gid, **kwargs): # noqa: E501 - """Get memberships from a team # noqa: E501 - - Returns the compact team memberships for the team. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.get_team_memberships_for_team(team_gid, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param str team_gid: Globally unique identifier for the team. (required) - :param int limit: Results per page. The number of objects to return per page. The value must be between 1 and 100. - :param str offset: 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 list[str] opt_fields: This endpoint returns a compact resource, which excludes some properties by default. To include those optional properties, set this query parameter to a comma-separated list of the properties you wish to include. - :return: TeamMembershipResponseArray - If the method is called asynchronously, - returns the request thread. - """ - kwargs['_return_http_data_only'] = True - if kwargs.get('async_req'): - return self.get_team_memberships_for_team_with_http_info(team_gid, **kwargs) # noqa: E501 - else: - (data) = self.get_team_memberships_for_team_with_http_info(team_gid, **kwargs) # noqa: E501 - return data - - def get_team_memberships_for_team_with_http_info(self, team_gid, **kwargs): # noqa: E501 - """Get memberships from a team # noqa: E501 - - Returns the compact team memberships for the team. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.get_team_memberships_for_team_with_http_info(team_gid, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param str team_gid: Globally unique identifier for the team. (required) - :param int limit: Results per page. The number of objects to return per page. The value must be between 1 and 100. - :param str offset: 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 list[str] opt_fields: This endpoint returns a compact resource, which excludes some properties by default. To include those optional properties, set this query parameter to a comma-separated list of the properties you wish to include. - :return: TeamMembershipResponseArray - If the method is called asynchronously, - returns the request thread. - """ - - all_params = ['team_gid', 'limit', 'offset', 'opt_fields'] # noqa: E501 - all_params.append('async_req') - all_params.append('_return_http_data_only') - all_params.append('_preload_content') - all_params.append('_request_timeout') - - params = locals() - for key, val in six.iteritems(params['kwargs']): - if key not in all_params: - raise TypeError( - "Got an unexpected keyword argument '%s'" - " to method get_team_memberships_for_team" % key - ) - params[key] = val - del params['kwargs'] - # verify the required parameter 'team_gid' is set - if ('team_gid' not in params or - params['team_gid'] is None): - raise ValueError("Missing the required parameter `team_gid` when calling `get_team_memberships_for_team`") # noqa: E501 - - collection_formats = {} - - path_params = {} - if 'team_gid' in params: - path_params['team_gid'] = params['team_gid'] # noqa: E501 - - query_params = [] - if 'limit' in params: - query_params.append(('limit', params['limit'])) # noqa: E501 - if 'offset' in params: - query_params.append(('offset', params['offset'])) # noqa: E501 - if 'opt_fields' in params: - query_params.append(('opt_fields', params['opt_fields'])) # noqa: E501 - collection_formats['opt_fields'] = 'csv' # noqa: E501 - - header_params = {} - - form_params = [] - local_var_files = {} - - body_params = None - # HTTP header `Accept` - header_params['Accept'] = self.api_client.select_header_accept( - ['application/json; charset=UTF-8']) # noqa: E501 - - # Authentication setting - auth_settings = ['oauth2'] # noqa: E501 - - return self.api_client.call_api( - '/teams/{team_gid}/team_memberships', 'GET', - path_params, - query_params, - header_params, - body=body_params, - post_params=form_params, - files=local_var_files, - response_type='TeamMembershipResponseArray', # noqa: E501 - auth_settings=auth_settings, - async_req=params.get('async_req'), - _return_http_data_only=params.get('_return_http_data_only'), - _preload_content=params.get('_preload_content', True), - _request_timeout=params.get('_request_timeout'), - collection_formats=collection_formats) - - def get_team_memberships_for_user(self, user_gid, workspace, **kwargs): # noqa: E501 - """Get memberships from a user # noqa: E501 - - Returns the compact team membership records for the user. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.get_team_memberships_for_user(user_gid, workspace, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param str user_gid: A string identifying a user. This can either be the string \"me\", an email, or the gid of a user. (required) - :param str workspace: Globally unique identifier for the workspace. (required) - :param int limit: Results per page. The number of objects to return per page. The value must be between 1 and 100. - :param str offset: 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 list[str] opt_fields: This endpoint returns a compact resource, which excludes some properties by default. To include those optional properties, set this query parameter to a comma-separated list of the properties you wish to include. - :return: TeamMembershipResponseArray - If the method is called asynchronously, - returns the request thread. - """ - kwargs['_return_http_data_only'] = True - if kwargs.get('async_req'): - return self.get_team_memberships_for_user_with_http_info(user_gid, workspace, **kwargs) # noqa: E501 - else: - (data) = self.get_team_memberships_for_user_with_http_info(user_gid, workspace, **kwargs) # noqa: E501 - return data - - def get_team_memberships_for_user_with_http_info(self, user_gid, workspace, **kwargs): # noqa: E501 - """Get memberships from a user # noqa: E501 - - Returns the compact team membership records for the user. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.get_team_memberships_for_user_with_http_info(user_gid, workspace, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param str user_gid: A string identifying a user. This can either be the string \"me\", an email, or the gid of a user. (required) - :param str workspace: Globally unique identifier for the workspace. (required) - :param int limit: Results per page. The number of objects to return per page. The value must be between 1 and 100. - :param str offset: 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 list[str] opt_fields: This endpoint returns a compact resource, which excludes some properties by default. To include those optional properties, set this query parameter to a comma-separated list of the properties you wish to include. - :return: TeamMembershipResponseArray - If the method is called asynchronously, - returns the request thread. - """ - - all_params = ['user_gid', 'workspace', 'limit', 'offset', 'opt_fields'] # noqa: E501 - all_params.append('async_req') - all_params.append('_return_http_data_only') - all_params.append('_preload_content') - all_params.append('_request_timeout') - - params = locals() - for key, val in six.iteritems(params['kwargs']): - if key not in all_params: - raise TypeError( - "Got an unexpected keyword argument '%s'" - " to method get_team_memberships_for_user" % key - ) - params[key] = val - del params['kwargs'] - # verify the required parameter 'user_gid' is set - if ('user_gid' not in params or - params['user_gid'] is None): - raise ValueError("Missing the required parameter `user_gid` when calling `get_team_memberships_for_user`") # noqa: E501 - # verify the required parameter 'workspace' is set - if ('workspace' not in params or - params['workspace'] is None): - raise ValueError("Missing the required parameter `workspace` when calling `get_team_memberships_for_user`") # noqa: E501 - - collection_formats = {} - - path_params = {} - if 'user_gid' in params: - path_params['user_gid'] = params['user_gid'] # noqa: E501 - - query_params = [] - if 'limit' in params: - query_params.append(('limit', params['limit'])) # noqa: E501 - if 'offset' in params: - query_params.append(('offset', params['offset'])) # noqa: E501 - if 'workspace' in params: - query_params.append(('workspace', params['workspace'])) # noqa: E501 - if 'opt_fields' in params: - query_params.append(('opt_fields', params['opt_fields'])) # noqa: E501 - collection_formats['opt_fields'] = 'csv' # noqa: E501 - - header_params = {} - - form_params = [] - local_var_files = {} - - body_params = None - # HTTP header `Accept` - header_params['Accept'] = self.api_client.select_header_accept( - ['application/json; charset=UTF-8']) # noqa: E501 - - # Authentication setting - auth_settings = ['oauth2'] # noqa: E501 - - return self.api_client.call_api( - '/users/{user_gid}/team_memberships', 'GET', - path_params, - query_params, - header_params, - body=body_params, - post_params=form_params, - files=local_var_files, - response_type='TeamMembershipResponseArray', # noqa: E501 - auth_settings=auth_settings, - async_req=params.get('async_req'), - _return_http_data_only=params.get('_return_http_data_only'), - _preload_content=params.get('_preload_content', True), - _request_timeout=params.get('_request_timeout'), - collection_formats=collection_formats) + all_params = ['user_gid', 'workspace', 'limit', 'offset', 'opt_fields'] # noqa: E501 + all_params.append('async_req') + all_params.append('header_params') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + params = locals() + for key, val in six.iteritems(params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method get_team_memberships_for_user" % key + ) + params[key] = val + del params['kwargs'] + # verify the required parameter 'user_gid' is set + if ('user_gid' not in params or + params['user_gid'] is None): + raise ValueError("Missing the required parameter `user_gid` when calling `get_team_memberships_for_user`") # noqa: E501 + # verify the required parameter 'workspace' is set + if ('workspace' not in params or + params['workspace'] is None): + raise ValueError("Missing the required parameter `workspace` when calling `get_team_memberships_for_user`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'user_gid' in params: + path_params['user_gid'] = params['user_gid'] # noqa: E501 + + query_params = [] + if 'limit' in params: + query_params.append(('limit', params['limit'])) # noqa: E501 + if 'offset' in params: + query_params.append(('offset', params['offset'])) # noqa: E501 + if 'workspace' in params: + query_params.append(('workspace', params['workspace'])) # noqa: E501 + if 'opt_fields' in params: + query_params.append(('opt_fields', params['opt_fields'])) # noqa: E501 + collection_formats['opt_fields'] = 'csv' # noqa: E501 + + header_params = kwargs.get("header_params", {}) + + form_params = [] + local_var_files = {} + + body_params = None + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['application/json; charset=UTF-8']) # noqa: E501 + + # Authentication setting + auth_settings = ['oauth2'] # noqa: E501 + + return self.api_client.call_api( + '/users/{user_gid}/team_memberships', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='TeamMembershipResponseArray', # noqa: E501 + auth_settings=auth_settings, + async_req=params.get('async_req'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) diff --git a/asana/api/teams_api.py b/asana/api/teams_api.py index c0376d77..829ac641 100644 --- a/asana/api/teams_api.py +++ b/asana/api/teams_api.py @@ -21,772 +21,779 @@ class TeamsApi(object): - """NOTE: This class is auto generated by the swagger code generator program. +"""NOTE: This class is auto generated by the swagger code generator program. - Do not edit the class manually. - Ref: https://github.com/swagger-api/swagger-codegen +Do not edit the class manually. +Ref: https://github.com/swagger-api/swagger-codegen +""" + +def __init__(self, api_client=None): + if api_client is None: + api_client = ApiClient() + self.api_client = api_client + +def add_user_for_team(self, body, team_gid, **kwargs): # noqa: E501 + """Add a user to a team # noqa: E501 + + The user making this call must be a member of the team in order to add others. The user being added must exist in the same organization as the team. Returns the complete team membership record for the newly added user. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.add_user_for_team(body, team_gid, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param TeamGidAddUserBody body: The user to add to the team. (required) + :param str team_gid: Globally unique identifier for the team. (required) + :param list[str] opt_fields: This endpoint returns a compact resource, which excludes some properties by default. To include those optional properties, set this query parameter to a comma-separated list of the properties you wish to include. + :return: TeamMembershipResponseData + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = kwargs.get("_return_http_data_only", True) + if kwargs.get('async_req'): + return self.add_user_for_team_with_http_info(body, team_gid, **kwargs) # noqa: E501 + else: + (data) = self.add_user_for_team_with_http_info(body, team_gid, **kwargs) # noqa: E501 + return data + +def add_user_for_team_with_http_info(self, body, team_gid, **kwargs): # noqa: E501 + """Add a user to a team # noqa: E501 + + The user making this call must be a member of the team in order to add others. The user being added must exist in the same organization as the team. Returns the complete team membership record for the newly added user. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.add_user_for_team_with_http_info(body, team_gid, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param TeamGidAddUserBody body: The user to add to the team. (required) + :param str team_gid: Globally unique identifier for the team. (required) + :param list[str] opt_fields: This endpoint returns a compact resource, which excludes some properties by default. To include those optional properties, set this query parameter to a comma-separated list of the properties you wish to include. + :return: TeamMembershipResponseData + If the method is called asynchronously, + returns the request thread. + """ + + all_params = ['body', 'team_gid', 'opt_fields'] # noqa: E501 + all_params.append('async_req') + all_params.append('header_params') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + params = locals() + for key, val in six.iteritems(params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method add_user_for_team" % key + ) + params[key] = val + del params['kwargs'] + # verify the required parameter 'body' is set + if ('body' not in params or + params['body'] is None): + raise ValueError("Missing the required parameter `body` when calling `add_user_for_team`") # noqa: E501 + # verify the required parameter 'team_gid' is set + if ('team_gid' not in params or + params['team_gid'] is None): + raise ValueError("Missing the required parameter `team_gid` when calling `add_user_for_team`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'team_gid' in params: + path_params['team_gid'] = params['team_gid'] # noqa: E501 + + query_params = [] + if 'opt_fields' in params: + query_params.append(('opt_fields', params['opt_fields'])) # noqa: E501 + collection_formats['opt_fields'] = 'csv' # noqa: E501 + + header_params = kwargs.get("header_params", {}) + + form_params = [] + local_var_files = {} + + body_params = None + if 'body' in params: + body_params = params['body'] + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['application/json; charset=UTF-8']) # noqa: E501 + + # HTTP header `Content-Type` + header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 + ['application/json; charset=UTF-8']) # noqa: E501 + + # Authentication setting + auth_settings = ['oauth2'] # noqa: E501 + + return self.api_client.call_api( + '/teams/{team_gid}/addUser', 'POST', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='TeamMembershipResponseData', # noqa: E501 + auth_settings=auth_settings, + async_req=params.get('async_req'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) + +def create_team(self, body, **kwargs): # noqa: E501 + """Create a team # noqa: E501 + + Creates a team within the current workspace. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.create_team(body, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param TeamsBody body: The team to create. (required) + :param list[str] opt_fields: This endpoint returns a compact resource, which excludes some properties by default. To include those optional properties, set this query parameter to a comma-separated list of the properties you wish to include. + :return: TeamResponseData + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = kwargs.get("_return_http_data_only", True) + if kwargs.get('async_req'): + return self.create_team_with_http_info(body, **kwargs) # noqa: E501 + else: + (data) = self.create_team_with_http_info(body, **kwargs) # noqa: E501 + return data + +def create_team_with_http_info(self, body, **kwargs): # noqa: E501 + """Create a team # noqa: E501 + + Creates a team within the current workspace. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.create_team_with_http_info(body, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param TeamsBody body: The team to create. (required) + :param list[str] opt_fields: This endpoint returns a compact resource, which excludes some properties by default. To include those optional properties, set this query parameter to a comma-separated list of the properties you wish to include. + :return: TeamResponseData + If the method is called asynchronously, + returns the request thread. + """ + + all_params = ['body', 'opt_fields'] # noqa: E501 + all_params.append('async_req') + all_params.append('header_params') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + params = locals() + for key, val in six.iteritems(params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method create_team" % key + ) + params[key] = val + del params['kwargs'] + # verify the required parameter 'body' is set + if ('body' not in params or + params['body'] is None): + raise ValueError("Missing the required parameter `body` when calling `create_team`") # noqa: E501 + + collection_formats = {} + + path_params = {} + + query_params = [] + if 'opt_fields' in params: + query_params.append(('opt_fields', params['opt_fields'])) # noqa: E501 + collection_formats['opt_fields'] = 'csv' # noqa: E501 + + header_params = kwargs.get("header_params", {}) + + form_params = [] + local_var_files = {} + + body_params = None + if 'body' in params: + body_params = params['body'] + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['application/json; charset=UTF-8']) # noqa: E501 + + # HTTP header `Content-Type` + header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 + ['application/json; charset=UTF-8']) # noqa: E501 + + # Authentication setting + auth_settings = ['oauth2'] # noqa: E501 + + return self.api_client.call_api( + '/teams', 'POST', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='TeamResponseData', # noqa: E501 + auth_settings=auth_settings, + async_req=params.get('async_req'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) + +def get_team(self, team_gid, **kwargs): # noqa: E501 + """Get a team # noqa: E501 + + Returns the full record for a single team. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.get_team(team_gid, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str team_gid: Globally unique identifier for the team. (required) + :param list[str] opt_fields: This endpoint returns a compact resource, which excludes some properties by default. To include those optional properties, set this query parameter to a comma-separated list of the properties you wish to include. + :return: TeamResponseData + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = kwargs.get("_return_http_data_only", True) + if kwargs.get('async_req'): + return self.get_team_with_http_info(team_gid, **kwargs) # noqa: E501 + else: + (data) = self.get_team_with_http_info(team_gid, **kwargs) # noqa: E501 + return data + +def get_team_with_http_info(self, team_gid, **kwargs): # noqa: E501 + """Get a team # noqa: E501 + + Returns the full record for a single team. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.get_team_with_http_info(team_gid, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str team_gid: Globally unique identifier for the team. (required) + :param list[str] opt_fields: This endpoint returns a compact resource, which excludes some properties by default. To include those optional properties, set this query parameter to a comma-separated list of the properties you wish to include. + :return: TeamResponseData + If the method is called asynchronously, + returns the request thread. + """ + + all_params = ['team_gid', 'opt_fields'] # noqa: E501 + all_params.append('async_req') + all_params.append('header_params') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + params = locals() + for key, val in six.iteritems(params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method get_team" % key + ) + params[key] = val + del params['kwargs'] + # verify the required parameter 'team_gid' is set + if ('team_gid' not in params or + params['team_gid'] is None): + raise ValueError("Missing the required parameter `team_gid` when calling `get_team`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'team_gid' in params: + path_params['team_gid'] = params['team_gid'] # noqa: E501 + + query_params = [] + if 'opt_fields' in params: + query_params.append(('opt_fields', params['opt_fields'])) # noqa: E501 + collection_formats['opt_fields'] = 'csv' # noqa: E501 + + header_params = kwargs.get("header_params", {}) + + form_params = [] + local_var_files = {} + + body_params = None + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['application/json; charset=UTF-8']) # noqa: E501 + + # Authentication setting + auth_settings = ['oauth2'] # noqa: E501 + + return self.api_client.call_api( + '/teams/{team_gid}', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='TeamResponseData', # noqa: E501 + auth_settings=auth_settings, + async_req=params.get('async_req'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) + +def get_teams_for_user(self, user_gid, organization, **kwargs): # noqa: E501 + """Get teams for a user # noqa: E501 + + Returns the compact records for all teams to which the given user is assigned. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.get_teams_for_user(user_gid, organization, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str user_gid: A string identifying a user. This can either be the string \"me\", an email, or the gid of a user. (required) + :param str organization: The workspace or organization to filter teams on. (required) + :param int limit: Results per page. The number of objects to return per page. The value must be between 1 and 100. + :param str offset: 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 list[str] opt_fields: This endpoint returns a compact resource, which excludes some properties by default. To include those optional properties, set this query parameter to a comma-separated list of the properties you wish to include. + :return: TeamResponseArray + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = kwargs.get("_return_http_data_only", True) + if kwargs.get('async_req'): + return self.get_teams_for_user_with_http_info(user_gid, organization, **kwargs) # noqa: E501 + else: + (data) = self.get_teams_for_user_with_http_info(user_gid, organization, **kwargs) # noqa: E501 + return data + +def get_teams_for_user_with_http_info(self, user_gid, organization, **kwargs): # noqa: E501 + """Get teams for a user # noqa: E501 + + Returns the compact records for all teams to which the given user is assigned. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.get_teams_for_user_with_http_info(user_gid, organization, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str user_gid: A string identifying a user. This can either be the string \"me\", an email, or the gid of a user. (required) + :param str organization: The workspace or organization to filter teams on. (required) + :param int limit: Results per page. The number of objects to return per page. The value must be between 1 and 100. + :param str offset: 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 list[str] opt_fields: This endpoint returns a compact resource, which excludes some properties by default. To include those optional properties, set this query parameter to a comma-separated list of the properties you wish to include. + :return: TeamResponseArray + If the method is called asynchronously, + returns the request thread. + """ + + all_params = ['user_gid', 'organization', 'limit', 'offset', 'opt_fields'] # noqa: E501 + all_params.append('async_req') + all_params.append('header_params') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + params = locals() + for key, val in six.iteritems(params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method get_teams_for_user" % key + ) + params[key] = val + del params['kwargs'] + # verify the required parameter 'user_gid' is set + if ('user_gid' not in params or + params['user_gid'] is None): + raise ValueError("Missing the required parameter `user_gid` when calling `get_teams_for_user`") # noqa: E501 + # verify the required parameter 'organization' is set + if ('organization' not in params or + params['organization'] is None): + raise ValueError("Missing the required parameter `organization` when calling `get_teams_for_user`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'user_gid' in params: + path_params['user_gid'] = params['user_gid'] # noqa: E501 + + query_params = [] + if 'limit' in params: + query_params.append(('limit', params['limit'])) # noqa: E501 + if 'offset' in params: + query_params.append(('offset', params['offset'])) # noqa: E501 + if 'organization' in params: + query_params.append(('organization', params['organization'])) # noqa: E501 + if 'opt_fields' in params: + query_params.append(('opt_fields', params['opt_fields'])) # noqa: E501 + collection_formats['opt_fields'] = 'csv' # noqa: E501 + + header_params = kwargs.get("header_params", {}) + + form_params = [] + local_var_files = {} + + body_params = None + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['application/json; charset=UTF-8']) # noqa: E501 + + # Authentication setting + auth_settings = ['oauth2'] # noqa: E501 + + return self.api_client.call_api( + '/users/{user_gid}/teams', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='TeamResponseArray', # noqa: E501 + auth_settings=auth_settings, + async_req=params.get('async_req'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) + +def get_teams_for_workspace(self, workspace_gid, **kwargs): # noqa: E501 + """Get teams in a workspace # noqa: E501 + + Returns the compact records for all teams in the workspace visible to the authorized user. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.get_teams_for_workspace(workspace_gid, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str workspace_gid: Globally unique identifier for the workspace or organization. (required) + :param int limit: Results per page. The number of objects to return per page. The value must be between 1 and 100. + :param str offset: 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 list[str] opt_fields: This endpoint returns a compact resource, which excludes some properties by default. To include those optional properties, set this query parameter to a comma-separated list of the properties you wish to include. + :return: TeamResponseArray + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = kwargs.get("_return_http_data_only", True) + if kwargs.get('async_req'): + return self.get_teams_for_workspace_with_http_info(workspace_gid, **kwargs) # noqa: E501 + else: + (data) = self.get_teams_for_workspace_with_http_info(workspace_gid, **kwargs) # noqa: E501 + return data + +def get_teams_for_workspace_with_http_info(self, workspace_gid, **kwargs): # noqa: E501 + """Get teams in a workspace # noqa: E501 + + Returns the compact records for all teams in the workspace visible to the authorized user. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.get_teams_for_workspace_with_http_info(workspace_gid, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str workspace_gid: Globally unique identifier for the workspace or organization. (required) + :param int limit: Results per page. The number of objects to return per page. The value must be between 1 and 100. + :param str offset: 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 list[str] opt_fields: This endpoint returns a compact resource, which excludes some properties by default. To include those optional properties, set this query parameter to a comma-separated list of the properties you wish to include. + :return: TeamResponseArray + If the method is called asynchronously, + returns the request thread. + """ + + all_params = ['workspace_gid', 'limit', 'offset', 'opt_fields'] # noqa: E501 + all_params.append('async_req') + all_params.append('header_params') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + params = locals() + for key, val in six.iteritems(params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method get_teams_for_workspace" % key + ) + params[key] = val + del params['kwargs'] + # verify the required parameter 'workspace_gid' is set + if ('workspace_gid' not in params or + params['workspace_gid'] is None): + raise ValueError("Missing the required parameter `workspace_gid` when calling `get_teams_for_workspace`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'workspace_gid' in params: + path_params['workspace_gid'] = params['workspace_gid'] # noqa: E501 + + query_params = [] + if 'limit' in params: + query_params.append(('limit', params['limit'])) # noqa: E501 + if 'offset' in params: + query_params.append(('offset', params['offset'])) # noqa: E501 + if 'opt_fields' in params: + query_params.append(('opt_fields', params['opt_fields'])) # noqa: E501 + collection_formats['opt_fields'] = 'csv' # noqa: E501 + + header_params = kwargs.get("header_params", {}) + + form_params = [] + local_var_files = {} + + body_params = None + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['application/json; charset=UTF-8']) # noqa: E501 + + # Authentication setting + auth_settings = ['oauth2'] # noqa: E501 + + return self.api_client.call_api( + '/workspaces/{workspace_gid}/teams', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='TeamResponseArray', # noqa: E501 + auth_settings=auth_settings, + async_req=params.get('async_req'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) + +def remove_user_for_team(self, body, team_gid, **kwargs): # noqa: E501 + """Remove a user from a team # noqa: E501 + + The user making this call must be a member of the team in order to remove themselves or others. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.remove_user_for_team(body, team_gid, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param TeamGidRemoveUserBody body: The user to remove from the team. (required) + :param str team_gid: Globally unique identifier for the team. (required) + :return: EmptyResponseData + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = kwargs.get("_return_http_data_only", True) + if kwargs.get('async_req'): + return self.remove_user_for_team_with_http_info(body, team_gid, **kwargs) # noqa: E501 + else: + (data) = self.remove_user_for_team_with_http_info(body, team_gid, **kwargs) # noqa: E501 + return data + +def remove_user_for_team_with_http_info(self, body, team_gid, **kwargs): # noqa: E501 + """Remove a user from a team # noqa: E501 + + The user making this call must be a member of the team in order to remove themselves or others. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.remove_user_for_team_with_http_info(body, team_gid, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param TeamGidRemoveUserBody body: The user to remove from the team. (required) + :param str team_gid: Globally unique identifier for the team. (required) + :return: EmptyResponseData + If the method is called asynchronously, + returns the request thread. + """ + + all_params = ['body', 'team_gid'] # noqa: E501 + all_params.append('async_req') + all_params.append('header_params') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + params = locals() + for key, val in six.iteritems(params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method remove_user_for_team" % key + ) + params[key] = val + del params['kwargs'] + # verify the required parameter 'body' is set + if ('body' not in params or + params['body'] is None): + raise ValueError("Missing the required parameter `body` when calling `remove_user_for_team`") # noqa: E501 + # verify the required parameter 'team_gid' is set + if ('team_gid' not in params or + params['team_gid'] is None): + raise ValueError("Missing the required parameter `team_gid` when calling `remove_user_for_team`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'team_gid' in params: + path_params['team_gid'] = params['team_gid'] # noqa: E501 + + query_params = [] + + header_params = kwargs.get("header_params", {}) + + form_params = [] + local_var_files = {} + + body_params = None + if 'body' in params: + body_params = params['body'] + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['application/json; charset=UTF-8']) # noqa: E501 + + # HTTP header `Content-Type` + header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 + ['application/json; charset=UTF-8']) # noqa: E501 + + # Authentication setting + auth_settings = ['oauth2'] # noqa: E501 + + return self.api_client.call_api( + '/teams/{team_gid}/removeUser', 'POST', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='EmptyResponseData', # noqa: E501 + auth_settings=auth_settings, + async_req=params.get('async_req'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) + +def update_team(self, body, team_gid, **kwargs): # noqa: E501 + """Update a team # noqa: E501 + + Updates a team within the current workspace. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.update_team(body, team_gid, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param TeamsTeamGidBody body: The team to update. (required) + :param str team_gid: Globally unique identifier for the team. (required) + :param list[str] opt_fields: This endpoint returns a compact resource, which excludes some properties by default. To include those optional properties, set this query parameter to a comma-separated list of the properties you wish to include. + :return: TeamResponseData + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = kwargs.get("_return_http_data_only", True) + if kwargs.get('async_req'): + return self.update_team_with_http_info(body, team_gid, **kwargs) # noqa: E501 + else: + (data) = self.update_team_with_http_info(body, team_gid, **kwargs) # noqa: E501 + return data + +def update_team_with_http_info(self, body, team_gid, **kwargs): # noqa: E501 + """Update a team # noqa: E501 + + Updates a team within the current workspace. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.update_team_with_http_info(body, team_gid, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param TeamsTeamGidBody body: The team to update. (required) + :param str team_gid: Globally unique identifier for the team. (required) + :param list[str] opt_fields: This endpoint returns a compact resource, which excludes some properties by default. To include those optional properties, set this query parameter to a comma-separated list of the properties you wish to include. + :return: TeamResponseData + If the method is called asynchronously, + returns the request thread. """ - def __init__(self, api_client=None): - if api_client is None: - api_client = ApiClient() - self.api_client = api_client - - def add_user_for_team(self, body, team_gid, **kwargs): # noqa: E501 - """Add a user to a team # noqa: E501 - - The user making this call must be a member of the team in order to add others. The user being added must exist in the same organization as the team. Returns the complete team membership record for the newly added user. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.add_user_for_team(body, team_gid, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param TeamGidAddUserBody body: The user to add to the team. (required) - :param str team_gid: Globally unique identifier for the team. (required) - :param list[str] opt_fields: This endpoint returns a compact resource, which excludes some properties by default. To include those optional properties, set this query parameter to a comma-separated list of the properties you wish to include. - :return: TeamMembershipResponseData - If the method is called asynchronously, - returns the request thread. - """ - kwargs['_return_http_data_only'] = True - if kwargs.get('async_req'): - return self.add_user_for_team_with_http_info(body, team_gid, **kwargs) # noqa: E501 - else: - (data) = self.add_user_for_team_with_http_info(body, team_gid, **kwargs) # noqa: E501 - return data - - def add_user_for_team_with_http_info(self, body, team_gid, **kwargs): # noqa: E501 - """Add a user to a team # noqa: E501 - - The user making this call must be a member of the team in order to add others. The user being added must exist in the same organization as the team. Returns the complete team membership record for the newly added user. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.add_user_for_team_with_http_info(body, team_gid, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param TeamGidAddUserBody body: The user to add to the team. (required) - :param str team_gid: Globally unique identifier for the team. (required) - :param list[str] opt_fields: This endpoint returns a compact resource, which excludes some properties by default. To include those optional properties, set this query parameter to a comma-separated list of the properties you wish to include. - :return: TeamMembershipResponseData - If the method is called asynchronously, - returns the request thread. - """ - - all_params = ['body', 'team_gid', 'opt_fields'] # noqa: E501 - all_params.append('async_req') - all_params.append('_return_http_data_only') - all_params.append('_preload_content') - all_params.append('_request_timeout') - - params = locals() - for key, val in six.iteritems(params['kwargs']): - if key not in all_params: - raise TypeError( - "Got an unexpected keyword argument '%s'" - " to method add_user_for_team" % key - ) - params[key] = val - del params['kwargs'] - # verify the required parameter 'body' is set - if ('body' not in params or - params['body'] is None): - raise ValueError("Missing the required parameter `body` when calling `add_user_for_team`") # noqa: E501 - # verify the required parameter 'team_gid' is set - if ('team_gid' not in params or - params['team_gid'] is None): - raise ValueError("Missing the required parameter `team_gid` when calling `add_user_for_team`") # noqa: E501 - - collection_formats = {} - - path_params = {} - if 'team_gid' in params: - path_params['team_gid'] = params['team_gid'] # noqa: E501 - - query_params = [] - if 'opt_fields' in params: - query_params.append(('opt_fields', params['opt_fields'])) # noqa: E501 - collection_formats['opt_fields'] = 'csv' # noqa: E501 - - header_params = {} - - form_params = [] - local_var_files = {} - - body_params = None - if 'body' in params: - body_params = params['body'] - # HTTP header `Accept` - header_params['Accept'] = self.api_client.select_header_accept( - ['application/json; charset=UTF-8']) # noqa: E501 - - # HTTP header `Content-Type` - header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 - ['application/json; charset=UTF-8']) # noqa: E501 - - # Authentication setting - auth_settings = ['oauth2'] # noqa: E501 - - return self.api_client.call_api( - '/teams/{team_gid}/addUser', 'POST', - path_params, - query_params, - header_params, - body=body_params, - post_params=form_params, - files=local_var_files, - response_type='TeamMembershipResponseData', # noqa: E501 - auth_settings=auth_settings, - async_req=params.get('async_req'), - _return_http_data_only=params.get('_return_http_data_only'), - _preload_content=params.get('_preload_content', True), - _request_timeout=params.get('_request_timeout'), - collection_formats=collection_formats) - - def create_team(self, body, **kwargs): # noqa: E501 - """Create a team # noqa: E501 - - Creates a team within the current workspace. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.create_team(body, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param TeamsBody body: The team to create. (required) - :param list[str] opt_fields: This endpoint returns a compact resource, which excludes some properties by default. To include those optional properties, set this query parameter to a comma-separated list of the properties you wish to include. - :return: TeamResponseData - If the method is called asynchronously, - returns the request thread. - """ - kwargs['_return_http_data_only'] = True - if kwargs.get('async_req'): - return self.create_team_with_http_info(body, **kwargs) # noqa: E501 - else: - (data) = self.create_team_with_http_info(body, **kwargs) # noqa: E501 - return data - - def create_team_with_http_info(self, body, **kwargs): # noqa: E501 - """Create a team # noqa: E501 - - Creates a team within the current workspace. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.create_team_with_http_info(body, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param TeamsBody body: The team to create. (required) - :param list[str] opt_fields: This endpoint returns a compact resource, which excludes some properties by default. To include those optional properties, set this query parameter to a comma-separated list of the properties you wish to include. - :return: TeamResponseData - If the method is called asynchronously, - returns the request thread. - """ - - all_params = ['body', 'opt_fields'] # noqa: E501 - all_params.append('async_req') - all_params.append('_return_http_data_only') - all_params.append('_preload_content') - all_params.append('_request_timeout') - - params = locals() - for key, val in six.iteritems(params['kwargs']): - if key not in all_params: - raise TypeError( - "Got an unexpected keyword argument '%s'" - " to method create_team" % key - ) - params[key] = val - del params['kwargs'] - # verify the required parameter 'body' is set - if ('body' not in params or - params['body'] is None): - raise ValueError("Missing the required parameter `body` when calling `create_team`") # noqa: E501 - - collection_formats = {} - - path_params = {} - - query_params = [] - if 'opt_fields' in params: - query_params.append(('opt_fields', params['opt_fields'])) # noqa: E501 - collection_formats['opt_fields'] = 'csv' # noqa: E501 - - header_params = {} - - form_params = [] - local_var_files = {} - - body_params = None - if 'body' in params: - body_params = params['body'] - # HTTP header `Accept` - header_params['Accept'] = self.api_client.select_header_accept( - ['application/json; charset=UTF-8']) # noqa: E501 - - # HTTP header `Content-Type` - header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 - ['application/json; charset=UTF-8']) # noqa: E501 - - # Authentication setting - auth_settings = ['oauth2'] # noqa: E501 - - return self.api_client.call_api( - '/teams', 'POST', - path_params, - query_params, - header_params, - body=body_params, - post_params=form_params, - files=local_var_files, - response_type='TeamResponseData', # noqa: E501 - auth_settings=auth_settings, - async_req=params.get('async_req'), - _return_http_data_only=params.get('_return_http_data_only'), - _preload_content=params.get('_preload_content', True), - _request_timeout=params.get('_request_timeout'), - collection_formats=collection_formats) - - def get_team(self, team_gid, **kwargs): # noqa: E501 - """Get a team # noqa: E501 - - Returns the full record for a single team. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.get_team(team_gid, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param str team_gid: Globally unique identifier for the team. (required) - :param list[str] opt_fields: This endpoint returns a compact resource, which excludes some properties by default. To include those optional properties, set this query parameter to a comma-separated list of the properties you wish to include. - :return: TeamResponseData - If the method is called asynchronously, - returns the request thread. - """ - kwargs['_return_http_data_only'] = True - if kwargs.get('async_req'): - return self.get_team_with_http_info(team_gid, **kwargs) # noqa: E501 - else: - (data) = self.get_team_with_http_info(team_gid, **kwargs) # noqa: E501 - return data - - def get_team_with_http_info(self, team_gid, **kwargs): # noqa: E501 - """Get a team # noqa: E501 - - Returns the full record for a single team. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.get_team_with_http_info(team_gid, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param str team_gid: Globally unique identifier for the team. (required) - :param list[str] opt_fields: This endpoint returns a compact resource, which excludes some properties by default. To include those optional properties, set this query parameter to a comma-separated list of the properties you wish to include. - :return: TeamResponseData - If the method is called asynchronously, - returns the request thread. - """ - - all_params = ['team_gid', 'opt_fields'] # noqa: E501 - all_params.append('async_req') - all_params.append('_return_http_data_only') - all_params.append('_preload_content') - all_params.append('_request_timeout') - - params = locals() - for key, val in six.iteritems(params['kwargs']): - if key not in all_params: - raise TypeError( - "Got an unexpected keyword argument '%s'" - " to method get_team" % key - ) - params[key] = val - del params['kwargs'] - # verify the required parameter 'team_gid' is set - if ('team_gid' not in params or - params['team_gid'] is None): - raise ValueError("Missing the required parameter `team_gid` when calling `get_team`") # noqa: E501 - - collection_formats = {} - - path_params = {} - if 'team_gid' in params: - path_params['team_gid'] = params['team_gid'] # noqa: E501 - - query_params = [] - if 'opt_fields' in params: - query_params.append(('opt_fields', params['opt_fields'])) # noqa: E501 - collection_formats['opt_fields'] = 'csv' # noqa: E501 - - header_params = {} - - form_params = [] - local_var_files = {} - - body_params = None - # HTTP header `Accept` - header_params['Accept'] = self.api_client.select_header_accept( - ['application/json; charset=UTF-8']) # noqa: E501 - - # Authentication setting - auth_settings = ['oauth2'] # noqa: E501 - - return self.api_client.call_api( - '/teams/{team_gid}', 'GET', - path_params, - query_params, - header_params, - body=body_params, - post_params=form_params, - files=local_var_files, - response_type='TeamResponseData', # noqa: E501 - auth_settings=auth_settings, - async_req=params.get('async_req'), - _return_http_data_only=params.get('_return_http_data_only'), - _preload_content=params.get('_preload_content', True), - _request_timeout=params.get('_request_timeout'), - collection_formats=collection_formats) - - def get_teams_for_user(self, user_gid, organization, **kwargs): # noqa: E501 - """Get teams for a user # noqa: E501 - - Returns the compact records for all teams to which the given user is assigned. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.get_teams_for_user(user_gid, organization, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param str user_gid: A string identifying a user. This can either be the string \"me\", an email, or the gid of a user. (required) - :param str organization: The workspace or organization to filter teams on. (required) - :param int limit: Results per page. The number of objects to return per page. The value must be between 1 and 100. - :param str offset: 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 list[str] opt_fields: This endpoint returns a compact resource, which excludes some properties by default. To include those optional properties, set this query parameter to a comma-separated list of the properties you wish to include. - :return: TeamResponseArray - If the method is called asynchronously, - returns the request thread. - """ - kwargs['_return_http_data_only'] = True - if kwargs.get('async_req'): - return self.get_teams_for_user_with_http_info(user_gid, organization, **kwargs) # noqa: E501 - else: - (data) = self.get_teams_for_user_with_http_info(user_gid, organization, **kwargs) # noqa: E501 - return data - - def get_teams_for_user_with_http_info(self, user_gid, organization, **kwargs): # noqa: E501 - """Get teams for a user # noqa: E501 - - Returns the compact records for all teams to which the given user is assigned. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.get_teams_for_user_with_http_info(user_gid, organization, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param str user_gid: A string identifying a user. This can either be the string \"me\", an email, or the gid of a user. (required) - :param str organization: The workspace or organization to filter teams on. (required) - :param int limit: Results per page. The number of objects to return per page. The value must be between 1 and 100. - :param str offset: 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 list[str] opt_fields: This endpoint returns a compact resource, which excludes some properties by default. To include those optional properties, set this query parameter to a comma-separated list of the properties you wish to include. - :return: TeamResponseArray - If the method is called asynchronously, - returns the request thread. - """ - - all_params = ['user_gid', 'organization', 'limit', 'offset', 'opt_fields'] # noqa: E501 - all_params.append('async_req') - all_params.append('_return_http_data_only') - all_params.append('_preload_content') - all_params.append('_request_timeout') - - params = locals() - for key, val in six.iteritems(params['kwargs']): - if key not in all_params: - raise TypeError( - "Got an unexpected keyword argument '%s'" - " to method get_teams_for_user" % key - ) - params[key] = val - del params['kwargs'] - # verify the required parameter 'user_gid' is set - if ('user_gid' not in params or - params['user_gid'] is None): - raise ValueError("Missing the required parameter `user_gid` when calling `get_teams_for_user`") # noqa: E501 - # verify the required parameter 'organization' is set - if ('organization' not in params or - params['organization'] is None): - raise ValueError("Missing the required parameter `organization` when calling `get_teams_for_user`") # noqa: E501 - - collection_formats = {} - - path_params = {} - if 'user_gid' in params: - path_params['user_gid'] = params['user_gid'] # noqa: E501 - - query_params = [] - if 'limit' in params: - query_params.append(('limit', params['limit'])) # noqa: E501 - if 'offset' in params: - query_params.append(('offset', params['offset'])) # noqa: E501 - if 'organization' in params: - query_params.append(('organization', params['organization'])) # noqa: E501 - if 'opt_fields' in params: - query_params.append(('opt_fields', params['opt_fields'])) # noqa: E501 - collection_formats['opt_fields'] = 'csv' # noqa: E501 - - header_params = {} - - form_params = [] - local_var_files = {} - - body_params = None - # HTTP header `Accept` - header_params['Accept'] = self.api_client.select_header_accept( - ['application/json; charset=UTF-8']) # noqa: E501 - - # Authentication setting - auth_settings = ['oauth2'] # noqa: E501 - - return self.api_client.call_api( - '/users/{user_gid}/teams', 'GET', - path_params, - query_params, - header_params, - body=body_params, - post_params=form_params, - files=local_var_files, - response_type='TeamResponseArray', # noqa: E501 - auth_settings=auth_settings, - async_req=params.get('async_req'), - _return_http_data_only=params.get('_return_http_data_only'), - _preload_content=params.get('_preload_content', True), - _request_timeout=params.get('_request_timeout'), - collection_formats=collection_formats) - - def get_teams_for_workspace(self, workspace_gid, **kwargs): # noqa: E501 - """Get teams in a workspace # noqa: E501 - - Returns the compact records for all teams in the workspace visible to the authorized user. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.get_teams_for_workspace(workspace_gid, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param str workspace_gid: Globally unique identifier for the workspace or organization. (required) - :param int limit: Results per page. The number of objects to return per page. The value must be between 1 and 100. - :param str offset: 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 list[str] opt_fields: This endpoint returns a compact resource, which excludes some properties by default. To include those optional properties, set this query parameter to a comma-separated list of the properties you wish to include. - :return: TeamResponseArray - If the method is called asynchronously, - returns the request thread. - """ - kwargs['_return_http_data_only'] = True - if kwargs.get('async_req'): - return self.get_teams_for_workspace_with_http_info(workspace_gid, **kwargs) # noqa: E501 - else: - (data) = self.get_teams_for_workspace_with_http_info(workspace_gid, **kwargs) # noqa: E501 - return data - - def get_teams_for_workspace_with_http_info(self, workspace_gid, **kwargs): # noqa: E501 - """Get teams in a workspace # noqa: E501 - - Returns the compact records for all teams in the workspace visible to the authorized user. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.get_teams_for_workspace_with_http_info(workspace_gid, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param str workspace_gid: Globally unique identifier for the workspace or organization. (required) - :param int limit: Results per page. The number of objects to return per page. The value must be between 1 and 100. - :param str offset: 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 list[str] opt_fields: This endpoint returns a compact resource, which excludes some properties by default. To include those optional properties, set this query parameter to a comma-separated list of the properties you wish to include. - :return: TeamResponseArray - If the method is called asynchronously, - returns the request thread. - """ - - all_params = ['workspace_gid', 'limit', 'offset', 'opt_fields'] # noqa: E501 - all_params.append('async_req') - all_params.append('_return_http_data_only') - all_params.append('_preload_content') - all_params.append('_request_timeout') - - params = locals() - for key, val in six.iteritems(params['kwargs']): - if key not in all_params: - raise TypeError( - "Got an unexpected keyword argument '%s'" - " to method get_teams_for_workspace" % key - ) - params[key] = val - del params['kwargs'] - # verify the required parameter 'workspace_gid' is set - if ('workspace_gid' not in params or - params['workspace_gid'] is None): - raise ValueError("Missing the required parameter `workspace_gid` when calling `get_teams_for_workspace`") # noqa: E501 - - collection_formats = {} - - path_params = {} - if 'workspace_gid' in params: - path_params['workspace_gid'] = params['workspace_gid'] # noqa: E501 - - query_params = [] - if 'limit' in params: - query_params.append(('limit', params['limit'])) # noqa: E501 - if 'offset' in params: - query_params.append(('offset', params['offset'])) # noqa: E501 - if 'opt_fields' in params: - query_params.append(('opt_fields', params['opt_fields'])) # noqa: E501 - collection_formats['opt_fields'] = 'csv' # noqa: E501 - - header_params = {} - - form_params = [] - local_var_files = {} - - body_params = None - # HTTP header `Accept` - header_params['Accept'] = self.api_client.select_header_accept( - ['application/json; charset=UTF-8']) # noqa: E501 - - # Authentication setting - auth_settings = ['oauth2'] # noqa: E501 - - return self.api_client.call_api( - '/workspaces/{workspace_gid}/teams', 'GET', - path_params, - query_params, - header_params, - body=body_params, - post_params=form_params, - files=local_var_files, - response_type='TeamResponseArray', # noqa: E501 - auth_settings=auth_settings, - async_req=params.get('async_req'), - _return_http_data_only=params.get('_return_http_data_only'), - _preload_content=params.get('_preload_content', True), - _request_timeout=params.get('_request_timeout'), - collection_formats=collection_formats) - - def remove_user_for_team(self, body, team_gid, **kwargs): # noqa: E501 - """Remove a user from a team # noqa: E501 - - The user making this call must be a member of the team in order to remove themselves or others. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.remove_user_for_team(body, team_gid, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param TeamGidRemoveUserBody body: The user to remove from the team. (required) - :param str team_gid: Globally unique identifier for the team. (required) - :return: EmptyResponseData - If the method is called asynchronously, - returns the request thread. - """ - kwargs['_return_http_data_only'] = True - if kwargs.get('async_req'): - return self.remove_user_for_team_with_http_info(body, team_gid, **kwargs) # noqa: E501 - else: - (data) = self.remove_user_for_team_with_http_info(body, team_gid, **kwargs) # noqa: E501 - return data - - def remove_user_for_team_with_http_info(self, body, team_gid, **kwargs): # noqa: E501 - """Remove a user from a team # noqa: E501 - - The user making this call must be a member of the team in order to remove themselves or others. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.remove_user_for_team_with_http_info(body, team_gid, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param TeamGidRemoveUserBody body: The user to remove from the team. (required) - :param str team_gid: Globally unique identifier for the team. (required) - :return: EmptyResponseData - If the method is called asynchronously, - returns the request thread. - """ - - all_params = ['body', 'team_gid'] # noqa: E501 - all_params.append('async_req') - all_params.append('_return_http_data_only') - all_params.append('_preload_content') - all_params.append('_request_timeout') - - params = locals() - for key, val in six.iteritems(params['kwargs']): - if key not in all_params: - raise TypeError( - "Got an unexpected keyword argument '%s'" - " to method remove_user_for_team" % key - ) - params[key] = val - del params['kwargs'] - # verify the required parameter 'body' is set - if ('body' not in params or - params['body'] is None): - raise ValueError("Missing the required parameter `body` when calling `remove_user_for_team`") # noqa: E501 - # verify the required parameter 'team_gid' is set - if ('team_gid' not in params or - params['team_gid'] is None): - raise ValueError("Missing the required parameter `team_gid` when calling `remove_user_for_team`") # noqa: E501 - - collection_formats = {} - - path_params = {} - if 'team_gid' in params: - path_params['team_gid'] = params['team_gid'] # noqa: E501 - - query_params = [] - - header_params = {} - - form_params = [] - local_var_files = {} - - body_params = None - if 'body' in params: - body_params = params['body'] - # HTTP header `Accept` - header_params['Accept'] = self.api_client.select_header_accept( - ['application/json; charset=UTF-8']) # noqa: E501 - - # HTTP header `Content-Type` - header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 - ['application/json; charset=UTF-8']) # noqa: E501 - - # Authentication setting - auth_settings = ['oauth2'] # noqa: E501 - - return self.api_client.call_api( - '/teams/{team_gid}/removeUser', 'POST', - path_params, - query_params, - header_params, - body=body_params, - post_params=form_params, - files=local_var_files, - response_type='EmptyResponseData', # noqa: E501 - auth_settings=auth_settings, - async_req=params.get('async_req'), - _return_http_data_only=params.get('_return_http_data_only'), - _preload_content=params.get('_preload_content', True), - _request_timeout=params.get('_request_timeout'), - collection_formats=collection_formats) - - def update_team(self, body, team_gid, **kwargs): # noqa: E501 - """Update a team # noqa: E501 - - Updates a team within the current workspace. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.update_team(body, team_gid, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param TeamsTeamGidBody body: The team to update. (required) - :param str team_gid: Globally unique identifier for the team. (required) - :param list[str] opt_fields: This endpoint returns a compact resource, which excludes some properties by default. To include those optional properties, set this query parameter to a comma-separated list of the properties you wish to include. - :return: TeamResponseData - If the method is called asynchronously, - returns the request thread. - """ - kwargs['_return_http_data_only'] = True - if kwargs.get('async_req'): - return self.update_team_with_http_info(body, team_gid, **kwargs) # noqa: E501 - else: - (data) = self.update_team_with_http_info(body, team_gid, **kwargs) # noqa: E501 - return data - - def update_team_with_http_info(self, body, team_gid, **kwargs): # noqa: E501 - """Update a team # noqa: E501 - - Updates a team within the current workspace. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.update_team_with_http_info(body, team_gid, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param TeamsTeamGidBody body: The team to update. (required) - :param str team_gid: Globally unique identifier for the team. (required) - :param list[str] opt_fields: This endpoint returns a compact resource, which excludes some properties by default. To include those optional properties, set this query parameter to a comma-separated list of the properties you wish to include. - :return: TeamResponseData - If the method is called asynchronously, - returns the request thread. - """ - - all_params = ['body', 'team_gid', 'opt_fields'] # noqa: E501 - all_params.append('async_req') - all_params.append('_return_http_data_only') - all_params.append('_preload_content') - all_params.append('_request_timeout') - - params = locals() - for key, val in six.iteritems(params['kwargs']): - if key not in all_params: - raise TypeError( - "Got an unexpected keyword argument '%s'" - " to method update_team" % key - ) - params[key] = val - del params['kwargs'] - # verify the required parameter 'body' is set - if ('body' not in params or - params['body'] is None): - raise ValueError("Missing the required parameter `body` when calling `update_team`") # noqa: E501 - # verify the required parameter 'team_gid' is set - if ('team_gid' not in params or - params['team_gid'] is None): - raise ValueError("Missing the required parameter `team_gid` when calling `update_team`") # noqa: E501 - - collection_formats = {} - - path_params = {} - if 'team_gid' in params: - path_params['team_gid'] = params['team_gid'] # noqa: E501 - - query_params = [] - if 'opt_fields' in params: - query_params.append(('opt_fields', params['opt_fields'])) # noqa: E501 - collection_formats['opt_fields'] = 'csv' # noqa: E501 - - header_params = {} - - form_params = [] - local_var_files = {} - - body_params = None - if 'body' in params: - body_params = params['body'] - # HTTP header `Accept` - header_params['Accept'] = self.api_client.select_header_accept( - ['application/json; charset=UTF-8']) # noqa: E501 - - # HTTP header `Content-Type` - header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 - ['application/json; charset=UTF-8']) # noqa: E501 - - # Authentication setting - auth_settings = ['oauth2'] # noqa: E501 - - return self.api_client.call_api( - '/teams/{team_gid}', 'PUT', - path_params, - query_params, - header_params, - body=body_params, - post_params=form_params, - files=local_var_files, - response_type='TeamResponseData', # noqa: E501 - auth_settings=auth_settings, - async_req=params.get('async_req'), - _return_http_data_only=params.get('_return_http_data_only'), - _preload_content=params.get('_preload_content', True), - _request_timeout=params.get('_request_timeout'), - collection_formats=collection_formats) + all_params = ['body', 'team_gid', 'opt_fields'] # noqa: E501 + all_params.append('async_req') + all_params.append('header_params') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + params = locals() + for key, val in six.iteritems(params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method update_team" % key + ) + params[key] = val + del params['kwargs'] + # verify the required parameter 'body' is set + if ('body' not in params or + params['body'] is None): + raise ValueError("Missing the required parameter `body` when calling `update_team`") # noqa: E501 + # verify the required parameter 'team_gid' is set + if ('team_gid' not in params or + params['team_gid'] is None): + raise ValueError("Missing the required parameter `team_gid` when calling `update_team`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'team_gid' in params: + path_params['team_gid'] = params['team_gid'] # noqa: E501 + + query_params = [] + if 'opt_fields' in params: + query_params.append(('opt_fields', params['opt_fields'])) # noqa: E501 + collection_formats['opt_fields'] = 'csv' # noqa: E501 + + header_params = kwargs.get("header_params", {}) + + form_params = [] + local_var_files = {} + + body_params = None + if 'body' in params: + body_params = params['body'] + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['application/json; charset=UTF-8']) # noqa: E501 + + # HTTP header `Content-Type` + header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 + ['application/json; charset=UTF-8']) # noqa: E501 + + # Authentication setting + auth_settings = ['oauth2'] # noqa: E501 + + return self.api_client.call_api( + '/teams/{team_gid}', 'PUT', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='TeamResponseData', # noqa: E501 + auth_settings=auth_settings, + async_req=params.get('async_req'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) diff --git a/asana/api/time_periods_api.py b/asana/api/time_periods_api.py index 36b97550..4833b99b 100644 --- a/asana/api/time_periods_api.py +++ b/asana/api/time_periods_api.py @@ -21,229 +21,231 @@ class TimePeriodsApi(object): - """NOTE: This class is auto generated by the swagger code generator program. +"""NOTE: This class is auto generated by the swagger code generator program. - Do not edit the class manually. - Ref: https://github.com/swagger-api/swagger-codegen +Do not edit the class manually. +Ref: https://github.com/swagger-api/swagger-codegen +""" + +def __init__(self, api_client=None): + if api_client is None: + api_client = ApiClient() + self.api_client = api_client + +def get_time_period(self, time_period_gid, **kwargs): # noqa: E501 + """Get a time period # noqa: E501 + + Returns the full record for a single time period. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.get_time_period(time_period_gid, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str time_period_gid: Globally unique identifier for the time period. (required) + :param list[str] opt_fields: This endpoint returns a compact resource, which excludes some properties by default. To include those optional properties, set this query parameter to a comma-separated list of the properties you wish to include. + :return: TimePeriodResponseData + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = kwargs.get("_return_http_data_only", True) + if kwargs.get('async_req'): + return self.get_time_period_with_http_info(time_period_gid, **kwargs) # noqa: E501 + else: + (data) = self.get_time_period_with_http_info(time_period_gid, **kwargs) # noqa: E501 + return data + +def get_time_period_with_http_info(self, time_period_gid, **kwargs): # noqa: E501 + """Get a time period # noqa: E501 + + Returns the full record for a single time period. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.get_time_period_with_http_info(time_period_gid, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str time_period_gid: Globally unique identifier for the time period. (required) + :param list[str] opt_fields: This endpoint returns a compact resource, which excludes some properties by default. To include those optional properties, set this query parameter to a comma-separated list of the properties you wish to include. + :return: TimePeriodResponseData + If the method is called asynchronously, + returns the request thread. + """ + + all_params = ['time_period_gid', 'opt_fields'] # noqa: E501 + all_params.append('async_req') + all_params.append('header_params') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + params = locals() + for key, val in six.iteritems(params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method get_time_period" % key + ) + params[key] = val + del params['kwargs'] + # verify the required parameter 'time_period_gid' is set + if ('time_period_gid' not in params or + params['time_period_gid'] is None): + raise ValueError("Missing the required parameter `time_period_gid` when calling `get_time_period`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'time_period_gid' in params: + path_params['time_period_gid'] = params['time_period_gid'] # noqa: E501 + + query_params = [] + if 'opt_fields' in params: + query_params.append(('opt_fields', params['opt_fields'])) # noqa: E501 + collection_formats['opt_fields'] = 'csv' # noqa: E501 + + header_params = kwargs.get("header_params", {}) + + form_params = [] + local_var_files = {} + + body_params = None + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['application/json; charset=UTF-8']) # noqa: E501 + + # Authentication setting + auth_settings = ['oauth2'] # noqa: E501 + + return self.api_client.call_api( + '/time_periods/{time_period_gid}', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='TimePeriodResponseData', # noqa: E501 + auth_settings=auth_settings, + async_req=params.get('async_req'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) + +def get_time_periods(self, workspace, **kwargs): # noqa: E501 + """Get time periods # noqa: E501 + + Returns compact time period records. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.get_time_periods(workspace, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str workspace: Globally unique identifier for the workspace. (required) + :param int limit: Results per page. The number of objects to return per page. The value must be between 1 and 100. + :param str offset: 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 date start_on: ISO 8601 date string + :param date end_on: ISO 8601 date string + :param list[str] opt_fields: This endpoint returns a compact resource, which excludes some properties by default. To include those optional properties, set this query parameter to a comma-separated list of the properties you wish to include. + :return: TimePeriodResponseArray + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = kwargs.get("_return_http_data_only", True) + if kwargs.get('async_req'): + return self.get_time_periods_with_http_info(workspace, **kwargs) # noqa: E501 + else: + (data) = self.get_time_periods_with_http_info(workspace, **kwargs) # noqa: E501 + return data + +def get_time_periods_with_http_info(self, workspace, **kwargs): # noqa: E501 + """Get time periods # noqa: E501 + + Returns compact time period records. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.get_time_periods_with_http_info(workspace, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str workspace: Globally unique identifier for the workspace. (required) + :param int limit: Results per page. The number of objects to return per page. The value must be between 1 and 100. + :param str offset: 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 date start_on: ISO 8601 date string + :param date end_on: ISO 8601 date string + :param list[str] opt_fields: This endpoint returns a compact resource, which excludes some properties by default. To include those optional properties, set this query parameter to a comma-separated list of the properties you wish to include. + :return: TimePeriodResponseArray + If the method is called asynchronously, + returns the request thread. """ - def __init__(self, api_client=None): - if api_client is None: - api_client = ApiClient() - self.api_client = api_client - - def get_time_period(self, time_period_gid, **kwargs): # noqa: E501 - """Get a time period # noqa: E501 - - Returns the full record for a single time period. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.get_time_period(time_period_gid, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param str time_period_gid: Globally unique identifier for the time period. (required) - :param list[str] opt_fields: This endpoint returns a compact resource, which excludes some properties by default. To include those optional properties, set this query parameter to a comma-separated list of the properties you wish to include. - :return: TimePeriodResponseData - If the method is called asynchronously, - returns the request thread. - """ - kwargs['_return_http_data_only'] = True - if kwargs.get('async_req'): - return self.get_time_period_with_http_info(time_period_gid, **kwargs) # noqa: E501 - else: - (data) = self.get_time_period_with_http_info(time_period_gid, **kwargs) # noqa: E501 - return data - - def get_time_period_with_http_info(self, time_period_gid, **kwargs): # noqa: E501 - """Get a time period # noqa: E501 - - Returns the full record for a single time period. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.get_time_period_with_http_info(time_period_gid, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param str time_period_gid: Globally unique identifier for the time period. (required) - :param list[str] opt_fields: This endpoint returns a compact resource, which excludes some properties by default. To include those optional properties, set this query parameter to a comma-separated list of the properties you wish to include. - :return: TimePeriodResponseData - If the method is called asynchronously, - returns the request thread. - """ - - all_params = ['time_period_gid', 'opt_fields'] # noqa: E501 - all_params.append('async_req') - all_params.append('_return_http_data_only') - all_params.append('_preload_content') - all_params.append('_request_timeout') - - params = locals() - for key, val in six.iteritems(params['kwargs']): - if key not in all_params: - raise TypeError( - "Got an unexpected keyword argument '%s'" - " to method get_time_period" % key - ) - params[key] = val - del params['kwargs'] - # verify the required parameter 'time_period_gid' is set - if ('time_period_gid' not in params or - params['time_period_gid'] is None): - raise ValueError("Missing the required parameter `time_period_gid` when calling `get_time_period`") # noqa: E501 - - collection_formats = {} - - path_params = {} - if 'time_period_gid' in params: - path_params['time_period_gid'] = params['time_period_gid'] # noqa: E501 - - query_params = [] - if 'opt_fields' in params: - query_params.append(('opt_fields', params['opt_fields'])) # noqa: E501 - collection_formats['opt_fields'] = 'csv' # noqa: E501 - - header_params = {} - - form_params = [] - local_var_files = {} - - body_params = None - # HTTP header `Accept` - header_params['Accept'] = self.api_client.select_header_accept( - ['application/json; charset=UTF-8']) # noqa: E501 - - # Authentication setting - auth_settings = ['oauth2'] # noqa: E501 - - return self.api_client.call_api( - '/time_periods/{time_period_gid}', 'GET', - path_params, - query_params, - header_params, - body=body_params, - post_params=form_params, - files=local_var_files, - response_type='TimePeriodResponseData', # noqa: E501 - auth_settings=auth_settings, - async_req=params.get('async_req'), - _return_http_data_only=params.get('_return_http_data_only'), - _preload_content=params.get('_preload_content', True), - _request_timeout=params.get('_request_timeout'), - collection_formats=collection_formats) - - def get_time_periods(self, workspace, **kwargs): # noqa: E501 - """Get time periods # noqa: E501 - - Returns compact time period records. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.get_time_periods(workspace, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param str workspace: Globally unique identifier for the workspace. (required) - :param int limit: Results per page. The number of objects to return per page. The value must be between 1 and 100. - :param str offset: 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 date start_on: ISO 8601 date string - :param date end_on: ISO 8601 date string - :param list[str] opt_fields: This endpoint returns a compact resource, which excludes some properties by default. To include those optional properties, set this query parameter to a comma-separated list of the properties you wish to include. - :return: TimePeriodResponseArray - If the method is called asynchronously, - returns the request thread. - """ - kwargs['_return_http_data_only'] = True - if kwargs.get('async_req'): - return self.get_time_periods_with_http_info(workspace, **kwargs) # noqa: E501 - else: - (data) = self.get_time_periods_with_http_info(workspace, **kwargs) # noqa: E501 - return data - - def get_time_periods_with_http_info(self, workspace, **kwargs): # noqa: E501 - """Get time periods # noqa: E501 - - Returns compact time period records. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.get_time_periods_with_http_info(workspace, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param str workspace: Globally unique identifier for the workspace. (required) - :param int limit: Results per page. The number of objects to return per page. The value must be between 1 and 100. - :param str offset: 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 date start_on: ISO 8601 date string - :param date end_on: ISO 8601 date string - :param list[str] opt_fields: This endpoint returns a compact resource, which excludes some properties by default. To include those optional properties, set this query parameter to a comma-separated list of the properties you wish to include. - :return: TimePeriodResponseArray - If the method is called asynchronously, - returns the request thread. - """ - - all_params = ['workspace', 'limit', 'offset', 'start_on', 'end_on', 'opt_fields'] # noqa: E501 - all_params.append('async_req') - all_params.append('_return_http_data_only') - all_params.append('_preload_content') - all_params.append('_request_timeout') - - params = locals() - for key, val in six.iteritems(params['kwargs']): - if key not in all_params: - raise TypeError( - "Got an unexpected keyword argument '%s'" - " to method get_time_periods" % key - ) - params[key] = val - del params['kwargs'] - # verify the required parameter 'workspace' is set - if ('workspace' not in params or - params['workspace'] is None): - raise ValueError("Missing the required parameter `workspace` when calling `get_time_periods`") # noqa: E501 - - collection_formats = {} - - path_params = {} - - query_params = [] - if 'limit' in params: - query_params.append(('limit', params['limit'])) # noqa: E501 - if 'offset' in params: - query_params.append(('offset', params['offset'])) # noqa: E501 - if 'start_on' in params: - query_params.append(('start_on', params['start_on'])) # noqa: E501 - if 'end_on' in params: - query_params.append(('end_on', params['end_on'])) # noqa: E501 - if 'workspace' in params: - query_params.append(('workspace', params['workspace'])) # noqa: E501 - if 'opt_fields' in params: - query_params.append(('opt_fields', params['opt_fields'])) # noqa: E501 - collection_formats['opt_fields'] = 'csv' # noqa: E501 - - header_params = {} - - form_params = [] - local_var_files = {} - - body_params = None - # HTTP header `Accept` - header_params['Accept'] = self.api_client.select_header_accept( - ['application/json; charset=UTF-8']) # noqa: E501 - - # Authentication setting - auth_settings = ['oauth2'] # noqa: E501 - - return self.api_client.call_api( - '/time_periods', 'GET', - path_params, - query_params, - header_params, - body=body_params, - post_params=form_params, - files=local_var_files, - response_type='TimePeriodResponseArray', # noqa: E501 - auth_settings=auth_settings, - async_req=params.get('async_req'), - _return_http_data_only=params.get('_return_http_data_only'), - _preload_content=params.get('_preload_content', True), - _request_timeout=params.get('_request_timeout'), - collection_formats=collection_formats) + all_params = ['workspace', 'limit', 'offset', 'start_on', 'end_on', 'opt_fields'] # noqa: E501 + all_params.append('async_req') + all_params.append('header_params') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + params = locals() + for key, val in six.iteritems(params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method get_time_periods" % key + ) + params[key] = val + del params['kwargs'] + # verify the required parameter 'workspace' is set + if ('workspace' not in params or + params['workspace'] is None): + raise ValueError("Missing the required parameter `workspace` when calling `get_time_periods`") # noqa: E501 + + collection_formats = {} + + path_params = {} + + query_params = [] + if 'limit' in params: + query_params.append(('limit', params['limit'])) # noqa: E501 + if 'offset' in params: + query_params.append(('offset', params['offset'])) # noqa: E501 + if 'start_on' in params: + query_params.append(('start_on', params['start_on'])) # noqa: E501 + if 'end_on' in params: + query_params.append(('end_on', params['end_on'])) # noqa: E501 + if 'workspace' in params: + query_params.append(('workspace', params['workspace'])) # noqa: E501 + if 'opt_fields' in params: + query_params.append(('opt_fields', params['opt_fields'])) # noqa: E501 + collection_formats['opt_fields'] = 'csv' # noqa: E501 + + header_params = kwargs.get("header_params", {}) + + form_params = [] + local_var_files = {} + + body_params = None + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['application/json; charset=UTF-8']) # noqa: E501 + + # Authentication setting + auth_settings = ['oauth2'] # noqa: E501 + + return self.api_client.call_api( + '/time_periods', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='TimePeriodResponseArray', # noqa: E501 + auth_settings=auth_settings, + async_req=params.get('async_req'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) diff --git a/asana/api/time_tracking_entries_api.py b/asana/api/time_tracking_entries_api.py index 409c89f4..970fd2f4 100644 --- a/asana/api/time_tracking_entries_api.py +++ b/asana/api/time_tracking_entries_api.py @@ -21,540 +21,545 @@ class TimeTrackingEntriesApi(object): - """NOTE: This class is auto generated by the swagger code generator program. +"""NOTE: This class is auto generated by the swagger code generator program. - Do not edit the class manually. - Ref: https://github.com/swagger-api/swagger-codegen +Do not edit the class manually. +Ref: https://github.com/swagger-api/swagger-codegen +""" + +def __init__(self, api_client=None): + if api_client is None: + api_client = ApiClient() + self.api_client = api_client + +def create_time_tracking_entry(self, body, task_gid, **kwargs): # noqa: E501 + """Create a time tracking entry # noqa: E501 + + Creates a time tracking entry on a given task. Returns the record of the newly created time tracking entry. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.create_time_tracking_entry(body, task_gid, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param TaskGidTimeTrackingEntriesBody body: Information about the time tracking entry. (required) + :param str task_gid: The task to operate on. (required) + :param list[str] opt_fields: This endpoint returns a compact resource, which excludes some properties by default. To include those optional properties, set this query parameter to a comma-separated list of the properties you wish to include. + :return: TimeTrackingEntryBaseData + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = kwargs.get("_return_http_data_only", True) + if kwargs.get('async_req'): + return self.create_time_tracking_entry_with_http_info(body, task_gid, **kwargs) # noqa: E501 + else: + (data) = self.create_time_tracking_entry_with_http_info(body, task_gid, **kwargs) # noqa: E501 + return data + +def create_time_tracking_entry_with_http_info(self, body, task_gid, **kwargs): # noqa: E501 + """Create a time tracking entry # noqa: E501 + + Creates a time tracking entry on a given task. Returns the record of the newly created time tracking entry. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.create_time_tracking_entry_with_http_info(body, task_gid, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param TaskGidTimeTrackingEntriesBody body: Information about the time tracking entry. (required) + :param str task_gid: The task to operate on. (required) + :param list[str] opt_fields: This endpoint returns a compact resource, which excludes some properties by default. To include those optional properties, set this query parameter to a comma-separated list of the properties you wish to include. + :return: TimeTrackingEntryBaseData + If the method is called asynchronously, + returns the request thread. + """ + + all_params = ['body', 'task_gid', 'opt_fields'] # noqa: E501 + all_params.append('async_req') + all_params.append('header_params') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + params = locals() + for key, val in six.iteritems(params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method create_time_tracking_entry" % key + ) + params[key] = val + del params['kwargs'] + # verify the required parameter 'body' is set + if ('body' not in params or + params['body'] is None): + raise ValueError("Missing the required parameter `body` when calling `create_time_tracking_entry`") # noqa: E501 + # verify the required parameter 'task_gid' is set + if ('task_gid' not in params or + params['task_gid'] is None): + raise ValueError("Missing the required parameter `task_gid` when calling `create_time_tracking_entry`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'task_gid' in params: + path_params['task_gid'] = params['task_gid'] # noqa: E501 + + query_params = [] + if 'opt_fields' in params: + query_params.append(('opt_fields', params['opt_fields'])) # noqa: E501 + collection_formats['opt_fields'] = 'csv' # noqa: E501 + + header_params = kwargs.get("header_params", {}) + + form_params = [] + local_var_files = {} + + body_params = None + if 'body' in params: + body_params = params['body'] + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['application/json; charset=UTF-8']) # noqa: E501 + + # HTTP header `Content-Type` + header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 + ['application/json; charset=UTF-8']) # noqa: E501 + + # Authentication setting + auth_settings = ['oauth2'] # noqa: E501 + + return self.api_client.call_api( + '/tasks/{task_gid}/time_tracking_entries', 'POST', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='TimeTrackingEntryBaseData', # noqa: E501 + auth_settings=auth_settings, + async_req=params.get('async_req'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) + +def delete_time_tracking_entry(self, time_tracking_entry_gid, **kwargs): # noqa: E501 + """Delete a time tracking entry # noqa: E501 + + A specific, existing time tracking entry can be deleted by making a `DELETE` request on the URL for that time tracking entry. Returns an empty data record. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.delete_time_tracking_entry(time_tracking_entry_gid, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str time_tracking_entry_gid: Globally unique identifier for the time tracking entry. (required) + :return: EmptyResponseData + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = kwargs.get("_return_http_data_only", True) + if kwargs.get('async_req'): + return self.delete_time_tracking_entry_with_http_info(time_tracking_entry_gid, **kwargs) # noqa: E501 + else: + (data) = self.delete_time_tracking_entry_with_http_info(time_tracking_entry_gid, **kwargs) # noqa: E501 + return data + +def delete_time_tracking_entry_with_http_info(self, time_tracking_entry_gid, **kwargs): # noqa: E501 + """Delete a time tracking entry # noqa: E501 + + A specific, existing time tracking entry can be deleted by making a `DELETE` request on the URL for that time tracking entry. Returns an empty data record. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.delete_time_tracking_entry_with_http_info(time_tracking_entry_gid, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str time_tracking_entry_gid: Globally unique identifier for the time tracking entry. (required) + :return: EmptyResponseData + If the method is called asynchronously, + returns the request thread. + """ + + all_params = ['time_tracking_entry_gid'] # noqa: E501 + all_params.append('async_req') + all_params.append('header_params') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + params = locals() + for key, val in six.iteritems(params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method delete_time_tracking_entry" % key + ) + params[key] = val + del params['kwargs'] + # verify the required parameter 'time_tracking_entry_gid' is set + if ('time_tracking_entry_gid' not in params or + params['time_tracking_entry_gid'] is None): + raise ValueError("Missing the required parameter `time_tracking_entry_gid` when calling `delete_time_tracking_entry`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'time_tracking_entry_gid' in params: + path_params['time_tracking_entry_gid'] = params['time_tracking_entry_gid'] # noqa: E501 + + query_params = [] + + header_params = kwargs.get("header_params", {}) + + form_params = [] + local_var_files = {} + + body_params = None + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['application/json; charset=UTF-8']) # noqa: E501 + + # Authentication setting + auth_settings = ['oauth2'] # noqa: E501 + + return self.api_client.call_api( + '/time_tracking_entries/{time_tracking_entry_gid}', 'DELETE', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='EmptyResponseData', # noqa: E501 + auth_settings=auth_settings, + async_req=params.get('async_req'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) + +def get_time_tracking_entries_for_task(self, task_gid, **kwargs): # noqa: E501 + """Get time tracking entries for a task # noqa: E501 + + Returns time tracking entries for a given task. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.get_time_tracking_entries_for_task(task_gid, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str task_gid: The task to operate on. (required) + :param int limit: Results per page. The number of objects to return per page. The value must be between 1 and 100. + :param str offset: 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 list[str] opt_fields: This endpoint returns a compact resource, which excludes some properties by default. To include those optional properties, set this query parameter to a comma-separated list of the properties you wish to include. + :return: TimeTrackingEntryCompactArray + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = kwargs.get("_return_http_data_only", True) + if kwargs.get('async_req'): + return self.get_time_tracking_entries_for_task_with_http_info(task_gid, **kwargs) # noqa: E501 + else: + (data) = self.get_time_tracking_entries_for_task_with_http_info(task_gid, **kwargs) # noqa: E501 + return data + +def get_time_tracking_entries_for_task_with_http_info(self, task_gid, **kwargs): # noqa: E501 + """Get time tracking entries for a task # noqa: E501 + + Returns time tracking entries for a given task. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.get_time_tracking_entries_for_task_with_http_info(task_gid, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str task_gid: The task to operate on. (required) + :param int limit: Results per page. The number of objects to return per page. The value must be between 1 and 100. + :param str offset: 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 list[str] opt_fields: This endpoint returns a compact resource, which excludes some properties by default. To include those optional properties, set this query parameter to a comma-separated list of the properties you wish to include. + :return: TimeTrackingEntryCompactArray + If the method is called asynchronously, + returns the request thread. + """ + + all_params = ['task_gid', 'limit', 'offset', 'opt_fields'] # noqa: E501 + all_params.append('async_req') + all_params.append('header_params') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + params = locals() + for key, val in six.iteritems(params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method get_time_tracking_entries_for_task" % key + ) + params[key] = val + del params['kwargs'] + # verify the required parameter 'task_gid' is set + if ('task_gid' not in params or + params['task_gid'] is None): + raise ValueError("Missing the required parameter `task_gid` when calling `get_time_tracking_entries_for_task`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'task_gid' in params: + path_params['task_gid'] = params['task_gid'] # noqa: E501 + + query_params = [] + if 'limit' in params: + query_params.append(('limit', params['limit'])) # noqa: E501 + if 'offset' in params: + query_params.append(('offset', params['offset'])) # noqa: E501 + if 'opt_fields' in params: + query_params.append(('opt_fields', params['opt_fields'])) # noqa: E501 + collection_formats['opt_fields'] = 'csv' # noqa: E501 + + header_params = kwargs.get("header_params", {}) + + form_params = [] + local_var_files = {} + + body_params = None + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['application/json; charset=UTF-8']) # noqa: E501 + + # Authentication setting + auth_settings = ['oauth2'] # noqa: E501 + + return self.api_client.call_api( + '/tasks/{task_gid}/time_tracking_entries', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='TimeTrackingEntryCompactArray', # noqa: E501 + auth_settings=auth_settings, + async_req=params.get('async_req'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) + +def get_time_tracking_entry(self, time_tracking_entry_gid, **kwargs): # noqa: E501 + """Get a time tracking entry # noqa: E501 + + Returns the complete time tracking entry record for a single time tracking entry. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.get_time_tracking_entry(time_tracking_entry_gid, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str time_tracking_entry_gid: Globally unique identifier for the time tracking entry. (required) + :param list[str] opt_fields: This endpoint returns a compact resource, which excludes some properties by default. To include those optional properties, set this query parameter to a comma-separated list of the properties you wish to include. + :return: TimeTrackingEntryBaseData + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = kwargs.get("_return_http_data_only", True) + if kwargs.get('async_req'): + return self.get_time_tracking_entry_with_http_info(time_tracking_entry_gid, **kwargs) # noqa: E501 + else: + (data) = self.get_time_tracking_entry_with_http_info(time_tracking_entry_gid, **kwargs) # noqa: E501 + return data + +def get_time_tracking_entry_with_http_info(self, time_tracking_entry_gid, **kwargs): # noqa: E501 + """Get a time tracking entry # noqa: E501 + + Returns the complete time tracking entry record for a single time tracking entry. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.get_time_tracking_entry_with_http_info(time_tracking_entry_gid, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str time_tracking_entry_gid: Globally unique identifier for the time tracking entry. (required) + :param list[str] opt_fields: This endpoint returns a compact resource, which excludes some properties by default. To include those optional properties, set this query parameter to a comma-separated list of the properties you wish to include. + :return: TimeTrackingEntryBaseData + If the method is called asynchronously, + returns the request thread. + """ + + all_params = ['time_tracking_entry_gid', 'opt_fields'] # noqa: E501 + all_params.append('async_req') + all_params.append('header_params') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + params = locals() + for key, val in six.iteritems(params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method get_time_tracking_entry" % key + ) + params[key] = val + del params['kwargs'] + # verify the required parameter 'time_tracking_entry_gid' is set + if ('time_tracking_entry_gid' not in params or + params['time_tracking_entry_gid'] is None): + raise ValueError("Missing the required parameter `time_tracking_entry_gid` when calling `get_time_tracking_entry`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'time_tracking_entry_gid' in params: + path_params['time_tracking_entry_gid'] = params['time_tracking_entry_gid'] # noqa: E501 + + query_params = [] + if 'opt_fields' in params: + query_params.append(('opt_fields', params['opt_fields'])) # noqa: E501 + collection_formats['opt_fields'] = 'csv' # noqa: E501 + + header_params = kwargs.get("header_params", {}) + + form_params = [] + local_var_files = {} + + body_params = None + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['application/json; charset=UTF-8']) # noqa: E501 + + # Authentication setting + auth_settings = ['oauth2'] # noqa: E501 + + return self.api_client.call_api( + '/time_tracking_entries/{time_tracking_entry_gid}', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='TimeTrackingEntryBaseData', # noqa: E501 + auth_settings=auth_settings, + async_req=params.get('async_req'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) + +def update_time_tracking_entry(self, body, time_tracking_entry_gid, **kwargs): # noqa: E501 + """Update a time tracking entry # noqa: E501 + + A specific, existing time tracking entry can be updated by making a `PUT` request on the URL for that time tracking entry. Only the fields provided in the `data` block will be updated; any unspecified fields will remain unchanged. When using this method, it is best to specify only those fields you wish to change, or else you may overwrite changes made by another user since you last retrieved the task. Returns the complete updated time tracking entry record. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.update_time_tracking_entry(body, time_tracking_entry_gid, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param TimeTrackingEntriesTimeTrackingEntryGidBody body: The updated fields for the time tracking entry. (required) + :param str time_tracking_entry_gid: Globally unique identifier for the time tracking entry. (required) + :param list[str] opt_fields: This endpoint returns a compact resource, which excludes some properties by default. To include those optional properties, set this query parameter to a comma-separated list of the properties you wish to include. + :return: TimeTrackingEntryBaseData + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = kwargs.get("_return_http_data_only", True) + if kwargs.get('async_req'): + return self.update_time_tracking_entry_with_http_info(body, time_tracking_entry_gid, **kwargs) # noqa: E501 + else: + (data) = self.update_time_tracking_entry_with_http_info(body, time_tracking_entry_gid, **kwargs) # noqa: E501 + return data + +def update_time_tracking_entry_with_http_info(self, body, time_tracking_entry_gid, **kwargs): # noqa: E501 + """Update a time tracking entry # noqa: E501 + + A specific, existing time tracking entry can be updated by making a `PUT` request on the URL for that time tracking entry. Only the fields provided in the `data` block will be updated; any unspecified fields will remain unchanged. When using this method, it is best to specify only those fields you wish to change, or else you may overwrite changes made by another user since you last retrieved the task. Returns the complete updated time tracking entry record. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.update_time_tracking_entry_with_http_info(body, time_tracking_entry_gid, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param TimeTrackingEntriesTimeTrackingEntryGidBody body: The updated fields for the time tracking entry. (required) + :param str time_tracking_entry_gid: Globally unique identifier for the time tracking entry. (required) + :param list[str] opt_fields: This endpoint returns a compact resource, which excludes some properties by default. To include those optional properties, set this query parameter to a comma-separated list of the properties you wish to include. + :return: TimeTrackingEntryBaseData + If the method is called asynchronously, + returns the request thread. """ - def __init__(self, api_client=None): - if api_client is None: - api_client = ApiClient() - self.api_client = api_client - - def create_time_tracking_entry(self, body, task_gid, **kwargs): # noqa: E501 - """Create a time tracking entry # noqa: E501 - - Creates a time tracking entry on a given task. Returns the record of the newly created time tracking entry. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.create_time_tracking_entry(body, task_gid, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param TaskGidTimeTrackingEntriesBody body: Information about the time tracking entry. (required) - :param str task_gid: The task to operate on. (required) - :param list[str] opt_fields: This endpoint returns a compact resource, which excludes some properties by default. To include those optional properties, set this query parameter to a comma-separated list of the properties you wish to include. - :return: TimeTrackingEntryBaseData - If the method is called asynchronously, - returns the request thread. - """ - kwargs['_return_http_data_only'] = True - if kwargs.get('async_req'): - return self.create_time_tracking_entry_with_http_info(body, task_gid, **kwargs) # noqa: E501 - else: - (data) = self.create_time_tracking_entry_with_http_info(body, task_gid, **kwargs) # noqa: E501 - return data - - def create_time_tracking_entry_with_http_info(self, body, task_gid, **kwargs): # noqa: E501 - """Create a time tracking entry # noqa: E501 - - Creates a time tracking entry on a given task. Returns the record of the newly created time tracking entry. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.create_time_tracking_entry_with_http_info(body, task_gid, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param TaskGidTimeTrackingEntriesBody body: Information about the time tracking entry. (required) - :param str task_gid: The task to operate on. (required) - :param list[str] opt_fields: This endpoint returns a compact resource, which excludes some properties by default. To include those optional properties, set this query parameter to a comma-separated list of the properties you wish to include. - :return: TimeTrackingEntryBaseData - If the method is called asynchronously, - returns the request thread. - """ - - all_params = ['body', 'task_gid', 'opt_fields'] # noqa: E501 - all_params.append('async_req') - all_params.append('_return_http_data_only') - all_params.append('_preload_content') - all_params.append('_request_timeout') - - params = locals() - for key, val in six.iteritems(params['kwargs']): - if key not in all_params: - raise TypeError( - "Got an unexpected keyword argument '%s'" - " to method create_time_tracking_entry" % key - ) - params[key] = val - del params['kwargs'] - # verify the required parameter 'body' is set - if ('body' not in params or - params['body'] is None): - raise ValueError("Missing the required parameter `body` when calling `create_time_tracking_entry`") # noqa: E501 - # verify the required parameter 'task_gid' is set - if ('task_gid' not in params or - params['task_gid'] is None): - raise ValueError("Missing the required parameter `task_gid` when calling `create_time_tracking_entry`") # noqa: E501 - - collection_formats = {} - - path_params = {} - if 'task_gid' in params: - path_params['task_gid'] = params['task_gid'] # noqa: E501 - - query_params = [] - if 'opt_fields' in params: - query_params.append(('opt_fields', params['opt_fields'])) # noqa: E501 - collection_formats['opt_fields'] = 'csv' # noqa: E501 - - header_params = {} - - form_params = [] - local_var_files = {} - - body_params = None - if 'body' in params: - body_params = params['body'] - # HTTP header `Accept` - header_params['Accept'] = self.api_client.select_header_accept( - ['application/json; charset=UTF-8']) # noqa: E501 - - # HTTP header `Content-Type` - header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 - ['application/json; charset=UTF-8']) # noqa: E501 - - # Authentication setting - auth_settings = ['oauth2'] # noqa: E501 - - return self.api_client.call_api( - '/tasks/{task_gid}/time_tracking_entries', 'POST', - path_params, - query_params, - header_params, - body=body_params, - post_params=form_params, - files=local_var_files, - response_type='TimeTrackingEntryBaseData', # noqa: E501 - auth_settings=auth_settings, - async_req=params.get('async_req'), - _return_http_data_only=params.get('_return_http_data_only'), - _preload_content=params.get('_preload_content', True), - _request_timeout=params.get('_request_timeout'), - collection_formats=collection_formats) - - def delete_time_tracking_entry(self, time_tracking_entry_gid, **kwargs): # noqa: E501 - """Delete a time tracking entry # noqa: E501 - - A specific, existing time tracking entry can be deleted by making a `DELETE` request on the URL for that time tracking entry. Returns an empty data record. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.delete_time_tracking_entry(time_tracking_entry_gid, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param str time_tracking_entry_gid: Globally unique identifier for the time tracking entry. (required) - :return: EmptyResponseData - If the method is called asynchronously, - returns the request thread. - """ - kwargs['_return_http_data_only'] = True - if kwargs.get('async_req'): - return self.delete_time_tracking_entry_with_http_info(time_tracking_entry_gid, **kwargs) # noqa: E501 - else: - (data) = self.delete_time_tracking_entry_with_http_info(time_tracking_entry_gid, **kwargs) # noqa: E501 - return data - - def delete_time_tracking_entry_with_http_info(self, time_tracking_entry_gid, **kwargs): # noqa: E501 - """Delete a time tracking entry # noqa: E501 - - A specific, existing time tracking entry can be deleted by making a `DELETE` request on the URL for that time tracking entry. Returns an empty data record. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.delete_time_tracking_entry_with_http_info(time_tracking_entry_gid, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param str time_tracking_entry_gid: Globally unique identifier for the time tracking entry. (required) - :return: EmptyResponseData - If the method is called asynchronously, - returns the request thread. - """ - - all_params = ['time_tracking_entry_gid'] # noqa: E501 - all_params.append('async_req') - all_params.append('_return_http_data_only') - all_params.append('_preload_content') - all_params.append('_request_timeout') - - params = locals() - for key, val in six.iteritems(params['kwargs']): - if key not in all_params: - raise TypeError( - "Got an unexpected keyword argument '%s'" - " to method delete_time_tracking_entry" % key - ) - params[key] = val - del params['kwargs'] - # verify the required parameter 'time_tracking_entry_gid' is set - if ('time_tracking_entry_gid' not in params or - params['time_tracking_entry_gid'] is None): - raise ValueError("Missing the required parameter `time_tracking_entry_gid` when calling `delete_time_tracking_entry`") # noqa: E501 - - collection_formats = {} - - path_params = {} - if 'time_tracking_entry_gid' in params: - path_params['time_tracking_entry_gid'] = params['time_tracking_entry_gid'] # noqa: E501 - - query_params = [] - - header_params = {} - - form_params = [] - local_var_files = {} - - body_params = None - # HTTP header `Accept` - header_params['Accept'] = self.api_client.select_header_accept( - ['application/json; charset=UTF-8']) # noqa: E501 - - # Authentication setting - auth_settings = ['oauth2'] # noqa: E501 - - return self.api_client.call_api( - '/time_tracking_entries/{time_tracking_entry_gid}', 'DELETE', - path_params, - query_params, - header_params, - body=body_params, - post_params=form_params, - files=local_var_files, - response_type='EmptyResponseData', # noqa: E501 - auth_settings=auth_settings, - async_req=params.get('async_req'), - _return_http_data_only=params.get('_return_http_data_only'), - _preload_content=params.get('_preload_content', True), - _request_timeout=params.get('_request_timeout'), - collection_formats=collection_formats) - - def get_time_tracking_entries_for_task(self, task_gid, **kwargs): # noqa: E501 - """Get time tracking entries for a task # noqa: E501 - - Returns time tracking entries for a given task. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.get_time_tracking_entries_for_task(task_gid, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param str task_gid: The task to operate on. (required) - :param int limit: Results per page. The number of objects to return per page. The value must be between 1 and 100. - :param str offset: 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 list[str] opt_fields: This endpoint returns a compact resource, which excludes some properties by default. To include those optional properties, set this query parameter to a comma-separated list of the properties you wish to include. - :return: TimeTrackingEntryCompactArray - If the method is called asynchronously, - returns the request thread. - """ - kwargs['_return_http_data_only'] = True - if kwargs.get('async_req'): - return self.get_time_tracking_entries_for_task_with_http_info(task_gid, **kwargs) # noqa: E501 - else: - (data) = self.get_time_tracking_entries_for_task_with_http_info(task_gid, **kwargs) # noqa: E501 - return data - - def get_time_tracking_entries_for_task_with_http_info(self, task_gid, **kwargs): # noqa: E501 - """Get time tracking entries for a task # noqa: E501 - - Returns time tracking entries for a given task. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.get_time_tracking_entries_for_task_with_http_info(task_gid, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param str task_gid: The task to operate on. (required) - :param int limit: Results per page. The number of objects to return per page. The value must be between 1 and 100. - :param str offset: 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 list[str] opt_fields: This endpoint returns a compact resource, which excludes some properties by default. To include those optional properties, set this query parameter to a comma-separated list of the properties you wish to include. - :return: TimeTrackingEntryCompactArray - If the method is called asynchronously, - returns the request thread. - """ - - all_params = ['task_gid', 'limit', 'offset', 'opt_fields'] # noqa: E501 - all_params.append('async_req') - all_params.append('_return_http_data_only') - all_params.append('_preload_content') - all_params.append('_request_timeout') - - params = locals() - for key, val in six.iteritems(params['kwargs']): - if key not in all_params: - raise TypeError( - "Got an unexpected keyword argument '%s'" - " to method get_time_tracking_entries_for_task" % key - ) - params[key] = val - del params['kwargs'] - # verify the required parameter 'task_gid' is set - if ('task_gid' not in params or - params['task_gid'] is None): - raise ValueError("Missing the required parameter `task_gid` when calling `get_time_tracking_entries_for_task`") # noqa: E501 - - collection_formats = {} - - path_params = {} - if 'task_gid' in params: - path_params['task_gid'] = params['task_gid'] # noqa: E501 - - query_params = [] - if 'limit' in params: - query_params.append(('limit', params['limit'])) # noqa: E501 - if 'offset' in params: - query_params.append(('offset', params['offset'])) # noqa: E501 - if 'opt_fields' in params: - query_params.append(('opt_fields', params['opt_fields'])) # noqa: E501 - collection_formats['opt_fields'] = 'csv' # noqa: E501 - - header_params = {} - - form_params = [] - local_var_files = {} - - body_params = None - # HTTP header `Accept` - header_params['Accept'] = self.api_client.select_header_accept( - ['application/json; charset=UTF-8']) # noqa: E501 - - # Authentication setting - auth_settings = ['oauth2'] # noqa: E501 - - return self.api_client.call_api( - '/tasks/{task_gid}/time_tracking_entries', 'GET', - path_params, - query_params, - header_params, - body=body_params, - post_params=form_params, - files=local_var_files, - response_type='TimeTrackingEntryCompactArray', # noqa: E501 - auth_settings=auth_settings, - async_req=params.get('async_req'), - _return_http_data_only=params.get('_return_http_data_only'), - _preload_content=params.get('_preload_content', True), - _request_timeout=params.get('_request_timeout'), - collection_formats=collection_formats) - - def get_time_tracking_entry(self, time_tracking_entry_gid, **kwargs): # noqa: E501 - """Get a time tracking entry # noqa: E501 - - Returns the complete time tracking entry record for a single time tracking entry. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.get_time_tracking_entry(time_tracking_entry_gid, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param str time_tracking_entry_gid: Globally unique identifier for the time tracking entry. (required) - :param list[str] opt_fields: This endpoint returns a compact resource, which excludes some properties by default. To include those optional properties, set this query parameter to a comma-separated list of the properties you wish to include. - :return: TimeTrackingEntryBaseData - If the method is called asynchronously, - returns the request thread. - """ - kwargs['_return_http_data_only'] = True - if kwargs.get('async_req'): - return self.get_time_tracking_entry_with_http_info(time_tracking_entry_gid, **kwargs) # noqa: E501 - else: - (data) = self.get_time_tracking_entry_with_http_info(time_tracking_entry_gid, **kwargs) # noqa: E501 - return data - - def get_time_tracking_entry_with_http_info(self, time_tracking_entry_gid, **kwargs): # noqa: E501 - """Get a time tracking entry # noqa: E501 - - Returns the complete time tracking entry record for a single time tracking entry. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.get_time_tracking_entry_with_http_info(time_tracking_entry_gid, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param str time_tracking_entry_gid: Globally unique identifier for the time tracking entry. (required) - :param list[str] opt_fields: This endpoint returns a compact resource, which excludes some properties by default. To include those optional properties, set this query parameter to a comma-separated list of the properties you wish to include. - :return: TimeTrackingEntryBaseData - If the method is called asynchronously, - returns the request thread. - """ - - all_params = ['time_tracking_entry_gid', 'opt_fields'] # noqa: E501 - all_params.append('async_req') - all_params.append('_return_http_data_only') - all_params.append('_preload_content') - all_params.append('_request_timeout') - - params = locals() - for key, val in six.iteritems(params['kwargs']): - if key not in all_params: - raise TypeError( - "Got an unexpected keyword argument '%s'" - " to method get_time_tracking_entry" % key - ) - params[key] = val - del params['kwargs'] - # verify the required parameter 'time_tracking_entry_gid' is set - if ('time_tracking_entry_gid' not in params or - params['time_tracking_entry_gid'] is None): - raise ValueError("Missing the required parameter `time_tracking_entry_gid` when calling `get_time_tracking_entry`") # noqa: E501 - - collection_formats = {} - - path_params = {} - if 'time_tracking_entry_gid' in params: - path_params['time_tracking_entry_gid'] = params['time_tracking_entry_gid'] # noqa: E501 - - query_params = [] - if 'opt_fields' in params: - query_params.append(('opt_fields', params['opt_fields'])) # noqa: E501 - collection_formats['opt_fields'] = 'csv' # noqa: E501 - - header_params = {} - - form_params = [] - local_var_files = {} - - body_params = None - # HTTP header `Accept` - header_params['Accept'] = self.api_client.select_header_accept( - ['application/json; charset=UTF-8']) # noqa: E501 - - # Authentication setting - auth_settings = ['oauth2'] # noqa: E501 - - return self.api_client.call_api( - '/time_tracking_entries/{time_tracking_entry_gid}', 'GET', - path_params, - query_params, - header_params, - body=body_params, - post_params=form_params, - files=local_var_files, - response_type='TimeTrackingEntryBaseData', # noqa: E501 - auth_settings=auth_settings, - async_req=params.get('async_req'), - _return_http_data_only=params.get('_return_http_data_only'), - _preload_content=params.get('_preload_content', True), - _request_timeout=params.get('_request_timeout'), - collection_formats=collection_formats) - - def update_time_tracking_entry(self, body, time_tracking_entry_gid, **kwargs): # noqa: E501 - """Update a time tracking entry # noqa: E501 - - A specific, existing time tracking entry can be updated by making a `PUT` request on the URL for that time tracking entry. Only the fields provided in the `data` block will be updated; any unspecified fields will remain unchanged. When using this method, it is best to specify only those fields you wish to change, or else you may overwrite changes made by another user since you last retrieved the task. Returns the complete updated time tracking entry record. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.update_time_tracking_entry(body, time_tracking_entry_gid, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param TimeTrackingEntriesTimeTrackingEntryGidBody body: The updated fields for the time tracking entry. (required) - :param str time_tracking_entry_gid: Globally unique identifier for the time tracking entry. (required) - :param list[str] opt_fields: This endpoint returns a compact resource, which excludes some properties by default. To include those optional properties, set this query parameter to a comma-separated list of the properties you wish to include. - :return: TimeTrackingEntryBaseData - If the method is called asynchronously, - returns the request thread. - """ - kwargs['_return_http_data_only'] = True - if kwargs.get('async_req'): - return self.update_time_tracking_entry_with_http_info(body, time_tracking_entry_gid, **kwargs) # noqa: E501 - else: - (data) = self.update_time_tracking_entry_with_http_info(body, time_tracking_entry_gid, **kwargs) # noqa: E501 - return data - - def update_time_tracking_entry_with_http_info(self, body, time_tracking_entry_gid, **kwargs): # noqa: E501 - """Update a time tracking entry # noqa: E501 - - A specific, existing time tracking entry can be updated by making a `PUT` request on the URL for that time tracking entry. Only the fields provided in the `data` block will be updated; any unspecified fields will remain unchanged. When using this method, it is best to specify only those fields you wish to change, or else you may overwrite changes made by another user since you last retrieved the task. Returns the complete updated time tracking entry record. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.update_time_tracking_entry_with_http_info(body, time_tracking_entry_gid, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param TimeTrackingEntriesTimeTrackingEntryGidBody body: The updated fields for the time tracking entry. (required) - :param str time_tracking_entry_gid: Globally unique identifier for the time tracking entry. (required) - :param list[str] opt_fields: This endpoint returns a compact resource, which excludes some properties by default. To include those optional properties, set this query parameter to a comma-separated list of the properties you wish to include. - :return: TimeTrackingEntryBaseData - If the method is called asynchronously, - returns the request thread. - """ - - all_params = ['body', 'time_tracking_entry_gid', 'opt_fields'] # noqa: E501 - all_params.append('async_req') - all_params.append('_return_http_data_only') - all_params.append('_preload_content') - all_params.append('_request_timeout') - - params = locals() - for key, val in six.iteritems(params['kwargs']): - if key not in all_params: - raise TypeError( - "Got an unexpected keyword argument '%s'" - " to method update_time_tracking_entry" % key - ) - params[key] = val - del params['kwargs'] - # verify the required parameter 'body' is set - if ('body' not in params or - params['body'] is None): - raise ValueError("Missing the required parameter `body` when calling `update_time_tracking_entry`") # noqa: E501 - # verify the required parameter 'time_tracking_entry_gid' is set - if ('time_tracking_entry_gid' not in params or - params['time_tracking_entry_gid'] is None): - raise ValueError("Missing the required parameter `time_tracking_entry_gid` when calling `update_time_tracking_entry`") # noqa: E501 - - collection_formats = {} - - path_params = {} - if 'time_tracking_entry_gid' in params: - path_params['time_tracking_entry_gid'] = params['time_tracking_entry_gid'] # noqa: E501 - - query_params = [] - if 'opt_fields' in params: - query_params.append(('opt_fields', params['opt_fields'])) # noqa: E501 - collection_formats['opt_fields'] = 'csv' # noqa: E501 - - header_params = {} - - form_params = [] - local_var_files = {} - - body_params = None - if 'body' in params: - body_params = params['body'] - # HTTP header `Accept` - header_params['Accept'] = self.api_client.select_header_accept( - ['application/json; charset=UTF-8']) # noqa: E501 - - # HTTP header `Content-Type` - header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 - ['application/json; charset=UTF-8']) # noqa: E501 - - # Authentication setting - auth_settings = ['oauth2'] # noqa: E501 - - return self.api_client.call_api( - '/time_tracking_entries/{time_tracking_entry_gid}', 'PUT', - path_params, - query_params, - header_params, - body=body_params, - post_params=form_params, - files=local_var_files, - response_type='TimeTrackingEntryBaseData', # noqa: E501 - auth_settings=auth_settings, - async_req=params.get('async_req'), - _return_http_data_only=params.get('_return_http_data_only'), - _preload_content=params.get('_preload_content', True), - _request_timeout=params.get('_request_timeout'), - collection_formats=collection_formats) + all_params = ['body', 'time_tracking_entry_gid', 'opt_fields'] # noqa: E501 + all_params.append('async_req') + all_params.append('header_params') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + params = locals() + for key, val in six.iteritems(params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method update_time_tracking_entry" % key + ) + params[key] = val + del params['kwargs'] + # verify the required parameter 'body' is set + if ('body' not in params or + params['body'] is None): + raise ValueError("Missing the required parameter `body` when calling `update_time_tracking_entry`") # noqa: E501 + # verify the required parameter 'time_tracking_entry_gid' is set + if ('time_tracking_entry_gid' not in params or + params['time_tracking_entry_gid'] is None): + raise ValueError("Missing the required parameter `time_tracking_entry_gid` when calling `update_time_tracking_entry`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'time_tracking_entry_gid' in params: + path_params['time_tracking_entry_gid'] = params['time_tracking_entry_gid'] # noqa: E501 + + query_params = [] + if 'opt_fields' in params: + query_params.append(('opt_fields', params['opt_fields'])) # noqa: E501 + collection_formats['opt_fields'] = 'csv' # noqa: E501 + + header_params = kwargs.get("header_params", {}) + + form_params = [] + local_var_files = {} + + body_params = None + if 'body' in params: + body_params = params['body'] + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['application/json; charset=UTF-8']) # noqa: E501 + + # HTTP header `Content-Type` + header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 + ['application/json; charset=UTF-8']) # noqa: E501 + + # Authentication setting + auth_settings = ['oauth2'] # noqa: E501 + + return self.api_client.call_api( + '/time_tracking_entries/{time_tracking_entry_gid}', 'PUT', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='TimeTrackingEntryBaseData', # noqa: E501 + auth_settings=auth_settings, + async_req=params.get('async_req'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) diff --git a/asana/api/typeahead_api.py b/asana/api/typeahead_api.py index bfb99c22..f29005a1 100644 --- a/asana/api/typeahead_api.py +++ b/asana/api/typeahead_api.py @@ -21,133 +21,134 @@ class TypeaheadApi(object): - """NOTE: This class is auto generated by the swagger code generator program. +"""NOTE: This class is auto generated by the swagger code generator program. - Do not edit the class manually. - Ref: https://github.com/swagger-api/swagger-codegen +Do not edit the class manually. +Ref: https://github.com/swagger-api/swagger-codegen +""" + +def __init__(self, api_client=None): + if api_client is None: + api_client = ApiClient() + self.api_client = api_client + +def typeahead_for_workspace(self, workspace_gid, resource_type, **kwargs): # noqa: E501 + """Get objects via typeahead # noqa: E501 + + Retrieves objects in the workspace based via an auto-completion/typeahead search algorithm. This feature is meant to provide results quickly, so do not rely on this API to provide extremely accurate search results. The result set is limited to a single page of results with a maximum size, so you won’t be able to fetch large numbers of results. The typeahead search API provides search for objects from a single workspace. This endpoint should be used to query for objects when creating an auto-completion/typeahead search feature. This API is meant to provide results quickly and should not be relied upon for accurate or exhaustive search results. The results sets are limited in size and cannot be paginated. Queries return a compact representation of each object which is typically the gid and name fields. Interested in a specific set of fields or all of the fields?! Of course you are. Use field selectors to manipulate what data is included in a response. Resources with type `user` are returned in order of most contacted to least contacted. This is determined by task assignments, adding the user to projects, and adding the user as a follower to tasks, messages, etc. Resources with type `project` are returned in order of recency. This is determined when the user visits the project, is added to the project, and completes tasks in the project. Resources with type `task` are returned with priority placed on tasks the user is following, but no guarantee on the order of those tasks. Resources with type `project_template` are returned with priority placed on favorited project templates. Leaving the `query` string empty or omitted will give you results, still following the resource ordering above. This could be used to list users or projects that are relevant for the requesting user's api token. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.typeahead_for_workspace(workspace_gid, resource_type, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str workspace_gid: Globally unique identifier for the workspace or organization. (required) + :param str resource_type: The type of values the typeahead should return. You can choose from one of the following: `custom_field`, `project`, `project_template`, `portfolio`, `tag`, `task`, and `user`. Note that unlike in the names of endpoints, the types listed here are in singular form (e.g. `task`). Using multiple types is not yet supported. (required) + :param str type: *Deprecated: new integrations should prefer the resource_type field.* + :param str query: The string that will be used to search for relevant objects. If an empty string is passed in, the API will return results. + :param int count: 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. + :param list[str] opt_fields: This endpoint returns a compact resource, which excludes some properties by default. To include those optional properties, set this query parameter to a comma-separated list of the properties you wish to include. + :return: AsanaNamedResourceArray + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = kwargs.get("_return_http_data_only", True) + if kwargs.get('async_req'): + return self.typeahead_for_workspace_with_http_info(workspace_gid, resource_type, **kwargs) # noqa: E501 + else: + (data) = self.typeahead_for_workspace_with_http_info(workspace_gid, resource_type, **kwargs) # noqa: E501 + return data + +def typeahead_for_workspace_with_http_info(self, workspace_gid, resource_type, **kwargs): # noqa: E501 + """Get objects via typeahead # noqa: E501 + + Retrieves objects in the workspace based via an auto-completion/typeahead search algorithm. This feature is meant to provide results quickly, so do not rely on this API to provide extremely accurate search results. The result set is limited to a single page of results with a maximum size, so you won’t be able to fetch large numbers of results. The typeahead search API provides search for objects from a single workspace. This endpoint should be used to query for objects when creating an auto-completion/typeahead search feature. This API is meant to provide results quickly and should not be relied upon for accurate or exhaustive search results. The results sets are limited in size and cannot be paginated. Queries return a compact representation of each object which is typically the gid and name fields. Interested in a specific set of fields or all of the fields?! Of course you are. Use field selectors to manipulate what data is included in a response. Resources with type `user` are returned in order of most contacted to least contacted. This is determined by task assignments, adding the user to projects, and adding the user as a follower to tasks, messages, etc. Resources with type `project` are returned in order of recency. This is determined when the user visits the project, is added to the project, and completes tasks in the project. Resources with type `task` are returned with priority placed on tasks the user is following, but no guarantee on the order of those tasks. Resources with type `project_template` are returned with priority placed on favorited project templates. Leaving the `query` string empty or omitted will give you results, still following the resource ordering above. This could be used to list users or projects that are relevant for the requesting user's api token. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.typeahead_for_workspace_with_http_info(workspace_gid, resource_type, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str workspace_gid: Globally unique identifier for the workspace or organization. (required) + :param str resource_type: The type of values the typeahead should return. You can choose from one of the following: `custom_field`, `project`, `project_template`, `portfolio`, `tag`, `task`, and `user`. Note that unlike in the names of endpoints, the types listed here are in singular form (e.g. `task`). Using multiple types is not yet supported. (required) + :param str type: *Deprecated: new integrations should prefer the resource_type field.* + :param str query: The string that will be used to search for relevant objects. If an empty string is passed in, the API will return results. + :param int count: 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. + :param list[str] opt_fields: This endpoint returns a compact resource, which excludes some properties by default. To include those optional properties, set this query parameter to a comma-separated list of the properties you wish to include. + :return: AsanaNamedResourceArray + If the method is called asynchronously, + returns the request thread. """ - def __init__(self, api_client=None): - if api_client is None: - api_client = ApiClient() - self.api_client = api_client - - def typeahead_for_workspace(self, workspace_gid, resource_type, **kwargs): # noqa: E501 - """Get objects via typeahead # noqa: E501 - - Retrieves objects in the workspace based via an auto-completion/typeahead search algorithm. This feature is meant to provide results quickly, so do not rely on this API to provide extremely accurate search results. The result set is limited to a single page of results with a maximum size, so you won’t be able to fetch large numbers of results. The typeahead search API provides search for objects from a single workspace. This endpoint should be used to query for objects when creating an auto-completion/typeahead search feature. This API is meant to provide results quickly and should not be relied upon for accurate or exhaustive search results. The results sets are limited in size and cannot be paginated. Queries return a compact representation of each object which is typically the gid and name fields. Interested in a specific set of fields or all of the fields?! Of course you are. Use field selectors to manipulate what data is included in a response. Resources with type `user` are returned in order of most contacted to least contacted. This is determined by task assignments, adding the user to projects, and adding the user as a follower to tasks, messages, etc. Resources with type `project` are returned in order of recency. This is determined when the user visits the project, is added to the project, and completes tasks in the project. Resources with type `task` are returned with priority placed on tasks the user is following, but no guarantee on the order of those tasks. Resources with type `project_template` are returned with priority placed on favorited project templates. Leaving the `query` string empty or omitted will give you results, still following the resource ordering above. This could be used to list users or projects that are relevant for the requesting user's api token. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.typeahead_for_workspace(workspace_gid, resource_type, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param str workspace_gid: Globally unique identifier for the workspace or organization. (required) - :param str resource_type: The type of values the typeahead should return. You can choose from one of the following: `custom_field`, `project`, `project_template`, `portfolio`, `tag`, `task`, and `user`. Note that unlike in the names of endpoints, the types listed here are in singular form (e.g. `task`). Using multiple types is not yet supported. (required) - :param str type: *Deprecated: new integrations should prefer the resource_type field.* - :param str query: The string that will be used to search for relevant objects. If an empty string is passed in, the API will return results. - :param int count: 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. - :param list[str] opt_fields: This endpoint returns a compact resource, which excludes some properties by default. To include those optional properties, set this query parameter to a comma-separated list of the properties you wish to include. - :return: AsanaNamedResourceArray - If the method is called asynchronously, - returns the request thread. - """ - kwargs['_return_http_data_only'] = True - if kwargs.get('async_req'): - return self.typeahead_for_workspace_with_http_info(workspace_gid, resource_type, **kwargs) # noqa: E501 - else: - (data) = self.typeahead_for_workspace_with_http_info(workspace_gid, resource_type, **kwargs) # noqa: E501 - return data - - def typeahead_for_workspace_with_http_info(self, workspace_gid, resource_type, **kwargs): # noqa: E501 - """Get objects via typeahead # noqa: E501 - - Retrieves objects in the workspace based via an auto-completion/typeahead search algorithm. This feature is meant to provide results quickly, so do not rely on this API to provide extremely accurate search results. The result set is limited to a single page of results with a maximum size, so you won’t be able to fetch large numbers of results. The typeahead search API provides search for objects from a single workspace. This endpoint should be used to query for objects when creating an auto-completion/typeahead search feature. This API is meant to provide results quickly and should not be relied upon for accurate or exhaustive search results. The results sets are limited in size and cannot be paginated. Queries return a compact representation of each object which is typically the gid and name fields. Interested in a specific set of fields or all of the fields?! Of course you are. Use field selectors to manipulate what data is included in a response. Resources with type `user` are returned in order of most contacted to least contacted. This is determined by task assignments, adding the user to projects, and adding the user as a follower to tasks, messages, etc. Resources with type `project` are returned in order of recency. This is determined when the user visits the project, is added to the project, and completes tasks in the project. Resources with type `task` are returned with priority placed on tasks the user is following, but no guarantee on the order of those tasks. Resources with type `project_template` are returned with priority placed on favorited project templates. Leaving the `query` string empty or omitted will give you results, still following the resource ordering above. This could be used to list users or projects that are relevant for the requesting user's api token. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.typeahead_for_workspace_with_http_info(workspace_gid, resource_type, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param str workspace_gid: Globally unique identifier for the workspace or organization. (required) - :param str resource_type: The type of values the typeahead should return. You can choose from one of the following: `custom_field`, `project`, `project_template`, `portfolio`, `tag`, `task`, and `user`. Note that unlike in the names of endpoints, the types listed here are in singular form (e.g. `task`). Using multiple types is not yet supported. (required) - :param str type: *Deprecated: new integrations should prefer the resource_type field.* - :param str query: The string that will be used to search for relevant objects. If an empty string is passed in, the API will return results. - :param int count: 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. - :param list[str] opt_fields: This endpoint returns a compact resource, which excludes some properties by default. To include those optional properties, set this query parameter to a comma-separated list of the properties you wish to include. - :return: AsanaNamedResourceArray - If the method is called asynchronously, - returns the request thread. - """ - - all_params = ['workspace_gid', 'resource_type', 'type', 'query', 'count', 'opt_fields'] # noqa: E501 - all_params.append('async_req') - all_params.append('_return_http_data_only') - all_params.append('_preload_content') - all_params.append('_request_timeout') - - params = locals() - for key, val in six.iteritems(params['kwargs']): - if key not in all_params: - raise TypeError( - "Got an unexpected keyword argument '%s'" - " to method typeahead_for_workspace" % key - ) - params[key] = val - del params['kwargs'] - # verify the required parameter 'workspace_gid' is set - if ('workspace_gid' not in params or - params['workspace_gid'] is None): - raise ValueError("Missing the required parameter `workspace_gid` when calling `typeahead_for_workspace`") # noqa: E501 - # verify the required parameter 'resource_type' is set - if ('resource_type' not in params or - params['resource_type'] is None): - raise ValueError("Missing the required parameter `resource_type` when calling `typeahead_for_workspace`") # noqa: E501 - - collection_formats = {} - - path_params = {} - if 'workspace_gid' in params: - path_params['workspace_gid'] = params['workspace_gid'] # noqa: E501 - - query_params = [] - if 'resource_type' in params: - query_params.append(('resource_type', params['resource_type'])) # noqa: E501 - if 'type' in params: - query_params.append(('type', params['type'])) # noqa: E501 - if 'query' in params: - query_params.append(('query', params['query'])) # noqa: E501 - if 'count' in params: - query_params.append(('count', params['count'])) # noqa: E501 - if 'opt_fields' in params: - query_params.append(('opt_fields', params['opt_fields'])) # noqa: E501 - collection_formats['opt_fields'] = 'csv' # noqa: E501 - - header_params = {} - - form_params = [] - local_var_files = {} - - body_params = None - # HTTP header `Accept` - header_params['Accept'] = self.api_client.select_header_accept( - ['application/json; charset=UTF-8']) # noqa: E501 - - # Authentication setting - auth_settings = ['oauth2'] # noqa: E501 - - return self.api_client.call_api( - '/workspaces/{workspace_gid}/typeahead', 'GET', - path_params, - query_params, - header_params, - body=body_params, - post_params=form_params, - files=local_var_files, - response_type='AsanaNamedResourceArray', # noqa: E501 - auth_settings=auth_settings, - async_req=params.get('async_req'), - _return_http_data_only=params.get('_return_http_data_only'), - _preload_content=params.get('_preload_content', True), - _request_timeout=params.get('_request_timeout'), - collection_formats=collection_formats) + all_params = ['workspace_gid', 'resource_type', 'type', 'query', 'count', 'opt_fields'] # noqa: E501 + all_params.append('async_req') + all_params.append('header_params') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + params = locals() + for key, val in six.iteritems(params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method typeahead_for_workspace" % key + ) + params[key] = val + del params['kwargs'] + # verify the required parameter 'workspace_gid' is set + if ('workspace_gid' not in params or + params['workspace_gid'] is None): + raise ValueError("Missing the required parameter `workspace_gid` when calling `typeahead_for_workspace`") # noqa: E501 + # verify the required parameter 'resource_type' is set + if ('resource_type' not in params or + params['resource_type'] is None): + raise ValueError("Missing the required parameter `resource_type` when calling `typeahead_for_workspace`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'workspace_gid' in params: + path_params['workspace_gid'] = params['workspace_gid'] # noqa: E501 + + query_params = [] + if 'resource_type' in params: + query_params.append(('resource_type', params['resource_type'])) # noqa: E501 + if 'type' in params: + query_params.append(('type', params['type'])) # noqa: E501 + if 'query' in params: + query_params.append(('query', params['query'])) # noqa: E501 + if 'count' in params: + query_params.append(('count', params['count'])) # noqa: E501 + if 'opt_fields' in params: + query_params.append(('opt_fields', params['opt_fields'])) # noqa: E501 + collection_formats['opt_fields'] = 'csv' # noqa: E501 + + header_params = kwargs.get("header_params", {}) + + form_params = [] + local_var_files = {} + + body_params = None + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['application/json; charset=UTF-8']) # noqa: E501 + + # Authentication setting + auth_settings = ['oauth2'] # noqa: E501 + + return self.api_client.call_api( + '/workspaces/{workspace_gid}/typeahead', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='AsanaNamedResourceArray', # noqa: E501 + auth_settings=auth_settings, + async_req=params.get('async_req'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) diff --git a/asana/api/user_task_lists_api.py b/asana/api/user_task_lists_api.py index 8211ff55..65086067 100644 --- a/asana/api/user_task_lists_api.py +++ b/asana/api/user_task_lists_api.py @@ -21,221 +21,223 @@ class UserTaskListsApi(object): - """NOTE: This class is auto generated by the swagger code generator program. +"""NOTE: This class is auto generated by the swagger code generator program. - Do not edit the class manually. - Ref: https://github.com/swagger-api/swagger-codegen +Do not edit the class manually. +Ref: https://github.com/swagger-api/swagger-codegen +""" + +def __init__(self, api_client=None): + if api_client is None: + api_client = ApiClient() + self.api_client = api_client + +def get_user_task_list(self, user_task_list_gid, **kwargs): # noqa: E501 + """Get a user task list # noqa: E501 + + Returns the full record for a user task list. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.get_user_task_list(user_task_list_gid, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str user_task_list_gid: Globally unique identifier for the user task list. (required) + :param list[str] opt_fields: This endpoint returns a compact resource, which excludes some properties by default. To include those optional properties, set this query parameter to a comma-separated list of the properties you wish to include. + :return: UserTaskListResponseData + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = kwargs.get("_return_http_data_only", True) + if kwargs.get('async_req'): + return self.get_user_task_list_with_http_info(user_task_list_gid, **kwargs) # noqa: E501 + else: + (data) = self.get_user_task_list_with_http_info(user_task_list_gid, **kwargs) # noqa: E501 + return data + +def get_user_task_list_with_http_info(self, user_task_list_gid, **kwargs): # noqa: E501 + """Get a user task list # noqa: E501 + + Returns the full record for a user task list. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.get_user_task_list_with_http_info(user_task_list_gid, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str user_task_list_gid: Globally unique identifier for the user task list. (required) + :param list[str] opt_fields: This endpoint returns a compact resource, which excludes some properties by default. To include those optional properties, set this query parameter to a comma-separated list of the properties you wish to include. + :return: UserTaskListResponseData + If the method is called asynchronously, + returns the request thread. + """ + + all_params = ['user_task_list_gid', 'opt_fields'] # noqa: E501 + all_params.append('async_req') + all_params.append('header_params') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + params = locals() + for key, val in six.iteritems(params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method get_user_task_list" % key + ) + params[key] = val + del params['kwargs'] + # verify the required parameter 'user_task_list_gid' is set + if ('user_task_list_gid' not in params or + params['user_task_list_gid'] is None): + raise ValueError("Missing the required parameter `user_task_list_gid` when calling `get_user_task_list`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'user_task_list_gid' in params: + path_params['user_task_list_gid'] = params['user_task_list_gid'] # noqa: E501 + + query_params = [] + if 'opt_fields' in params: + query_params.append(('opt_fields', params['opt_fields'])) # noqa: E501 + collection_formats['opt_fields'] = 'csv' # noqa: E501 + + header_params = kwargs.get("header_params", {}) + + form_params = [] + local_var_files = {} + + body_params = None + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['application/json; charset=UTF-8']) # noqa: E501 + + # Authentication setting + auth_settings = ['oauth2'] # noqa: E501 + + return self.api_client.call_api( + '/user_task_lists/{user_task_list_gid}', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='UserTaskListResponseData', # noqa: E501 + auth_settings=auth_settings, + async_req=params.get('async_req'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) + +def get_user_task_list_for_user(self, user_gid, workspace, **kwargs): # noqa: E501 + """Get a user's task list # noqa: E501 + + Returns the full record for a user's task list. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.get_user_task_list_for_user(user_gid, workspace, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str user_gid: A string identifying a user. This can either be the string \"me\", an email, or the gid of a user. (required) + :param str workspace: The workspace in which to get the user task list. (required) + :param list[str] opt_fields: This endpoint returns a compact resource, which excludes some properties by default. To include those optional properties, set this query parameter to a comma-separated list of the properties you wish to include. + :return: UserTaskListResponseData + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = kwargs.get("_return_http_data_only", True) + if kwargs.get('async_req'): + return self.get_user_task_list_for_user_with_http_info(user_gid, workspace, **kwargs) # noqa: E501 + else: + (data) = self.get_user_task_list_for_user_with_http_info(user_gid, workspace, **kwargs) # noqa: E501 + return data + +def get_user_task_list_for_user_with_http_info(self, user_gid, workspace, **kwargs): # noqa: E501 + """Get a user's task list # noqa: E501 + + Returns the full record for a user's task list. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.get_user_task_list_for_user_with_http_info(user_gid, workspace, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str user_gid: A string identifying a user. This can either be the string \"me\", an email, or the gid of a user. (required) + :param str workspace: The workspace in which to get the user task list. (required) + :param list[str] opt_fields: This endpoint returns a compact resource, which excludes some properties by default. To include those optional properties, set this query parameter to a comma-separated list of the properties you wish to include. + :return: UserTaskListResponseData + If the method is called asynchronously, + returns the request thread. """ - def __init__(self, api_client=None): - if api_client is None: - api_client = ApiClient() - self.api_client = api_client - - def get_user_task_list(self, user_task_list_gid, **kwargs): # noqa: E501 - """Get a user task list # noqa: E501 - - Returns the full record for a user task list. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.get_user_task_list(user_task_list_gid, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param str user_task_list_gid: Globally unique identifier for the user task list. (required) - :param list[str] opt_fields: This endpoint returns a compact resource, which excludes some properties by default. To include those optional properties, set this query parameter to a comma-separated list of the properties you wish to include. - :return: UserTaskListResponseData - If the method is called asynchronously, - returns the request thread. - """ - kwargs['_return_http_data_only'] = True - if kwargs.get('async_req'): - return self.get_user_task_list_with_http_info(user_task_list_gid, **kwargs) # noqa: E501 - else: - (data) = self.get_user_task_list_with_http_info(user_task_list_gid, **kwargs) # noqa: E501 - return data - - def get_user_task_list_with_http_info(self, user_task_list_gid, **kwargs): # noqa: E501 - """Get a user task list # noqa: E501 - - Returns the full record for a user task list. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.get_user_task_list_with_http_info(user_task_list_gid, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param str user_task_list_gid: Globally unique identifier for the user task list. (required) - :param list[str] opt_fields: This endpoint returns a compact resource, which excludes some properties by default. To include those optional properties, set this query parameter to a comma-separated list of the properties you wish to include. - :return: UserTaskListResponseData - If the method is called asynchronously, - returns the request thread. - """ - - all_params = ['user_task_list_gid', 'opt_fields'] # noqa: E501 - all_params.append('async_req') - all_params.append('_return_http_data_only') - all_params.append('_preload_content') - all_params.append('_request_timeout') - - params = locals() - for key, val in six.iteritems(params['kwargs']): - if key not in all_params: - raise TypeError( - "Got an unexpected keyword argument '%s'" - " to method get_user_task_list" % key - ) - params[key] = val - del params['kwargs'] - # verify the required parameter 'user_task_list_gid' is set - if ('user_task_list_gid' not in params or - params['user_task_list_gid'] is None): - raise ValueError("Missing the required parameter `user_task_list_gid` when calling `get_user_task_list`") # noqa: E501 - - collection_formats = {} - - path_params = {} - if 'user_task_list_gid' in params: - path_params['user_task_list_gid'] = params['user_task_list_gid'] # noqa: E501 - - query_params = [] - if 'opt_fields' in params: - query_params.append(('opt_fields', params['opt_fields'])) # noqa: E501 - collection_formats['opt_fields'] = 'csv' # noqa: E501 - - header_params = {} - - form_params = [] - local_var_files = {} - - body_params = None - # HTTP header `Accept` - header_params['Accept'] = self.api_client.select_header_accept( - ['application/json; charset=UTF-8']) # noqa: E501 - - # Authentication setting - auth_settings = ['oauth2'] # noqa: E501 - - return self.api_client.call_api( - '/user_task_lists/{user_task_list_gid}', 'GET', - path_params, - query_params, - header_params, - body=body_params, - post_params=form_params, - files=local_var_files, - response_type='UserTaskListResponseData', # noqa: E501 - auth_settings=auth_settings, - async_req=params.get('async_req'), - _return_http_data_only=params.get('_return_http_data_only'), - _preload_content=params.get('_preload_content', True), - _request_timeout=params.get('_request_timeout'), - collection_formats=collection_formats) - - def get_user_task_list_for_user(self, user_gid, workspace, **kwargs): # noqa: E501 - """Get a user's task list # noqa: E501 - - Returns the full record for a user's task list. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.get_user_task_list_for_user(user_gid, workspace, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param str user_gid: A string identifying a user. This can either be the string \"me\", an email, or the gid of a user. (required) - :param str workspace: The workspace in which to get the user task list. (required) - :param list[str] opt_fields: This endpoint returns a compact resource, which excludes some properties by default. To include those optional properties, set this query parameter to a comma-separated list of the properties you wish to include. - :return: UserTaskListResponseData - If the method is called asynchronously, - returns the request thread. - """ - kwargs['_return_http_data_only'] = True - if kwargs.get('async_req'): - return self.get_user_task_list_for_user_with_http_info(user_gid, workspace, **kwargs) # noqa: E501 - else: - (data) = self.get_user_task_list_for_user_with_http_info(user_gid, workspace, **kwargs) # noqa: E501 - return data - - def get_user_task_list_for_user_with_http_info(self, user_gid, workspace, **kwargs): # noqa: E501 - """Get a user's task list # noqa: E501 - - Returns the full record for a user's task list. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.get_user_task_list_for_user_with_http_info(user_gid, workspace, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param str user_gid: A string identifying a user. This can either be the string \"me\", an email, or the gid of a user. (required) - :param str workspace: The workspace in which to get the user task list. (required) - :param list[str] opt_fields: This endpoint returns a compact resource, which excludes some properties by default. To include those optional properties, set this query parameter to a comma-separated list of the properties you wish to include. - :return: UserTaskListResponseData - If the method is called asynchronously, - returns the request thread. - """ - - all_params = ['user_gid', 'workspace', 'opt_fields'] # noqa: E501 - all_params.append('async_req') - all_params.append('_return_http_data_only') - all_params.append('_preload_content') - all_params.append('_request_timeout') - - params = locals() - for key, val in six.iteritems(params['kwargs']): - if key not in all_params: - raise TypeError( - "Got an unexpected keyword argument '%s'" - " to method get_user_task_list_for_user" % key - ) - params[key] = val - del params['kwargs'] - # verify the required parameter 'user_gid' is set - if ('user_gid' not in params or - params['user_gid'] is None): - raise ValueError("Missing the required parameter `user_gid` when calling `get_user_task_list_for_user`") # noqa: E501 - # verify the required parameter 'workspace' is set - if ('workspace' not in params or - params['workspace'] is None): - raise ValueError("Missing the required parameter `workspace` when calling `get_user_task_list_for_user`") # noqa: E501 - - collection_formats = {} - - path_params = {} - if 'user_gid' in params: - path_params['user_gid'] = params['user_gid'] # noqa: E501 - - query_params = [] - if 'workspace' in params: - query_params.append(('workspace', params['workspace'])) # noqa: E501 - if 'opt_fields' in params: - query_params.append(('opt_fields', params['opt_fields'])) # noqa: E501 - collection_formats['opt_fields'] = 'csv' # noqa: E501 - - header_params = {} - - form_params = [] - local_var_files = {} - - body_params = None - # HTTP header `Accept` - header_params['Accept'] = self.api_client.select_header_accept( - ['application/json; charset=UTF-8']) # noqa: E501 - - # Authentication setting - auth_settings = ['oauth2'] # noqa: E501 - - return self.api_client.call_api( - '/users/{user_gid}/user_task_list', 'GET', - path_params, - query_params, - header_params, - body=body_params, - post_params=form_params, - files=local_var_files, - response_type='UserTaskListResponseData', # noqa: E501 - auth_settings=auth_settings, - async_req=params.get('async_req'), - _return_http_data_only=params.get('_return_http_data_only'), - _preload_content=params.get('_preload_content', True), - _request_timeout=params.get('_request_timeout'), - collection_formats=collection_formats) + all_params = ['user_gid', 'workspace', 'opt_fields'] # noqa: E501 + all_params.append('async_req') + all_params.append('header_params') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + params = locals() + for key, val in six.iteritems(params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method get_user_task_list_for_user" % key + ) + params[key] = val + del params['kwargs'] + # verify the required parameter 'user_gid' is set + if ('user_gid' not in params or + params['user_gid'] is None): + raise ValueError("Missing the required parameter `user_gid` when calling `get_user_task_list_for_user`") # noqa: E501 + # verify the required parameter 'workspace' is set + if ('workspace' not in params or + params['workspace'] is None): + raise ValueError("Missing the required parameter `workspace` when calling `get_user_task_list_for_user`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'user_gid' in params: + path_params['user_gid'] = params['user_gid'] # noqa: E501 + + query_params = [] + if 'workspace' in params: + query_params.append(('workspace', params['workspace'])) # noqa: E501 + if 'opt_fields' in params: + query_params.append(('opt_fields', params['opt_fields'])) # noqa: E501 + collection_formats['opt_fields'] = 'csv' # noqa: E501 + + header_params = kwargs.get("header_params", {}) + + form_params = [] + local_var_files = {} + + body_params = None + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['application/json; charset=UTF-8']) # noqa: E501 + + # Authentication setting + auth_settings = ['oauth2'] # noqa: E501 + + return self.api_client.call_api( + '/users/{user_gid}/user_task_list', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='UserTaskListResponseData', # noqa: E501 + auth_settings=auth_settings, + async_req=params.get('async_req'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) diff --git a/asana/api/users_api.py b/asana/api/users_api.py index e8bc381a..cf5d0fea 100644 --- a/asana/api/users_api.py +++ b/asana/api/users_api.py @@ -21,553 +21,558 @@ class UsersApi(object): - """NOTE: This class is auto generated by the swagger code generator program. +"""NOTE: This class is auto generated by the swagger code generator program. - Do not edit the class manually. - Ref: https://github.com/swagger-api/swagger-codegen +Do not edit the class manually. +Ref: https://github.com/swagger-api/swagger-codegen +""" + +def __init__(self, api_client=None): + if api_client is None: + api_client = ApiClient() + self.api_client = api_client + +def get_favorites_for_user(self, user_gid, resource_type, workspace, **kwargs): # noqa: E501 + """Get a user's favorites # noqa: E501 + + Returns all of a user's favorites in the given workspace, of the given type. Results are given in order (The same order as Asana's sidebar). # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.get_favorites_for_user(user_gid, resource_type, workspace, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str user_gid: A string identifying a user. This can either be the string \"me\", an email, or the gid of a user. (required) + :param str resource_type: The resource type of favorites to be returned. (required) + :param str workspace: The workspace in which to get favorites. (required) + :param int limit: Results per page. The number of objects to return per page. The value must be between 1 and 100. + :param str offset: 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 list[str] opt_fields: This endpoint returns a compact resource, which excludes some properties by default. To include those optional properties, set this query parameter to a comma-separated list of the properties you wish to include. + :return: AsanaNamedResourceArray + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = kwargs.get("_return_http_data_only", True) + if kwargs.get('async_req'): + return self.get_favorites_for_user_with_http_info(user_gid, resource_type, workspace, **kwargs) # noqa: E501 + else: + (data) = self.get_favorites_for_user_with_http_info(user_gid, resource_type, workspace, **kwargs) # noqa: E501 + return data + +def get_favorites_for_user_with_http_info(self, user_gid, resource_type, workspace, **kwargs): # noqa: E501 + """Get a user's favorites # noqa: E501 + + Returns all of a user's favorites in the given workspace, of the given type. Results are given in order (The same order as Asana's sidebar). # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.get_favorites_for_user_with_http_info(user_gid, resource_type, workspace, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str user_gid: A string identifying a user. This can either be the string \"me\", an email, or the gid of a user. (required) + :param str resource_type: The resource type of favorites to be returned. (required) + :param str workspace: The workspace in which to get favorites. (required) + :param int limit: Results per page. The number of objects to return per page. The value must be between 1 and 100. + :param str offset: 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 list[str] opt_fields: This endpoint returns a compact resource, which excludes some properties by default. To include those optional properties, set this query parameter to a comma-separated list of the properties you wish to include. + :return: AsanaNamedResourceArray + If the method is called asynchronously, + returns the request thread. + """ + + all_params = ['user_gid', 'resource_type', 'workspace', 'limit', 'offset', 'opt_fields'] # noqa: E501 + all_params.append('async_req') + all_params.append('header_params') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + params = locals() + for key, val in six.iteritems(params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method get_favorites_for_user" % key + ) + params[key] = val + del params['kwargs'] + # verify the required parameter 'user_gid' is set + if ('user_gid' not in params or + params['user_gid'] is None): + raise ValueError("Missing the required parameter `user_gid` when calling `get_favorites_for_user`") # noqa: E501 + # verify the required parameter 'resource_type' is set + if ('resource_type' not in params or + params['resource_type'] is None): + raise ValueError("Missing the required parameter `resource_type` when calling `get_favorites_for_user`") # noqa: E501 + # verify the required parameter 'workspace' is set + if ('workspace' not in params or + params['workspace'] is None): + raise ValueError("Missing the required parameter `workspace` when calling `get_favorites_for_user`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'user_gid' in params: + path_params['user_gid'] = params['user_gid'] # noqa: E501 + + query_params = [] + if 'limit' in params: + query_params.append(('limit', params['limit'])) # noqa: E501 + if 'offset' in params: + query_params.append(('offset', params['offset'])) # noqa: E501 + if 'resource_type' in params: + query_params.append(('resource_type', params['resource_type'])) # noqa: E501 + if 'workspace' in params: + query_params.append(('workspace', params['workspace'])) # noqa: E501 + if 'opt_fields' in params: + query_params.append(('opt_fields', params['opt_fields'])) # noqa: E501 + collection_formats['opt_fields'] = 'csv' # noqa: E501 + + header_params = kwargs.get("header_params", {}) + + form_params = [] + local_var_files = {} + + body_params = None + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['application/json; charset=UTF-8']) # noqa: E501 + + # Authentication setting + auth_settings = ['oauth2'] # noqa: E501 + + return self.api_client.call_api( + '/users/{user_gid}/favorites', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='AsanaNamedResourceArray', # noqa: E501 + auth_settings=auth_settings, + async_req=params.get('async_req'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) + +def get_user(self, user_gid, **kwargs): # noqa: E501 + """Get a user # noqa: E501 + + Returns the full user record for the single user with the provided ID. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.get_user(user_gid, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str user_gid: A string identifying a user. This can either be the string \"me\", an email, or the gid of a user. (required) + :param list[str] opt_fields: This endpoint returns a compact resource, which excludes some properties by default. To include those optional properties, set this query parameter to a comma-separated list of the properties you wish to include. + :return: UserResponseData + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = kwargs.get("_return_http_data_only", True) + if kwargs.get('async_req'): + return self.get_user_with_http_info(user_gid, **kwargs) # noqa: E501 + else: + (data) = self.get_user_with_http_info(user_gid, **kwargs) # noqa: E501 + return data + +def get_user_with_http_info(self, user_gid, **kwargs): # noqa: E501 + """Get a user # noqa: E501 + + Returns the full user record for the single user with the provided ID. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.get_user_with_http_info(user_gid, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str user_gid: A string identifying a user. This can either be the string \"me\", an email, or the gid of a user. (required) + :param list[str] opt_fields: This endpoint returns a compact resource, which excludes some properties by default. To include those optional properties, set this query parameter to a comma-separated list of the properties you wish to include. + :return: UserResponseData + If the method is called asynchronously, + returns the request thread. + """ + + all_params = ['user_gid', 'opt_fields'] # noqa: E501 + all_params.append('async_req') + all_params.append('header_params') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + params = locals() + for key, val in six.iteritems(params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method get_user" % key + ) + params[key] = val + del params['kwargs'] + # verify the required parameter 'user_gid' is set + if ('user_gid' not in params or + params['user_gid'] is None): + raise ValueError("Missing the required parameter `user_gid` when calling `get_user`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'user_gid' in params: + path_params['user_gid'] = params['user_gid'] # noqa: E501 + + query_params = [] + if 'opt_fields' in params: + query_params.append(('opt_fields', params['opt_fields'])) # noqa: E501 + collection_formats['opt_fields'] = 'csv' # noqa: E501 + + header_params = kwargs.get("header_params", {}) + + form_params = [] + local_var_files = {} + + body_params = None + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['application/json; charset=UTF-8']) # noqa: E501 + + # Authentication setting + auth_settings = ['oauth2'] # noqa: E501 + + return self.api_client.call_api( + '/users/{user_gid}', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='UserResponseData', # noqa: E501 + auth_settings=auth_settings, + async_req=params.get('async_req'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) + +def get_users(self, **kwargs): # noqa: E501 + """Get multiple users # noqa: E501 + + Returns the user records for all users in all workspaces and organizations accessible to the authenticated user. Accepts an optional workspace ID parameter. Results are sorted by user ID. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.get_users(async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str workspace: The workspace or organization ID to filter users on. + :param str team: The team ID to filter users on. + :param int limit: Results per page. The number of objects to return per page. The value must be between 1 and 100. + :param str offset: 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 list[str] opt_fields: This endpoint returns a compact resource, which excludes some properties by default. To include those optional properties, set this query parameter to a comma-separated list of the properties you wish to include. + :return: UserResponseArray + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = kwargs.get("_return_http_data_only", True) + if kwargs.get('async_req'): + return self.get_users_with_http_info(**kwargs) # noqa: E501 + else: + (data) = self.get_users_with_http_info(**kwargs) # noqa: E501 + return data + +def get_users_with_http_info(self, **kwargs): # noqa: E501 + """Get multiple users # noqa: E501 + + Returns the user records for all users in all workspaces and organizations accessible to the authenticated user. Accepts an optional workspace ID parameter. Results are sorted by user ID. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.get_users_with_http_info(async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str workspace: The workspace or organization ID to filter users on. + :param str team: The team ID to filter users on. + :param int limit: Results per page. The number of objects to return per page. The value must be between 1 and 100. + :param str offset: 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 list[str] opt_fields: This endpoint returns a compact resource, which excludes some properties by default. To include those optional properties, set this query parameter to a comma-separated list of the properties you wish to include. + :return: UserResponseArray + If the method is called asynchronously, + returns the request thread. + """ + + all_params = ['workspace', 'team', 'limit', 'offset', 'opt_fields'] # noqa: E501 + all_params.append('async_req') + all_params.append('header_params') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + params = locals() + for key, val in six.iteritems(params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method get_users" % key + ) + params[key] = val + del params['kwargs'] + + collection_formats = {} + + path_params = {} + + query_params = [] + if 'workspace' in params: + query_params.append(('workspace', params['workspace'])) # noqa: E501 + if 'team' in params: + query_params.append(('team', params['team'])) # noqa: E501 + if 'limit' in params: + query_params.append(('limit', params['limit'])) # noqa: E501 + if 'offset' in params: + query_params.append(('offset', params['offset'])) # noqa: E501 + if 'opt_fields' in params: + query_params.append(('opt_fields', params['opt_fields'])) # noqa: E501 + collection_formats['opt_fields'] = 'csv' # noqa: E501 + + header_params = kwargs.get("header_params", {}) + + form_params = [] + local_var_files = {} + + body_params = None + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['application/json; charset=UTF-8']) # noqa: E501 + + # Authentication setting + auth_settings = ['oauth2'] # noqa: E501 + + return self.api_client.call_api( + '/users', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='UserResponseArray', # noqa: E501 + auth_settings=auth_settings, + async_req=params.get('async_req'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) + +def get_users_for_team(self, team_gid, **kwargs): # noqa: E501 + """Get users in a team # noqa: E501 + + Returns the compact records for all users that are members of the team. Results are sorted alphabetically and limited to 2000. For more results use the `/users` endpoint. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.get_users_for_team(team_gid, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str team_gid: Globally unique identifier for the team. (required) + :param str offset: 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 list[str] opt_fields: This endpoint returns a compact resource, which excludes some properties by default. To include those optional properties, set this query parameter to a comma-separated list of the properties you wish to include. + :return: UserResponseArray + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = kwargs.get("_return_http_data_only", True) + if kwargs.get('async_req'): + return self.get_users_for_team_with_http_info(team_gid, **kwargs) # noqa: E501 + else: + (data) = self.get_users_for_team_with_http_info(team_gid, **kwargs) # noqa: E501 + return data + +def get_users_for_team_with_http_info(self, team_gid, **kwargs): # noqa: E501 + """Get users in a team # noqa: E501 + + Returns the compact records for all users that are members of the team. Results are sorted alphabetically and limited to 2000. For more results use the `/users` endpoint. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.get_users_for_team_with_http_info(team_gid, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str team_gid: Globally unique identifier for the team. (required) + :param str offset: 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 list[str] opt_fields: This endpoint returns a compact resource, which excludes some properties by default. To include those optional properties, set this query parameter to a comma-separated list of the properties you wish to include. + :return: UserResponseArray + If the method is called asynchronously, + returns the request thread. + """ + + all_params = ['team_gid', 'offset', 'opt_fields'] # noqa: E501 + all_params.append('async_req') + all_params.append('header_params') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + params = locals() + for key, val in six.iteritems(params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method get_users_for_team" % key + ) + params[key] = val + del params['kwargs'] + # verify the required parameter 'team_gid' is set + if ('team_gid' not in params or + params['team_gid'] is None): + raise ValueError("Missing the required parameter `team_gid` when calling `get_users_for_team`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'team_gid' in params: + path_params['team_gid'] = params['team_gid'] # noqa: E501 + + query_params = [] + if 'offset' in params: + query_params.append(('offset', params['offset'])) # noqa: E501 + if 'opt_fields' in params: + query_params.append(('opt_fields', params['opt_fields'])) # noqa: E501 + collection_formats['opt_fields'] = 'csv' # noqa: E501 + + header_params = kwargs.get("header_params", {}) + + form_params = [] + local_var_files = {} + + body_params = None + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['application/json; charset=UTF-8']) # noqa: E501 + + # Authentication setting + auth_settings = ['oauth2'] # noqa: E501 + + return self.api_client.call_api( + '/teams/{team_gid}/users', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='UserResponseArray', # noqa: E501 + auth_settings=auth_settings, + async_req=params.get('async_req'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) + +def get_users_for_workspace(self, workspace_gid, **kwargs): # noqa: E501 + """Get users in a workspace or organization # noqa: E501 + + Returns the compact records for all users in the specified workspace or organization. Results are sorted alphabetically and limited to 2000. For more results use the `/users` endpoint. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.get_users_for_workspace(workspace_gid, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str workspace_gid: Globally unique identifier for the workspace or organization. (required) + :param str offset: 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 list[str] opt_fields: This endpoint returns a compact resource, which excludes some properties by default. To include those optional properties, set this query parameter to a comma-separated list of the properties you wish to include. + :return: UserResponseArray + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = kwargs.get("_return_http_data_only", True) + if kwargs.get('async_req'): + return self.get_users_for_workspace_with_http_info(workspace_gid, **kwargs) # noqa: E501 + else: + (data) = self.get_users_for_workspace_with_http_info(workspace_gid, **kwargs) # noqa: E501 + return data + +def get_users_for_workspace_with_http_info(self, workspace_gid, **kwargs): # noqa: E501 + """Get users in a workspace or organization # noqa: E501 + + Returns the compact records for all users in the specified workspace or organization. Results are sorted alphabetically and limited to 2000. For more results use the `/users` endpoint. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.get_users_for_workspace_with_http_info(workspace_gid, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str workspace_gid: Globally unique identifier for the workspace or organization. (required) + :param str offset: 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 list[str] opt_fields: This endpoint returns a compact resource, which excludes some properties by default. To include those optional properties, set this query parameter to a comma-separated list of the properties you wish to include. + :return: UserResponseArray + If the method is called asynchronously, + returns the request thread. """ - def __init__(self, api_client=None): - if api_client is None: - api_client = ApiClient() - self.api_client = api_client - - def get_favorites_for_user(self, user_gid, resource_type, workspace, **kwargs): # noqa: E501 - """Get a user's favorites # noqa: E501 - - Returns all of a user's favorites in the given workspace, of the given type. Results are given in order (The same order as Asana's sidebar). # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.get_favorites_for_user(user_gid, resource_type, workspace, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param str user_gid: A string identifying a user. This can either be the string \"me\", an email, or the gid of a user. (required) - :param str resource_type: The resource type of favorites to be returned. (required) - :param str workspace: The workspace in which to get favorites. (required) - :param int limit: Results per page. The number of objects to return per page. The value must be between 1 and 100. - :param str offset: 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 list[str] opt_fields: This endpoint returns a compact resource, which excludes some properties by default. To include those optional properties, set this query parameter to a comma-separated list of the properties you wish to include. - :return: AsanaNamedResourceArray - If the method is called asynchronously, - returns the request thread. - """ - kwargs['_return_http_data_only'] = True - if kwargs.get('async_req'): - return self.get_favorites_for_user_with_http_info(user_gid, resource_type, workspace, **kwargs) # noqa: E501 - else: - (data) = self.get_favorites_for_user_with_http_info(user_gid, resource_type, workspace, **kwargs) # noqa: E501 - return data - - def get_favorites_for_user_with_http_info(self, user_gid, resource_type, workspace, **kwargs): # noqa: E501 - """Get a user's favorites # noqa: E501 - - Returns all of a user's favorites in the given workspace, of the given type. Results are given in order (The same order as Asana's sidebar). # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.get_favorites_for_user_with_http_info(user_gid, resource_type, workspace, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param str user_gid: A string identifying a user. This can either be the string \"me\", an email, or the gid of a user. (required) - :param str resource_type: The resource type of favorites to be returned. (required) - :param str workspace: The workspace in which to get favorites. (required) - :param int limit: Results per page. The number of objects to return per page. The value must be between 1 and 100. - :param str offset: 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 list[str] opt_fields: This endpoint returns a compact resource, which excludes some properties by default. To include those optional properties, set this query parameter to a comma-separated list of the properties you wish to include. - :return: AsanaNamedResourceArray - If the method is called asynchronously, - returns the request thread. - """ - - all_params = ['user_gid', 'resource_type', 'workspace', 'limit', 'offset', 'opt_fields'] # noqa: E501 - all_params.append('async_req') - all_params.append('_return_http_data_only') - all_params.append('_preload_content') - all_params.append('_request_timeout') - - params = locals() - for key, val in six.iteritems(params['kwargs']): - if key not in all_params: - raise TypeError( - "Got an unexpected keyword argument '%s'" - " to method get_favorites_for_user" % key - ) - params[key] = val - del params['kwargs'] - # verify the required parameter 'user_gid' is set - if ('user_gid' not in params or - params['user_gid'] is None): - raise ValueError("Missing the required parameter `user_gid` when calling `get_favorites_for_user`") # noqa: E501 - # verify the required parameter 'resource_type' is set - if ('resource_type' not in params or - params['resource_type'] is None): - raise ValueError("Missing the required parameter `resource_type` when calling `get_favorites_for_user`") # noqa: E501 - # verify the required parameter 'workspace' is set - if ('workspace' not in params or - params['workspace'] is None): - raise ValueError("Missing the required parameter `workspace` when calling `get_favorites_for_user`") # noqa: E501 - - collection_formats = {} - - path_params = {} - if 'user_gid' in params: - path_params['user_gid'] = params['user_gid'] # noqa: E501 - - query_params = [] - if 'limit' in params: - query_params.append(('limit', params['limit'])) # noqa: E501 - if 'offset' in params: - query_params.append(('offset', params['offset'])) # noqa: E501 - if 'resource_type' in params: - query_params.append(('resource_type', params['resource_type'])) # noqa: E501 - if 'workspace' in params: - query_params.append(('workspace', params['workspace'])) # noqa: E501 - if 'opt_fields' in params: - query_params.append(('opt_fields', params['opt_fields'])) # noqa: E501 - collection_formats['opt_fields'] = 'csv' # noqa: E501 - - header_params = {} - - form_params = [] - local_var_files = {} - - body_params = None - # HTTP header `Accept` - header_params['Accept'] = self.api_client.select_header_accept( - ['application/json; charset=UTF-8']) # noqa: E501 - - # Authentication setting - auth_settings = ['oauth2'] # noqa: E501 - - return self.api_client.call_api( - '/users/{user_gid}/favorites', 'GET', - path_params, - query_params, - header_params, - body=body_params, - post_params=form_params, - files=local_var_files, - response_type='AsanaNamedResourceArray', # noqa: E501 - auth_settings=auth_settings, - async_req=params.get('async_req'), - _return_http_data_only=params.get('_return_http_data_only'), - _preload_content=params.get('_preload_content', True), - _request_timeout=params.get('_request_timeout'), - collection_formats=collection_formats) - - def get_user(self, user_gid, **kwargs): # noqa: E501 - """Get a user # noqa: E501 - - Returns the full user record for the single user with the provided ID. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.get_user(user_gid, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param str user_gid: A string identifying a user. This can either be the string \"me\", an email, or the gid of a user. (required) - :param list[str] opt_fields: This endpoint returns a compact resource, which excludes some properties by default. To include those optional properties, set this query parameter to a comma-separated list of the properties you wish to include. - :return: UserResponseData - If the method is called asynchronously, - returns the request thread. - """ - kwargs['_return_http_data_only'] = True - if kwargs.get('async_req'): - return self.get_user_with_http_info(user_gid, **kwargs) # noqa: E501 - else: - (data) = self.get_user_with_http_info(user_gid, **kwargs) # noqa: E501 - return data - - def get_user_with_http_info(self, user_gid, **kwargs): # noqa: E501 - """Get a user # noqa: E501 - - Returns the full user record for the single user with the provided ID. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.get_user_with_http_info(user_gid, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param str user_gid: A string identifying a user. This can either be the string \"me\", an email, or the gid of a user. (required) - :param list[str] opt_fields: This endpoint returns a compact resource, which excludes some properties by default. To include those optional properties, set this query parameter to a comma-separated list of the properties you wish to include. - :return: UserResponseData - If the method is called asynchronously, - returns the request thread. - """ - - all_params = ['user_gid', 'opt_fields'] # noqa: E501 - all_params.append('async_req') - all_params.append('_return_http_data_only') - all_params.append('_preload_content') - all_params.append('_request_timeout') - - params = locals() - for key, val in six.iteritems(params['kwargs']): - if key not in all_params: - raise TypeError( - "Got an unexpected keyword argument '%s'" - " to method get_user" % key - ) - params[key] = val - del params['kwargs'] - # verify the required parameter 'user_gid' is set - if ('user_gid' not in params or - params['user_gid'] is None): - raise ValueError("Missing the required parameter `user_gid` when calling `get_user`") # noqa: E501 - - collection_formats = {} - - path_params = {} - if 'user_gid' in params: - path_params['user_gid'] = params['user_gid'] # noqa: E501 - - query_params = [] - if 'opt_fields' in params: - query_params.append(('opt_fields', params['opt_fields'])) # noqa: E501 - collection_formats['opt_fields'] = 'csv' # noqa: E501 - - header_params = {} - - form_params = [] - local_var_files = {} - - body_params = None - # HTTP header `Accept` - header_params['Accept'] = self.api_client.select_header_accept( - ['application/json; charset=UTF-8']) # noqa: E501 - - # Authentication setting - auth_settings = ['oauth2'] # noqa: E501 - - return self.api_client.call_api( - '/users/{user_gid}', 'GET', - path_params, - query_params, - header_params, - body=body_params, - post_params=form_params, - files=local_var_files, - response_type='UserResponseData', # noqa: E501 - auth_settings=auth_settings, - async_req=params.get('async_req'), - _return_http_data_only=params.get('_return_http_data_only'), - _preload_content=params.get('_preload_content', True), - _request_timeout=params.get('_request_timeout'), - collection_formats=collection_formats) - - def get_users(self, **kwargs): # noqa: E501 - """Get multiple users # noqa: E501 - - Returns the user records for all users in all workspaces and organizations accessible to the authenticated user. Accepts an optional workspace ID parameter. Results are sorted by user ID. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.get_users(async_req=True) - >>> result = thread.get() - - :param async_req bool - :param str workspace: The workspace or organization ID to filter users on. - :param str team: The team ID to filter users on. - :param int limit: Results per page. The number of objects to return per page. The value must be between 1 and 100. - :param str offset: 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 list[str] opt_fields: This endpoint returns a compact resource, which excludes some properties by default. To include those optional properties, set this query parameter to a comma-separated list of the properties you wish to include. - :return: UserResponseArray - If the method is called asynchronously, - returns the request thread. - """ - kwargs['_return_http_data_only'] = True - if kwargs.get('async_req'): - return self.get_users_with_http_info(**kwargs) # noqa: E501 - else: - (data) = self.get_users_with_http_info(**kwargs) # noqa: E501 - return data - - def get_users_with_http_info(self, **kwargs): # noqa: E501 - """Get multiple users # noqa: E501 - - Returns the user records for all users in all workspaces and organizations accessible to the authenticated user. Accepts an optional workspace ID parameter. Results are sorted by user ID. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.get_users_with_http_info(async_req=True) - >>> result = thread.get() - - :param async_req bool - :param str workspace: The workspace or organization ID to filter users on. - :param str team: The team ID to filter users on. - :param int limit: Results per page. The number of objects to return per page. The value must be between 1 and 100. - :param str offset: 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 list[str] opt_fields: This endpoint returns a compact resource, which excludes some properties by default. To include those optional properties, set this query parameter to a comma-separated list of the properties you wish to include. - :return: UserResponseArray - If the method is called asynchronously, - returns the request thread. - """ - - all_params = ['workspace', 'team', 'limit', 'offset', 'opt_fields'] # noqa: E501 - all_params.append('async_req') - all_params.append('_return_http_data_only') - all_params.append('_preload_content') - all_params.append('_request_timeout') - - params = locals() - for key, val in six.iteritems(params['kwargs']): - if key not in all_params: - raise TypeError( - "Got an unexpected keyword argument '%s'" - " to method get_users" % key - ) - params[key] = val - del params['kwargs'] - - collection_formats = {} - - path_params = {} - - query_params = [] - if 'workspace' in params: - query_params.append(('workspace', params['workspace'])) # noqa: E501 - if 'team' in params: - query_params.append(('team', params['team'])) # noqa: E501 - if 'limit' in params: - query_params.append(('limit', params['limit'])) # noqa: E501 - if 'offset' in params: - query_params.append(('offset', params['offset'])) # noqa: E501 - if 'opt_fields' in params: - query_params.append(('opt_fields', params['opt_fields'])) # noqa: E501 - collection_formats['opt_fields'] = 'csv' # noqa: E501 - - header_params = {} - - form_params = [] - local_var_files = {} - - body_params = None - # HTTP header `Accept` - header_params['Accept'] = self.api_client.select_header_accept( - ['application/json; charset=UTF-8']) # noqa: E501 - - # Authentication setting - auth_settings = ['oauth2'] # noqa: E501 - - return self.api_client.call_api( - '/users', 'GET', - path_params, - query_params, - header_params, - body=body_params, - post_params=form_params, - files=local_var_files, - response_type='UserResponseArray', # noqa: E501 - auth_settings=auth_settings, - async_req=params.get('async_req'), - _return_http_data_only=params.get('_return_http_data_only'), - _preload_content=params.get('_preload_content', True), - _request_timeout=params.get('_request_timeout'), - collection_formats=collection_formats) - - def get_users_for_team(self, team_gid, **kwargs): # noqa: E501 - """Get users in a team # noqa: E501 - - Returns the compact records for all users that are members of the team. Results are sorted alphabetically and limited to 2000. For more results use the `/users` endpoint. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.get_users_for_team(team_gid, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param str team_gid: Globally unique identifier for the team. (required) - :param str offset: 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 list[str] opt_fields: This endpoint returns a compact resource, which excludes some properties by default. To include those optional properties, set this query parameter to a comma-separated list of the properties you wish to include. - :return: UserResponseArray - If the method is called asynchronously, - returns the request thread. - """ - kwargs['_return_http_data_only'] = True - if kwargs.get('async_req'): - return self.get_users_for_team_with_http_info(team_gid, **kwargs) # noqa: E501 - else: - (data) = self.get_users_for_team_with_http_info(team_gid, **kwargs) # noqa: E501 - return data - - def get_users_for_team_with_http_info(self, team_gid, **kwargs): # noqa: E501 - """Get users in a team # noqa: E501 - - Returns the compact records for all users that are members of the team. Results are sorted alphabetically and limited to 2000. For more results use the `/users` endpoint. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.get_users_for_team_with_http_info(team_gid, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param str team_gid: Globally unique identifier for the team. (required) - :param str offset: 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 list[str] opt_fields: This endpoint returns a compact resource, which excludes some properties by default. To include those optional properties, set this query parameter to a comma-separated list of the properties you wish to include. - :return: UserResponseArray - If the method is called asynchronously, - returns the request thread. - """ - - all_params = ['team_gid', 'offset', 'opt_fields'] # noqa: E501 - all_params.append('async_req') - all_params.append('_return_http_data_only') - all_params.append('_preload_content') - all_params.append('_request_timeout') - - params = locals() - for key, val in six.iteritems(params['kwargs']): - if key not in all_params: - raise TypeError( - "Got an unexpected keyword argument '%s'" - " to method get_users_for_team" % key - ) - params[key] = val - del params['kwargs'] - # verify the required parameter 'team_gid' is set - if ('team_gid' not in params or - params['team_gid'] is None): - raise ValueError("Missing the required parameter `team_gid` when calling `get_users_for_team`") # noqa: E501 - - collection_formats = {} - - path_params = {} - if 'team_gid' in params: - path_params['team_gid'] = params['team_gid'] # noqa: E501 - - query_params = [] - if 'offset' in params: - query_params.append(('offset', params['offset'])) # noqa: E501 - if 'opt_fields' in params: - query_params.append(('opt_fields', params['opt_fields'])) # noqa: E501 - collection_formats['opt_fields'] = 'csv' # noqa: E501 - - header_params = {} - - form_params = [] - local_var_files = {} - - body_params = None - # HTTP header `Accept` - header_params['Accept'] = self.api_client.select_header_accept( - ['application/json; charset=UTF-8']) # noqa: E501 - - # Authentication setting - auth_settings = ['oauth2'] # noqa: E501 - - return self.api_client.call_api( - '/teams/{team_gid}/users', 'GET', - path_params, - query_params, - header_params, - body=body_params, - post_params=form_params, - files=local_var_files, - response_type='UserResponseArray', # noqa: E501 - auth_settings=auth_settings, - async_req=params.get('async_req'), - _return_http_data_only=params.get('_return_http_data_only'), - _preload_content=params.get('_preload_content', True), - _request_timeout=params.get('_request_timeout'), - collection_formats=collection_formats) - - def get_users_for_workspace(self, workspace_gid, **kwargs): # noqa: E501 - """Get users in a workspace or organization # noqa: E501 - - Returns the compact records for all users in the specified workspace or organization. Results are sorted alphabetically and limited to 2000. For more results use the `/users` endpoint. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.get_users_for_workspace(workspace_gid, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param str workspace_gid: Globally unique identifier for the workspace or organization. (required) - :param str offset: 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 list[str] opt_fields: This endpoint returns a compact resource, which excludes some properties by default. To include those optional properties, set this query parameter to a comma-separated list of the properties you wish to include. - :return: UserResponseArray - If the method is called asynchronously, - returns the request thread. - """ - kwargs['_return_http_data_only'] = True - if kwargs.get('async_req'): - return self.get_users_for_workspace_with_http_info(workspace_gid, **kwargs) # noqa: E501 - else: - (data) = self.get_users_for_workspace_with_http_info(workspace_gid, **kwargs) # noqa: E501 - return data - - def get_users_for_workspace_with_http_info(self, workspace_gid, **kwargs): # noqa: E501 - """Get users in a workspace or organization # noqa: E501 - - Returns the compact records for all users in the specified workspace or organization. Results are sorted alphabetically and limited to 2000. For more results use the `/users` endpoint. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.get_users_for_workspace_with_http_info(workspace_gid, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param str workspace_gid: Globally unique identifier for the workspace or organization. (required) - :param str offset: 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 list[str] opt_fields: This endpoint returns a compact resource, which excludes some properties by default. To include those optional properties, set this query parameter to a comma-separated list of the properties you wish to include. - :return: UserResponseArray - If the method is called asynchronously, - returns the request thread. - """ - - all_params = ['workspace_gid', 'offset', 'opt_fields'] # noqa: E501 - all_params.append('async_req') - all_params.append('_return_http_data_only') - all_params.append('_preload_content') - all_params.append('_request_timeout') - - params = locals() - for key, val in six.iteritems(params['kwargs']): - if key not in all_params: - raise TypeError( - "Got an unexpected keyword argument '%s'" - " to method get_users_for_workspace" % key - ) - params[key] = val - del params['kwargs'] - # verify the required parameter 'workspace_gid' is set - if ('workspace_gid' not in params or - params['workspace_gid'] is None): - raise ValueError("Missing the required parameter `workspace_gid` when calling `get_users_for_workspace`") # noqa: E501 - - collection_formats = {} - - path_params = {} - if 'workspace_gid' in params: - path_params['workspace_gid'] = params['workspace_gid'] # noqa: E501 - - query_params = [] - if 'offset' in params: - query_params.append(('offset', params['offset'])) # noqa: E501 - if 'opt_fields' in params: - query_params.append(('opt_fields', params['opt_fields'])) # noqa: E501 - collection_formats['opt_fields'] = 'csv' # noqa: E501 - - header_params = {} - - form_params = [] - local_var_files = {} - - body_params = None - # HTTP header `Accept` - header_params['Accept'] = self.api_client.select_header_accept( - ['application/json; charset=UTF-8']) # noqa: E501 - - # Authentication setting - auth_settings = ['oauth2'] # noqa: E501 - - return self.api_client.call_api( - '/workspaces/{workspace_gid}/users', 'GET', - path_params, - query_params, - header_params, - body=body_params, - post_params=form_params, - files=local_var_files, - response_type='UserResponseArray', # noqa: E501 - auth_settings=auth_settings, - async_req=params.get('async_req'), - _return_http_data_only=params.get('_return_http_data_only'), - _preload_content=params.get('_preload_content', True), - _request_timeout=params.get('_request_timeout'), - collection_formats=collection_formats) + all_params = ['workspace_gid', 'offset', 'opt_fields'] # noqa: E501 + all_params.append('async_req') + all_params.append('header_params') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + params = locals() + for key, val in six.iteritems(params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method get_users_for_workspace" % key + ) + params[key] = val + del params['kwargs'] + # verify the required parameter 'workspace_gid' is set + if ('workspace_gid' not in params or + params['workspace_gid'] is None): + raise ValueError("Missing the required parameter `workspace_gid` when calling `get_users_for_workspace`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'workspace_gid' in params: + path_params['workspace_gid'] = params['workspace_gid'] # noqa: E501 + + query_params = [] + if 'offset' in params: + query_params.append(('offset', params['offset'])) # noqa: E501 + if 'opt_fields' in params: + query_params.append(('opt_fields', params['opt_fields'])) # noqa: E501 + collection_formats['opt_fields'] = 'csv' # noqa: E501 + + header_params = kwargs.get("header_params", {}) + + form_params = [] + local_var_files = {} + + body_params = None + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['application/json; charset=UTF-8']) # noqa: E501 + + # Authentication setting + auth_settings = ['oauth2'] # noqa: E501 + + return self.api_client.call_api( + '/workspaces/{workspace_gid}/users', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='UserResponseArray', # noqa: E501 + auth_settings=auth_settings, + async_req=params.get('async_req'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) diff --git a/asana/api/webhooks_api.py b/asana/api/webhooks_api.py index d2ef9975..b2a1f815 100644 --- a/asana/api/webhooks_api.py +++ b/asana/api/webhooks_api.py @@ -21,536 +21,541 @@ class WebhooksApi(object): - """NOTE: This class is auto generated by the swagger code generator program. +"""NOTE: This class is auto generated by the swagger code generator program. - Do not edit the class manually. - Ref: https://github.com/swagger-api/swagger-codegen +Do not edit the class manually. +Ref: https://github.com/swagger-api/swagger-codegen +""" + +def __init__(self, api_client=None): + if api_client is None: + api_client = ApiClient() + self.api_client = api_client + +def create_webhook(self, body, **kwargs): # noqa: E501 + """Establish a webhook # noqa: E501 + + Establishing a webhook is a two-part process. First, a simple HTTP POST request initiates the creation similar to creating any other resource. Next, in the middle of this request comes the confirmation handshake. When a webhook is created, we will send a test POST to the target with an `X-Hook-Secret` header. The target must respond with a `200 OK` or `204 No Content` and a matching `X-Hook-Secret` header to confirm that this webhook subscription is indeed expected. We strongly recommend storing this secret to be used to verify future webhook event signatures. The POST request to create the webhook will then return with the status of the request. If you do not acknowledge the webhook’s confirmation handshake it will fail to setup, and you will receive an error in response to your attempt to create it. This means you need to be able to receive and complete the webhook *while* the POST request is in-flight (in other words, have a server that can handle requests asynchronously). Invalid hostnames like localhost will recieve a 403 Forbidden status code. ``` # Request curl -H \"Authorization: Bearer \" \\ -X POST https://app.asana.com/api/1.0/webhooks \\ -d \"resource=8675309\" \\ -d \"target=https://example.com/receive-webhook/7654\" ``` ``` # Handshake sent to https://example.com/ POST /receive-webhook/7654 X-Hook-Secret: b537207f20cbfa02357cf448134da559e8bd39d61597dcd5631b8012eae53e81 ``` ``` # Handshake response sent by example.com HTTP/1.1 200 X-Hook-Secret: b537207f20cbfa02357cf448134da559e8bd39d61597dcd5631b8012eae53e81 ``` ``` # Response HTTP/1.1 201 { \"data\": { \"gid\": \"43214\", \"resource\": { \"gid\": \"8675309\", \"name\": \"Bugs\" }, \"target\": \"https://example.com/receive-webhook/7654\", \"active\": false, \"last_success_at\": null, \"last_failure_at\": null, \"last_failure_content\": null } } ``` # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.create_webhook(body, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param WebhooksBody body: The webhook workspace and target. (required) + :param list[str] opt_fields: This endpoint returns a compact resource, which excludes some properties by default. To include those optional properties, set this query parameter to a comma-separated list of the properties you wish to include. + :return: WebhookResponseData + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = kwargs.get("_return_http_data_only", True) + if kwargs.get('async_req'): + return self.create_webhook_with_http_info(body, **kwargs) # noqa: E501 + else: + (data) = self.create_webhook_with_http_info(body, **kwargs) # noqa: E501 + return data + +def create_webhook_with_http_info(self, body, **kwargs): # noqa: E501 + """Establish a webhook # noqa: E501 + + Establishing a webhook is a two-part process. First, a simple HTTP POST request initiates the creation similar to creating any other resource. Next, in the middle of this request comes the confirmation handshake. When a webhook is created, we will send a test POST to the target with an `X-Hook-Secret` header. The target must respond with a `200 OK` or `204 No Content` and a matching `X-Hook-Secret` header to confirm that this webhook subscription is indeed expected. We strongly recommend storing this secret to be used to verify future webhook event signatures. The POST request to create the webhook will then return with the status of the request. If you do not acknowledge the webhook’s confirmation handshake it will fail to setup, and you will receive an error in response to your attempt to create it. This means you need to be able to receive and complete the webhook *while* the POST request is in-flight (in other words, have a server that can handle requests asynchronously). Invalid hostnames like localhost will recieve a 403 Forbidden status code. ``` # Request curl -H \"Authorization: Bearer \" \\ -X POST https://app.asana.com/api/1.0/webhooks \\ -d \"resource=8675309\" \\ -d \"target=https://example.com/receive-webhook/7654\" ``` ``` # Handshake sent to https://example.com/ POST /receive-webhook/7654 X-Hook-Secret: b537207f20cbfa02357cf448134da559e8bd39d61597dcd5631b8012eae53e81 ``` ``` # Handshake response sent by example.com HTTP/1.1 200 X-Hook-Secret: b537207f20cbfa02357cf448134da559e8bd39d61597dcd5631b8012eae53e81 ``` ``` # Response HTTP/1.1 201 { \"data\": { \"gid\": \"43214\", \"resource\": { \"gid\": \"8675309\", \"name\": \"Bugs\" }, \"target\": \"https://example.com/receive-webhook/7654\", \"active\": false, \"last_success_at\": null, \"last_failure_at\": null, \"last_failure_content\": null } } ``` # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.create_webhook_with_http_info(body, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param WebhooksBody body: The webhook workspace and target. (required) + :param list[str] opt_fields: This endpoint returns a compact resource, which excludes some properties by default. To include those optional properties, set this query parameter to a comma-separated list of the properties you wish to include. + :return: WebhookResponseData + If the method is called asynchronously, + returns the request thread. + """ + + all_params = ['body', 'opt_fields'] # noqa: E501 + all_params.append('async_req') + all_params.append('header_params') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + params = locals() + for key, val in six.iteritems(params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method create_webhook" % key + ) + params[key] = val + del params['kwargs'] + # verify the required parameter 'body' is set + if ('body' not in params or + params['body'] is None): + raise ValueError("Missing the required parameter `body` when calling `create_webhook`") # noqa: E501 + + collection_formats = {} + + path_params = {} + + query_params = [] + if 'opt_fields' in params: + query_params.append(('opt_fields', params['opt_fields'])) # noqa: E501 + collection_formats['opt_fields'] = 'csv' # noqa: E501 + + header_params = kwargs.get("header_params", {}) + + form_params = [] + local_var_files = {} + + body_params = None + if 'body' in params: + body_params = params['body'] + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['application/json; charset=UTF-8']) # noqa: E501 + + # HTTP header `Content-Type` + header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 + ['application/json; charset=UTF-8']) # noqa: E501 + + # Authentication setting + auth_settings = ['oauth2'] # noqa: E501 + + return self.api_client.call_api( + '/webhooks', 'POST', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='WebhookResponseData', # noqa: E501 + auth_settings=auth_settings, + async_req=params.get('async_req'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) + +def delete_webhook(self, webhook_gid, **kwargs): # noqa: E501 + """Delete a webhook # noqa: E501 + + This method *permanently* removes a webhook. Note that it may be possible to receive a request that was already in flight after deleting the webhook, but no further requests will be issued. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.delete_webhook(webhook_gid, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str webhook_gid: Globally unique identifier for the webhook. (required) + :return: EmptyResponseData + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = kwargs.get("_return_http_data_only", True) + if kwargs.get('async_req'): + return self.delete_webhook_with_http_info(webhook_gid, **kwargs) # noqa: E501 + else: + (data) = self.delete_webhook_with_http_info(webhook_gid, **kwargs) # noqa: E501 + return data + +def delete_webhook_with_http_info(self, webhook_gid, **kwargs): # noqa: E501 + """Delete a webhook # noqa: E501 + + This method *permanently* removes a webhook. Note that it may be possible to receive a request that was already in flight after deleting the webhook, but no further requests will be issued. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.delete_webhook_with_http_info(webhook_gid, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str webhook_gid: Globally unique identifier for the webhook. (required) + :return: EmptyResponseData + If the method is called asynchronously, + returns the request thread. + """ + + all_params = ['webhook_gid'] # noqa: E501 + all_params.append('async_req') + all_params.append('header_params') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + params = locals() + for key, val in six.iteritems(params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method delete_webhook" % key + ) + params[key] = val + del params['kwargs'] + # verify the required parameter 'webhook_gid' is set + if ('webhook_gid' not in params or + params['webhook_gid'] is None): + raise ValueError("Missing the required parameter `webhook_gid` when calling `delete_webhook`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'webhook_gid' in params: + path_params['webhook_gid'] = params['webhook_gid'] # noqa: E501 + + query_params = [] + + header_params = kwargs.get("header_params", {}) + + form_params = [] + local_var_files = {} + + body_params = None + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['application/json; charset=UTF-8']) # noqa: E501 + + # Authentication setting + auth_settings = ['oauth2'] # noqa: E501 + + return self.api_client.call_api( + '/webhooks/{webhook_gid}', 'DELETE', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='EmptyResponseData', # noqa: E501 + auth_settings=auth_settings, + async_req=params.get('async_req'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) + +def get_webhook(self, webhook_gid, **kwargs): # noqa: E501 + """Get a webhook # noqa: E501 + + Returns the full record for the given webhook. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.get_webhook(webhook_gid, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str webhook_gid: Globally unique identifier for the webhook. (required) + :param list[str] opt_fields: This endpoint returns a compact resource, which excludes some properties by default. To include those optional properties, set this query parameter to a comma-separated list of the properties you wish to include. + :return: WebhookResponseData + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = kwargs.get("_return_http_data_only", True) + if kwargs.get('async_req'): + return self.get_webhook_with_http_info(webhook_gid, **kwargs) # noqa: E501 + else: + (data) = self.get_webhook_with_http_info(webhook_gid, **kwargs) # noqa: E501 + return data + +def get_webhook_with_http_info(self, webhook_gid, **kwargs): # noqa: E501 + """Get a webhook # noqa: E501 + + Returns the full record for the given webhook. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.get_webhook_with_http_info(webhook_gid, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str webhook_gid: Globally unique identifier for the webhook. (required) + :param list[str] opt_fields: This endpoint returns a compact resource, which excludes some properties by default. To include those optional properties, set this query parameter to a comma-separated list of the properties you wish to include. + :return: WebhookResponseData + If the method is called asynchronously, + returns the request thread. + """ + + all_params = ['webhook_gid', 'opt_fields'] # noqa: E501 + all_params.append('async_req') + all_params.append('header_params') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + params = locals() + for key, val in six.iteritems(params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method get_webhook" % key + ) + params[key] = val + del params['kwargs'] + # verify the required parameter 'webhook_gid' is set + if ('webhook_gid' not in params or + params['webhook_gid'] is None): + raise ValueError("Missing the required parameter `webhook_gid` when calling `get_webhook`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'webhook_gid' in params: + path_params['webhook_gid'] = params['webhook_gid'] # noqa: E501 + + query_params = [] + if 'opt_fields' in params: + query_params.append(('opt_fields', params['opt_fields'])) # noqa: E501 + collection_formats['opt_fields'] = 'csv' # noqa: E501 + + header_params = kwargs.get("header_params", {}) + + form_params = [] + local_var_files = {} + + body_params = None + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['application/json; charset=UTF-8']) # noqa: E501 + + # Authentication setting + auth_settings = ['oauth2'] # noqa: E501 + + return self.api_client.call_api( + '/webhooks/{webhook_gid}', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='WebhookResponseData', # noqa: E501 + auth_settings=auth_settings, + async_req=params.get('async_req'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) + +def get_webhooks(self, workspace, **kwargs): # noqa: E501 + """Get multiple webhooks # noqa: E501 + + Get the compact representation of all webhooks your app has registered for the authenticated user in the given workspace. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.get_webhooks(workspace, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str workspace: The workspace to query for webhooks in. (required) + :param int limit: Results per page. The number of objects to return per page. The value must be between 1 and 100. + :param str offset: 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 str resource: Only return webhooks for the given resource. + :param list[str] opt_fields: This endpoint returns a compact resource, which excludes some properties by default. To include those optional properties, set this query parameter to a comma-separated list of the properties you wish to include. + :return: WebhookResponseArray + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = kwargs.get("_return_http_data_only", True) + if kwargs.get('async_req'): + return self.get_webhooks_with_http_info(workspace, **kwargs) # noqa: E501 + else: + (data) = self.get_webhooks_with_http_info(workspace, **kwargs) # noqa: E501 + return data + +def get_webhooks_with_http_info(self, workspace, **kwargs): # noqa: E501 + """Get multiple webhooks # noqa: E501 + + Get the compact representation of all webhooks your app has registered for the authenticated user in the given workspace. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.get_webhooks_with_http_info(workspace, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str workspace: The workspace to query for webhooks in. (required) + :param int limit: Results per page. The number of objects to return per page. The value must be between 1 and 100. + :param str offset: 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 str resource: Only return webhooks for the given resource. + :param list[str] opt_fields: This endpoint returns a compact resource, which excludes some properties by default. To include those optional properties, set this query parameter to a comma-separated list of the properties you wish to include. + :return: WebhookResponseArray + If the method is called asynchronously, + returns the request thread. + """ + + all_params = ['workspace', 'limit', 'offset', 'resource', 'opt_fields'] # noqa: E501 + all_params.append('async_req') + all_params.append('header_params') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + params = locals() + for key, val in six.iteritems(params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method get_webhooks" % key + ) + params[key] = val + del params['kwargs'] + # verify the required parameter 'workspace' is set + if ('workspace' not in params or + params['workspace'] is None): + raise ValueError("Missing the required parameter `workspace` when calling `get_webhooks`") # noqa: E501 + + collection_formats = {} + + path_params = {} + + query_params = [] + if 'limit' in params: + query_params.append(('limit', params['limit'])) # noqa: E501 + if 'offset' in params: + query_params.append(('offset', params['offset'])) # noqa: E501 + if 'workspace' in params: + query_params.append(('workspace', params['workspace'])) # noqa: E501 + if 'resource' in params: + query_params.append(('resource', params['resource'])) # noqa: E501 + if 'opt_fields' in params: + query_params.append(('opt_fields', params['opt_fields'])) # noqa: E501 + collection_formats['opt_fields'] = 'csv' # noqa: E501 + + header_params = kwargs.get("header_params", {}) + + form_params = [] + local_var_files = {} + + body_params = None + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['application/json; charset=UTF-8']) # noqa: E501 + + # Authentication setting + auth_settings = ['oauth2'] # noqa: E501 + + return self.api_client.call_api( + '/webhooks', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='WebhookResponseArray', # noqa: E501 + auth_settings=auth_settings, + async_req=params.get('async_req'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) + +def update_webhook(self, body, webhook_gid, **kwargs): # noqa: E501 + """Update a webhook # noqa: E501 + + An existing webhook's filters can be updated by making a PUT request on the URL for that webhook. Note that the webhook's previous `filters` array will be completely overwritten by the `filters` sent in the PUT request. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.update_webhook(body, webhook_gid, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param WebhooksWebhookGidBody body: The updated filters for the webhook. (required) + :param str webhook_gid: Globally unique identifier for the webhook. (required) + :param list[str] opt_fields: This endpoint returns a compact resource, which excludes some properties by default. To include those optional properties, set this query parameter to a comma-separated list of the properties you wish to include. + :return: WebhookResponseData + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = kwargs.get("_return_http_data_only", True) + if kwargs.get('async_req'): + return self.update_webhook_with_http_info(body, webhook_gid, **kwargs) # noqa: E501 + else: + (data) = self.update_webhook_with_http_info(body, webhook_gid, **kwargs) # noqa: E501 + return data + +def update_webhook_with_http_info(self, body, webhook_gid, **kwargs): # noqa: E501 + """Update a webhook # noqa: E501 + + An existing webhook's filters can be updated by making a PUT request on the URL for that webhook. Note that the webhook's previous `filters` array will be completely overwritten by the `filters` sent in the PUT request. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.update_webhook_with_http_info(body, webhook_gid, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param WebhooksWebhookGidBody body: The updated filters for the webhook. (required) + :param str webhook_gid: Globally unique identifier for the webhook. (required) + :param list[str] opt_fields: This endpoint returns a compact resource, which excludes some properties by default. To include those optional properties, set this query parameter to a comma-separated list of the properties you wish to include. + :return: WebhookResponseData + If the method is called asynchronously, + returns the request thread. """ - def __init__(self, api_client=None): - if api_client is None: - api_client = ApiClient() - self.api_client = api_client - - def create_webhook(self, body, **kwargs): # noqa: E501 - """Establish a webhook # noqa: E501 - - Establishing a webhook is a two-part process. First, a simple HTTP POST request initiates the creation similar to creating any other resource. Next, in the middle of this request comes the confirmation handshake. When a webhook is created, we will send a test POST to the target with an `X-Hook-Secret` header. The target must respond with a `200 OK` or `204 No Content` and a matching `X-Hook-Secret` header to confirm that this webhook subscription is indeed expected. We strongly recommend storing this secret to be used to verify future webhook event signatures. The POST request to create the webhook will then return with the status of the request. If you do not acknowledge the webhook’s confirmation handshake it will fail to setup, and you will receive an error in response to your attempt to create it. This means you need to be able to receive and complete the webhook *while* the POST request is in-flight (in other words, have a server that can handle requests asynchronously). Invalid hostnames like localhost will recieve a 403 Forbidden status code. ``` # Request curl -H \"Authorization: Bearer \" \\ -X POST https://app.asana.com/api/1.0/webhooks \\ -d \"resource=8675309\" \\ -d \"target=https://example.com/receive-webhook/7654\" ``` ``` # Handshake sent to https://example.com/ POST /receive-webhook/7654 X-Hook-Secret: b537207f20cbfa02357cf448134da559e8bd39d61597dcd5631b8012eae53e81 ``` ``` # Handshake response sent by example.com HTTP/1.1 200 X-Hook-Secret: b537207f20cbfa02357cf448134da559e8bd39d61597dcd5631b8012eae53e81 ``` ``` # Response HTTP/1.1 201 { \"data\": { \"gid\": \"43214\", \"resource\": { \"gid\": \"8675309\", \"name\": \"Bugs\" }, \"target\": \"https://example.com/receive-webhook/7654\", \"active\": false, \"last_success_at\": null, \"last_failure_at\": null, \"last_failure_content\": null } } ``` # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.create_webhook(body, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param WebhooksBody body: The webhook workspace and target. (required) - :param list[str] opt_fields: This endpoint returns a compact resource, which excludes some properties by default. To include those optional properties, set this query parameter to a comma-separated list of the properties you wish to include. - :return: WebhookResponseData - If the method is called asynchronously, - returns the request thread. - """ - kwargs['_return_http_data_only'] = True - if kwargs.get('async_req'): - return self.create_webhook_with_http_info(body, **kwargs) # noqa: E501 - else: - (data) = self.create_webhook_with_http_info(body, **kwargs) # noqa: E501 - return data - - def create_webhook_with_http_info(self, body, **kwargs): # noqa: E501 - """Establish a webhook # noqa: E501 - - Establishing a webhook is a two-part process. First, a simple HTTP POST request initiates the creation similar to creating any other resource. Next, in the middle of this request comes the confirmation handshake. When a webhook is created, we will send a test POST to the target with an `X-Hook-Secret` header. The target must respond with a `200 OK` or `204 No Content` and a matching `X-Hook-Secret` header to confirm that this webhook subscription is indeed expected. We strongly recommend storing this secret to be used to verify future webhook event signatures. The POST request to create the webhook will then return with the status of the request. If you do not acknowledge the webhook’s confirmation handshake it will fail to setup, and you will receive an error in response to your attempt to create it. This means you need to be able to receive and complete the webhook *while* the POST request is in-flight (in other words, have a server that can handle requests asynchronously). Invalid hostnames like localhost will recieve a 403 Forbidden status code. ``` # Request curl -H \"Authorization: Bearer \" \\ -X POST https://app.asana.com/api/1.0/webhooks \\ -d \"resource=8675309\" \\ -d \"target=https://example.com/receive-webhook/7654\" ``` ``` # Handshake sent to https://example.com/ POST /receive-webhook/7654 X-Hook-Secret: b537207f20cbfa02357cf448134da559e8bd39d61597dcd5631b8012eae53e81 ``` ``` # Handshake response sent by example.com HTTP/1.1 200 X-Hook-Secret: b537207f20cbfa02357cf448134da559e8bd39d61597dcd5631b8012eae53e81 ``` ``` # Response HTTP/1.1 201 { \"data\": { \"gid\": \"43214\", \"resource\": { \"gid\": \"8675309\", \"name\": \"Bugs\" }, \"target\": \"https://example.com/receive-webhook/7654\", \"active\": false, \"last_success_at\": null, \"last_failure_at\": null, \"last_failure_content\": null } } ``` # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.create_webhook_with_http_info(body, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param WebhooksBody body: The webhook workspace and target. (required) - :param list[str] opt_fields: This endpoint returns a compact resource, which excludes some properties by default. To include those optional properties, set this query parameter to a comma-separated list of the properties you wish to include. - :return: WebhookResponseData - If the method is called asynchronously, - returns the request thread. - """ - - all_params = ['body', 'opt_fields'] # noqa: E501 - all_params.append('async_req') - all_params.append('_return_http_data_only') - all_params.append('_preload_content') - all_params.append('_request_timeout') - - params = locals() - for key, val in six.iteritems(params['kwargs']): - if key not in all_params: - raise TypeError( - "Got an unexpected keyword argument '%s'" - " to method create_webhook" % key - ) - params[key] = val - del params['kwargs'] - # verify the required parameter 'body' is set - if ('body' not in params or - params['body'] is None): - raise ValueError("Missing the required parameter `body` when calling `create_webhook`") # noqa: E501 - - collection_formats = {} - - path_params = {} - - query_params = [] - if 'opt_fields' in params: - query_params.append(('opt_fields', params['opt_fields'])) # noqa: E501 - collection_formats['opt_fields'] = 'csv' # noqa: E501 - - header_params = {} - - form_params = [] - local_var_files = {} - - body_params = None - if 'body' in params: - body_params = params['body'] - # HTTP header `Accept` - header_params['Accept'] = self.api_client.select_header_accept( - ['application/json; charset=UTF-8']) # noqa: E501 - - # HTTP header `Content-Type` - header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 - ['application/json; charset=UTF-8']) # noqa: E501 - - # Authentication setting - auth_settings = ['oauth2'] # noqa: E501 - - return self.api_client.call_api( - '/webhooks', 'POST', - path_params, - query_params, - header_params, - body=body_params, - post_params=form_params, - files=local_var_files, - response_type='WebhookResponseData', # noqa: E501 - auth_settings=auth_settings, - async_req=params.get('async_req'), - _return_http_data_only=params.get('_return_http_data_only'), - _preload_content=params.get('_preload_content', True), - _request_timeout=params.get('_request_timeout'), - collection_formats=collection_formats) - - def delete_webhook(self, webhook_gid, **kwargs): # noqa: E501 - """Delete a webhook # noqa: E501 - - This method *permanently* removes a webhook. Note that it may be possible to receive a request that was already in flight after deleting the webhook, but no further requests will be issued. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.delete_webhook(webhook_gid, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param str webhook_gid: Globally unique identifier for the webhook. (required) - :return: EmptyResponseData - If the method is called asynchronously, - returns the request thread. - """ - kwargs['_return_http_data_only'] = True - if kwargs.get('async_req'): - return self.delete_webhook_with_http_info(webhook_gid, **kwargs) # noqa: E501 - else: - (data) = self.delete_webhook_with_http_info(webhook_gid, **kwargs) # noqa: E501 - return data - - def delete_webhook_with_http_info(self, webhook_gid, **kwargs): # noqa: E501 - """Delete a webhook # noqa: E501 - - This method *permanently* removes a webhook. Note that it may be possible to receive a request that was already in flight after deleting the webhook, but no further requests will be issued. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.delete_webhook_with_http_info(webhook_gid, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param str webhook_gid: Globally unique identifier for the webhook. (required) - :return: EmptyResponseData - If the method is called asynchronously, - returns the request thread. - """ - - all_params = ['webhook_gid'] # noqa: E501 - all_params.append('async_req') - all_params.append('_return_http_data_only') - all_params.append('_preload_content') - all_params.append('_request_timeout') - - params = locals() - for key, val in six.iteritems(params['kwargs']): - if key not in all_params: - raise TypeError( - "Got an unexpected keyword argument '%s'" - " to method delete_webhook" % key - ) - params[key] = val - del params['kwargs'] - # verify the required parameter 'webhook_gid' is set - if ('webhook_gid' not in params or - params['webhook_gid'] is None): - raise ValueError("Missing the required parameter `webhook_gid` when calling `delete_webhook`") # noqa: E501 - - collection_formats = {} - - path_params = {} - if 'webhook_gid' in params: - path_params['webhook_gid'] = params['webhook_gid'] # noqa: E501 - - query_params = [] - - header_params = {} - - form_params = [] - local_var_files = {} - - body_params = None - # HTTP header `Accept` - header_params['Accept'] = self.api_client.select_header_accept( - ['application/json; charset=UTF-8']) # noqa: E501 - - # Authentication setting - auth_settings = ['oauth2'] # noqa: E501 - - return self.api_client.call_api( - '/webhooks/{webhook_gid}', 'DELETE', - path_params, - query_params, - header_params, - body=body_params, - post_params=form_params, - files=local_var_files, - response_type='EmptyResponseData', # noqa: E501 - auth_settings=auth_settings, - async_req=params.get('async_req'), - _return_http_data_only=params.get('_return_http_data_only'), - _preload_content=params.get('_preload_content', True), - _request_timeout=params.get('_request_timeout'), - collection_formats=collection_formats) - - def get_webhook(self, webhook_gid, **kwargs): # noqa: E501 - """Get a webhook # noqa: E501 - - Returns the full record for the given webhook. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.get_webhook(webhook_gid, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param str webhook_gid: Globally unique identifier for the webhook. (required) - :param list[str] opt_fields: This endpoint returns a compact resource, which excludes some properties by default. To include those optional properties, set this query parameter to a comma-separated list of the properties you wish to include. - :return: WebhookResponseData - If the method is called asynchronously, - returns the request thread. - """ - kwargs['_return_http_data_only'] = True - if kwargs.get('async_req'): - return self.get_webhook_with_http_info(webhook_gid, **kwargs) # noqa: E501 - else: - (data) = self.get_webhook_with_http_info(webhook_gid, **kwargs) # noqa: E501 - return data - - def get_webhook_with_http_info(self, webhook_gid, **kwargs): # noqa: E501 - """Get a webhook # noqa: E501 - - Returns the full record for the given webhook. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.get_webhook_with_http_info(webhook_gid, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param str webhook_gid: Globally unique identifier for the webhook. (required) - :param list[str] opt_fields: This endpoint returns a compact resource, which excludes some properties by default. To include those optional properties, set this query parameter to a comma-separated list of the properties you wish to include. - :return: WebhookResponseData - If the method is called asynchronously, - returns the request thread. - """ - - all_params = ['webhook_gid', 'opt_fields'] # noqa: E501 - all_params.append('async_req') - all_params.append('_return_http_data_only') - all_params.append('_preload_content') - all_params.append('_request_timeout') - - params = locals() - for key, val in six.iteritems(params['kwargs']): - if key not in all_params: - raise TypeError( - "Got an unexpected keyword argument '%s'" - " to method get_webhook" % key - ) - params[key] = val - del params['kwargs'] - # verify the required parameter 'webhook_gid' is set - if ('webhook_gid' not in params or - params['webhook_gid'] is None): - raise ValueError("Missing the required parameter `webhook_gid` when calling `get_webhook`") # noqa: E501 - - collection_formats = {} - - path_params = {} - if 'webhook_gid' in params: - path_params['webhook_gid'] = params['webhook_gid'] # noqa: E501 - - query_params = [] - if 'opt_fields' in params: - query_params.append(('opt_fields', params['opt_fields'])) # noqa: E501 - collection_formats['opt_fields'] = 'csv' # noqa: E501 - - header_params = {} - - form_params = [] - local_var_files = {} - - body_params = None - # HTTP header `Accept` - header_params['Accept'] = self.api_client.select_header_accept( - ['application/json; charset=UTF-8']) # noqa: E501 - - # Authentication setting - auth_settings = ['oauth2'] # noqa: E501 - - return self.api_client.call_api( - '/webhooks/{webhook_gid}', 'GET', - path_params, - query_params, - header_params, - body=body_params, - post_params=form_params, - files=local_var_files, - response_type='WebhookResponseData', # noqa: E501 - auth_settings=auth_settings, - async_req=params.get('async_req'), - _return_http_data_only=params.get('_return_http_data_only'), - _preload_content=params.get('_preload_content', True), - _request_timeout=params.get('_request_timeout'), - collection_formats=collection_formats) - - def get_webhooks(self, workspace, **kwargs): # noqa: E501 - """Get multiple webhooks # noqa: E501 - - Get the compact representation of all webhooks your app has registered for the authenticated user in the given workspace. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.get_webhooks(workspace, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param str workspace: The workspace to query for webhooks in. (required) - :param int limit: Results per page. The number of objects to return per page. The value must be between 1 and 100. - :param str offset: 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 str resource: Only return webhooks for the given resource. - :param list[str] opt_fields: This endpoint returns a compact resource, which excludes some properties by default. To include those optional properties, set this query parameter to a comma-separated list of the properties you wish to include. - :return: WebhookResponseArray - If the method is called asynchronously, - returns the request thread. - """ - kwargs['_return_http_data_only'] = True - if kwargs.get('async_req'): - return self.get_webhooks_with_http_info(workspace, **kwargs) # noqa: E501 - else: - (data) = self.get_webhooks_with_http_info(workspace, **kwargs) # noqa: E501 - return data - - def get_webhooks_with_http_info(self, workspace, **kwargs): # noqa: E501 - """Get multiple webhooks # noqa: E501 - - Get the compact representation of all webhooks your app has registered for the authenticated user in the given workspace. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.get_webhooks_with_http_info(workspace, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param str workspace: The workspace to query for webhooks in. (required) - :param int limit: Results per page. The number of objects to return per page. The value must be between 1 and 100. - :param str offset: 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 str resource: Only return webhooks for the given resource. - :param list[str] opt_fields: This endpoint returns a compact resource, which excludes some properties by default. To include those optional properties, set this query parameter to a comma-separated list of the properties you wish to include. - :return: WebhookResponseArray - If the method is called asynchronously, - returns the request thread. - """ - - all_params = ['workspace', 'limit', 'offset', 'resource', 'opt_fields'] # noqa: E501 - all_params.append('async_req') - all_params.append('_return_http_data_only') - all_params.append('_preload_content') - all_params.append('_request_timeout') - - params = locals() - for key, val in six.iteritems(params['kwargs']): - if key not in all_params: - raise TypeError( - "Got an unexpected keyword argument '%s'" - " to method get_webhooks" % key - ) - params[key] = val - del params['kwargs'] - # verify the required parameter 'workspace' is set - if ('workspace' not in params or - params['workspace'] is None): - raise ValueError("Missing the required parameter `workspace` when calling `get_webhooks`") # noqa: E501 - - collection_formats = {} - - path_params = {} - - query_params = [] - if 'limit' in params: - query_params.append(('limit', params['limit'])) # noqa: E501 - if 'offset' in params: - query_params.append(('offset', params['offset'])) # noqa: E501 - if 'workspace' in params: - query_params.append(('workspace', params['workspace'])) # noqa: E501 - if 'resource' in params: - query_params.append(('resource', params['resource'])) # noqa: E501 - if 'opt_fields' in params: - query_params.append(('opt_fields', params['opt_fields'])) # noqa: E501 - collection_formats['opt_fields'] = 'csv' # noqa: E501 - - header_params = {} - - form_params = [] - local_var_files = {} - - body_params = None - # HTTP header `Accept` - header_params['Accept'] = self.api_client.select_header_accept( - ['application/json; charset=UTF-8']) # noqa: E501 - - # Authentication setting - auth_settings = ['oauth2'] # noqa: E501 - - return self.api_client.call_api( - '/webhooks', 'GET', - path_params, - query_params, - header_params, - body=body_params, - post_params=form_params, - files=local_var_files, - response_type='WebhookResponseArray', # noqa: E501 - auth_settings=auth_settings, - async_req=params.get('async_req'), - _return_http_data_only=params.get('_return_http_data_only'), - _preload_content=params.get('_preload_content', True), - _request_timeout=params.get('_request_timeout'), - collection_formats=collection_formats) - - def update_webhook(self, body, webhook_gid, **kwargs): # noqa: E501 - """Update a webhook # noqa: E501 - - An existing webhook's filters can be updated by making a PUT request on the URL for that webhook. Note that the webhook's previous `filters` array will be completely overwritten by the `filters` sent in the PUT request. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.update_webhook(body, webhook_gid, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param WebhooksWebhookGidBody body: The updated filters for the webhook. (required) - :param str webhook_gid: Globally unique identifier for the webhook. (required) - :param list[str] opt_fields: This endpoint returns a compact resource, which excludes some properties by default. To include those optional properties, set this query parameter to a comma-separated list of the properties you wish to include. - :return: WebhookResponseData - If the method is called asynchronously, - returns the request thread. - """ - kwargs['_return_http_data_only'] = True - if kwargs.get('async_req'): - return self.update_webhook_with_http_info(body, webhook_gid, **kwargs) # noqa: E501 - else: - (data) = self.update_webhook_with_http_info(body, webhook_gid, **kwargs) # noqa: E501 - return data - - def update_webhook_with_http_info(self, body, webhook_gid, **kwargs): # noqa: E501 - """Update a webhook # noqa: E501 - - An existing webhook's filters can be updated by making a PUT request on the URL for that webhook. Note that the webhook's previous `filters` array will be completely overwritten by the `filters` sent in the PUT request. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.update_webhook_with_http_info(body, webhook_gid, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param WebhooksWebhookGidBody body: The updated filters for the webhook. (required) - :param str webhook_gid: Globally unique identifier for the webhook. (required) - :param list[str] opt_fields: This endpoint returns a compact resource, which excludes some properties by default. To include those optional properties, set this query parameter to a comma-separated list of the properties you wish to include. - :return: WebhookResponseData - If the method is called asynchronously, - returns the request thread. - """ - - all_params = ['body', 'webhook_gid', 'opt_fields'] # noqa: E501 - all_params.append('async_req') - all_params.append('_return_http_data_only') - all_params.append('_preload_content') - all_params.append('_request_timeout') - - params = locals() - for key, val in six.iteritems(params['kwargs']): - if key not in all_params: - raise TypeError( - "Got an unexpected keyword argument '%s'" - " to method update_webhook" % key - ) - params[key] = val - del params['kwargs'] - # verify the required parameter 'body' is set - if ('body' not in params or - params['body'] is None): - raise ValueError("Missing the required parameter `body` when calling `update_webhook`") # noqa: E501 - # verify the required parameter 'webhook_gid' is set - if ('webhook_gid' not in params or - params['webhook_gid'] is None): - raise ValueError("Missing the required parameter `webhook_gid` when calling `update_webhook`") # noqa: E501 - - collection_formats = {} - - path_params = {} - if 'webhook_gid' in params: - path_params['webhook_gid'] = params['webhook_gid'] # noqa: E501 - - query_params = [] - if 'opt_fields' in params: - query_params.append(('opt_fields', params['opt_fields'])) # noqa: E501 - collection_formats['opt_fields'] = 'csv' # noqa: E501 - - header_params = {} - - form_params = [] - local_var_files = {} - - body_params = None - if 'body' in params: - body_params = params['body'] - # HTTP header `Accept` - header_params['Accept'] = self.api_client.select_header_accept( - ['application/json; charset=UTF-8']) # noqa: E501 - - # HTTP header `Content-Type` - header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 - ['application/json; charset=UTF-8']) # noqa: E501 - - # Authentication setting - auth_settings = ['oauth2'] # noqa: E501 - - return self.api_client.call_api( - '/webhooks/{webhook_gid}', 'PUT', - path_params, - query_params, - header_params, - body=body_params, - post_params=form_params, - files=local_var_files, - response_type='WebhookResponseData', # noqa: E501 - auth_settings=auth_settings, - async_req=params.get('async_req'), - _return_http_data_only=params.get('_return_http_data_only'), - _preload_content=params.get('_preload_content', True), - _request_timeout=params.get('_request_timeout'), - collection_formats=collection_formats) + all_params = ['body', 'webhook_gid', 'opt_fields'] # noqa: E501 + all_params.append('async_req') + all_params.append('header_params') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + params = locals() + for key, val in six.iteritems(params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method update_webhook" % key + ) + params[key] = val + del params['kwargs'] + # verify the required parameter 'body' is set + if ('body' not in params or + params['body'] is None): + raise ValueError("Missing the required parameter `body` when calling `update_webhook`") # noqa: E501 + # verify the required parameter 'webhook_gid' is set + if ('webhook_gid' not in params or + params['webhook_gid'] is None): + raise ValueError("Missing the required parameter `webhook_gid` when calling `update_webhook`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'webhook_gid' in params: + path_params['webhook_gid'] = params['webhook_gid'] # noqa: E501 + + query_params = [] + if 'opt_fields' in params: + query_params.append(('opt_fields', params['opt_fields'])) # noqa: E501 + collection_formats['opt_fields'] = 'csv' # noqa: E501 + + header_params = kwargs.get("header_params", {}) + + form_params = [] + local_var_files = {} + + body_params = None + if 'body' in params: + body_params = params['body'] + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['application/json; charset=UTF-8']) # noqa: E501 + + # HTTP header `Content-Type` + header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 + ['application/json; charset=UTF-8']) # noqa: E501 + + # Authentication setting + auth_settings = ['oauth2'] # noqa: E501 + + return self.api_client.call_api( + '/webhooks/{webhook_gid}', 'PUT', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='WebhookResponseData', # noqa: E501 + auth_settings=auth_settings, + async_req=params.get('async_req'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) diff --git a/asana/api/workspace_memberships_api.py b/asana/api/workspace_memberships_api.py index 0df038b7..06957b99 100644 --- a/asana/api/workspace_memberships_api.py +++ b/asana/api/workspace_memberships_api.py @@ -21,333 +21,336 @@ class WorkspaceMembershipsApi(object): - """NOTE: This class is auto generated by the swagger code generator program. +"""NOTE: This class is auto generated by the swagger code generator program. - Do not edit the class manually. - Ref: https://github.com/swagger-api/swagger-codegen +Do not edit the class manually. +Ref: https://github.com/swagger-api/swagger-codegen +""" + +def __init__(self, api_client=None): + if api_client is None: + api_client = ApiClient() + self.api_client = api_client + +def get_workspace_membership(self, workspace_membership_gid, **kwargs): # noqa: E501 + """Get a workspace membership # noqa: E501 + + Returns the complete workspace record for a single workspace membership. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.get_workspace_membership(workspace_membership_gid, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str workspace_membership_gid: (required) + :param list[str] opt_fields: This endpoint returns a compact resource, which excludes some properties by default. To include those optional properties, set this query parameter to a comma-separated list of the properties you wish to include. + :return: WorkspaceMembershipResponseData + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = kwargs.get("_return_http_data_only", True) + if kwargs.get('async_req'): + return self.get_workspace_membership_with_http_info(workspace_membership_gid, **kwargs) # noqa: E501 + else: + (data) = self.get_workspace_membership_with_http_info(workspace_membership_gid, **kwargs) # noqa: E501 + return data + +def get_workspace_membership_with_http_info(self, workspace_membership_gid, **kwargs): # noqa: E501 + """Get a workspace membership # noqa: E501 + + Returns the complete workspace record for a single workspace membership. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.get_workspace_membership_with_http_info(workspace_membership_gid, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str workspace_membership_gid: (required) + :param list[str] opt_fields: This endpoint returns a compact resource, which excludes some properties by default. To include those optional properties, set this query parameter to a comma-separated list of the properties you wish to include. + :return: WorkspaceMembershipResponseData + If the method is called asynchronously, + returns the request thread. + """ + + all_params = ['workspace_membership_gid', 'opt_fields'] # noqa: E501 + all_params.append('async_req') + all_params.append('header_params') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + params = locals() + for key, val in six.iteritems(params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method get_workspace_membership" % key + ) + params[key] = val + del params['kwargs'] + # verify the required parameter 'workspace_membership_gid' is set + if ('workspace_membership_gid' not in params or + params['workspace_membership_gid'] is None): + raise ValueError("Missing the required parameter `workspace_membership_gid` when calling `get_workspace_membership`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'workspace_membership_gid' in params: + path_params['workspace_membership_gid'] = params['workspace_membership_gid'] # noqa: E501 + + query_params = [] + if 'opt_fields' in params: + query_params.append(('opt_fields', params['opt_fields'])) # noqa: E501 + collection_formats['opt_fields'] = 'csv' # noqa: E501 + + header_params = kwargs.get("header_params", {}) + + form_params = [] + local_var_files = {} + + body_params = None + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['application/json; charset=UTF-8']) # noqa: E501 + + # Authentication setting + auth_settings = ['oauth2'] # noqa: E501 + + return self.api_client.call_api( + '/workspace_memberships/{workspace_membership_gid}', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='WorkspaceMembershipResponseData', # noqa: E501 + auth_settings=auth_settings, + async_req=params.get('async_req'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) + +def get_workspace_memberships_for_user(self, user_gid, **kwargs): # noqa: E501 + """Get workspace memberships for a user # noqa: E501 + + Returns the compact workspace membership records for the user. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.get_workspace_memberships_for_user(user_gid, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str user_gid: A string identifying a user. This can either be the string \"me\", an email, or the gid of a user. (required) + :param int limit: Results per page. The number of objects to return per page. The value must be between 1 and 100. + :param str offset: 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 list[str] opt_fields: This endpoint returns a compact resource, which excludes some properties by default. To include those optional properties, set this query parameter to a comma-separated list of the properties you wish to include. + :return: WorkspaceMembershipResponseArray + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = kwargs.get("_return_http_data_only", True) + if kwargs.get('async_req'): + return self.get_workspace_memberships_for_user_with_http_info(user_gid, **kwargs) # noqa: E501 + else: + (data) = self.get_workspace_memberships_for_user_with_http_info(user_gid, **kwargs) # noqa: E501 + return data + +def get_workspace_memberships_for_user_with_http_info(self, user_gid, **kwargs): # noqa: E501 + """Get workspace memberships for a user # noqa: E501 + + Returns the compact workspace membership records for the user. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.get_workspace_memberships_for_user_with_http_info(user_gid, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str user_gid: A string identifying a user. This can either be the string \"me\", an email, or the gid of a user. (required) + :param int limit: Results per page. The number of objects to return per page. The value must be between 1 and 100. + :param str offset: 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 list[str] opt_fields: This endpoint returns a compact resource, which excludes some properties by default. To include those optional properties, set this query parameter to a comma-separated list of the properties you wish to include. + :return: WorkspaceMembershipResponseArray + If the method is called asynchronously, + returns the request thread. + """ + + all_params = ['user_gid', 'limit', 'offset', 'opt_fields'] # noqa: E501 + all_params.append('async_req') + all_params.append('header_params') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + params = locals() + for key, val in six.iteritems(params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method get_workspace_memberships_for_user" % key + ) + params[key] = val + del params['kwargs'] + # verify the required parameter 'user_gid' is set + if ('user_gid' not in params or + params['user_gid'] is None): + raise ValueError("Missing the required parameter `user_gid` when calling `get_workspace_memberships_for_user`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'user_gid' in params: + path_params['user_gid'] = params['user_gid'] # noqa: E501 + + query_params = [] + if 'limit' in params: + query_params.append(('limit', params['limit'])) # noqa: E501 + if 'offset' in params: + query_params.append(('offset', params['offset'])) # noqa: E501 + if 'opt_fields' in params: + query_params.append(('opt_fields', params['opt_fields'])) # noqa: E501 + collection_formats['opt_fields'] = 'csv' # noqa: E501 + + header_params = kwargs.get("header_params", {}) + + form_params = [] + local_var_files = {} + + body_params = None + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['application/json; charset=UTF-8']) # noqa: E501 + + # Authentication setting + auth_settings = ['oauth2'] # noqa: E501 + + return self.api_client.call_api( + '/users/{user_gid}/workspace_memberships', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='WorkspaceMembershipResponseArray', # noqa: E501 + auth_settings=auth_settings, + async_req=params.get('async_req'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) + +def get_workspace_memberships_for_workspace(self, workspace_gid, **kwargs): # noqa: E501 + """Get the workspace memberships for a workspace # noqa: E501 + + Returns the compact workspace membership records for the workspace. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.get_workspace_memberships_for_workspace(workspace_gid, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str workspace_gid: Globally unique identifier for the workspace or organization. (required) + :param str user: A string identifying a user. This can either be the string \"me\", an email, or the gid of a user. + :param int limit: Results per page. The number of objects to return per page. The value must be between 1 and 100. + :param str offset: 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 list[str] opt_fields: This endpoint returns a compact resource, which excludes some properties by default. To include those optional properties, set this query parameter to a comma-separated list of the properties you wish to include. + :return: WorkspaceMembershipResponseArray + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = kwargs.get("_return_http_data_only", True) + if kwargs.get('async_req'): + return self.get_workspace_memberships_for_workspace_with_http_info(workspace_gid, **kwargs) # noqa: E501 + else: + (data) = self.get_workspace_memberships_for_workspace_with_http_info(workspace_gid, **kwargs) # noqa: E501 + return data + +def get_workspace_memberships_for_workspace_with_http_info(self, workspace_gid, **kwargs): # noqa: E501 + """Get the workspace memberships for a workspace # noqa: E501 + + Returns the compact workspace membership records for the workspace. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.get_workspace_memberships_for_workspace_with_http_info(workspace_gid, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str workspace_gid: Globally unique identifier for the workspace or organization. (required) + :param str user: A string identifying a user. This can either be the string \"me\", an email, or the gid of a user. + :param int limit: Results per page. The number of objects to return per page. The value must be between 1 and 100. + :param str offset: 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 list[str] opt_fields: This endpoint returns a compact resource, which excludes some properties by default. To include those optional properties, set this query parameter to a comma-separated list of the properties you wish to include. + :return: WorkspaceMembershipResponseArray + If the method is called asynchronously, + returns the request thread. """ - def __init__(self, api_client=None): - if api_client is None: - api_client = ApiClient() - self.api_client = api_client - - def get_workspace_membership(self, workspace_membership_gid, **kwargs): # noqa: E501 - """Get a workspace membership # noqa: E501 - - Returns the complete workspace record for a single workspace membership. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.get_workspace_membership(workspace_membership_gid, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param str workspace_membership_gid: (required) - :param list[str] opt_fields: This endpoint returns a compact resource, which excludes some properties by default. To include those optional properties, set this query parameter to a comma-separated list of the properties you wish to include. - :return: WorkspaceMembershipResponseData - If the method is called asynchronously, - returns the request thread. - """ - kwargs['_return_http_data_only'] = True - if kwargs.get('async_req'): - return self.get_workspace_membership_with_http_info(workspace_membership_gid, **kwargs) # noqa: E501 - else: - (data) = self.get_workspace_membership_with_http_info(workspace_membership_gid, **kwargs) # noqa: E501 - return data - - def get_workspace_membership_with_http_info(self, workspace_membership_gid, **kwargs): # noqa: E501 - """Get a workspace membership # noqa: E501 - - Returns the complete workspace record for a single workspace membership. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.get_workspace_membership_with_http_info(workspace_membership_gid, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param str workspace_membership_gid: (required) - :param list[str] opt_fields: This endpoint returns a compact resource, which excludes some properties by default. To include those optional properties, set this query parameter to a comma-separated list of the properties you wish to include. - :return: WorkspaceMembershipResponseData - If the method is called asynchronously, - returns the request thread. - """ - - all_params = ['workspace_membership_gid', 'opt_fields'] # noqa: E501 - all_params.append('async_req') - all_params.append('_return_http_data_only') - all_params.append('_preload_content') - all_params.append('_request_timeout') - - params = locals() - for key, val in six.iteritems(params['kwargs']): - if key not in all_params: - raise TypeError( - "Got an unexpected keyword argument '%s'" - " to method get_workspace_membership" % key - ) - params[key] = val - del params['kwargs'] - # verify the required parameter 'workspace_membership_gid' is set - if ('workspace_membership_gid' not in params or - params['workspace_membership_gid'] is None): - raise ValueError("Missing the required parameter `workspace_membership_gid` when calling `get_workspace_membership`") # noqa: E501 - - collection_formats = {} - - path_params = {} - if 'workspace_membership_gid' in params: - path_params['workspace_membership_gid'] = params['workspace_membership_gid'] # noqa: E501 - - query_params = [] - if 'opt_fields' in params: - query_params.append(('opt_fields', params['opt_fields'])) # noqa: E501 - collection_formats['opt_fields'] = 'csv' # noqa: E501 - - header_params = {} - - form_params = [] - local_var_files = {} - - body_params = None - # HTTP header `Accept` - header_params['Accept'] = self.api_client.select_header_accept( - ['application/json; charset=UTF-8']) # noqa: E501 - - # Authentication setting - auth_settings = ['oauth2'] # noqa: E501 - - return self.api_client.call_api( - '/workspace_memberships/{workspace_membership_gid}', 'GET', - path_params, - query_params, - header_params, - body=body_params, - post_params=form_params, - files=local_var_files, - response_type='WorkspaceMembershipResponseData', # noqa: E501 - auth_settings=auth_settings, - async_req=params.get('async_req'), - _return_http_data_only=params.get('_return_http_data_only'), - _preload_content=params.get('_preload_content', True), - _request_timeout=params.get('_request_timeout'), - collection_formats=collection_formats) - - def get_workspace_memberships_for_user(self, user_gid, **kwargs): # noqa: E501 - """Get workspace memberships for a user # noqa: E501 - - Returns the compact workspace membership records for the user. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.get_workspace_memberships_for_user(user_gid, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param str user_gid: A string identifying a user. This can either be the string \"me\", an email, or the gid of a user. (required) - :param int limit: Results per page. The number of objects to return per page. The value must be between 1 and 100. - :param str offset: 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 list[str] opt_fields: This endpoint returns a compact resource, which excludes some properties by default. To include those optional properties, set this query parameter to a comma-separated list of the properties you wish to include. - :return: WorkspaceMembershipResponseArray - If the method is called asynchronously, - returns the request thread. - """ - kwargs['_return_http_data_only'] = True - if kwargs.get('async_req'): - return self.get_workspace_memberships_for_user_with_http_info(user_gid, **kwargs) # noqa: E501 - else: - (data) = self.get_workspace_memberships_for_user_with_http_info(user_gid, **kwargs) # noqa: E501 - return data - - def get_workspace_memberships_for_user_with_http_info(self, user_gid, **kwargs): # noqa: E501 - """Get workspace memberships for a user # noqa: E501 - - Returns the compact workspace membership records for the user. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.get_workspace_memberships_for_user_with_http_info(user_gid, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param str user_gid: A string identifying a user. This can either be the string \"me\", an email, or the gid of a user. (required) - :param int limit: Results per page. The number of objects to return per page. The value must be between 1 and 100. - :param str offset: 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 list[str] opt_fields: This endpoint returns a compact resource, which excludes some properties by default. To include those optional properties, set this query parameter to a comma-separated list of the properties you wish to include. - :return: WorkspaceMembershipResponseArray - If the method is called asynchronously, - returns the request thread. - """ - - all_params = ['user_gid', 'limit', 'offset', 'opt_fields'] # noqa: E501 - all_params.append('async_req') - all_params.append('_return_http_data_only') - all_params.append('_preload_content') - all_params.append('_request_timeout') - - params = locals() - for key, val in six.iteritems(params['kwargs']): - if key not in all_params: - raise TypeError( - "Got an unexpected keyword argument '%s'" - " to method get_workspace_memberships_for_user" % key - ) - params[key] = val - del params['kwargs'] - # verify the required parameter 'user_gid' is set - if ('user_gid' not in params or - params['user_gid'] is None): - raise ValueError("Missing the required parameter `user_gid` when calling `get_workspace_memberships_for_user`") # noqa: E501 - - collection_formats = {} - - path_params = {} - if 'user_gid' in params: - path_params['user_gid'] = params['user_gid'] # noqa: E501 - - query_params = [] - if 'limit' in params: - query_params.append(('limit', params['limit'])) # noqa: E501 - if 'offset' in params: - query_params.append(('offset', params['offset'])) # noqa: E501 - if 'opt_fields' in params: - query_params.append(('opt_fields', params['opt_fields'])) # noqa: E501 - collection_formats['opt_fields'] = 'csv' # noqa: E501 - - header_params = {} - - form_params = [] - local_var_files = {} - - body_params = None - # HTTP header `Accept` - header_params['Accept'] = self.api_client.select_header_accept( - ['application/json; charset=UTF-8']) # noqa: E501 - - # Authentication setting - auth_settings = ['oauth2'] # noqa: E501 - - return self.api_client.call_api( - '/users/{user_gid}/workspace_memberships', 'GET', - path_params, - query_params, - header_params, - body=body_params, - post_params=form_params, - files=local_var_files, - response_type='WorkspaceMembershipResponseArray', # noqa: E501 - auth_settings=auth_settings, - async_req=params.get('async_req'), - _return_http_data_only=params.get('_return_http_data_only'), - _preload_content=params.get('_preload_content', True), - _request_timeout=params.get('_request_timeout'), - collection_formats=collection_formats) - - def get_workspace_memberships_for_workspace(self, workspace_gid, **kwargs): # noqa: E501 - """Get the workspace memberships for a workspace # noqa: E501 - - Returns the compact workspace membership records for the workspace. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.get_workspace_memberships_for_workspace(workspace_gid, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param str workspace_gid: Globally unique identifier for the workspace or organization. (required) - :param str user: A string identifying a user. This can either be the string \"me\", an email, or the gid of a user. - :param int limit: Results per page. The number of objects to return per page. The value must be between 1 and 100. - :param str offset: 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 list[str] opt_fields: This endpoint returns a compact resource, which excludes some properties by default. To include those optional properties, set this query parameter to a comma-separated list of the properties you wish to include. - :return: WorkspaceMembershipResponseArray - If the method is called asynchronously, - returns the request thread. - """ - kwargs['_return_http_data_only'] = True - if kwargs.get('async_req'): - return self.get_workspace_memberships_for_workspace_with_http_info(workspace_gid, **kwargs) # noqa: E501 - else: - (data) = self.get_workspace_memberships_for_workspace_with_http_info(workspace_gid, **kwargs) # noqa: E501 - return data - - def get_workspace_memberships_for_workspace_with_http_info(self, workspace_gid, **kwargs): # noqa: E501 - """Get the workspace memberships for a workspace # noqa: E501 - - Returns the compact workspace membership records for the workspace. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.get_workspace_memberships_for_workspace_with_http_info(workspace_gid, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param str workspace_gid: Globally unique identifier for the workspace or organization. (required) - :param str user: A string identifying a user. This can either be the string \"me\", an email, or the gid of a user. - :param int limit: Results per page. The number of objects to return per page. The value must be between 1 and 100. - :param str offset: 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 list[str] opt_fields: This endpoint returns a compact resource, which excludes some properties by default. To include those optional properties, set this query parameter to a comma-separated list of the properties you wish to include. - :return: WorkspaceMembershipResponseArray - If the method is called asynchronously, - returns the request thread. - """ - - all_params = ['workspace_gid', 'user', 'limit', 'offset', 'opt_fields'] # noqa: E501 - all_params.append('async_req') - all_params.append('_return_http_data_only') - all_params.append('_preload_content') - all_params.append('_request_timeout') - - params = locals() - for key, val in six.iteritems(params['kwargs']): - if key not in all_params: - raise TypeError( - "Got an unexpected keyword argument '%s'" - " to method get_workspace_memberships_for_workspace" % key - ) - params[key] = val - del params['kwargs'] - # verify the required parameter 'workspace_gid' is set - if ('workspace_gid' not in params or - params['workspace_gid'] is None): - raise ValueError("Missing the required parameter `workspace_gid` when calling `get_workspace_memberships_for_workspace`") # noqa: E501 - - collection_formats = {} - - path_params = {} - if 'workspace_gid' in params: - path_params['workspace_gid'] = params['workspace_gid'] # noqa: E501 - - query_params = [] - if 'user' in params: - query_params.append(('user', params['user'])) # noqa: E501 - if 'limit' in params: - query_params.append(('limit', params['limit'])) # noqa: E501 - if 'offset' in params: - query_params.append(('offset', params['offset'])) # noqa: E501 - if 'opt_fields' in params: - query_params.append(('opt_fields', params['opt_fields'])) # noqa: E501 - collection_formats['opt_fields'] = 'csv' # noqa: E501 - - header_params = {} - - form_params = [] - local_var_files = {} - - body_params = None - # HTTP header `Accept` - header_params['Accept'] = self.api_client.select_header_accept( - ['application/json; charset=UTF-8']) # noqa: E501 - - # Authentication setting - auth_settings = ['oauth2'] # noqa: E501 - - return self.api_client.call_api( - '/workspaces/{workspace_gid}/workspace_memberships', 'GET', - path_params, - query_params, - header_params, - body=body_params, - post_params=form_params, - files=local_var_files, - response_type='WorkspaceMembershipResponseArray', # noqa: E501 - auth_settings=auth_settings, - async_req=params.get('async_req'), - _return_http_data_only=params.get('_return_http_data_only'), - _preload_content=params.get('_preload_content', True), - _request_timeout=params.get('_request_timeout'), - collection_formats=collection_formats) + all_params = ['workspace_gid', 'user', 'limit', 'offset', 'opt_fields'] # noqa: E501 + all_params.append('async_req') + all_params.append('header_params') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + params = locals() + for key, val in six.iteritems(params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method get_workspace_memberships_for_workspace" % key + ) + params[key] = val + del params['kwargs'] + # verify the required parameter 'workspace_gid' is set + if ('workspace_gid' not in params or + params['workspace_gid'] is None): + raise ValueError("Missing the required parameter `workspace_gid` when calling `get_workspace_memberships_for_workspace`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'workspace_gid' in params: + path_params['workspace_gid'] = params['workspace_gid'] # noqa: E501 + + query_params = [] + if 'user' in params: + query_params.append(('user', params['user'])) # noqa: E501 + if 'limit' in params: + query_params.append(('limit', params['limit'])) # noqa: E501 + if 'offset' in params: + query_params.append(('offset', params['offset'])) # noqa: E501 + if 'opt_fields' in params: + query_params.append(('opt_fields', params['opt_fields'])) # noqa: E501 + collection_formats['opt_fields'] = 'csv' # noqa: E501 + + header_params = kwargs.get("header_params", {}) + + form_params = [] + local_var_files = {} + + body_params = None + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['application/json; charset=UTF-8']) # noqa: E501 + + # Authentication setting + auth_settings = ['oauth2'] # noqa: E501 + + return self.api_client.call_api( + '/workspaces/{workspace_gid}/workspace_memberships', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='WorkspaceMembershipResponseArray', # noqa: E501 + auth_settings=auth_settings, + async_req=params.get('async_req'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) diff --git a/asana/api/workspaces_api.py b/asana/api/workspaces_api.py index 74dc2ef1..3d1de453 100644 --- a/asana/api/workspaces_api.py +++ b/asana/api/workspaces_api.py @@ -21,544 +21,549 @@ class WorkspacesApi(object): - """NOTE: This class is auto generated by the swagger code generator program. +"""NOTE: This class is auto generated by the swagger code generator program. - Do not edit the class manually. - Ref: https://github.com/swagger-api/swagger-codegen +Do not edit the class manually. +Ref: https://github.com/swagger-api/swagger-codegen +""" + +def __init__(self, api_client=None): + if api_client is None: + api_client = ApiClient() + self.api_client = api_client + +def add_user_for_workspace(self, body, workspace_gid, **kwargs): # noqa: E501 + """Add a user to a workspace or organization # noqa: E501 + + Add a user to a workspace or organization. The user can be referenced by their globally unique user ID or their email address. Returns the full user record for the invited user. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.add_user_for_workspace(body, workspace_gid, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param WorkspaceGidAddUserBody body: The user to add to the workspace. (required) + :param str workspace_gid: Globally unique identifier for the workspace or organization. (required) + :param list[str] opt_fields: This endpoint returns a compact resource, which excludes some properties by default. To include those optional properties, set this query parameter to a comma-separated list of the properties you wish to include. + :return: UserBaseResponseData + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = kwargs.get("_return_http_data_only", True) + if kwargs.get('async_req'): + return self.add_user_for_workspace_with_http_info(body, workspace_gid, **kwargs) # noqa: E501 + else: + (data) = self.add_user_for_workspace_with_http_info(body, workspace_gid, **kwargs) # noqa: E501 + return data + +def add_user_for_workspace_with_http_info(self, body, workspace_gid, **kwargs): # noqa: E501 + """Add a user to a workspace or organization # noqa: E501 + + Add a user to a workspace or organization. The user can be referenced by their globally unique user ID or their email address. Returns the full user record for the invited user. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.add_user_for_workspace_with_http_info(body, workspace_gid, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param WorkspaceGidAddUserBody body: The user to add to the workspace. (required) + :param str workspace_gid: Globally unique identifier for the workspace or organization. (required) + :param list[str] opt_fields: This endpoint returns a compact resource, which excludes some properties by default. To include those optional properties, set this query parameter to a comma-separated list of the properties you wish to include. + :return: UserBaseResponseData + If the method is called asynchronously, + returns the request thread. + """ + + all_params = ['body', 'workspace_gid', 'opt_fields'] # noqa: E501 + all_params.append('async_req') + all_params.append('header_params') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + params = locals() + for key, val in six.iteritems(params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method add_user_for_workspace" % key + ) + params[key] = val + del params['kwargs'] + # verify the required parameter 'body' is set + if ('body' not in params or + params['body'] is None): + raise ValueError("Missing the required parameter `body` when calling `add_user_for_workspace`") # noqa: E501 + # verify the required parameter 'workspace_gid' is set + if ('workspace_gid' not in params or + params['workspace_gid'] is None): + raise ValueError("Missing the required parameter `workspace_gid` when calling `add_user_for_workspace`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'workspace_gid' in params: + path_params['workspace_gid'] = params['workspace_gid'] # noqa: E501 + + query_params = [] + if 'opt_fields' in params: + query_params.append(('opt_fields', params['opt_fields'])) # noqa: E501 + collection_formats['opt_fields'] = 'csv' # noqa: E501 + + header_params = kwargs.get("header_params", {}) + + form_params = [] + local_var_files = {} + + body_params = None + if 'body' in params: + body_params = params['body'] + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['application/json; charset=UTF-8']) # noqa: E501 + + # HTTP header `Content-Type` + header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 + ['application/json; charset=UTF-8']) # noqa: E501 + + # Authentication setting + auth_settings = ['oauth2'] # noqa: E501 + + return self.api_client.call_api( + '/workspaces/{workspace_gid}/addUser', 'POST', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='UserBaseResponseData', # noqa: E501 + auth_settings=auth_settings, + async_req=params.get('async_req'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) + +def get_workspace(self, workspace_gid, **kwargs): # noqa: E501 + """Get a workspace # noqa: E501 + + Returns the full workspace record for a single workspace. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.get_workspace(workspace_gid, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str workspace_gid: Globally unique identifier for the workspace or organization. (required) + :param list[str] opt_fields: This endpoint returns a compact resource, which excludes some properties by default. To include those optional properties, set this query parameter to a comma-separated list of the properties you wish to include. + :return: WorkspaceResponseData + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = kwargs.get("_return_http_data_only", True) + if kwargs.get('async_req'): + return self.get_workspace_with_http_info(workspace_gid, **kwargs) # noqa: E501 + else: + (data) = self.get_workspace_with_http_info(workspace_gid, **kwargs) # noqa: E501 + return data + +def get_workspace_with_http_info(self, workspace_gid, **kwargs): # noqa: E501 + """Get a workspace # noqa: E501 + + Returns the full workspace record for a single workspace. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.get_workspace_with_http_info(workspace_gid, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str workspace_gid: Globally unique identifier for the workspace or organization. (required) + :param list[str] opt_fields: This endpoint returns a compact resource, which excludes some properties by default. To include those optional properties, set this query parameter to a comma-separated list of the properties you wish to include. + :return: WorkspaceResponseData + If the method is called asynchronously, + returns the request thread. + """ + + all_params = ['workspace_gid', 'opt_fields'] # noqa: E501 + all_params.append('async_req') + all_params.append('header_params') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + params = locals() + for key, val in six.iteritems(params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method get_workspace" % key + ) + params[key] = val + del params['kwargs'] + # verify the required parameter 'workspace_gid' is set + if ('workspace_gid' not in params or + params['workspace_gid'] is None): + raise ValueError("Missing the required parameter `workspace_gid` when calling `get_workspace`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'workspace_gid' in params: + path_params['workspace_gid'] = params['workspace_gid'] # noqa: E501 + + query_params = [] + if 'opt_fields' in params: + query_params.append(('opt_fields', params['opt_fields'])) # noqa: E501 + collection_formats['opt_fields'] = 'csv' # noqa: E501 + + header_params = kwargs.get("header_params", {}) + + form_params = [] + local_var_files = {} + + body_params = None + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['application/json; charset=UTF-8']) # noqa: E501 + + # Authentication setting + auth_settings = ['oauth2'] # noqa: E501 + + return self.api_client.call_api( + '/workspaces/{workspace_gid}', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='WorkspaceResponseData', # noqa: E501 + auth_settings=auth_settings, + async_req=params.get('async_req'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) + +def get_workspaces(self, **kwargs): # noqa: E501 + """Get multiple workspaces # noqa: E501 + + Returns the compact records for all workspaces visible to the authorized user. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.get_workspaces(async_req=True) + >>> result = thread.get() + + :param async_req bool + :param int limit: Results per page. The number of objects to return per page. The value must be between 1 and 100. + :param str offset: 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 list[str] opt_fields: This endpoint returns a compact resource, which excludes some properties by default. To include those optional properties, set this query parameter to a comma-separated list of the properties you wish to include. + :return: WorkspaceResponseArray + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = kwargs.get("_return_http_data_only", True) + if kwargs.get('async_req'): + return self.get_workspaces_with_http_info(**kwargs) # noqa: E501 + else: + (data) = self.get_workspaces_with_http_info(**kwargs) # noqa: E501 + return data + +def get_workspaces_with_http_info(self, **kwargs): # noqa: E501 + """Get multiple workspaces # noqa: E501 + + Returns the compact records for all workspaces visible to the authorized user. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.get_workspaces_with_http_info(async_req=True) + >>> result = thread.get() + + :param async_req bool + :param int limit: Results per page. The number of objects to return per page. The value must be between 1 and 100. + :param str offset: 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 list[str] opt_fields: This endpoint returns a compact resource, which excludes some properties by default. To include those optional properties, set this query parameter to a comma-separated list of the properties you wish to include. + :return: WorkspaceResponseArray + If the method is called asynchronously, + returns the request thread. + """ + + all_params = ['limit', 'offset', 'opt_fields'] # noqa: E501 + all_params.append('async_req') + all_params.append('header_params') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + params = locals() + for key, val in six.iteritems(params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method get_workspaces" % key + ) + params[key] = val + del params['kwargs'] + + collection_formats = {} + + path_params = {} + + query_params = [] + if 'limit' in params: + query_params.append(('limit', params['limit'])) # noqa: E501 + if 'offset' in params: + query_params.append(('offset', params['offset'])) # noqa: E501 + if 'opt_fields' in params: + query_params.append(('opt_fields', params['opt_fields'])) # noqa: E501 + collection_formats['opt_fields'] = 'csv' # noqa: E501 + + header_params = kwargs.get("header_params", {}) + + form_params = [] + local_var_files = {} + + body_params = None + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['application/json; charset=UTF-8']) # noqa: E501 + + # Authentication setting + auth_settings = ['oauth2'] # noqa: E501 + + return self.api_client.call_api( + '/workspaces', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='WorkspaceResponseArray', # noqa: E501 + auth_settings=auth_settings, + async_req=params.get('async_req'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) + +def remove_user_for_workspace(self, body, workspace_gid, **kwargs): # noqa: E501 + """Remove a user from a workspace or organization # noqa: E501 + + Remove a user from a workspace or organization. The user making this call must be an admin in the workspace. The user can be referenced by their globally unique user ID or their email address. Returns an empty data record. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.remove_user_for_workspace(body, workspace_gid, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param WorkspaceGidRemoveUserBody body: The user to remove from the workspace. (required) + :param str workspace_gid: Globally unique identifier for the workspace or organization. (required) + :return: EmptyResponseData + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = kwargs.get("_return_http_data_only", True) + if kwargs.get('async_req'): + return self.remove_user_for_workspace_with_http_info(body, workspace_gid, **kwargs) # noqa: E501 + else: + (data) = self.remove_user_for_workspace_with_http_info(body, workspace_gid, **kwargs) # noqa: E501 + return data + +def remove_user_for_workspace_with_http_info(self, body, workspace_gid, **kwargs): # noqa: E501 + """Remove a user from a workspace or organization # noqa: E501 + + Remove a user from a workspace or organization. The user making this call must be an admin in the workspace. The user can be referenced by their globally unique user ID or their email address. Returns an empty data record. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.remove_user_for_workspace_with_http_info(body, workspace_gid, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param WorkspaceGidRemoveUserBody body: The user to remove from the workspace. (required) + :param str workspace_gid: Globally unique identifier for the workspace or organization. (required) + :return: EmptyResponseData + If the method is called asynchronously, + returns the request thread. + """ + + all_params = ['body', 'workspace_gid'] # noqa: E501 + all_params.append('async_req') + all_params.append('header_params') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + params = locals() + for key, val in six.iteritems(params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method remove_user_for_workspace" % key + ) + params[key] = val + del params['kwargs'] + # verify the required parameter 'body' is set + if ('body' not in params or + params['body'] is None): + raise ValueError("Missing the required parameter `body` when calling `remove_user_for_workspace`") # noqa: E501 + # verify the required parameter 'workspace_gid' is set + if ('workspace_gid' not in params or + params['workspace_gid'] is None): + raise ValueError("Missing the required parameter `workspace_gid` when calling `remove_user_for_workspace`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'workspace_gid' in params: + path_params['workspace_gid'] = params['workspace_gid'] # noqa: E501 + + query_params = [] + + header_params = kwargs.get("header_params", {}) + + form_params = [] + local_var_files = {} + + body_params = None + if 'body' in params: + body_params = params['body'] + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['application/json; charset=UTF-8']) # noqa: E501 + + # HTTP header `Content-Type` + header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 + ['application/json; charset=UTF-8']) # noqa: E501 + + # Authentication setting + auth_settings = ['oauth2'] # noqa: E501 + + return self.api_client.call_api( + '/workspaces/{workspace_gid}/removeUser', 'POST', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='EmptyResponseData', # noqa: E501 + auth_settings=auth_settings, + async_req=params.get('async_req'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) + +def update_workspace(self, body, workspace_gid, **kwargs): # noqa: E501 + """Update a workspace # noqa: E501 + + A specific, existing workspace can be updated by making a PUT request on the URL for that workspace. Only the fields provided in the data block will be updated; any unspecified fields will remain unchanged. Currently the only field that can be modified for a workspace is its name. Returns the complete, updated workspace record. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.update_workspace(body, workspace_gid, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param WorkspacesWorkspaceGidBody body: The workspace object with all updated properties. (required) + :param str workspace_gid: Globally unique identifier for the workspace or organization. (required) + :param list[str] opt_fields: This endpoint returns a compact resource, which excludes some properties by default. To include those optional properties, set this query parameter to a comma-separated list of the properties you wish to include. + :return: WorkspaceResponseData + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = kwargs.get("_return_http_data_only", True) + if kwargs.get('async_req'): + return self.update_workspace_with_http_info(body, workspace_gid, **kwargs) # noqa: E501 + else: + (data) = self.update_workspace_with_http_info(body, workspace_gid, **kwargs) # noqa: E501 + return data + +def update_workspace_with_http_info(self, body, workspace_gid, **kwargs): # noqa: E501 + """Update a workspace # noqa: E501 + + A specific, existing workspace can be updated by making a PUT request on the URL for that workspace. Only the fields provided in the data block will be updated; any unspecified fields will remain unchanged. Currently the only field that can be modified for a workspace is its name. Returns the complete, updated workspace record. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.update_workspace_with_http_info(body, workspace_gid, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param WorkspacesWorkspaceGidBody body: The workspace object with all updated properties. (required) + :param str workspace_gid: Globally unique identifier for the workspace or organization. (required) + :param list[str] opt_fields: This endpoint returns a compact resource, which excludes some properties by default. To include those optional properties, set this query parameter to a comma-separated list of the properties you wish to include. + :return: WorkspaceResponseData + If the method is called asynchronously, + returns the request thread. """ - def __init__(self, api_client=None): - if api_client is None: - api_client = ApiClient() - self.api_client = api_client - - def add_user_for_workspace(self, body, workspace_gid, **kwargs): # noqa: E501 - """Add a user to a workspace or organization # noqa: E501 - - Add a user to a workspace or organization. The user can be referenced by their globally unique user ID or their email address. Returns the full user record for the invited user. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.add_user_for_workspace(body, workspace_gid, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param WorkspaceGidAddUserBody body: The user to add to the workspace. (required) - :param str workspace_gid: Globally unique identifier for the workspace or organization. (required) - :param list[str] opt_fields: This endpoint returns a compact resource, which excludes some properties by default. To include those optional properties, set this query parameter to a comma-separated list of the properties you wish to include. - :return: UserBaseResponseData - If the method is called asynchronously, - returns the request thread. - """ - kwargs['_return_http_data_only'] = True - if kwargs.get('async_req'): - return self.add_user_for_workspace_with_http_info(body, workspace_gid, **kwargs) # noqa: E501 - else: - (data) = self.add_user_for_workspace_with_http_info(body, workspace_gid, **kwargs) # noqa: E501 - return data - - def add_user_for_workspace_with_http_info(self, body, workspace_gid, **kwargs): # noqa: E501 - """Add a user to a workspace or organization # noqa: E501 - - Add a user to a workspace or organization. The user can be referenced by their globally unique user ID or their email address. Returns the full user record for the invited user. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.add_user_for_workspace_with_http_info(body, workspace_gid, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param WorkspaceGidAddUserBody body: The user to add to the workspace. (required) - :param str workspace_gid: Globally unique identifier for the workspace or organization. (required) - :param list[str] opt_fields: This endpoint returns a compact resource, which excludes some properties by default. To include those optional properties, set this query parameter to a comma-separated list of the properties you wish to include. - :return: UserBaseResponseData - If the method is called asynchronously, - returns the request thread. - """ - - all_params = ['body', 'workspace_gid', 'opt_fields'] # noqa: E501 - all_params.append('async_req') - all_params.append('_return_http_data_only') - all_params.append('_preload_content') - all_params.append('_request_timeout') - - params = locals() - for key, val in six.iteritems(params['kwargs']): - if key not in all_params: - raise TypeError( - "Got an unexpected keyword argument '%s'" - " to method add_user_for_workspace" % key - ) - params[key] = val - del params['kwargs'] - # verify the required parameter 'body' is set - if ('body' not in params or - params['body'] is None): - raise ValueError("Missing the required parameter `body` when calling `add_user_for_workspace`") # noqa: E501 - # verify the required parameter 'workspace_gid' is set - if ('workspace_gid' not in params or - params['workspace_gid'] is None): - raise ValueError("Missing the required parameter `workspace_gid` when calling `add_user_for_workspace`") # noqa: E501 - - collection_formats = {} - - path_params = {} - if 'workspace_gid' in params: - path_params['workspace_gid'] = params['workspace_gid'] # noqa: E501 - - query_params = [] - if 'opt_fields' in params: - query_params.append(('opt_fields', params['opt_fields'])) # noqa: E501 - collection_formats['opt_fields'] = 'csv' # noqa: E501 - - header_params = {} - - form_params = [] - local_var_files = {} - - body_params = None - if 'body' in params: - body_params = params['body'] - # HTTP header `Accept` - header_params['Accept'] = self.api_client.select_header_accept( - ['application/json; charset=UTF-8']) # noqa: E501 - - # HTTP header `Content-Type` - header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 - ['application/json; charset=UTF-8']) # noqa: E501 - - # Authentication setting - auth_settings = ['oauth2'] # noqa: E501 - - return self.api_client.call_api( - '/workspaces/{workspace_gid}/addUser', 'POST', - path_params, - query_params, - header_params, - body=body_params, - post_params=form_params, - files=local_var_files, - response_type='UserBaseResponseData', # noqa: E501 - auth_settings=auth_settings, - async_req=params.get('async_req'), - _return_http_data_only=params.get('_return_http_data_only'), - _preload_content=params.get('_preload_content', True), - _request_timeout=params.get('_request_timeout'), - collection_formats=collection_formats) - - def get_workspace(self, workspace_gid, **kwargs): # noqa: E501 - """Get a workspace # noqa: E501 - - Returns the full workspace record for a single workspace. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.get_workspace(workspace_gid, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param str workspace_gid: Globally unique identifier for the workspace or organization. (required) - :param list[str] opt_fields: This endpoint returns a compact resource, which excludes some properties by default. To include those optional properties, set this query parameter to a comma-separated list of the properties you wish to include. - :return: WorkspaceResponseData - If the method is called asynchronously, - returns the request thread. - """ - kwargs['_return_http_data_only'] = True - if kwargs.get('async_req'): - return self.get_workspace_with_http_info(workspace_gid, **kwargs) # noqa: E501 - else: - (data) = self.get_workspace_with_http_info(workspace_gid, **kwargs) # noqa: E501 - return data - - def get_workspace_with_http_info(self, workspace_gid, **kwargs): # noqa: E501 - """Get a workspace # noqa: E501 - - Returns the full workspace record for a single workspace. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.get_workspace_with_http_info(workspace_gid, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param str workspace_gid: Globally unique identifier for the workspace or organization. (required) - :param list[str] opt_fields: This endpoint returns a compact resource, which excludes some properties by default. To include those optional properties, set this query parameter to a comma-separated list of the properties you wish to include. - :return: WorkspaceResponseData - If the method is called asynchronously, - returns the request thread. - """ - - all_params = ['workspace_gid', 'opt_fields'] # noqa: E501 - all_params.append('async_req') - all_params.append('_return_http_data_only') - all_params.append('_preload_content') - all_params.append('_request_timeout') - - params = locals() - for key, val in six.iteritems(params['kwargs']): - if key not in all_params: - raise TypeError( - "Got an unexpected keyword argument '%s'" - " to method get_workspace" % key - ) - params[key] = val - del params['kwargs'] - # verify the required parameter 'workspace_gid' is set - if ('workspace_gid' not in params or - params['workspace_gid'] is None): - raise ValueError("Missing the required parameter `workspace_gid` when calling `get_workspace`") # noqa: E501 - - collection_formats = {} - - path_params = {} - if 'workspace_gid' in params: - path_params['workspace_gid'] = params['workspace_gid'] # noqa: E501 - - query_params = [] - if 'opt_fields' in params: - query_params.append(('opt_fields', params['opt_fields'])) # noqa: E501 - collection_formats['opt_fields'] = 'csv' # noqa: E501 - - header_params = {} - - form_params = [] - local_var_files = {} - - body_params = None - # HTTP header `Accept` - header_params['Accept'] = self.api_client.select_header_accept( - ['application/json; charset=UTF-8']) # noqa: E501 - - # Authentication setting - auth_settings = ['oauth2'] # noqa: E501 - - return self.api_client.call_api( - '/workspaces/{workspace_gid}', 'GET', - path_params, - query_params, - header_params, - body=body_params, - post_params=form_params, - files=local_var_files, - response_type='WorkspaceResponseData', # noqa: E501 - auth_settings=auth_settings, - async_req=params.get('async_req'), - _return_http_data_only=params.get('_return_http_data_only'), - _preload_content=params.get('_preload_content', True), - _request_timeout=params.get('_request_timeout'), - collection_formats=collection_formats) - - def get_workspaces(self, **kwargs): # noqa: E501 - """Get multiple workspaces # noqa: E501 - - Returns the compact records for all workspaces visible to the authorized user. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.get_workspaces(async_req=True) - >>> result = thread.get() - - :param async_req bool - :param int limit: Results per page. The number of objects to return per page. The value must be between 1 and 100. - :param str offset: 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 list[str] opt_fields: This endpoint returns a compact resource, which excludes some properties by default. To include those optional properties, set this query parameter to a comma-separated list of the properties you wish to include. - :return: WorkspaceResponseArray - If the method is called asynchronously, - returns the request thread. - """ - kwargs['_return_http_data_only'] = True - if kwargs.get('async_req'): - return self.get_workspaces_with_http_info(**kwargs) # noqa: E501 - else: - (data) = self.get_workspaces_with_http_info(**kwargs) # noqa: E501 - return data - - def get_workspaces_with_http_info(self, **kwargs): # noqa: E501 - """Get multiple workspaces # noqa: E501 - - Returns the compact records for all workspaces visible to the authorized user. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.get_workspaces_with_http_info(async_req=True) - >>> result = thread.get() - - :param async_req bool - :param int limit: Results per page. The number of objects to return per page. The value must be between 1 and 100. - :param str offset: 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 list[str] opt_fields: This endpoint returns a compact resource, which excludes some properties by default. To include those optional properties, set this query parameter to a comma-separated list of the properties you wish to include. - :return: WorkspaceResponseArray - If the method is called asynchronously, - returns the request thread. - """ - - all_params = ['limit', 'offset', 'opt_fields'] # noqa: E501 - all_params.append('async_req') - all_params.append('_return_http_data_only') - all_params.append('_preload_content') - all_params.append('_request_timeout') - - params = locals() - for key, val in six.iteritems(params['kwargs']): - if key not in all_params: - raise TypeError( - "Got an unexpected keyword argument '%s'" - " to method get_workspaces" % key - ) - params[key] = val - del params['kwargs'] - - collection_formats = {} - - path_params = {} - - query_params = [] - if 'limit' in params: - query_params.append(('limit', params['limit'])) # noqa: E501 - if 'offset' in params: - query_params.append(('offset', params['offset'])) # noqa: E501 - if 'opt_fields' in params: - query_params.append(('opt_fields', params['opt_fields'])) # noqa: E501 - collection_formats['opt_fields'] = 'csv' # noqa: E501 - - header_params = {} - - form_params = [] - local_var_files = {} - - body_params = None - # HTTP header `Accept` - header_params['Accept'] = self.api_client.select_header_accept( - ['application/json; charset=UTF-8']) # noqa: E501 - - # Authentication setting - auth_settings = ['oauth2'] # noqa: E501 - - return self.api_client.call_api( - '/workspaces', 'GET', - path_params, - query_params, - header_params, - body=body_params, - post_params=form_params, - files=local_var_files, - response_type='WorkspaceResponseArray', # noqa: E501 - auth_settings=auth_settings, - async_req=params.get('async_req'), - _return_http_data_only=params.get('_return_http_data_only'), - _preload_content=params.get('_preload_content', True), - _request_timeout=params.get('_request_timeout'), - collection_formats=collection_formats) - - def remove_user_for_workspace(self, body, workspace_gid, **kwargs): # noqa: E501 - """Remove a user from a workspace or organization # noqa: E501 - - Remove a user from a workspace or organization. The user making this call must be an admin in the workspace. The user can be referenced by their globally unique user ID or their email address. Returns an empty data record. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.remove_user_for_workspace(body, workspace_gid, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param WorkspaceGidRemoveUserBody body: The user to remove from the workspace. (required) - :param str workspace_gid: Globally unique identifier for the workspace or organization. (required) - :return: EmptyResponseData - If the method is called asynchronously, - returns the request thread. - """ - kwargs['_return_http_data_only'] = True - if kwargs.get('async_req'): - return self.remove_user_for_workspace_with_http_info(body, workspace_gid, **kwargs) # noqa: E501 - else: - (data) = self.remove_user_for_workspace_with_http_info(body, workspace_gid, **kwargs) # noqa: E501 - return data - - def remove_user_for_workspace_with_http_info(self, body, workspace_gid, **kwargs): # noqa: E501 - """Remove a user from a workspace or organization # noqa: E501 - - Remove a user from a workspace or organization. The user making this call must be an admin in the workspace. The user can be referenced by their globally unique user ID or their email address. Returns an empty data record. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.remove_user_for_workspace_with_http_info(body, workspace_gid, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param WorkspaceGidRemoveUserBody body: The user to remove from the workspace. (required) - :param str workspace_gid: Globally unique identifier for the workspace or organization. (required) - :return: EmptyResponseData - If the method is called asynchronously, - returns the request thread. - """ - - all_params = ['body', 'workspace_gid'] # noqa: E501 - all_params.append('async_req') - all_params.append('_return_http_data_only') - all_params.append('_preload_content') - all_params.append('_request_timeout') - - params = locals() - for key, val in six.iteritems(params['kwargs']): - if key not in all_params: - raise TypeError( - "Got an unexpected keyword argument '%s'" - " to method remove_user_for_workspace" % key - ) - params[key] = val - del params['kwargs'] - # verify the required parameter 'body' is set - if ('body' not in params or - params['body'] is None): - raise ValueError("Missing the required parameter `body` when calling `remove_user_for_workspace`") # noqa: E501 - # verify the required parameter 'workspace_gid' is set - if ('workspace_gid' not in params or - params['workspace_gid'] is None): - raise ValueError("Missing the required parameter `workspace_gid` when calling `remove_user_for_workspace`") # noqa: E501 - - collection_formats = {} - - path_params = {} - if 'workspace_gid' in params: - path_params['workspace_gid'] = params['workspace_gid'] # noqa: E501 - - query_params = [] - - header_params = {} - - form_params = [] - local_var_files = {} - - body_params = None - if 'body' in params: - body_params = params['body'] - # HTTP header `Accept` - header_params['Accept'] = self.api_client.select_header_accept( - ['application/json; charset=UTF-8']) # noqa: E501 - - # HTTP header `Content-Type` - header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 - ['application/json; charset=UTF-8']) # noqa: E501 - - # Authentication setting - auth_settings = ['oauth2'] # noqa: E501 - - return self.api_client.call_api( - '/workspaces/{workspace_gid}/removeUser', 'POST', - path_params, - query_params, - header_params, - body=body_params, - post_params=form_params, - files=local_var_files, - response_type='EmptyResponseData', # noqa: E501 - auth_settings=auth_settings, - async_req=params.get('async_req'), - _return_http_data_only=params.get('_return_http_data_only'), - _preload_content=params.get('_preload_content', True), - _request_timeout=params.get('_request_timeout'), - collection_formats=collection_formats) - - def update_workspace(self, body, workspace_gid, **kwargs): # noqa: E501 - """Update a workspace # noqa: E501 - - A specific, existing workspace can be updated by making a PUT request on the URL for that workspace. Only the fields provided in the data block will be updated; any unspecified fields will remain unchanged. Currently the only field that can be modified for a workspace is its name. Returns the complete, updated workspace record. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.update_workspace(body, workspace_gid, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param WorkspacesWorkspaceGidBody body: The workspace object with all updated properties. (required) - :param str workspace_gid: Globally unique identifier for the workspace or organization. (required) - :param list[str] opt_fields: This endpoint returns a compact resource, which excludes some properties by default. To include those optional properties, set this query parameter to a comma-separated list of the properties you wish to include. - :return: WorkspaceResponseData - If the method is called asynchronously, - returns the request thread. - """ - kwargs['_return_http_data_only'] = True - if kwargs.get('async_req'): - return self.update_workspace_with_http_info(body, workspace_gid, **kwargs) # noqa: E501 - else: - (data) = self.update_workspace_with_http_info(body, workspace_gid, **kwargs) # noqa: E501 - return data - - def update_workspace_with_http_info(self, body, workspace_gid, **kwargs): # noqa: E501 - """Update a workspace # noqa: E501 - - A specific, existing workspace can be updated by making a PUT request on the URL for that workspace. Only the fields provided in the data block will be updated; any unspecified fields will remain unchanged. Currently the only field that can be modified for a workspace is its name. Returns the complete, updated workspace record. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.update_workspace_with_http_info(body, workspace_gid, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param WorkspacesWorkspaceGidBody body: The workspace object with all updated properties. (required) - :param str workspace_gid: Globally unique identifier for the workspace or organization. (required) - :param list[str] opt_fields: This endpoint returns a compact resource, which excludes some properties by default. To include those optional properties, set this query parameter to a comma-separated list of the properties you wish to include. - :return: WorkspaceResponseData - If the method is called asynchronously, - returns the request thread. - """ - - all_params = ['body', 'workspace_gid', 'opt_fields'] # noqa: E501 - all_params.append('async_req') - all_params.append('_return_http_data_only') - all_params.append('_preload_content') - all_params.append('_request_timeout') - - params = locals() - for key, val in six.iteritems(params['kwargs']): - if key not in all_params: - raise TypeError( - "Got an unexpected keyword argument '%s'" - " to method update_workspace" % key - ) - params[key] = val - del params['kwargs'] - # verify the required parameter 'body' is set - if ('body' not in params or - params['body'] is None): - raise ValueError("Missing the required parameter `body` when calling `update_workspace`") # noqa: E501 - # verify the required parameter 'workspace_gid' is set - if ('workspace_gid' not in params or - params['workspace_gid'] is None): - raise ValueError("Missing the required parameter `workspace_gid` when calling `update_workspace`") # noqa: E501 - - collection_formats = {} - - path_params = {} - if 'workspace_gid' in params: - path_params['workspace_gid'] = params['workspace_gid'] # noqa: E501 - - query_params = [] - if 'opt_fields' in params: - query_params.append(('opt_fields', params['opt_fields'])) # noqa: E501 - collection_formats['opt_fields'] = 'csv' # noqa: E501 - - header_params = {} - - form_params = [] - local_var_files = {} - - body_params = None - if 'body' in params: - body_params = params['body'] - # HTTP header `Accept` - header_params['Accept'] = self.api_client.select_header_accept( - ['application/json; charset=UTF-8']) # noqa: E501 - - # HTTP header `Content-Type` - header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 - ['application/json; charset=UTF-8']) # noqa: E501 - - # Authentication setting - auth_settings = ['oauth2'] # noqa: E501 - - return self.api_client.call_api( - '/workspaces/{workspace_gid}', 'PUT', - path_params, - query_params, - header_params, - body=body_params, - post_params=form_params, - files=local_var_files, - response_type='WorkspaceResponseData', # noqa: E501 - auth_settings=auth_settings, - async_req=params.get('async_req'), - _return_http_data_only=params.get('_return_http_data_only'), - _preload_content=params.get('_preload_content', True), - _request_timeout=params.get('_request_timeout'), - collection_formats=collection_formats) + all_params = ['body', 'workspace_gid', 'opt_fields'] # noqa: E501 + all_params.append('async_req') + all_params.append('header_params') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + params = locals() + for key, val in six.iteritems(params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method update_workspace" % key + ) + params[key] = val + del params['kwargs'] + # verify the required parameter 'body' is set + if ('body' not in params or + params['body'] is None): + raise ValueError("Missing the required parameter `body` when calling `update_workspace`") # noqa: E501 + # verify the required parameter 'workspace_gid' is set + if ('workspace_gid' not in params or + params['workspace_gid'] is None): + raise ValueError("Missing the required parameter `workspace_gid` when calling `update_workspace`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'workspace_gid' in params: + path_params['workspace_gid'] = params['workspace_gid'] # noqa: E501 + + query_params = [] + if 'opt_fields' in params: + query_params.append(('opt_fields', params['opt_fields'])) # noqa: E501 + collection_formats['opt_fields'] = 'csv' # noqa: E501 + + header_params = kwargs.get("header_params", {}) + + form_params = [] + local_var_files = {} + + body_params = None + if 'body' in params: + body_params = params['body'] + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['application/json; charset=UTF-8']) # noqa: E501 + + # HTTP header `Content-Type` + header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 + ['application/json; charset=UTF-8']) # noqa: E501 + + # Authentication setting + auth_settings = ['oauth2'] # noqa: E501 + + return self.api_client.call_api( + '/workspaces/{workspace_gid}', 'PUT', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='WorkspaceResponseData', # noqa: E501 + auth_settings=auth_settings, + async_req=params.get('async_req'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) diff --git a/asana/api_client.py b/asana/api_client.py index f04bc330..6d53f490 100644 --- a/asana/api_client.py +++ b/asana/api_client.py @@ -75,12 +75,12 @@ def __init__(self, configuration=None, header_name=None, header_value=None, self.default_headers[header_name] = header_value self.cookie = cookie # Set default User-Agent. - self.user_agent = 'Swagger-Codegen/4.0.4/python' + self.user_agent = 'Swagger-Codegen/4.0.5/python' # Add custom header self.default_headers['X-Asana-Client-Lib'] = urlencode( { 'language': 'Python', - 'version': '4.0.4', + 'version': '4.0.5', 'language_version': platform.python_version(), 'os': platform.system(), 'os_version': platform.release() diff --git a/asana/configuration.py b/asana/configuration.py index 8d821412..159ea937 100644 --- a/asana/configuration.py +++ b/asana/configuration.py @@ -249,5 +249,5 @@ def to_debug_report(self): "OS: {env}\n"\ "Python Version: {pyversion}\n"\ "Version of the API: 1.0\n"\ - "SDK Package Version: 4.0.4".\ + "SDK Package Version: 4.0.5".\ format(env=sys.platform, pyversion=sys.version) diff --git a/asana/models/project_base.py b/asana/models/project_base.py index 358163c1..c2621f65 100644 --- a/asana/models/project_base.py +++ b/asana/models/project_base.py @@ -45,7 +45,8 @@ class ProjectBase(object): 'modified_at': 'datetime', 'notes': 'str', 'public': 'bool', - 'start_on': 'date' + 'start_on': 'date', + 'default_access_level': 'str' } attribute_map = { @@ -66,10 +67,11 @@ class ProjectBase(object): 'modified_at': 'modified_at', 'notes': 'notes', 'public': 'public', - 'start_on': 'start_on' + 'start_on': 'start_on', + 'default_access_level': 'default_access_level' } - def __init__(self, gid=None, resource_type=None, name=None, archived=None, color=None, created_at=None, current_status=None, current_status_update=None, custom_field_settings=None, default_view=None, due_date=None, due_on=None, html_notes=None, members=None, modified_at=None, notes=None, public=None, start_on=None): # noqa: E501 + def __init__(self, gid=None, resource_type=None, name=None, archived=None, color=None, created_at=None, current_status=None, current_status_update=None, custom_field_settings=None, default_view=None, due_date=None, due_on=None, html_notes=None, members=None, modified_at=None, notes=None, public=None, start_on=None, default_access_level=None): # noqa: E501 """ProjectBase - a model defined in Swagger""" # noqa: E501 self._gid = None self._resource_type = None @@ -89,6 +91,7 @@ def __init__(self, gid=None, resource_type=None, name=None, archived=None, color self._notes = None self._public = None self._start_on = None + self._default_access_level = None self.discriminator = None if gid is not None: self.gid = gid @@ -126,6 +129,8 @@ def __init__(self, gid=None, resource_type=None, name=None, archived=None, color self.public = public if start_on is not None: self.start_on = start_on + if default_access_level is not None: + self.default_access_level = default_access_level @property def gid(self): @@ -549,6 +554,35 @@ def start_on(self, start_on): self._start_on = start_on + @property + def default_access_level(self): + """Gets the default_access_level of this ProjectBase. # noqa: E501 + + The default access for users or teams who join or are added as members to the project. # noqa: E501 + + :return: The default_access_level of this ProjectBase. # noqa: E501 + :rtype: str + """ + return self._default_access_level + + @default_access_level.setter + def default_access_level(self, default_access_level): + """Sets the default_access_level of this ProjectBase. + + The default access for users or teams who join or are added as members to the project. # noqa: E501 + + :param default_access_level: The default_access_level of this ProjectBase. # noqa: E501 + :type: str + """ + allowed_values = ["admin", "editor", "commenter", "viewer"] # noqa: E501 + if default_access_level not in allowed_values: + raise ValueError( + "Invalid value for `default_access_level` ({0}), must be one of {1}" # noqa: E501 + .format(default_access_level, allowed_values) + ) + + self._default_access_level = default_access_level + def to_dict(self): """Returns the model properties as a dict""" result = {} diff --git a/asana/models/project_request.py b/asana/models/project_request.py index 21dfd295..e7d6f8bf 100644 --- a/asana/models/project_request.py +++ b/asana/models/project_request.py @@ -46,11 +46,11 @@ class ProjectRequest(object): 'notes': 'str', 'public': 'bool', 'start_on': 'date', + 'default_access_level': 'str', 'custom_fields': 'dict(str, str)', 'followers': 'str', 'owner': 'str', 'team': 'str', - 'default_access_level': 'str', 'workspace': 'str' } @@ -73,15 +73,15 @@ class ProjectRequest(object): 'notes': 'notes', 'public': 'public', 'start_on': 'start_on', + 'default_access_level': 'default_access_level', 'custom_fields': 'custom_fields', 'followers': 'followers', 'owner': 'owner', 'team': 'team', - 'default_access_level': 'default_access_level', 'workspace': 'workspace' } - def __init__(self, gid=None, resource_type=None, name=None, archived=None, color=None, created_at=None, current_status=None, current_status_update=None, custom_field_settings=None, default_view=None, due_date=None, due_on=None, html_notes=None, members=None, modified_at=None, notes=None, public=None, start_on=None, custom_fields=None, followers=None, owner=None, team=None, default_access_level=None, workspace=None): # noqa: E501 + def __init__(self, gid=None, resource_type=None, name=None, archived=None, color=None, created_at=None, current_status=None, current_status_update=None, custom_field_settings=None, default_view=None, due_date=None, due_on=None, html_notes=None, members=None, modified_at=None, notes=None, public=None, start_on=None, default_access_level=None, custom_fields=None, followers=None, owner=None, team=None, workspace=None): # noqa: E501 """ProjectRequest - a model defined in Swagger""" # noqa: E501 self._gid = None self._resource_type = None @@ -101,11 +101,11 @@ def __init__(self, gid=None, resource_type=None, name=None, archived=None, color self._notes = None self._public = None self._start_on = None + self._default_access_level = None self._custom_fields = None self._followers = None self._owner = None self._team = None - self._default_access_level = None self._workspace = None self.discriminator = None if gid is not None: @@ -144,6 +144,8 @@ def __init__(self, gid=None, resource_type=None, name=None, archived=None, color self.public = public if start_on is not None: self.start_on = start_on + if default_access_level is not None: + self.default_access_level = default_access_level if custom_fields is not None: self.custom_fields = custom_fields if followers is not None: @@ -152,8 +154,6 @@ def __init__(self, gid=None, resource_type=None, name=None, archived=None, color self.owner = owner if team is not None: self.team = team - if default_access_level is not None: - self.default_access_level = default_access_level if workspace is not None: self.workspace = workspace @@ -579,6 +579,35 @@ def start_on(self, start_on): self._start_on = start_on + @property + def default_access_level(self): + """Gets the default_access_level of this ProjectRequest. # noqa: E501 + + The default access for users or teams who join or are added as members to the project. # noqa: E501 + + :return: The default_access_level of this ProjectRequest. # noqa: E501 + :rtype: str + """ + return self._default_access_level + + @default_access_level.setter + def default_access_level(self, default_access_level): + """Sets the default_access_level of this ProjectRequest. + + The default access for users or teams who join or are added as members to the project. # noqa: E501 + + :param default_access_level: The default_access_level of this ProjectRequest. # noqa: E501 + :type: str + """ + allowed_values = ["admin", "editor", "commenter", "viewer"] # noqa: E501 + if default_access_level not in allowed_values: + raise ValueError( + "Invalid value for `default_access_level` ({0}), must be one of {1}" # noqa: E501 + .format(default_access_level, allowed_values) + ) + + self._default_access_level = default_access_level + @property def custom_fields(self): """Gets the custom_fields of this ProjectRequest. # noqa: E501 @@ -671,35 +700,6 @@ def team(self, team): self._team = team - @property - def default_access_level(self): - """Gets the default_access_level of this ProjectRequest. # noqa: E501 - - The default access users for users who join or are added as members to the project. # noqa: E501 - - :return: The default_access_level of this ProjectRequest. # noqa: E501 - :rtype: str - """ - return self._default_access_level - - @default_access_level.setter - def default_access_level(self, default_access_level): - """Sets the default_access_level of this ProjectRequest. - - The default access users for users who join or are added as members to the project. # noqa: E501 - - :param default_access_level: The default_access_level of this ProjectRequest. # noqa: E501 - :type: str - """ - allowed_values = ["admin", "editor", "commenter", "viewer"] # noqa: E501 - if default_access_level not in allowed_values: - raise ValueError( - "Invalid value for `default_access_level` ({0}), must be one of {1}" # noqa: E501 - .format(default_access_level, allowed_values) - ) - - self._default_access_level = default_access_level - @property def workspace(self): """Gets the workspace of this ProjectRequest. # noqa: E501 diff --git a/asana/models/project_response.py b/asana/models/project_response.py index 982537ab..744a54b8 100644 --- a/asana/models/project_response.py +++ b/asana/models/project_response.py @@ -46,6 +46,7 @@ class ProjectResponse(object): 'notes': 'str', 'public': 'bool', 'start_on': 'date', + 'default_access_level': 'str', 'custom_fields': 'list[PortfolioResponseCustomFields]', 'completed': 'bool', 'completed_at': 'datetime', @@ -57,7 +58,6 @@ class ProjectResponse(object): 'permalink_url': 'str', 'project_brief': 'ProjectResponseProjectBrief', 'created_from_template': 'ProjectResponseCreatedFromTemplate', - 'default_access_level': 'str', 'workspace': 'ProjectResponseWorkspace' } @@ -80,6 +80,7 @@ class ProjectResponse(object): 'notes': 'notes', 'public': 'public', 'start_on': 'start_on', + 'default_access_level': 'default_access_level', 'custom_fields': 'custom_fields', 'completed': 'completed', 'completed_at': 'completed_at', @@ -91,11 +92,10 @@ class ProjectResponse(object): 'permalink_url': 'permalink_url', 'project_brief': 'project_brief', 'created_from_template': 'created_from_template', - 'default_access_level': 'default_access_level', 'workspace': 'workspace' } - def __init__(self, gid=None, resource_type=None, name=None, archived=None, color=None, created_at=None, current_status=None, current_status_update=None, custom_field_settings=None, default_view=None, due_date=None, due_on=None, html_notes=None, members=None, modified_at=None, notes=None, public=None, start_on=None, custom_fields=None, completed=None, completed_at=None, completed_by=None, followers=None, owner=None, team=None, icon=None, permalink_url=None, project_brief=None, created_from_template=None, default_access_level=None, workspace=None): # noqa: E501 + def __init__(self, gid=None, resource_type=None, name=None, archived=None, color=None, created_at=None, current_status=None, current_status_update=None, custom_field_settings=None, default_view=None, due_date=None, due_on=None, html_notes=None, members=None, modified_at=None, notes=None, public=None, start_on=None, default_access_level=None, custom_fields=None, completed=None, completed_at=None, completed_by=None, followers=None, owner=None, team=None, icon=None, permalink_url=None, project_brief=None, created_from_template=None, workspace=None): # noqa: E501 """ProjectResponse - a model defined in Swagger""" # noqa: E501 self._gid = None self._resource_type = None @@ -115,6 +115,7 @@ def __init__(self, gid=None, resource_type=None, name=None, archived=None, color self._notes = None self._public = None self._start_on = None + self._default_access_level = None self._custom_fields = None self._completed = None self._completed_at = None @@ -126,7 +127,6 @@ def __init__(self, gid=None, resource_type=None, name=None, archived=None, color self._permalink_url = None self._project_brief = None self._created_from_template = None - self._default_access_level = None self._workspace = None self.discriminator = None if gid is not None: @@ -165,6 +165,8 @@ def __init__(self, gid=None, resource_type=None, name=None, archived=None, color self.public = public if start_on is not None: self.start_on = start_on + if default_access_level is not None: + self.default_access_level = default_access_level if custom_fields is not None: self.custom_fields = custom_fields if completed is not None: @@ -187,8 +189,6 @@ def __init__(self, gid=None, resource_type=None, name=None, archived=None, color self.project_brief = project_brief if created_from_template is not None: self.created_from_template = created_from_template - if default_access_level is not None: - self.default_access_level = default_access_level if workspace is not None: self.workspace = workspace @@ -614,6 +614,35 @@ def start_on(self, start_on): self._start_on = start_on + @property + def default_access_level(self): + """Gets the default_access_level of this ProjectResponse. # noqa: E501 + + The default access for users or teams who join or are added as members to the project. # noqa: E501 + + :return: The default_access_level of this ProjectResponse. # noqa: E501 + :rtype: str + """ + return self._default_access_level + + @default_access_level.setter + def default_access_level(self, default_access_level): + """Sets the default_access_level of this ProjectResponse. + + The default access for users or teams who join or are added as members to the project. # noqa: E501 + + :param default_access_level: The default_access_level of this ProjectResponse. # noqa: E501 + :type: str + """ + allowed_values = ["admin", "editor", "commenter", "viewer"] # noqa: E501 + if default_access_level not in allowed_values: + raise ValueError( + "Invalid value for `default_access_level` ({0}), must be one of {1}" # noqa: E501 + .format(default_access_level, allowed_values) + ) + + self._default_access_level = default_access_level + @property def custom_fields(self): """Gets the custom_fields of this ProjectResponse. # noqa: E501 @@ -865,35 +894,6 @@ def created_from_template(self, created_from_template): self._created_from_template = created_from_template - @property - def default_access_level(self): - """Gets the default_access_level of this ProjectResponse. # noqa: E501 - - The default access users for users who join or are added as members to the project. # noqa: E501 - - :return: The default_access_level of this ProjectResponse. # noqa: E501 - :rtype: str - """ - return self._default_access_level - - @default_access_level.setter - def default_access_level(self, default_access_level): - """Sets the default_access_level of this ProjectResponse. - - The default access users for users who join or are added as members to the project. # noqa: E501 - - :param default_access_level: The default_access_level of this ProjectResponse. # noqa: E501 - :type: str - """ - allowed_values = ["admin", "editor", "commenter", "viewer"] # noqa: E501 - if default_access_level not in allowed_values: - raise ValueError( - "Invalid value for `default_access_level` ({0}), must be one of {1}" # noqa: E501 - .format(default_access_level, allowed_values) - ) - - self._default_access_level = default_access_level - @property def workspace(self): """Gets the workspace of this ProjectResponse. # noqa: E501 diff --git a/asana/models/project_update_request.py b/asana/models/project_update_request.py index e85c3714..20733dae 100644 --- a/asana/models/project_update_request.py +++ b/asana/models/project_update_request.py @@ -46,6 +46,7 @@ class ProjectUpdateRequest(object): 'notes': 'str', 'public': 'bool', 'start_on': 'date', + 'default_access_level': 'str', 'custom_fields': 'dict(str, str)', 'followers': 'str', 'owner': 'str', @@ -71,13 +72,14 @@ class ProjectUpdateRequest(object): 'notes': 'notes', 'public': 'public', 'start_on': 'start_on', + 'default_access_level': 'default_access_level', 'custom_fields': 'custom_fields', 'followers': 'followers', 'owner': 'owner', 'team': 'team' } - def __init__(self, gid=None, resource_type=None, name=None, archived=None, color=None, created_at=None, current_status=None, current_status_update=None, custom_field_settings=None, default_view=None, due_date=None, due_on=None, html_notes=None, members=None, modified_at=None, notes=None, public=None, start_on=None, custom_fields=None, followers=None, owner=None, team=None): # noqa: E501 + def __init__(self, gid=None, resource_type=None, name=None, archived=None, color=None, created_at=None, current_status=None, current_status_update=None, custom_field_settings=None, default_view=None, due_date=None, due_on=None, html_notes=None, members=None, modified_at=None, notes=None, public=None, start_on=None, default_access_level=None, custom_fields=None, followers=None, owner=None, team=None): # noqa: E501 """ProjectUpdateRequest - a model defined in Swagger""" # noqa: E501 self._gid = None self._resource_type = None @@ -97,6 +99,7 @@ def __init__(self, gid=None, resource_type=None, name=None, archived=None, color self._notes = None self._public = None self._start_on = None + self._default_access_level = None self._custom_fields = None self._followers = None self._owner = None @@ -138,6 +141,8 @@ def __init__(self, gid=None, resource_type=None, name=None, archived=None, color self.public = public if start_on is not None: self.start_on = start_on + if default_access_level is not None: + self.default_access_level = default_access_level if custom_fields is not None: self.custom_fields = custom_fields if followers is not None: @@ -569,6 +574,35 @@ def start_on(self, start_on): self._start_on = start_on + @property + def default_access_level(self): + """Gets the default_access_level of this ProjectUpdateRequest. # noqa: E501 + + The default access for users or teams who join or are added as members to the project. # noqa: E501 + + :return: The default_access_level of this ProjectUpdateRequest. # noqa: E501 + :rtype: str + """ + return self._default_access_level + + @default_access_level.setter + def default_access_level(self, default_access_level): + """Sets the default_access_level of this ProjectUpdateRequest. + + The default access for users or teams who join or are added as members to the project. # noqa: E501 + + :param default_access_level: The default_access_level of this ProjectUpdateRequest. # noqa: E501 + :type: str + """ + allowed_values = ["admin", "editor", "commenter", "viewer"] # noqa: E501 + if default_access_level not in allowed_values: + raise ValueError( + "Invalid value for `default_access_level` ({0}), must be one of {1}" # noqa: E501 + .format(default_access_level, allowed_values) + ) + + self._default_access_level = default_access_level + @property def custom_fields(self): """Gets the custom_fields of this ProjectUpdateRequest. # noqa: E501 diff --git a/docs/AttachmentsApi.md b/docs/AttachmentsApi.md index ff187e98..ef3cf5a5 100644 --- a/docs/AttachmentsApi.md +++ b/docs/AttachmentsApi.md @@ -25,9 +25,10 @@ from pprint import pprint # Configure OAuth2 access token for authorization: oauth2 configuration = asana.Configuration() configuration.access_token = '' +api_client = asana.ApiClient(configuration) # create an instance of the API class -api_instance = asana.AttachmentsApi(asana.ApiClient(configuration)) +api_instance = asana.AttachmentsApi(api_client) resource_subtype = 'external' # str | (optional) file = 'file_example' # str | (optional) parent = 'parent_example' # str | (optional) @@ -37,11 +38,11 @@ connect_to_app = true # bool | (optional) opt_fields = ["connected_to_app","created_at","download_url","host","name","parent","parent.created_by","parent.name","parent.resource_subtype","permanent_url","resource_subtype","size","view_url"] # list[str] | This endpoint returns a compact resource, which excludes some properties by default. To include those optional properties, set this query parameter to a comma-separated list of the properties you wish to include. (optional) try: - # Upload an attachment - api_response = api_instance.create_attachment_for_object(resource_subtype=resource_subtype, file=file, parent=parent, url=url, name=name, connect_to_app=connect_to_app, opt_fields=opt_fields) - pprint(api_response) + # Upload an attachment + api_response = api_instance.create_attachment_for_object(resource_subtype=resource_subtype, file=file, parent=parent, url=url, name=name, connect_to_app=connect_to_app, opt_fields=opt_fields) + pprint(api_response) except ApiException as e: - print("Exception when calling AttachmentsApi->create_attachment_for_object: %s\n" % e) + print("Exception when calling AttachmentsApi->create_attachment_for_object: %s\n" % e) ``` ### Parameters @@ -87,17 +88,18 @@ from pprint import pprint # Configure OAuth2 access token for authorization: oauth2 configuration = asana.Configuration() configuration.access_token = '' +api_client = asana.ApiClient(configuration) # create an instance of the API class -api_instance = asana.AttachmentsApi(asana.ApiClient(configuration)) +api_instance = asana.AttachmentsApi(api_client) attachment_gid = '12345' # str | Globally unique identifier for the attachment. try: - # Delete an attachment - api_response = api_instance.delete_attachment(attachment_gid) - pprint(api_response) + # Delete an attachment + api_response = api_instance.delete_attachment(attachment_gid) + pprint(api_response) except ApiException as e: - print("Exception when calling AttachmentsApi->delete_attachment: %s\n" % e) + print("Exception when calling AttachmentsApi->delete_attachment: %s\n" % e) ``` ### Parameters @@ -137,18 +139,19 @@ from pprint import pprint # Configure OAuth2 access token for authorization: oauth2 configuration = asana.Configuration() configuration.access_token = '' +api_client = asana.ApiClient(configuration) # create an instance of the API class -api_instance = asana.AttachmentsApi(asana.ApiClient(configuration)) +api_instance = asana.AttachmentsApi(api_client) attachment_gid = '12345' # str | Globally unique identifier for the attachment. opt_fields = ["connected_to_app","created_at","download_url","host","name","parent","parent.created_by","parent.name","parent.resource_subtype","permanent_url","resource_subtype","size","view_url"] # list[str] | This endpoint returns a compact resource, which excludes some properties by default. To include those optional properties, set this query parameter to a comma-separated list of the properties you wish to include. (optional) try: - # Get an attachment - api_response = api_instance.get_attachment(attachment_gid, opt_fields=opt_fields) - pprint(api_response) + # Get an attachment + api_response = api_instance.get_attachment(attachment_gid, opt_fields=opt_fields) + pprint(api_response) except ApiException as e: - print("Exception when calling AttachmentsApi->get_attachment: %s\n" % e) + print("Exception when calling AttachmentsApi->get_attachment: %s\n" % e) ``` ### Parameters @@ -189,20 +192,21 @@ from pprint import pprint # Configure OAuth2 access token for authorization: oauth2 configuration = asana.Configuration() configuration.access_token = '' +api_client = asana.ApiClient(configuration) # create an instance of the API class -api_instance = asana.AttachmentsApi(asana.ApiClient(configuration)) +api_instance = asana.AttachmentsApi(api_client) parent = '159874' # str | Globally unique identifier for object to fetch statuses from. Must be a GID for a `project`, `project_brief`, or `task`. limit = 50 # int | Results per page. The number of objects to return per page. The value must be between 1 and 100. (optional) offset = 'eyJ0eXAiOJiKV1iQLCJhbGciOiJIUzI1NiJ9' # 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.' (optional) opt_fields = ["connected_to_app","created_at","download_url","host","name","offset","parent","parent.created_by","parent.name","parent.resource_subtype","path","permanent_url","resource_subtype","size","uri","view_url"] # list[str] | This endpoint returns a compact resource, which excludes some properties by default. To include those optional properties, set this query parameter to a comma-separated list of the properties you wish to include. (optional) try: - # Get attachments from an object - api_response = api_instance.get_attachments_for_object(parent, limit=limit, offset=offset, opt_fields=opt_fields) - pprint(api_response) + # Get attachments from an object + api_response = api_instance.get_attachments_for_object(parent, limit=limit, offset=offset, opt_fields=opt_fields) + pprint(api_response) except ApiException as e: - print("Exception when calling AttachmentsApi->get_attachments_for_object: %s\n" % e) + print("Exception when calling AttachmentsApi->get_attachments_for_object: %s\n" % e) ``` ### Parameters diff --git a/docs/AttachmentsApi.yaml b/docs/AttachmentsApi.yaml index 47bf4e6b..bf88bae7 100644 --- a/docs/AttachmentsApi.yaml +++ b/docs/AttachmentsApi.yaml @@ -7,9 +7,10 @@ AttachmentsApi: # Configure OAuth2 access token for authorization: oauth2 configuration = asana.Configuration() configuration.access_token = '' + api_client = asana.ApiClient(configuration) # create an instance of the API class - api_instance = asana.AttachmentsApi(asana.ApiClient(configuration)) + api_instance = asana.AttachmentsApi(api_client) resource_subtype = 'external' # str | (optional) file = 'file_example' # str | (optional) parent = 'parent_example' # str | (optional) @@ -19,11 +20,11 @@ AttachmentsApi: opt_fields = ["connected_to_app","created_at","download_url","host","name","parent","parent.created_by","parent.name","parent.resource_subtype","permanent_url","resource_subtype","size","view_url"] # list[str] | This endpoint returns a compact resource, which excludes some properties by default. To include those optional properties, set this query parameter to a comma-separated list of the properties you wish to include. (optional) try: - # Upload an attachment - api_response = api_instance.create_attachment_for_object(resource_subtype=resource_subtype, file=file, parent=parent, url=url, name=name, connect_to_app=connect_to_app, opt_fields=opt_fields) - pprint(api_response) + # Upload an attachment + api_response = api_instance.create_attachment_for_object(resource_subtype=resource_subtype, file=file, parent=parent, url=url, name=name, connect_to_app=connect_to_app, opt_fields=opt_fields) + pprint(api_response) except ApiException as e: - print("Exception when calling AttachmentsApi->create_attachment_for_object: %s\n" % e) + print("Exception when calling AttachmentsApi->create_attachment_for_object: %s\n" % e) delete_attachment: |- import asana from asana.rest import ApiException @@ -32,17 +33,18 @@ AttachmentsApi: # Configure OAuth2 access token for authorization: oauth2 configuration = asana.Configuration() configuration.access_token = '' + api_client = asana.ApiClient(configuration) # create an instance of the API class - api_instance = asana.AttachmentsApi(asana.ApiClient(configuration)) + api_instance = asana.AttachmentsApi(api_client) attachment_gid = '12345' # str | Globally unique identifier for the attachment. try: - # Delete an attachment - api_response = api_instance.delete_attachment(attachment_gid) - pprint(api_response) + # Delete an attachment + api_response = api_instance.delete_attachment(attachment_gid) + pprint(api_response) except ApiException as e: - print("Exception when calling AttachmentsApi->delete_attachment: %s\n" % e) + print("Exception when calling AttachmentsApi->delete_attachment: %s\n" % e) get_attachment: |- import asana from asana.rest import ApiException @@ -51,18 +53,19 @@ AttachmentsApi: # Configure OAuth2 access token for authorization: oauth2 configuration = asana.Configuration() configuration.access_token = '' + api_client = asana.ApiClient(configuration) # create an instance of the API class - api_instance = asana.AttachmentsApi(asana.ApiClient(configuration)) + api_instance = asana.AttachmentsApi(api_client) attachment_gid = '12345' # str | Globally unique identifier for the attachment. opt_fields = ["connected_to_app","created_at","download_url","host","name","parent","parent.created_by","parent.name","parent.resource_subtype","permanent_url","resource_subtype","size","view_url"] # list[str] | This endpoint returns a compact resource, which excludes some properties by default. To include those optional properties, set this query parameter to a comma-separated list of the properties you wish to include. (optional) try: - # Get an attachment - api_response = api_instance.get_attachment(attachment_gid, opt_fields=opt_fields) - pprint(api_response) + # Get an attachment + api_response = api_instance.get_attachment(attachment_gid, opt_fields=opt_fields) + pprint(api_response) except ApiException as e: - print("Exception when calling AttachmentsApi->get_attachment: %s\n" % e) + print("Exception when calling AttachmentsApi->get_attachment: %s\n" % e) get_attachments_for_object: |- import asana from asana.rest import ApiException @@ -71,17 +74,18 @@ AttachmentsApi: # Configure OAuth2 access token for authorization: oauth2 configuration = asana.Configuration() configuration.access_token = '' + api_client = asana.ApiClient(configuration) # create an instance of the API class - api_instance = asana.AttachmentsApi(asana.ApiClient(configuration)) + api_instance = asana.AttachmentsApi(api_client) parent = '159874' # str | Globally unique identifier for object to fetch statuses from. Must be a GID for a `project`, `project_brief`, or `task`. limit = 50 # int | Results per page. The number of objects to return per page. The value must be between 1 and 100. (optional) offset = 'eyJ0eXAiOJiKV1iQLCJhbGciOiJIUzI1NiJ9' # 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.' (optional) opt_fields = ["connected_to_app","created_at","download_url","host","name","offset","parent","parent.created_by","parent.name","parent.resource_subtype","path","permanent_url","resource_subtype","size","uri","view_url"] # list[str] | This endpoint returns a compact resource, which excludes some properties by default. To include those optional properties, set this query parameter to a comma-separated list of the properties you wish to include. (optional) try: - # Get attachments from an object - api_response = api_instance.get_attachments_for_object(parent, limit=limit, offset=offset, opt_fields=opt_fields) - pprint(api_response) + # Get attachments from an object + api_response = api_instance.get_attachments_for_object(parent, limit=limit, offset=offset, opt_fields=opt_fields) + pprint(api_response) except ApiException as e: - print("Exception when calling AttachmentsApi->get_attachments_for_object: %s\n" % e) + print("Exception when calling AttachmentsApi->get_attachments_for_object: %s\n" % e) diff --git a/docs/AuditLogAPIApi.md b/docs/AuditLogAPIApi.md index b794d083..e2a6b973 100644 --- a/docs/AuditLogAPIApi.md +++ b/docs/AuditLogAPIApi.md @@ -22,9 +22,10 @@ from pprint import pprint # Configure OAuth2 access token for authorization: oauth2 configuration = asana.Configuration() configuration.access_token = '' +api_client = asana.ApiClient(configuration) # create an instance of the API class -api_instance = asana.AuditLogAPIApi(asana.ApiClient(configuration)) +api_instance = asana.AuditLogAPIApi(api_client) workspace_gid = '12345' # str | Globally unique identifier for the workspace or organization. start_at = '2013-10-20T19:20:30+01:00' # datetime | Filter to events created after this time (inclusive). (optional) end_at = '2013-10-20T19:20:30+01:00' # datetime | Filter to events created before this time (exclusive). (optional) @@ -36,11 +37,11 @@ limit = 50 # int | Results per page. The number of objects to return per page. T offset = 'eyJ0eXAiOJiKV1iQLCJhbGciOiJIUzI1NiJ9' # 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.' (optional) try: - # Get audit log events - api_response = api_instance.get_audit_log_events(workspace_gid, start_at=start_at, end_at=end_at, event_type=event_type, actor_type=actor_type, actor_gid=actor_gid, resource_gid=resource_gid, limit=limit, offset=offset) - pprint(api_response) + # Get audit log events + api_response = api_instance.get_audit_log_events(workspace_gid, start_at=start_at, end_at=end_at, event_type=event_type, actor_type=actor_type, actor_gid=actor_gid, resource_gid=resource_gid, limit=limit, offset=offset) + pprint(api_response) except ApiException as e: - print("Exception when calling AuditLogAPIApi->get_audit_log_events: %s\n" % e) + print("Exception when calling AuditLogAPIApi->get_audit_log_events: %s\n" % e) ``` ### Parameters diff --git a/docs/AuditLogAPIApi.yaml b/docs/AuditLogAPIApi.yaml index 7ba2242d..b03b744a 100644 --- a/docs/AuditLogAPIApi.yaml +++ b/docs/AuditLogAPIApi.yaml @@ -7,9 +7,10 @@ AuditLogAPIApi: # Configure OAuth2 access token for authorization: oauth2 configuration = asana.Configuration() configuration.access_token = '' + api_client = asana.ApiClient(configuration) # create an instance of the API class - api_instance = asana.AuditLogAPIApi(asana.ApiClient(configuration)) + api_instance = asana.AuditLogAPIApi(api_client) workspace_gid = '12345' # str | Globally unique identifier for the workspace or organization. start_at = '2013-10-20T19:20:30+01:00' # datetime | Filter to events created after this time (inclusive). (optional) end_at = '2013-10-20T19:20:30+01:00' # datetime | Filter to events created before this time (exclusive). (optional) @@ -21,8 +22,8 @@ AuditLogAPIApi: offset = 'eyJ0eXAiOJiKV1iQLCJhbGciOiJIUzI1NiJ9' # 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.' (optional) try: - # Get audit log events - api_response = api_instance.get_audit_log_events(workspace_gid, start_at=start_at, end_at=end_at, event_type=event_type, actor_type=actor_type, actor_gid=actor_gid, resource_gid=resource_gid, limit=limit, offset=offset) - pprint(api_response) + # Get audit log events + api_response = api_instance.get_audit_log_events(workspace_gid, start_at=start_at, end_at=end_at, event_type=event_type, actor_type=actor_type, actor_gid=actor_gid, resource_gid=resource_gid, limit=limit, offset=offset) + pprint(api_response) except ApiException as e: - print("Exception when calling AuditLogAPIApi->get_audit_log_events: %s\n" % e) + print("Exception when calling AuditLogAPIApi->get_audit_log_events: %s\n" % e) diff --git a/docs/BatchAPIApi.md b/docs/BatchAPIApi.md index 1a28e683..be932bbb 100644 --- a/docs/BatchAPIApi.md +++ b/docs/BatchAPIApi.md @@ -22,18 +22,19 @@ from pprint import pprint # Configure OAuth2 access token for authorization: oauth2 configuration = asana.Configuration() configuration.access_token = '' +api_client = asana.ApiClient(configuration) # create an instance of the API class -api_instance = asana.BatchAPIApi(asana.ApiClient(configuration)) +api_instance = asana.BatchAPIApi(api_client) body = asana.BatchBody({"param1": "value1", "param2": "value2",}) # BatchBody | The requests to batch together via the Batch API. opt_fields = ["body","headers","status_code"] # list[str] | This endpoint returns a compact resource, which excludes some properties by default. To include those optional properties, set this query parameter to a comma-separated list of the properties you wish to include. (optional) try: - # Submit parallel requests - api_response = api_instance.create_batch_request(body, opt_fields=opt_fields) - pprint(api_response) + # Submit parallel requests + api_response = api_instance.create_batch_request(body, opt_fields=opt_fields) + pprint(api_response) except ApiException as e: - print("Exception when calling BatchAPIApi->create_batch_request: %s\n" % e) + print("Exception when calling BatchAPIApi->create_batch_request: %s\n" % e) ``` ### Parameters diff --git a/docs/BatchAPIApi.yaml b/docs/BatchAPIApi.yaml index ae310217..38a61181 100644 --- a/docs/BatchAPIApi.yaml +++ b/docs/BatchAPIApi.yaml @@ -7,15 +7,16 @@ BatchAPIApi: # Configure OAuth2 access token for authorization: oauth2 configuration = asana.Configuration() configuration.access_token = '' + api_client = asana.ApiClient(configuration) # create an instance of the API class - api_instance = asana.BatchAPIApi(asana.ApiClient(configuration)) + api_instance = asana.BatchAPIApi(api_client) body = asana.BatchBody({"param1": "value1", "param2": "value2",}) # BatchBody | The requests to batch together via the Batch API. opt_fields = ["body","headers","status_code"] # list[str] | This endpoint returns a compact resource, which excludes some properties by default. To include those optional properties, set this query parameter to a comma-separated list of the properties you wish to include. (optional) try: - # Submit parallel requests - api_response = api_instance.create_batch_request(body, opt_fields=opt_fields) - pprint(api_response) + # Submit parallel requests + api_response = api_instance.create_batch_request(body, opt_fields=opt_fields) + pprint(api_response) except ApiException as e: - print("Exception when calling BatchAPIApi->create_batch_request: %s\n" % e) + print("Exception when calling BatchAPIApi->create_batch_request: %s\n" % e) diff --git a/docs/CustomFieldSettingsApi.md b/docs/CustomFieldSettingsApi.md index 9b7d0573..7e3ea2d0 100644 --- a/docs/CustomFieldSettingsApi.md +++ b/docs/CustomFieldSettingsApi.md @@ -23,20 +23,21 @@ from pprint import pprint # Configure OAuth2 access token for authorization: oauth2 configuration = asana.Configuration() configuration.access_token = '' +api_client = asana.ApiClient(configuration) # create an instance of the API class -api_instance = asana.CustomFieldSettingsApi(asana.ApiClient(configuration)) +api_instance = asana.CustomFieldSettingsApi(api_client) portfolio_gid = '12345' # str | Globally unique identifier for the portfolio. limit = 50 # int | Results per page. The number of objects to return per page. The value must be between 1 and 100. (optional) offset = 'eyJ0eXAiOJiKV1iQLCJhbGciOiJIUzI1NiJ9' # 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.' (optional) opt_fields = ["custom_field","custom_field.asana_created_field","custom_field.created_by","custom_field.created_by.name","custom_field.currency_code","custom_field.custom_label","custom_field.custom_label_position","custom_field.date_value","custom_field.date_value.date","custom_field.date_value.date_time","custom_field.description","custom_field.display_value","custom_field.enabled","custom_field.enum_options","custom_field.enum_options.color","custom_field.enum_options.enabled","custom_field.enum_options.name","custom_field.enum_value","custom_field.enum_value.color","custom_field.enum_value.enabled","custom_field.enum_value.name","custom_field.format","custom_field.has_notifications_enabled","custom_field.is_formula_field","custom_field.is_global_to_workspace","custom_field.is_value_read_only","custom_field.multi_enum_values","custom_field.multi_enum_values.color","custom_field.multi_enum_values.enabled","custom_field.multi_enum_values.name","custom_field.name","custom_field.number_value","custom_field.people_value","custom_field.people_value.name","custom_field.precision","custom_field.resource_subtype","custom_field.text_value","custom_field.type","is_important","offset","parent","parent.name","path","project","project.name","uri"] # list[str] | This endpoint returns a compact resource, which excludes some properties by default. To include those optional properties, set this query parameter to a comma-separated list of the properties you wish to include. (optional) try: - # Get a portfolio's custom fields - api_response = api_instance.get_custom_field_settings_for_portfolio(portfolio_gid, limit=limit, offset=offset, opt_fields=opt_fields) - pprint(api_response) + # Get a portfolio's custom fields + api_response = api_instance.get_custom_field_settings_for_portfolio(portfolio_gid, limit=limit, offset=offset, opt_fields=opt_fields) + pprint(api_response) except ApiException as e: - print("Exception when calling CustomFieldSettingsApi->get_custom_field_settings_for_portfolio: %s\n" % e) + print("Exception when calling CustomFieldSettingsApi->get_custom_field_settings_for_portfolio: %s\n" % e) ``` ### Parameters @@ -79,20 +80,21 @@ from pprint import pprint # Configure OAuth2 access token for authorization: oauth2 configuration = asana.Configuration() configuration.access_token = '' +api_client = asana.ApiClient(configuration) # create an instance of the API class -api_instance = asana.CustomFieldSettingsApi(asana.ApiClient(configuration)) +api_instance = asana.CustomFieldSettingsApi(api_client) project_gid = '1331' # str | Globally unique identifier for the project. limit = 50 # int | Results per page. The number of objects to return per page. The value must be between 1 and 100. (optional) offset = 'eyJ0eXAiOJiKV1iQLCJhbGciOiJIUzI1NiJ9' # 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.' (optional) opt_fields = ["custom_field","custom_field.asana_created_field","custom_field.created_by","custom_field.created_by.name","custom_field.currency_code","custom_field.custom_label","custom_field.custom_label_position","custom_field.date_value","custom_field.date_value.date","custom_field.date_value.date_time","custom_field.description","custom_field.display_value","custom_field.enabled","custom_field.enum_options","custom_field.enum_options.color","custom_field.enum_options.enabled","custom_field.enum_options.name","custom_field.enum_value","custom_field.enum_value.color","custom_field.enum_value.enabled","custom_field.enum_value.name","custom_field.format","custom_field.has_notifications_enabled","custom_field.is_formula_field","custom_field.is_global_to_workspace","custom_field.is_value_read_only","custom_field.multi_enum_values","custom_field.multi_enum_values.color","custom_field.multi_enum_values.enabled","custom_field.multi_enum_values.name","custom_field.name","custom_field.number_value","custom_field.people_value","custom_field.people_value.name","custom_field.precision","custom_field.resource_subtype","custom_field.text_value","custom_field.type","is_important","offset","parent","parent.name","path","project","project.name","uri"] # list[str] | This endpoint returns a compact resource, which excludes some properties by default. To include those optional properties, set this query parameter to a comma-separated list of the properties you wish to include. (optional) try: - # Get a project's custom fields - api_response = api_instance.get_custom_field_settings_for_project(project_gid, limit=limit, offset=offset, opt_fields=opt_fields) - pprint(api_response) + # Get a project's custom fields + api_response = api_instance.get_custom_field_settings_for_project(project_gid, limit=limit, offset=offset, opt_fields=opt_fields) + pprint(api_response) except ApiException as e: - print("Exception when calling CustomFieldSettingsApi->get_custom_field_settings_for_project: %s\n" % e) + print("Exception when calling CustomFieldSettingsApi->get_custom_field_settings_for_project: %s\n" % e) ``` ### Parameters diff --git a/docs/CustomFieldSettingsApi.yaml b/docs/CustomFieldSettingsApi.yaml index 85d01ffb..2d71a3ca 100644 --- a/docs/CustomFieldSettingsApi.yaml +++ b/docs/CustomFieldSettingsApi.yaml @@ -7,20 +7,21 @@ CustomFieldSettingsApi: # Configure OAuth2 access token for authorization: oauth2 configuration = asana.Configuration() configuration.access_token = '' + api_client = asana.ApiClient(configuration) # create an instance of the API class - api_instance = asana.CustomFieldSettingsApi(asana.ApiClient(configuration)) + api_instance = asana.CustomFieldSettingsApi(api_client) portfolio_gid = '12345' # str | Globally unique identifier for the portfolio. limit = 50 # int | Results per page. The number of objects to return per page. The value must be between 1 and 100. (optional) offset = 'eyJ0eXAiOJiKV1iQLCJhbGciOiJIUzI1NiJ9' # 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.' (optional) opt_fields = ["custom_field","custom_field.asana_created_field","custom_field.created_by","custom_field.created_by.name","custom_field.currency_code","custom_field.custom_label","custom_field.custom_label_position","custom_field.date_value","custom_field.date_value.date","custom_field.date_value.date_time","custom_field.description","custom_field.display_value","custom_field.enabled","custom_field.enum_options","custom_field.enum_options.color","custom_field.enum_options.enabled","custom_field.enum_options.name","custom_field.enum_value","custom_field.enum_value.color","custom_field.enum_value.enabled","custom_field.enum_value.name","custom_field.format","custom_field.has_notifications_enabled","custom_field.is_formula_field","custom_field.is_global_to_workspace","custom_field.is_value_read_only","custom_field.multi_enum_values","custom_field.multi_enum_values.color","custom_field.multi_enum_values.enabled","custom_field.multi_enum_values.name","custom_field.name","custom_field.number_value","custom_field.people_value","custom_field.people_value.name","custom_field.precision","custom_field.resource_subtype","custom_field.text_value","custom_field.type","is_important","offset","parent","parent.name","path","project","project.name","uri"] # list[str] | This endpoint returns a compact resource, which excludes some properties by default. To include those optional properties, set this query parameter to a comma-separated list of the properties you wish to include. (optional) try: - # Get a portfolio's custom fields - api_response = api_instance.get_custom_field_settings_for_portfolio(portfolio_gid, limit=limit, offset=offset, opt_fields=opt_fields) - pprint(api_response) + # Get a portfolio's custom fields + api_response = api_instance.get_custom_field_settings_for_portfolio(portfolio_gid, limit=limit, offset=offset, opt_fields=opt_fields) + pprint(api_response) except ApiException as e: - print("Exception when calling CustomFieldSettingsApi->get_custom_field_settings_for_portfolio: %s\n" % e) + print("Exception when calling CustomFieldSettingsApi->get_custom_field_settings_for_portfolio: %s\n" % e) get_custom_field_settings_for_project: |- import asana from asana.rest import ApiException @@ -29,17 +30,18 @@ CustomFieldSettingsApi: # Configure OAuth2 access token for authorization: oauth2 configuration = asana.Configuration() configuration.access_token = '' + api_client = asana.ApiClient(configuration) # create an instance of the API class - api_instance = asana.CustomFieldSettingsApi(asana.ApiClient(configuration)) + api_instance = asana.CustomFieldSettingsApi(api_client) project_gid = '1331' # str | Globally unique identifier for the project. limit = 50 # int | Results per page. The number of objects to return per page. The value must be between 1 and 100. (optional) offset = 'eyJ0eXAiOJiKV1iQLCJhbGciOiJIUzI1NiJ9' # 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.' (optional) opt_fields = ["custom_field","custom_field.asana_created_field","custom_field.created_by","custom_field.created_by.name","custom_field.currency_code","custom_field.custom_label","custom_field.custom_label_position","custom_field.date_value","custom_field.date_value.date","custom_field.date_value.date_time","custom_field.description","custom_field.display_value","custom_field.enabled","custom_field.enum_options","custom_field.enum_options.color","custom_field.enum_options.enabled","custom_field.enum_options.name","custom_field.enum_value","custom_field.enum_value.color","custom_field.enum_value.enabled","custom_field.enum_value.name","custom_field.format","custom_field.has_notifications_enabled","custom_field.is_formula_field","custom_field.is_global_to_workspace","custom_field.is_value_read_only","custom_field.multi_enum_values","custom_field.multi_enum_values.color","custom_field.multi_enum_values.enabled","custom_field.multi_enum_values.name","custom_field.name","custom_field.number_value","custom_field.people_value","custom_field.people_value.name","custom_field.precision","custom_field.resource_subtype","custom_field.text_value","custom_field.type","is_important","offset","parent","parent.name","path","project","project.name","uri"] # list[str] | This endpoint returns a compact resource, which excludes some properties by default. To include those optional properties, set this query parameter to a comma-separated list of the properties you wish to include. (optional) try: - # Get a project's custom fields - api_response = api_instance.get_custom_field_settings_for_project(project_gid, limit=limit, offset=offset, opt_fields=opt_fields) - pprint(api_response) + # Get a project's custom fields + api_response = api_instance.get_custom_field_settings_for_project(project_gid, limit=limit, offset=offset, opt_fields=opt_fields) + pprint(api_response) except ApiException as e: - print("Exception when calling CustomFieldSettingsApi->get_custom_field_settings_for_project: %s\n" % e) + print("Exception when calling CustomFieldSettingsApi->get_custom_field_settings_for_project: %s\n" % e) diff --git a/docs/CustomFieldsApi.md b/docs/CustomFieldsApi.md index a3b31045..418b7358 100644 --- a/docs/CustomFieldsApi.md +++ b/docs/CustomFieldsApi.md @@ -29,18 +29,19 @@ from pprint import pprint # Configure OAuth2 access token for authorization: oauth2 configuration = asana.Configuration() configuration.access_token = '' +api_client = asana.ApiClient(configuration) # create an instance of the API class -api_instance = asana.CustomFieldsApi(asana.ApiClient(configuration)) +api_instance = asana.CustomFieldsApi(api_client) body = asana.CustomFieldsBody({"param1": "value1", "param2": "value2",}) # CustomFieldsBody | The custom field object to create. opt_fields = ["asana_created_field","created_by","created_by.name","currency_code","custom_label","custom_label_position","date_value","date_value.date","date_value.date_time","description","display_value","enabled","enum_options","enum_options.color","enum_options.enabled","enum_options.name","enum_value","enum_value.color","enum_value.enabled","enum_value.name","format","has_notifications_enabled","is_formula_field","is_global_to_workspace","is_value_read_only","multi_enum_values","multi_enum_values.color","multi_enum_values.enabled","multi_enum_values.name","name","number_value","people_value","people_value.name","precision","resource_subtype","text_value","type"] # list[str] | This endpoint returns a compact resource, which excludes some properties by default. To include those optional properties, set this query parameter to a comma-separated list of the properties you wish to include. (optional) try: - # Create a custom field - api_response = api_instance.create_custom_field(body, opt_fields=opt_fields) - pprint(api_response) + # Create a custom field + api_response = api_instance.create_custom_field(body, opt_fields=opt_fields) + pprint(api_response) except ApiException as e: - print("Exception when calling CustomFieldsApi->create_custom_field: %s\n" % e) + print("Exception when calling CustomFieldsApi->create_custom_field: %s\n" % e) ``` ### Parameters @@ -81,19 +82,20 @@ from pprint import pprint # Configure OAuth2 access token for authorization: oauth2 configuration = asana.Configuration() configuration.access_token = '' +api_client = asana.ApiClient(configuration) # create an instance of the API class -api_instance = asana.CustomFieldsApi(asana.ApiClient(configuration)) +api_instance = asana.CustomFieldsApi(api_client) custom_field_gid = '12345' # str | Globally unique identifier for the custom field. body = asana.CustomFieldGidEnumOptionsBody({"param1": "value1", "param2": "value2",}) # CustomFieldGidEnumOptionsBody | The enum option object to create. (optional) opt_fields = ["color","enabled","name"] # list[str] | This endpoint returns a compact resource, which excludes some properties by default. To include those optional properties, set this query parameter to a comma-separated list of the properties you wish to include. (optional) try: - # Create an enum option - api_response = api_instance.create_enum_option_for_custom_field(custom_field_gid, body=body, opt_fields=opt_fields) - pprint(api_response) + # Create an enum option + api_response = api_instance.create_enum_option_for_custom_field(custom_field_gid, body=body, opt_fields=opt_fields) + pprint(api_response) except ApiException as e: - print("Exception when calling CustomFieldsApi->create_enum_option_for_custom_field: %s\n" % e) + print("Exception when calling CustomFieldsApi->create_enum_option_for_custom_field: %s\n" % e) ``` ### Parameters @@ -135,17 +137,18 @@ from pprint import pprint # Configure OAuth2 access token for authorization: oauth2 configuration = asana.Configuration() configuration.access_token = '' +api_client = asana.ApiClient(configuration) # create an instance of the API class -api_instance = asana.CustomFieldsApi(asana.ApiClient(configuration)) +api_instance = asana.CustomFieldsApi(api_client) custom_field_gid = '12345' # str | Globally unique identifier for the custom field. try: - # Delete a custom field - api_response = api_instance.delete_custom_field(custom_field_gid) - pprint(api_response) + # Delete a custom field + api_response = api_instance.delete_custom_field(custom_field_gid) + pprint(api_response) except ApiException as e: - print("Exception when calling CustomFieldsApi->delete_custom_field: %s\n" % e) + print("Exception when calling CustomFieldsApi->delete_custom_field: %s\n" % e) ``` ### Parameters @@ -185,18 +188,19 @@ from pprint import pprint # Configure OAuth2 access token for authorization: oauth2 configuration = asana.Configuration() configuration.access_token = '' +api_client = asana.ApiClient(configuration) # create an instance of the API class -api_instance = asana.CustomFieldsApi(asana.ApiClient(configuration)) +api_instance = asana.CustomFieldsApi(api_client) custom_field_gid = '12345' # str | Globally unique identifier for the custom field. opt_fields = ["asana_created_field","created_by","created_by.name","currency_code","custom_label","custom_label_position","date_value","date_value.date","date_value.date_time","description","display_value","enabled","enum_options","enum_options.color","enum_options.enabled","enum_options.name","enum_value","enum_value.color","enum_value.enabled","enum_value.name","format","has_notifications_enabled","is_formula_field","is_global_to_workspace","is_value_read_only","multi_enum_values","multi_enum_values.color","multi_enum_values.enabled","multi_enum_values.name","name","number_value","people_value","people_value.name","precision","resource_subtype","text_value","type"] # list[str] | This endpoint returns a compact resource, which excludes some properties by default. To include those optional properties, set this query parameter to a comma-separated list of the properties you wish to include. (optional) try: - # Get a custom field - api_response = api_instance.get_custom_field(custom_field_gid, opt_fields=opt_fields) - pprint(api_response) + # Get a custom field + api_response = api_instance.get_custom_field(custom_field_gid, opt_fields=opt_fields) + pprint(api_response) except ApiException as e: - print("Exception when calling CustomFieldsApi->get_custom_field: %s\n" % e) + print("Exception when calling CustomFieldsApi->get_custom_field: %s\n" % e) ``` ### Parameters @@ -237,20 +241,21 @@ from pprint import pprint # Configure OAuth2 access token for authorization: oauth2 configuration = asana.Configuration() configuration.access_token = '' +api_client = asana.ApiClient(configuration) # create an instance of the API class -api_instance = asana.CustomFieldsApi(asana.ApiClient(configuration)) +api_instance = asana.CustomFieldsApi(api_client) workspace_gid = '12345' # str | Globally unique identifier for the workspace or organization. limit = 50 # int | Results per page. The number of objects to return per page. The value must be between 1 and 100. (optional) offset = 'eyJ0eXAiOJiKV1iQLCJhbGciOiJIUzI1NiJ9' # 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.' (optional) opt_fields = ["asana_created_field","created_by","created_by.name","currency_code","custom_label","custom_label_position","date_value","date_value.date","date_value.date_time","description","display_value","enabled","enum_options","enum_options.color","enum_options.enabled","enum_options.name","enum_value","enum_value.color","enum_value.enabled","enum_value.name","format","has_notifications_enabled","is_formula_field","is_global_to_workspace","is_value_read_only","multi_enum_values","multi_enum_values.color","multi_enum_values.enabled","multi_enum_values.name","name","number_value","offset","path","people_value","people_value.name","precision","resource_subtype","text_value","type","uri"] # list[str] | This endpoint returns a compact resource, which excludes some properties by default. To include those optional properties, set this query parameter to a comma-separated list of the properties you wish to include. (optional) try: - # Get a workspace's custom fields - api_response = api_instance.get_custom_fields_for_workspace(workspace_gid, limit=limit, offset=offset, opt_fields=opt_fields) - pprint(api_response) + # Get a workspace's custom fields + api_response = api_instance.get_custom_fields_for_workspace(workspace_gid, limit=limit, offset=offset, opt_fields=opt_fields) + pprint(api_response) except ApiException as e: - print("Exception when calling CustomFieldsApi->get_custom_fields_for_workspace: %s\n" % e) + print("Exception when calling CustomFieldsApi->get_custom_fields_for_workspace: %s\n" % e) ``` ### Parameters @@ -293,19 +298,20 @@ from pprint import pprint # Configure OAuth2 access token for authorization: oauth2 configuration = asana.Configuration() configuration.access_token = '' +api_client = asana.ApiClient(configuration) # create an instance of the API class -api_instance = asana.CustomFieldsApi(asana.ApiClient(configuration)) +api_instance = asana.CustomFieldsApi(api_client) custom_field_gid = '12345' # str | Globally unique identifier for the custom field. body = asana.EnumOptionsInsertBody({"param1": "value1", "param2": "value2",}) # EnumOptionsInsertBody | The enum option object to create. (optional) opt_fields = ["color","enabled","name"] # list[str] | This endpoint returns a compact resource, which excludes some properties by default. To include those optional properties, set this query parameter to a comma-separated list of the properties you wish to include. (optional) try: - # Reorder a custom field's enum - api_response = api_instance.insert_enum_option_for_custom_field(custom_field_gid, body=body, opt_fields=opt_fields) - pprint(api_response) + # Reorder a custom field's enum + api_response = api_instance.insert_enum_option_for_custom_field(custom_field_gid, body=body, opt_fields=opt_fields) + pprint(api_response) except ApiException as e: - print("Exception when calling CustomFieldsApi->insert_enum_option_for_custom_field: %s\n" % e) + print("Exception when calling CustomFieldsApi->insert_enum_option_for_custom_field: %s\n" % e) ``` ### Parameters @@ -347,19 +353,20 @@ from pprint import pprint # Configure OAuth2 access token for authorization: oauth2 configuration = asana.Configuration() configuration.access_token = '' +api_client = asana.ApiClient(configuration) # create an instance of the API class -api_instance = asana.CustomFieldsApi(asana.ApiClient(configuration)) +api_instance = asana.CustomFieldsApi(api_client) custom_field_gid = '12345' # str | Globally unique identifier for the custom field. body = asana.CustomFieldsCustomFieldGidBody({"param1": "value1", "param2": "value2",}) # CustomFieldsCustomFieldGidBody | The custom field object with all updated properties. (optional) opt_fields = ["asana_created_field","created_by","created_by.name","currency_code","custom_label","custom_label_position","date_value","date_value.date","date_value.date_time","description","display_value","enabled","enum_options","enum_options.color","enum_options.enabled","enum_options.name","enum_value","enum_value.color","enum_value.enabled","enum_value.name","format","has_notifications_enabled","is_formula_field","is_global_to_workspace","is_value_read_only","multi_enum_values","multi_enum_values.color","multi_enum_values.enabled","multi_enum_values.name","name","number_value","people_value","people_value.name","precision","resource_subtype","text_value","type"] # list[str] | This endpoint returns a compact resource, which excludes some properties by default. To include those optional properties, set this query parameter to a comma-separated list of the properties you wish to include. (optional) try: - # Update a custom field - api_response = api_instance.update_custom_field(custom_field_gid, body=body, opt_fields=opt_fields) - pprint(api_response) + # Update a custom field + api_response = api_instance.update_custom_field(custom_field_gid, body=body, opt_fields=opt_fields) + pprint(api_response) except ApiException as e: - print("Exception when calling CustomFieldsApi->update_custom_field: %s\n" % e) + print("Exception when calling CustomFieldsApi->update_custom_field: %s\n" % e) ``` ### Parameters @@ -401,19 +408,20 @@ from pprint import pprint # Configure OAuth2 access token for authorization: oauth2 configuration = asana.Configuration() configuration.access_token = '' +api_client = asana.ApiClient(configuration) # create an instance of the API class -api_instance = asana.CustomFieldsApi(asana.ApiClient(configuration)) +api_instance = asana.CustomFieldsApi(api_client) enum_option_gid = '124578' # str | Globally unique identifier for the enum option. body = asana.EnumOptionsEnumOptionGidBody({"param1": "value1", "param2": "value2",}) # EnumOptionsEnumOptionGidBody | The enum option object to update (optional) opt_fields = ["color","enabled","name"] # list[str] | This endpoint returns a compact resource, which excludes some properties by default. To include those optional properties, set this query parameter to a comma-separated list of the properties you wish to include. (optional) try: - # Update an enum option - api_response = api_instance.update_enum_option(enum_option_gid, body=body, opt_fields=opt_fields) - pprint(api_response) + # Update an enum option + api_response = api_instance.update_enum_option(enum_option_gid, body=body, opt_fields=opt_fields) + pprint(api_response) except ApiException as e: - print("Exception when calling CustomFieldsApi->update_enum_option: %s\n" % e) + print("Exception when calling CustomFieldsApi->update_enum_option: %s\n" % e) ``` ### Parameters diff --git a/docs/CustomFieldsApi.yaml b/docs/CustomFieldsApi.yaml index 91ef009f..c6a9ccf7 100644 --- a/docs/CustomFieldsApi.yaml +++ b/docs/CustomFieldsApi.yaml @@ -7,18 +7,19 @@ CustomFieldsApi: # Configure OAuth2 access token for authorization: oauth2 configuration = asana.Configuration() configuration.access_token = '' + api_client = asana.ApiClient(configuration) # create an instance of the API class - api_instance = asana.CustomFieldsApi(asana.ApiClient(configuration)) + api_instance = asana.CustomFieldsApi(api_client) body = asana.CustomFieldsBody({"param1": "value1", "param2": "value2",}) # CustomFieldsBody | The custom field object to create. opt_fields = ["asana_created_field","created_by","created_by.name","currency_code","custom_label","custom_label_position","date_value","date_value.date","date_value.date_time","description","display_value","enabled","enum_options","enum_options.color","enum_options.enabled","enum_options.name","enum_value","enum_value.color","enum_value.enabled","enum_value.name","format","has_notifications_enabled","is_formula_field","is_global_to_workspace","is_value_read_only","multi_enum_values","multi_enum_values.color","multi_enum_values.enabled","multi_enum_values.name","name","number_value","people_value","people_value.name","precision","resource_subtype","text_value","type"] # list[str] | This endpoint returns a compact resource, which excludes some properties by default. To include those optional properties, set this query parameter to a comma-separated list of the properties you wish to include. (optional) try: - # Create a custom field - api_response = api_instance.create_custom_field(body, opt_fields=opt_fields) - pprint(api_response) + # Create a custom field + api_response = api_instance.create_custom_field(body, opt_fields=opt_fields) + pprint(api_response) except ApiException as e: - print("Exception when calling CustomFieldsApi->create_custom_field: %s\n" % e) + print("Exception when calling CustomFieldsApi->create_custom_field: %s\n" % e) create_enum_option_for_custom_field: |- import asana from asana.rest import ApiException @@ -27,19 +28,20 @@ CustomFieldsApi: # Configure OAuth2 access token for authorization: oauth2 configuration = asana.Configuration() configuration.access_token = '' + api_client = asana.ApiClient(configuration) # create an instance of the API class - api_instance = asana.CustomFieldsApi(asana.ApiClient(configuration)) + api_instance = asana.CustomFieldsApi(api_client) custom_field_gid = '12345' # str | Globally unique identifier for the custom field. body = asana.CustomFieldGidEnumOptionsBody({"param1": "value1", "param2": "value2",}) # CustomFieldGidEnumOptionsBody | The enum option object to create. (optional) opt_fields = ["color","enabled","name"] # list[str] | This endpoint returns a compact resource, which excludes some properties by default. To include those optional properties, set this query parameter to a comma-separated list of the properties you wish to include. (optional) try: - # Create an enum option - api_response = api_instance.create_enum_option_for_custom_field(custom_field_gid, body=body, opt_fields=opt_fields) - pprint(api_response) + # Create an enum option + api_response = api_instance.create_enum_option_for_custom_field(custom_field_gid, body=body, opt_fields=opt_fields) + pprint(api_response) except ApiException as e: - print("Exception when calling CustomFieldsApi->create_enum_option_for_custom_field: %s\n" % e) + print("Exception when calling CustomFieldsApi->create_enum_option_for_custom_field: %s\n" % e) delete_custom_field: |- import asana from asana.rest import ApiException @@ -48,17 +50,18 @@ CustomFieldsApi: # Configure OAuth2 access token for authorization: oauth2 configuration = asana.Configuration() configuration.access_token = '' + api_client = asana.ApiClient(configuration) # create an instance of the API class - api_instance = asana.CustomFieldsApi(asana.ApiClient(configuration)) + api_instance = asana.CustomFieldsApi(api_client) custom_field_gid = '12345' # str | Globally unique identifier for the custom field. try: - # Delete a custom field - api_response = api_instance.delete_custom_field(custom_field_gid) - pprint(api_response) + # Delete a custom field + api_response = api_instance.delete_custom_field(custom_field_gid) + pprint(api_response) except ApiException as e: - print("Exception when calling CustomFieldsApi->delete_custom_field: %s\n" % e) + print("Exception when calling CustomFieldsApi->delete_custom_field: %s\n" % e) get_custom_field: |- import asana from asana.rest import ApiException @@ -67,18 +70,19 @@ CustomFieldsApi: # Configure OAuth2 access token for authorization: oauth2 configuration = asana.Configuration() configuration.access_token = '' + api_client = asana.ApiClient(configuration) # create an instance of the API class - api_instance = asana.CustomFieldsApi(asana.ApiClient(configuration)) + api_instance = asana.CustomFieldsApi(api_client) custom_field_gid = '12345' # str | Globally unique identifier for the custom field. opt_fields = ["asana_created_field","created_by","created_by.name","currency_code","custom_label","custom_label_position","date_value","date_value.date","date_value.date_time","description","display_value","enabled","enum_options","enum_options.color","enum_options.enabled","enum_options.name","enum_value","enum_value.color","enum_value.enabled","enum_value.name","format","has_notifications_enabled","is_formula_field","is_global_to_workspace","is_value_read_only","multi_enum_values","multi_enum_values.color","multi_enum_values.enabled","multi_enum_values.name","name","number_value","people_value","people_value.name","precision","resource_subtype","text_value","type"] # list[str] | This endpoint returns a compact resource, which excludes some properties by default. To include those optional properties, set this query parameter to a comma-separated list of the properties you wish to include. (optional) try: - # Get a custom field - api_response = api_instance.get_custom_field(custom_field_gid, opt_fields=opt_fields) - pprint(api_response) + # Get a custom field + api_response = api_instance.get_custom_field(custom_field_gid, opt_fields=opt_fields) + pprint(api_response) except ApiException as e: - print("Exception when calling CustomFieldsApi->get_custom_field: %s\n" % e) + print("Exception when calling CustomFieldsApi->get_custom_field: %s\n" % e) get_custom_fields_for_workspace: |- import asana from asana.rest import ApiException @@ -87,20 +91,21 @@ CustomFieldsApi: # Configure OAuth2 access token for authorization: oauth2 configuration = asana.Configuration() configuration.access_token = '' + api_client = asana.ApiClient(configuration) # create an instance of the API class - api_instance = asana.CustomFieldsApi(asana.ApiClient(configuration)) + api_instance = asana.CustomFieldsApi(api_client) workspace_gid = '12345' # str | Globally unique identifier for the workspace or organization. limit = 50 # int | Results per page. The number of objects to return per page. The value must be between 1 and 100. (optional) offset = 'eyJ0eXAiOJiKV1iQLCJhbGciOiJIUzI1NiJ9' # 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.' (optional) opt_fields = ["asana_created_field","created_by","created_by.name","currency_code","custom_label","custom_label_position","date_value","date_value.date","date_value.date_time","description","display_value","enabled","enum_options","enum_options.color","enum_options.enabled","enum_options.name","enum_value","enum_value.color","enum_value.enabled","enum_value.name","format","has_notifications_enabled","is_formula_field","is_global_to_workspace","is_value_read_only","multi_enum_values","multi_enum_values.color","multi_enum_values.enabled","multi_enum_values.name","name","number_value","offset","path","people_value","people_value.name","precision","resource_subtype","text_value","type","uri"] # list[str] | This endpoint returns a compact resource, which excludes some properties by default. To include those optional properties, set this query parameter to a comma-separated list of the properties you wish to include. (optional) try: - # Get a workspace's custom fields - api_response = api_instance.get_custom_fields_for_workspace(workspace_gid, limit=limit, offset=offset, opt_fields=opt_fields) - pprint(api_response) + # Get a workspace's custom fields + api_response = api_instance.get_custom_fields_for_workspace(workspace_gid, limit=limit, offset=offset, opt_fields=opt_fields) + pprint(api_response) except ApiException as e: - print("Exception when calling CustomFieldsApi->get_custom_fields_for_workspace: %s\n" % e) + print("Exception when calling CustomFieldsApi->get_custom_fields_for_workspace: %s\n" % e) insert_enum_option_for_custom_field: |- import asana from asana.rest import ApiException @@ -109,19 +114,20 @@ CustomFieldsApi: # Configure OAuth2 access token for authorization: oauth2 configuration = asana.Configuration() configuration.access_token = '' + api_client = asana.ApiClient(configuration) # create an instance of the API class - api_instance = asana.CustomFieldsApi(asana.ApiClient(configuration)) + api_instance = asana.CustomFieldsApi(api_client) custom_field_gid = '12345' # str | Globally unique identifier for the custom field. body = asana.EnumOptionsInsertBody({"param1": "value1", "param2": "value2",}) # EnumOptionsInsertBody | The enum option object to create. (optional) opt_fields = ["color","enabled","name"] # list[str] | This endpoint returns a compact resource, which excludes some properties by default. To include those optional properties, set this query parameter to a comma-separated list of the properties you wish to include. (optional) try: - # Reorder a custom field's enum - api_response = api_instance.insert_enum_option_for_custom_field(custom_field_gid, body=body, opt_fields=opt_fields) - pprint(api_response) + # Reorder a custom field's enum + api_response = api_instance.insert_enum_option_for_custom_field(custom_field_gid, body=body, opt_fields=opt_fields) + pprint(api_response) except ApiException as e: - print("Exception when calling CustomFieldsApi->insert_enum_option_for_custom_field: %s\n" % e) + print("Exception when calling CustomFieldsApi->insert_enum_option_for_custom_field: %s\n" % e) update_custom_field: |- import asana from asana.rest import ApiException @@ -130,19 +136,20 @@ CustomFieldsApi: # Configure OAuth2 access token for authorization: oauth2 configuration = asana.Configuration() configuration.access_token = '' + api_client = asana.ApiClient(configuration) # create an instance of the API class - api_instance = asana.CustomFieldsApi(asana.ApiClient(configuration)) + api_instance = asana.CustomFieldsApi(api_client) custom_field_gid = '12345' # str | Globally unique identifier for the custom field. body = asana.CustomFieldsCustomFieldGidBody({"param1": "value1", "param2": "value2",}) # CustomFieldsCustomFieldGidBody | The custom field object with all updated properties. (optional) opt_fields = ["asana_created_field","created_by","created_by.name","currency_code","custom_label","custom_label_position","date_value","date_value.date","date_value.date_time","description","display_value","enabled","enum_options","enum_options.color","enum_options.enabled","enum_options.name","enum_value","enum_value.color","enum_value.enabled","enum_value.name","format","has_notifications_enabled","is_formula_field","is_global_to_workspace","is_value_read_only","multi_enum_values","multi_enum_values.color","multi_enum_values.enabled","multi_enum_values.name","name","number_value","people_value","people_value.name","precision","resource_subtype","text_value","type"] # list[str] | This endpoint returns a compact resource, which excludes some properties by default. To include those optional properties, set this query parameter to a comma-separated list of the properties you wish to include. (optional) try: - # Update a custom field - api_response = api_instance.update_custom_field(custom_field_gid, body=body, opt_fields=opt_fields) - pprint(api_response) + # Update a custom field + api_response = api_instance.update_custom_field(custom_field_gid, body=body, opt_fields=opt_fields) + pprint(api_response) except ApiException as e: - print("Exception when calling CustomFieldsApi->update_custom_field: %s\n" % e) + print("Exception when calling CustomFieldsApi->update_custom_field: %s\n" % e) update_enum_option: |- import asana from asana.rest import ApiException @@ -151,16 +158,17 @@ CustomFieldsApi: # Configure OAuth2 access token for authorization: oauth2 configuration = asana.Configuration() configuration.access_token = '' + api_client = asana.ApiClient(configuration) # create an instance of the API class - api_instance = asana.CustomFieldsApi(asana.ApiClient(configuration)) + api_instance = asana.CustomFieldsApi(api_client) enum_option_gid = '124578' # str | Globally unique identifier for the enum option. body = asana.EnumOptionsEnumOptionGidBody({"param1": "value1", "param2": "value2",}) # EnumOptionsEnumOptionGidBody | The enum option object to update (optional) opt_fields = ["color","enabled","name"] # list[str] | This endpoint returns a compact resource, which excludes some properties by default. To include those optional properties, set this query parameter to a comma-separated list of the properties you wish to include. (optional) try: - # Update an enum option - api_response = api_instance.update_enum_option(enum_option_gid, body=body, opt_fields=opt_fields) - pprint(api_response) + # Update an enum option + api_response = api_instance.update_enum_option(enum_option_gid, body=body, opt_fields=opt_fields) + pprint(api_response) except ApiException as e: - print("Exception when calling CustomFieldsApi->update_enum_option: %s\n" % e) + print("Exception when calling CustomFieldsApi->update_enum_option: %s\n" % e) diff --git a/docs/EventsApi.md b/docs/EventsApi.md index 2f478f6d..905f3b45 100644 --- a/docs/EventsApi.md +++ b/docs/EventsApi.md @@ -22,19 +22,20 @@ from pprint import pprint # Configure OAuth2 access token for authorization: oauth2 configuration = asana.Configuration() configuration.access_token = '' +api_client = asana.ApiClient(configuration) # create an instance of the API class -api_instance = asana.EventsApi(asana.ApiClient(configuration)) +api_instance = asana.EventsApi(api_client) resource = '12345' # str | A resource ID to subscribe to. The resource can be a task or project. sync = 'de4774f6915eae04714ca93bb2f5ee81' # 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.* (optional) opt_fields = ["action","change","change.action","change.added_value","change.field","change.new_value","change.removed_value","created_at","parent","parent.name","resource","resource.name","type","user","user.name"] # list[str] | This endpoint returns a compact resource, which excludes some properties by default. To include those optional properties, set this query parameter to a comma-separated list of the properties you wish to include. (optional) try: - # Get events on a resource - api_response = api_instance.get_events(resource, sync=sync, opt_fields=opt_fields) - pprint(api_response) + # Get events on a resource + api_response = api_instance.get_events(resource, sync=sync, opt_fields=opt_fields) + pprint(api_response) except ApiException as e: - print("Exception when calling EventsApi->get_events: %s\n" % e) + print("Exception when calling EventsApi->get_events: %s\n" % e) ``` ### Parameters diff --git a/docs/EventsApi.yaml b/docs/EventsApi.yaml index eaf047d9..c6e27a7a 100644 --- a/docs/EventsApi.yaml +++ b/docs/EventsApi.yaml @@ -7,16 +7,17 @@ EventsApi: # Configure OAuth2 access token for authorization: oauth2 configuration = asana.Configuration() configuration.access_token = '' + api_client = asana.ApiClient(configuration) # create an instance of the API class - api_instance = asana.EventsApi(asana.ApiClient(configuration)) + api_instance = asana.EventsApi(api_client) resource = '12345' # str | A resource ID to subscribe to. The resource can be a task or project. sync = 'de4774f6915eae04714ca93bb2f5ee81' # 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.* (optional) opt_fields = ["action","change","change.action","change.added_value","change.field","change.new_value","change.removed_value","created_at","parent","parent.name","resource","resource.name","type","user","user.name"] # list[str] | This endpoint returns a compact resource, which excludes some properties by default. To include those optional properties, set this query parameter to a comma-separated list of the properties you wish to include. (optional) try: - # Get events on a resource - api_response = api_instance.get_events(resource, sync=sync, opt_fields=opt_fields) - pprint(api_response) + # Get events on a resource + api_response = api_instance.get_events(resource, sync=sync, opt_fields=opt_fields) + pprint(api_response) except ApiException as e: - print("Exception when calling EventsApi->get_events: %s\n" % e) + print("Exception when calling EventsApi->get_events: %s\n" % e) diff --git a/docs/GoalRelationshipsApi.md b/docs/GoalRelationshipsApi.md index 3ac8b671..52ce2d97 100644 --- a/docs/GoalRelationshipsApi.md +++ b/docs/GoalRelationshipsApi.md @@ -26,19 +26,20 @@ from pprint import pprint # Configure OAuth2 access token for authorization: oauth2 configuration = asana.Configuration() configuration.access_token = '' +api_client = asana.ApiClient(configuration) # create an instance of the API class -api_instance = asana.GoalRelationshipsApi(asana.ApiClient(configuration)) +api_instance = asana.GoalRelationshipsApi(api_client) body = asana.GoalGidAddSupportingRelationshipBody({"param1": "value1", "param2": "value2",}) # GoalGidAddSupportingRelationshipBody | The supporting resource to be added to the goal goal_gid = '12345' # str | Globally unique identifier for the goal. opt_fields = ["contribution_weight","resource_subtype","supported_goal","supported_goal.name","supported_goal.owner","supported_goal.owner.name","supporting_resource","supporting_resource.name"] # list[str] | This endpoint returns a compact resource, which excludes some properties by default. To include those optional properties, set this query parameter to a comma-separated list of the properties you wish to include. (optional) try: - # Add a supporting goal relationship - api_response = api_instance.add_supporting_relationship(body, goal_gid, opt_fields=opt_fields) - pprint(api_response) + # Add a supporting goal relationship + api_response = api_instance.add_supporting_relationship(body, goal_gid, opt_fields=opt_fields) + pprint(api_response) except ApiException as e: - print("Exception when calling GoalRelationshipsApi->add_supporting_relationship: %s\n" % e) + print("Exception when calling GoalRelationshipsApi->add_supporting_relationship: %s\n" % e) ``` ### Parameters @@ -80,18 +81,19 @@ from pprint import pprint # Configure OAuth2 access token for authorization: oauth2 configuration = asana.Configuration() configuration.access_token = '' +api_client = asana.ApiClient(configuration) # create an instance of the API class -api_instance = asana.GoalRelationshipsApi(asana.ApiClient(configuration)) +api_instance = asana.GoalRelationshipsApi(api_client) goal_relationship_gid = '12345' # str | Globally unique identifier for the goal relationship. opt_fields = ["contribution_weight","resource_subtype","supported_goal","supported_goal.name","supported_goal.owner","supported_goal.owner.name","supporting_resource","supporting_resource.name"] # list[str] | This endpoint returns a compact resource, which excludes some properties by default. To include those optional properties, set this query parameter to a comma-separated list of the properties you wish to include. (optional) try: - # Get a goal relationship - api_response = api_instance.get_goal_relationship(goal_relationship_gid, opt_fields=opt_fields) - pprint(api_response) + # Get a goal relationship + api_response = api_instance.get_goal_relationship(goal_relationship_gid, opt_fields=opt_fields) + pprint(api_response) except ApiException as e: - print("Exception when calling GoalRelationshipsApi->get_goal_relationship: %s\n" % e) + print("Exception when calling GoalRelationshipsApi->get_goal_relationship: %s\n" % e) ``` ### Parameters @@ -132,9 +134,10 @@ from pprint import pprint # Configure OAuth2 access token for authorization: oauth2 configuration = asana.Configuration() configuration.access_token = '' +api_client = asana.ApiClient(configuration) # create an instance of the API class -api_instance = asana.GoalRelationshipsApi(asana.ApiClient(configuration)) +api_instance = asana.GoalRelationshipsApi(api_client) supported_goal = '12345' # str | Globally unique identifier for the supported goal in the goal relationship. limit = 50 # int | Results per page. The number of objects to return per page. The value must be between 1 and 100. (optional) offset = 'eyJ0eXAiOJiKV1iQLCJhbGciOiJIUzI1NiJ9' # 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.' (optional) @@ -142,11 +145,11 @@ resource_subtype = 'subgoal' # str | If provided, filter to goal relationships w opt_fields = ["contribution_weight","offset","path","resource_subtype","supported_goal","supported_goal.name","supported_goal.owner","supported_goal.owner.name","supporting_resource","supporting_resource.name","uri"] # list[str] | This endpoint returns a compact resource, which excludes some properties by default. To include those optional properties, set this query parameter to a comma-separated list of the properties you wish to include. (optional) try: - # Get goal relationships - api_response = api_instance.get_goal_relationships(supported_goal, limit=limit, offset=offset, resource_subtype=resource_subtype, opt_fields=opt_fields) - pprint(api_response) + # Get goal relationships + api_response = api_instance.get_goal_relationships(supported_goal, limit=limit, offset=offset, resource_subtype=resource_subtype, opt_fields=opt_fields) + pprint(api_response) except ApiException as e: - print("Exception when calling GoalRelationshipsApi->get_goal_relationships: %s\n" % e) + print("Exception when calling GoalRelationshipsApi->get_goal_relationships: %s\n" % e) ``` ### Parameters @@ -190,18 +193,19 @@ from pprint import pprint # Configure OAuth2 access token for authorization: oauth2 configuration = asana.Configuration() configuration.access_token = '' +api_client = asana.ApiClient(configuration) # create an instance of the API class -api_instance = asana.GoalRelationshipsApi(asana.ApiClient(configuration)) +api_instance = asana.GoalRelationshipsApi(api_client) body = asana.GoalGidRemoveSupportingRelationshipBody({"param1": "value1", "param2": "value2",}) # GoalGidRemoveSupportingRelationshipBody | The supporting resource to be removed from the goal goal_gid = '12345' # str | Globally unique identifier for the goal. try: - # Removes a supporting goal relationship - api_response = api_instance.remove_supporting_relationship(body, goal_gid) - pprint(api_response) + # Removes a supporting goal relationship + api_response = api_instance.remove_supporting_relationship(body, goal_gid) + pprint(api_response) except ApiException as e: - print("Exception when calling GoalRelationshipsApi->remove_supporting_relationship: %s\n" % e) + print("Exception when calling GoalRelationshipsApi->remove_supporting_relationship: %s\n" % e) ``` ### Parameters @@ -242,19 +246,20 @@ from pprint import pprint # Configure OAuth2 access token for authorization: oauth2 configuration = asana.Configuration() configuration.access_token = '' +api_client = asana.ApiClient(configuration) # create an instance of the API class -api_instance = asana.GoalRelationshipsApi(asana.ApiClient(configuration)) +api_instance = asana.GoalRelationshipsApi(api_client) body = asana.GoalRelationshipsGoalRelationshipGidBody({"param1": "value1", "param2": "value2",}) # GoalRelationshipsGoalRelationshipGidBody | The updated fields for the goal relationship. goal_relationship_gid = '12345' # str | Globally unique identifier for the goal relationship. opt_fields = ["contribution_weight","resource_subtype","supported_goal","supported_goal.name","supported_goal.owner","supported_goal.owner.name","supporting_resource","supporting_resource.name"] # list[str] | This endpoint returns a compact resource, which excludes some properties by default. To include those optional properties, set this query parameter to a comma-separated list of the properties you wish to include. (optional) try: - # Update a goal relationship - api_response = api_instance.update_goal_relationship(body, goal_relationship_gid, opt_fields=opt_fields) - pprint(api_response) + # Update a goal relationship + api_response = api_instance.update_goal_relationship(body, goal_relationship_gid, opt_fields=opt_fields) + pprint(api_response) except ApiException as e: - print("Exception when calling GoalRelationshipsApi->update_goal_relationship: %s\n" % e) + print("Exception when calling GoalRelationshipsApi->update_goal_relationship: %s\n" % e) ``` ### Parameters diff --git a/docs/GoalRelationshipsApi.yaml b/docs/GoalRelationshipsApi.yaml index c8e3131e..20f6c82e 100644 --- a/docs/GoalRelationshipsApi.yaml +++ b/docs/GoalRelationshipsApi.yaml @@ -7,19 +7,20 @@ GoalRelationshipsApi: # Configure OAuth2 access token for authorization: oauth2 configuration = asana.Configuration() configuration.access_token = '' + api_client = asana.ApiClient(configuration) # create an instance of the API class - api_instance = asana.GoalRelationshipsApi(asana.ApiClient(configuration)) + api_instance = asana.GoalRelationshipsApi(api_client) body = asana.GoalGidAddSupportingRelationshipBody({"param1": "value1", "param2": "value2",}) # GoalGidAddSupportingRelationshipBody | The supporting resource to be added to the goal goal_gid = '12345' # str | Globally unique identifier for the goal. opt_fields = ["contribution_weight","resource_subtype","supported_goal","supported_goal.name","supported_goal.owner","supported_goal.owner.name","supporting_resource","supporting_resource.name"] # list[str] | This endpoint returns a compact resource, which excludes some properties by default. To include those optional properties, set this query parameter to a comma-separated list of the properties you wish to include. (optional) try: - # Add a supporting goal relationship - api_response = api_instance.add_supporting_relationship(body, goal_gid, opt_fields=opt_fields) - pprint(api_response) + # Add a supporting goal relationship + api_response = api_instance.add_supporting_relationship(body, goal_gid, opt_fields=opt_fields) + pprint(api_response) except ApiException as e: - print("Exception when calling GoalRelationshipsApi->add_supporting_relationship: %s\n" % e) + print("Exception when calling GoalRelationshipsApi->add_supporting_relationship: %s\n" % e) get_goal_relationship: |- import asana from asana.rest import ApiException @@ -28,18 +29,19 @@ GoalRelationshipsApi: # Configure OAuth2 access token for authorization: oauth2 configuration = asana.Configuration() configuration.access_token = '' + api_client = asana.ApiClient(configuration) # create an instance of the API class - api_instance = asana.GoalRelationshipsApi(asana.ApiClient(configuration)) + api_instance = asana.GoalRelationshipsApi(api_client) goal_relationship_gid = '12345' # str | Globally unique identifier for the goal relationship. opt_fields = ["contribution_weight","resource_subtype","supported_goal","supported_goal.name","supported_goal.owner","supported_goal.owner.name","supporting_resource","supporting_resource.name"] # list[str] | This endpoint returns a compact resource, which excludes some properties by default. To include those optional properties, set this query parameter to a comma-separated list of the properties you wish to include. (optional) try: - # Get a goal relationship - api_response = api_instance.get_goal_relationship(goal_relationship_gid, opt_fields=opt_fields) - pprint(api_response) + # Get a goal relationship + api_response = api_instance.get_goal_relationship(goal_relationship_gid, opt_fields=opt_fields) + pprint(api_response) except ApiException as e: - print("Exception when calling GoalRelationshipsApi->get_goal_relationship: %s\n" % e) + print("Exception when calling GoalRelationshipsApi->get_goal_relationship: %s\n" % e) get_goal_relationships: |- import asana from asana.rest import ApiException @@ -48,9 +50,10 @@ GoalRelationshipsApi: # Configure OAuth2 access token for authorization: oauth2 configuration = asana.Configuration() configuration.access_token = '' + api_client = asana.ApiClient(configuration) # create an instance of the API class - api_instance = asana.GoalRelationshipsApi(asana.ApiClient(configuration)) + api_instance = asana.GoalRelationshipsApi(api_client) supported_goal = '12345' # str | Globally unique identifier for the supported goal in the goal relationship. limit = 50 # int | Results per page. The number of objects to return per page. The value must be between 1 and 100. (optional) offset = 'eyJ0eXAiOJiKV1iQLCJhbGciOiJIUzI1NiJ9' # 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.' (optional) @@ -58,11 +61,11 @@ GoalRelationshipsApi: opt_fields = ["contribution_weight","offset","path","resource_subtype","supported_goal","supported_goal.name","supported_goal.owner","supported_goal.owner.name","supporting_resource","supporting_resource.name","uri"] # list[str] | This endpoint returns a compact resource, which excludes some properties by default. To include those optional properties, set this query parameter to a comma-separated list of the properties you wish to include. (optional) try: - # Get goal relationships - api_response = api_instance.get_goal_relationships(supported_goal, limit=limit, offset=offset, resource_subtype=resource_subtype, opt_fields=opt_fields) - pprint(api_response) + # Get goal relationships + api_response = api_instance.get_goal_relationships(supported_goal, limit=limit, offset=offset, resource_subtype=resource_subtype, opt_fields=opt_fields) + pprint(api_response) except ApiException as e: - print("Exception when calling GoalRelationshipsApi->get_goal_relationships: %s\n" % e) + print("Exception when calling GoalRelationshipsApi->get_goal_relationships: %s\n" % e) remove_supporting_relationship: |- import asana from asana.rest import ApiException @@ -71,18 +74,19 @@ GoalRelationshipsApi: # Configure OAuth2 access token for authorization: oauth2 configuration = asana.Configuration() configuration.access_token = '' + api_client = asana.ApiClient(configuration) # create an instance of the API class - api_instance = asana.GoalRelationshipsApi(asana.ApiClient(configuration)) + api_instance = asana.GoalRelationshipsApi(api_client) body = asana.GoalGidRemoveSupportingRelationshipBody({"param1": "value1", "param2": "value2",}) # GoalGidRemoveSupportingRelationshipBody | The supporting resource to be removed from the goal goal_gid = '12345' # str | Globally unique identifier for the goal. try: - # Removes a supporting goal relationship - api_response = api_instance.remove_supporting_relationship(body, goal_gid) - pprint(api_response) + # Removes a supporting goal relationship + api_response = api_instance.remove_supporting_relationship(body, goal_gid) + pprint(api_response) except ApiException as e: - print("Exception when calling GoalRelationshipsApi->remove_supporting_relationship: %s\n" % e) + print("Exception when calling GoalRelationshipsApi->remove_supporting_relationship: %s\n" % e) update_goal_relationship: |- import asana from asana.rest import ApiException @@ -91,16 +95,17 @@ GoalRelationshipsApi: # Configure OAuth2 access token for authorization: oauth2 configuration = asana.Configuration() configuration.access_token = '' + api_client = asana.ApiClient(configuration) # create an instance of the API class - api_instance = asana.GoalRelationshipsApi(asana.ApiClient(configuration)) + api_instance = asana.GoalRelationshipsApi(api_client) body = asana.GoalRelationshipsGoalRelationshipGidBody({"param1": "value1", "param2": "value2",}) # GoalRelationshipsGoalRelationshipGidBody | The updated fields for the goal relationship. goal_relationship_gid = '12345' # str | Globally unique identifier for the goal relationship. opt_fields = ["contribution_weight","resource_subtype","supported_goal","supported_goal.name","supported_goal.owner","supported_goal.owner.name","supporting_resource","supporting_resource.name"] # list[str] | This endpoint returns a compact resource, which excludes some properties by default. To include those optional properties, set this query parameter to a comma-separated list of the properties you wish to include. (optional) try: - # Update a goal relationship - api_response = api_instance.update_goal_relationship(body, goal_relationship_gid, opt_fields=opt_fields) - pprint(api_response) + # Update a goal relationship + api_response = api_instance.update_goal_relationship(body, goal_relationship_gid, opt_fields=opt_fields) + pprint(api_response) except ApiException as e: - print("Exception when calling GoalRelationshipsApi->update_goal_relationship: %s\n" % e) + print("Exception when calling GoalRelationshipsApi->update_goal_relationship: %s\n" % e) diff --git a/docs/GoalsApi.md b/docs/GoalsApi.md index 32746daf..a4175e5e 100644 --- a/docs/GoalsApi.md +++ b/docs/GoalsApi.md @@ -31,19 +31,20 @@ from pprint import pprint # Configure OAuth2 access token for authorization: oauth2 configuration = asana.Configuration() configuration.access_token = '' +api_client = asana.ApiClient(configuration) # create an instance of the API class -api_instance = asana.GoalsApi(asana.ApiClient(configuration)) +api_instance = asana.GoalsApi(api_client) body = asana.GoalGidAddFollowersBody({"param1": "value1", "param2": "value2",}) # GoalGidAddFollowersBody | The followers to be added as collaborators goal_gid = '12345' # str | Globally unique identifier for the goal. opt_fields = ["current_status_update","current_status_update.resource_subtype","current_status_update.title","due_on","followers","followers.name","html_notes","is_workspace_level","liked","likes","likes.user","likes.user.name","metric","metric.can_manage","metric.currency_code","metric.current_display_value","metric.current_number_value","metric.initial_number_value","metric.precision","metric.progress_source","metric.resource_subtype","metric.target_number_value","metric.unit","name","notes","num_likes","owner","owner.name","start_on","status","team","team.name","time_period","time_period.display_name","time_period.end_on","time_period.period","time_period.start_on","workspace","workspace.name"] # list[str] | This endpoint returns a compact resource, which excludes some properties by default. To include those optional properties, set this query parameter to a comma-separated list of the properties you wish to include. (optional) try: - # Add a collaborator to a goal - api_response = api_instance.add_followers(body, goal_gid, opt_fields=opt_fields) - pprint(api_response) + # Add a collaborator to a goal + api_response = api_instance.add_followers(body, goal_gid, opt_fields=opt_fields) + pprint(api_response) except ApiException as e: - print("Exception when calling GoalsApi->add_followers: %s\n" % e) + print("Exception when calling GoalsApi->add_followers: %s\n" % e) ``` ### Parameters @@ -85,18 +86,19 @@ from pprint import pprint # Configure OAuth2 access token for authorization: oauth2 configuration = asana.Configuration() configuration.access_token = '' +api_client = asana.ApiClient(configuration) # create an instance of the API class -api_instance = asana.GoalsApi(asana.ApiClient(configuration)) +api_instance = asana.GoalsApi(api_client) body = asana.GoalsBody({"param1": "value1", "param2": "value2",}) # GoalsBody | The goal to create. opt_fields = ["current_status_update","current_status_update.resource_subtype","current_status_update.title","due_on","followers","followers.name","html_notes","is_workspace_level","liked","likes","likes.user","likes.user.name","metric","metric.can_manage","metric.currency_code","metric.current_display_value","metric.current_number_value","metric.initial_number_value","metric.precision","metric.progress_source","metric.resource_subtype","metric.target_number_value","metric.unit","name","notes","num_likes","owner","owner.name","start_on","status","team","team.name","time_period","time_period.display_name","time_period.end_on","time_period.period","time_period.start_on","workspace","workspace.name"] # list[str] | This endpoint returns a compact resource, which excludes some properties by default. To include those optional properties, set this query parameter to a comma-separated list of the properties you wish to include. (optional) try: - # Create a goal - api_response = api_instance.create_goal(body, opt_fields=opt_fields) - pprint(api_response) + # Create a goal + api_response = api_instance.create_goal(body, opt_fields=opt_fields) + pprint(api_response) except ApiException as e: - print("Exception when calling GoalsApi->create_goal: %s\n" % e) + print("Exception when calling GoalsApi->create_goal: %s\n" % e) ``` ### Parameters @@ -137,19 +139,20 @@ from pprint import pprint # Configure OAuth2 access token for authorization: oauth2 configuration = asana.Configuration() configuration.access_token = '' +api_client = asana.ApiClient(configuration) # create an instance of the API class -api_instance = asana.GoalsApi(asana.ApiClient(configuration)) +api_instance = asana.GoalsApi(api_client) body = asana.GoalGidSetMetricBody({"param1": "value1", "param2": "value2",}) # GoalGidSetMetricBody | The goal metric to create. goal_gid = '12345' # str | Globally unique identifier for the goal. opt_fields = ["current_status_update","current_status_update.resource_subtype","current_status_update.title","due_on","followers","followers.name","html_notes","is_workspace_level","liked","likes","likes.user","likes.user.name","metric","metric.can_manage","metric.currency_code","metric.current_display_value","metric.current_number_value","metric.initial_number_value","metric.precision","metric.progress_source","metric.resource_subtype","metric.target_number_value","metric.unit","name","notes","num_likes","owner","owner.name","start_on","status","team","team.name","time_period","time_period.display_name","time_period.end_on","time_period.period","time_period.start_on","workspace","workspace.name"] # list[str] | This endpoint returns a compact resource, which excludes some properties by default. To include those optional properties, set this query parameter to a comma-separated list of the properties you wish to include. (optional) try: - # Create a goal metric - api_response = api_instance.create_goal_metric(body, goal_gid, opt_fields=opt_fields) - pprint(api_response) + # Create a goal metric + api_response = api_instance.create_goal_metric(body, goal_gid, opt_fields=opt_fields) + pprint(api_response) except ApiException as e: - print("Exception when calling GoalsApi->create_goal_metric: %s\n" % e) + print("Exception when calling GoalsApi->create_goal_metric: %s\n" % e) ``` ### Parameters @@ -191,17 +194,18 @@ from pprint import pprint # Configure OAuth2 access token for authorization: oauth2 configuration = asana.Configuration() configuration.access_token = '' +api_client = asana.ApiClient(configuration) # create an instance of the API class -api_instance = asana.GoalsApi(asana.ApiClient(configuration)) +api_instance = asana.GoalsApi(api_client) goal_gid = '12345' # str | Globally unique identifier for the goal. try: - # Delete a goal - api_response = api_instance.delete_goal(goal_gid) - pprint(api_response) + # Delete a goal + api_response = api_instance.delete_goal(goal_gid) + pprint(api_response) except ApiException as e: - print("Exception when calling GoalsApi->delete_goal: %s\n" % e) + print("Exception when calling GoalsApi->delete_goal: %s\n" % e) ``` ### Parameters @@ -241,18 +245,19 @@ from pprint import pprint # Configure OAuth2 access token for authorization: oauth2 configuration = asana.Configuration() configuration.access_token = '' +api_client = asana.ApiClient(configuration) # create an instance of the API class -api_instance = asana.GoalsApi(asana.ApiClient(configuration)) +api_instance = asana.GoalsApi(api_client) goal_gid = '12345' # str | Globally unique identifier for the goal. opt_fields = ["current_status_update","current_status_update.resource_subtype","current_status_update.title","due_on","followers","followers.name","html_notes","is_workspace_level","liked","likes","likes.user","likes.user.name","metric","metric.can_manage","metric.currency_code","metric.current_display_value","metric.current_number_value","metric.initial_number_value","metric.precision","metric.progress_source","metric.resource_subtype","metric.target_number_value","metric.unit","name","notes","num_likes","owner","owner.name","start_on","status","team","team.name","time_period","time_period.display_name","time_period.end_on","time_period.period","time_period.start_on","workspace","workspace.name"] # list[str] | This endpoint returns a compact resource, which excludes some properties by default. To include those optional properties, set this query parameter to a comma-separated list of the properties you wish to include. (optional) try: - # Get a goal - api_response = api_instance.get_goal(goal_gid, opt_fields=opt_fields) - pprint(api_response) + # Get a goal + api_response = api_instance.get_goal(goal_gid, opt_fields=opt_fields) + pprint(api_response) except ApiException as e: - print("Exception when calling GoalsApi->get_goal: %s\n" % e) + print("Exception when calling GoalsApi->get_goal: %s\n" % e) ``` ### Parameters @@ -293,9 +298,10 @@ from pprint import pprint # Configure OAuth2 access token for authorization: oauth2 configuration = asana.Configuration() configuration.access_token = '' +api_client = asana.ApiClient(configuration) # create an instance of the API class -api_instance = asana.GoalsApi(asana.ApiClient(configuration)) +api_instance = asana.GoalsApi(api_client) portfolio = '159874' # str | Globally unique identifier for supporting portfolio. (optional) project = '512241' # str | Globally unique identifier for supporting project. (optional) is_workspace_level = false # bool | Filter to goals with is_workspace_level set to query value. Must be used with the workspace parameter. (optional) @@ -307,11 +313,11 @@ offset = 'eyJ0eXAiOJiKV1iQLCJhbGciOiJIUzI1NiJ9' # str | Offset token. An offset opt_fields = ["current_status_update","current_status_update.resource_subtype","current_status_update.title","due_on","followers","followers.name","html_notes","is_workspace_level","liked","likes","likes.user","likes.user.name","metric","metric.can_manage","metric.currency_code","metric.current_display_value","metric.current_number_value","metric.initial_number_value","metric.precision","metric.progress_source","metric.resource_subtype","metric.target_number_value","metric.unit","name","notes","num_likes","offset","owner","owner.name","path","start_on","status","team","team.name","time_period","time_period.display_name","time_period.end_on","time_period.period","time_period.start_on","uri","workspace","workspace.name"] # list[str] | This endpoint returns a compact resource, which excludes some properties by default. To include those optional properties, set this query parameter to a comma-separated list of the properties you wish to include. (optional) try: - # Get goals - api_response = api_instance.get_goals(portfolio=portfolio, project=project, is_workspace_level=is_workspace_level, team=team, workspace=workspace, time_periods=time_periods, limit=limit, offset=offset, opt_fields=opt_fields) - pprint(api_response) + # Get goals + api_response = api_instance.get_goals(portfolio=portfolio, project=project, is_workspace_level=is_workspace_level, team=team, workspace=workspace, time_periods=time_periods, limit=limit, offset=offset, opt_fields=opt_fields) + pprint(api_response) except ApiException as e: - print("Exception when calling GoalsApi->get_goals: %s\n" % e) + print("Exception when calling GoalsApi->get_goals: %s\n" % e) ``` ### Parameters @@ -359,18 +365,19 @@ from pprint import pprint # Configure OAuth2 access token for authorization: oauth2 configuration = asana.Configuration() configuration.access_token = '' +api_client = asana.ApiClient(configuration) # create an instance of the API class -api_instance = asana.GoalsApi(asana.ApiClient(configuration)) +api_instance = asana.GoalsApi(api_client) goal_gid = '12345' # str | Globally unique identifier for the goal. opt_fields = ["current_status_update","current_status_update.resource_subtype","current_status_update.title","due_on","followers","followers.name","html_notes","is_workspace_level","liked","likes","likes.user","likes.user.name","metric","metric.can_manage","metric.currency_code","metric.current_display_value","metric.current_number_value","metric.initial_number_value","metric.precision","metric.progress_source","metric.resource_subtype","metric.target_number_value","metric.unit","name","notes","num_likes","owner","owner.name","start_on","status","team","team.name","time_period","time_period.display_name","time_period.end_on","time_period.period","time_period.start_on","workspace","workspace.name"] # list[str] | This endpoint returns a compact resource, which excludes some properties by default. To include those optional properties, set this query parameter to a comma-separated list of the properties you wish to include. (optional) try: - # Get parent goals from a goal - api_response = api_instance.get_parent_goals_for_goal(goal_gid, opt_fields=opt_fields) - pprint(api_response) + # Get parent goals from a goal + api_response = api_instance.get_parent_goals_for_goal(goal_gid, opt_fields=opt_fields) + pprint(api_response) except ApiException as e: - print("Exception when calling GoalsApi->get_parent_goals_for_goal: %s\n" % e) + print("Exception when calling GoalsApi->get_parent_goals_for_goal: %s\n" % e) ``` ### Parameters @@ -411,19 +418,20 @@ from pprint import pprint # Configure OAuth2 access token for authorization: oauth2 configuration = asana.Configuration() configuration.access_token = '' +api_client = asana.ApiClient(configuration) # create an instance of the API class -api_instance = asana.GoalsApi(asana.ApiClient(configuration)) +api_instance = asana.GoalsApi(api_client) body = asana.GoalGidRemoveFollowersBody({"param1": "value1", "param2": "value2",}) # GoalGidRemoveFollowersBody | The followers to be removed as collaborators goal_gid = '12345' # str | Globally unique identifier for the goal. opt_fields = ["current_status_update","current_status_update.resource_subtype","current_status_update.title","due_on","followers","followers.name","html_notes","is_workspace_level","liked","likes","likes.user","likes.user.name","metric","metric.can_manage","metric.currency_code","metric.current_display_value","metric.current_number_value","metric.initial_number_value","metric.precision","metric.progress_source","metric.resource_subtype","metric.target_number_value","metric.unit","name","notes","num_likes","owner","owner.name","start_on","status","team","team.name","time_period","time_period.display_name","time_period.end_on","time_period.period","time_period.start_on","workspace","workspace.name"] # list[str] | This endpoint returns a compact resource, which excludes some properties by default. To include those optional properties, set this query parameter to a comma-separated list of the properties you wish to include. (optional) try: - # Remove a collaborator from a goal - api_response = api_instance.remove_followers(body, goal_gid, opt_fields=opt_fields) - pprint(api_response) + # Remove a collaborator from a goal + api_response = api_instance.remove_followers(body, goal_gid, opt_fields=opt_fields) + pprint(api_response) except ApiException as e: - print("Exception when calling GoalsApi->remove_followers: %s\n" % e) + print("Exception when calling GoalsApi->remove_followers: %s\n" % e) ``` ### Parameters @@ -465,19 +473,20 @@ from pprint import pprint # Configure OAuth2 access token for authorization: oauth2 configuration = asana.Configuration() configuration.access_token = '' +api_client = asana.ApiClient(configuration) # create an instance of the API class -api_instance = asana.GoalsApi(asana.ApiClient(configuration)) +api_instance = asana.GoalsApi(api_client) body = asana.GoalsGoalGidBody({"param1": "value1", "param2": "value2",}) # GoalsGoalGidBody | The updated fields for the goal. goal_gid = '12345' # str | Globally unique identifier for the goal. opt_fields = ["current_status_update","current_status_update.resource_subtype","current_status_update.title","due_on","followers","followers.name","html_notes","is_workspace_level","liked","likes","likes.user","likes.user.name","metric","metric.can_manage","metric.currency_code","metric.current_display_value","metric.current_number_value","metric.initial_number_value","metric.precision","metric.progress_source","metric.resource_subtype","metric.target_number_value","metric.unit","name","notes","num_likes","owner","owner.name","start_on","status","team","team.name","time_period","time_period.display_name","time_period.end_on","time_period.period","time_period.start_on","workspace","workspace.name"] # list[str] | This endpoint returns a compact resource, which excludes some properties by default. To include those optional properties, set this query parameter to a comma-separated list of the properties you wish to include. (optional) try: - # Update a goal - api_response = api_instance.update_goal(body, goal_gid, opt_fields=opt_fields) - pprint(api_response) + # Update a goal + api_response = api_instance.update_goal(body, goal_gid, opt_fields=opt_fields) + pprint(api_response) except ApiException as e: - print("Exception when calling GoalsApi->update_goal: %s\n" % e) + print("Exception when calling GoalsApi->update_goal: %s\n" % e) ``` ### Parameters @@ -519,19 +528,20 @@ from pprint import pprint # Configure OAuth2 access token for authorization: oauth2 configuration = asana.Configuration() configuration.access_token = '' +api_client = asana.ApiClient(configuration) # create an instance of the API class -api_instance = asana.GoalsApi(asana.ApiClient(configuration)) +api_instance = asana.GoalsApi(api_client) body = asana.GoalGidSetMetricCurrentValueBody({"param1": "value1", "param2": "value2",}) # GoalGidSetMetricCurrentValueBody | The updated fields for the goal metric. goal_gid = '12345' # str | Globally unique identifier for the goal. opt_fields = ["current_status_update","current_status_update.resource_subtype","current_status_update.title","due_on","followers","followers.name","html_notes","is_workspace_level","liked","likes","likes.user","likes.user.name","metric","metric.can_manage","metric.currency_code","metric.current_display_value","metric.current_number_value","metric.initial_number_value","metric.precision","metric.progress_source","metric.resource_subtype","metric.target_number_value","metric.unit","name","notes","num_likes","owner","owner.name","start_on","status","team","team.name","time_period","time_period.display_name","time_period.end_on","time_period.period","time_period.start_on","workspace","workspace.name"] # list[str] | This endpoint returns a compact resource, which excludes some properties by default. To include those optional properties, set this query parameter to a comma-separated list of the properties you wish to include. (optional) try: - # Update a goal metric - api_response = api_instance.update_goal_metric(body, goal_gid, opt_fields=opt_fields) - pprint(api_response) + # Update a goal metric + api_response = api_instance.update_goal_metric(body, goal_gid, opt_fields=opt_fields) + pprint(api_response) except ApiException as e: - print("Exception when calling GoalsApi->update_goal_metric: %s\n" % e) + print("Exception when calling GoalsApi->update_goal_metric: %s\n" % e) ``` ### Parameters diff --git a/docs/GoalsApi.yaml b/docs/GoalsApi.yaml index 3dd90472..3fbbd149 100644 --- a/docs/GoalsApi.yaml +++ b/docs/GoalsApi.yaml @@ -7,19 +7,20 @@ GoalsApi: # Configure OAuth2 access token for authorization: oauth2 configuration = asana.Configuration() configuration.access_token = '' + api_client = asana.ApiClient(configuration) # create an instance of the API class - api_instance = asana.GoalsApi(asana.ApiClient(configuration)) + api_instance = asana.GoalsApi(api_client) body = asana.GoalGidAddFollowersBody({"param1": "value1", "param2": "value2",}) # GoalGidAddFollowersBody | The followers to be added as collaborators goal_gid = '12345' # str | Globally unique identifier for the goal. opt_fields = ["current_status_update","current_status_update.resource_subtype","current_status_update.title","due_on","followers","followers.name","html_notes","is_workspace_level","liked","likes","likes.user","likes.user.name","metric","metric.can_manage","metric.currency_code","metric.current_display_value","metric.current_number_value","metric.initial_number_value","metric.precision","metric.progress_source","metric.resource_subtype","metric.target_number_value","metric.unit","name","notes","num_likes","owner","owner.name","start_on","status","team","team.name","time_period","time_period.display_name","time_period.end_on","time_period.period","time_period.start_on","workspace","workspace.name"] # list[str] | This endpoint returns a compact resource, which excludes some properties by default. To include those optional properties, set this query parameter to a comma-separated list of the properties you wish to include. (optional) try: - # Add a collaborator to a goal - api_response = api_instance.add_followers(body, goal_gid, opt_fields=opt_fields) - pprint(api_response) + # Add a collaborator to a goal + api_response = api_instance.add_followers(body, goal_gid, opt_fields=opt_fields) + pprint(api_response) except ApiException as e: - print("Exception when calling GoalsApi->add_followers: %s\n" % e) + print("Exception when calling GoalsApi->add_followers: %s\n" % e) create_goal: |- import asana from asana.rest import ApiException @@ -28,18 +29,19 @@ GoalsApi: # Configure OAuth2 access token for authorization: oauth2 configuration = asana.Configuration() configuration.access_token = '' + api_client = asana.ApiClient(configuration) # create an instance of the API class - api_instance = asana.GoalsApi(asana.ApiClient(configuration)) + api_instance = asana.GoalsApi(api_client) body = asana.GoalsBody({"param1": "value1", "param2": "value2",}) # GoalsBody | The goal to create. opt_fields = ["current_status_update","current_status_update.resource_subtype","current_status_update.title","due_on","followers","followers.name","html_notes","is_workspace_level","liked","likes","likes.user","likes.user.name","metric","metric.can_manage","metric.currency_code","metric.current_display_value","metric.current_number_value","metric.initial_number_value","metric.precision","metric.progress_source","metric.resource_subtype","metric.target_number_value","metric.unit","name","notes","num_likes","owner","owner.name","start_on","status","team","team.name","time_period","time_period.display_name","time_period.end_on","time_period.period","time_period.start_on","workspace","workspace.name"] # list[str] | This endpoint returns a compact resource, which excludes some properties by default. To include those optional properties, set this query parameter to a comma-separated list of the properties you wish to include. (optional) try: - # Create a goal - api_response = api_instance.create_goal(body, opt_fields=opt_fields) - pprint(api_response) + # Create a goal + api_response = api_instance.create_goal(body, opt_fields=opt_fields) + pprint(api_response) except ApiException as e: - print("Exception when calling GoalsApi->create_goal: %s\n" % e) + print("Exception when calling GoalsApi->create_goal: %s\n" % e) create_goal_metric: |- import asana from asana.rest import ApiException @@ -48,19 +50,20 @@ GoalsApi: # Configure OAuth2 access token for authorization: oauth2 configuration = asana.Configuration() configuration.access_token = '' + api_client = asana.ApiClient(configuration) # create an instance of the API class - api_instance = asana.GoalsApi(asana.ApiClient(configuration)) + api_instance = asana.GoalsApi(api_client) body = asana.GoalGidSetMetricBody({"param1": "value1", "param2": "value2",}) # GoalGidSetMetricBody | The goal metric to create. goal_gid = '12345' # str | Globally unique identifier for the goal. opt_fields = ["current_status_update","current_status_update.resource_subtype","current_status_update.title","due_on","followers","followers.name","html_notes","is_workspace_level","liked","likes","likes.user","likes.user.name","metric","metric.can_manage","metric.currency_code","metric.current_display_value","metric.current_number_value","metric.initial_number_value","metric.precision","metric.progress_source","metric.resource_subtype","metric.target_number_value","metric.unit","name","notes","num_likes","owner","owner.name","start_on","status","team","team.name","time_period","time_period.display_name","time_period.end_on","time_period.period","time_period.start_on","workspace","workspace.name"] # list[str] | This endpoint returns a compact resource, which excludes some properties by default. To include those optional properties, set this query parameter to a comma-separated list of the properties you wish to include. (optional) try: - # Create a goal metric - api_response = api_instance.create_goal_metric(body, goal_gid, opt_fields=opt_fields) - pprint(api_response) + # Create a goal metric + api_response = api_instance.create_goal_metric(body, goal_gid, opt_fields=opt_fields) + pprint(api_response) except ApiException as e: - print("Exception when calling GoalsApi->create_goal_metric: %s\n" % e) + print("Exception when calling GoalsApi->create_goal_metric: %s\n" % e) delete_goal: |- import asana from asana.rest import ApiException @@ -69,17 +72,18 @@ GoalsApi: # Configure OAuth2 access token for authorization: oauth2 configuration = asana.Configuration() configuration.access_token = '' + api_client = asana.ApiClient(configuration) # create an instance of the API class - api_instance = asana.GoalsApi(asana.ApiClient(configuration)) + api_instance = asana.GoalsApi(api_client) goal_gid = '12345' # str | Globally unique identifier for the goal. try: - # Delete a goal - api_response = api_instance.delete_goal(goal_gid) - pprint(api_response) + # Delete a goal + api_response = api_instance.delete_goal(goal_gid) + pprint(api_response) except ApiException as e: - print("Exception when calling GoalsApi->delete_goal: %s\n" % e) + print("Exception when calling GoalsApi->delete_goal: %s\n" % e) get_goal: |- import asana from asana.rest import ApiException @@ -88,18 +92,19 @@ GoalsApi: # Configure OAuth2 access token for authorization: oauth2 configuration = asana.Configuration() configuration.access_token = '' + api_client = asana.ApiClient(configuration) # create an instance of the API class - api_instance = asana.GoalsApi(asana.ApiClient(configuration)) + api_instance = asana.GoalsApi(api_client) goal_gid = '12345' # str | Globally unique identifier for the goal. opt_fields = ["current_status_update","current_status_update.resource_subtype","current_status_update.title","due_on","followers","followers.name","html_notes","is_workspace_level","liked","likes","likes.user","likes.user.name","metric","metric.can_manage","metric.currency_code","metric.current_display_value","metric.current_number_value","metric.initial_number_value","metric.precision","metric.progress_source","metric.resource_subtype","metric.target_number_value","metric.unit","name","notes","num_likes","owner","owner.name","start_on","status","team","team.name","time_period","time_period.display_name","time_period.end_on","time_period.period","time_period.start_on","workspace","workspace.name"] # list[str] | This endpoint returns a compact resource, which excludes some properties by default. To include those optional properties, set this query parameter to a comma-separated list of the properties you wish to include. (optional) try: - # Get a goal - api_response = api_instance.get_goal(goal_gid, opt_fields=opt_fields) - pprint(api_response) + # Get a goal + api_response = api_instance.get_goal(goal_gid, opt_fields=opt_fields) + pprint(api_response) except ApiException as e: - print("Exception when calling GoalsApi->get_goal: %s\n" % e) + print("Exception when calling GoalsApi->get_goal: %s\n" % e) get_goals: |- import asana from asana.rest import ApiException @@ -108,9 +113,10 @@ GoalsApi: # Configure OAuth2 access token for authorization: oauth2 configuration = asana.Configuration() configuration.access_token = '' + api_client = asana.ApiClient(configuration) # create an instance of the API class - api_instance = asana.GoalsApi(asana.ApiClient(configuration)) + api_instance = asana.GoalsApi(api_client) portfolio = '159874' # str | Globally unique identifier for supporting portfolio. (optional) project = '512241' # str | Globally unique identifier for supporting project. (optional) is_workspace_level = false # bool | Filter to goals with is_workspace_level set to query value. Must be used with the workspace parameter. (optional) @@ -122,11 +128,11 @@ GoalsApi: opt_fields = ["current_status_update","current_status_update.resource_subtype","current_status_update.title","due_on","followers","followers.name","html_notes","is_workspace_level","liked","likes","likes.user","likes.user.name","metric","metric.can_manage","metric.currency_code","metric.current_display_value","metric.current_number_value","metric.initial_number_value","metric.precision","metric.progress_source","metric.resource_subtype","metric.target_number_value","metric.unit","name","notes","num_likes","offset","owner","owner.name","path","start_on","status","team","team.name","time_period","time_period.display_name","time_period.end_on","time_period.period","time_period.start_on","uri","workspace","workspace.name"] # list[str] | This endpoint returns a compact resource, which excludes some properties by default. To include those optional properties, set this query parameter to a comma-separated list of the properties you wish to include. (optional) try: - # Get goals - api_response = api_instance.get_goals(portfolio=portfolio, project=project, is_workspace_level=is_workspace_level, team=team, workspace=workspace, time_periods=time_periods, limit=limit, offset=offset, opt_fields=opt_fields) - pprint(api_response) + # Get goals + api_response = api_instance.get_goals(portfolio=portfolio, project=project, is_workspace_level=is_workspace_level, team=team, workspace=workspace, time_periods=time_periods, limit=limit, offset=offset, opt_fields=opt_fields) + pprint(api_response) except ApiException as e: - print("Exception when calling GoalsApi->get_goals: %s\n" % e) + print("Exception when calling GoalsApi->get_goals: %s\n" % e) get_parent_goals_for_goal: |- import asana from asana.rest import ApiException @@ -135,18 +141,19 @@ GoalsApi: # Configure OAuth2 access token for authorization: oauth2 configuration = asana.Configuration() configuration.access_token = '' + api_client = asana.ApiClient(configuration) # create an instance of the API class - api_instance = asana.GoalsApi(asana.ApiClient(configuration)) + api_instance = asana.GoalsApi(api_client) goal_gid = '12345' # str | Globally unique identifier for the goal. opt_fields = ["current_status_update","current_status_update.resource_subtype","current_status_update.title","due_on","followers","followers.name","html_notes","is_workspace_level","liked","likes","likes.user","likes.user.name","metric","metric.can_manage","metric.currency_code","metric.current_display_value","metric.current_number_value","metric.initial_number_value","metric.precision","metric.progress_source","metric.resource_subtype","metric.target_number_value","metric.unit","name","notes","num_likes","owner","owner.name","start_on","status","team","team.name","time_period","time_period.display_name","time_period.end_on","time_period.period","time_period.start_on","workspace","workspace.name"] # list[str] | This endpoint returns a compact resource, which excludes some properties by default. To include those optional properties, set this query parameter to a comma-separated list of the properties you wish to include. (optional) try: - # Get parent goals from a goal - api_response = api_instance.get_parent_goals_for_goal(goal_gid, opt_fields=opt_fields) - pprint(api_response) + # Get parent goals from a goal + api_response = api_instance.get_parent_goals_for_goal(goal_gid, opt_fields=opt_fields) + pprint(api_response) except ApiException as e: - print("Exception when calling GoalsApi->get_parent_goals_for_goal: %s\n" % e) + print("Exception when calling GoalsApi->get_parent_goals_for_goal: %s\n" % e) remove_followers: |- import asana from asana.rest import ApiException @@ -155,19 +162,20 @@ GoalsApi: # Configure OAuth2 access token for authorization: oauth2 configuration = asana.Configuration() configuration.access_token = '' + api_client = asana.ApiClient(configuration) # create an instance of the API class - api_instance = asana.GoalsApi(asana.ApiClient(configuration)) + api_instance = asana.GoalsApi(api_client) body = asana.GoalGidRemoveFollowersBody({"param1": "value1", "param2": "value2",}) # GoalGidRemoveFollowersBody | The followers to be removed as collaborators goal_gid = '12345' # str | Globally unique identifier for the goal. opt_fields = ["current_status_update","current_status_update.resource_subtype","current_status_update.title","due_on","followers","followers.name","html_notes","is_workspace_level","liked","likes","likes.user","likes.user.name","metric","metric.can_manage","metric.currency_code","metric.current_display_value","metric.current_number_value","metric.initial_number_value","metric.precision","metric.progress_source","metric.resource_subtype","metric.target_number_value","metric.unit","name","notes","num_likes","owner","owner.name","start_on","status","team","team.name","time_period","time_period.display_name","time_period.end_on","time_period.period","time_period.start_on","workspace","workspace.name"] # list[str] | This endpoint returns a compact resource, which excludes some properties by default. To include those optional properties, set this query parameter to a comma-separated list of the properties you wish to include. (optional) try: - # Remove a collaborator from a goal - api_response = api_instance.remove_followers(body, goal_gid, opt_fields=opt_fields) - pprint(api_response) + # Remove a collaborator from a goal + api_response = api_instance.remove_followers(body, goal_gid, opt_fields=opt_fields) + pprint(api_response) except ApiException as e: - print("Exception when calling GoalsApi->remove_followers: %s\n" % e) + print("Exception when calling GoalsApi->remove_followers: %s\n" % e) update_goal: |- import asana from asana.rest import ApiException @@ -176,19 +184,20 @@ GoalsApi: # Configure OAuth2 access token for authorization: oauth2 configuration = asana.Configuration() configuration.access_token = '' + api_client = asana.ApiClient(configuration) # create an instance of the API class - api_instance = asana.GoalsApi(asana.ApiClient(configuration)) + api_instance = asana.GoalsApi(api_client) body = asana.GoalsGoalGidBody({"param1": "value1", "param2": "value2",}) # GoalsGoalGidBody | The updated fields for the goal. goal_gid = '12345' # str | Globally unique identifier for the goal. opt_fields = ["current_status_update","current_status_update.resource_subtype","current_status_update.title","due_on","followers","followers.name","html_notes","is_workspace_level","liked","likes","likes.user","likes.user.name","metric","metric.can_manage","metric.currency_code","metric.current_display_value","metric.current_number_value","metric.initial_number_value","metric.precision","metric.progress_source","metric.resource_subtype","metric.target_number_value","metric.unit","name","notes","num_likes","owner","owner.name","start_on","status","team","team.name","time_period","time_period.display_name","time_period.end_on","time_period.period","time_period.start_on","workspace","workspace.name"] # list[str] | This endpoint returns a compact resource, which excludes some properties by default. To include those optional properties, set this query parameter to a comma-separated list of the properties you wish to include. (optional) try: - # Update a goal - api_response = api_instance.update_goal(body, goal_gid, opt_fields=opt_fields) - pprint(api_response) + # Update a goal + api_response = api_instance.update_goal(body, goal_gid, opt_fields=opt_fields) + pprint(api_response) except ApiException as e: - print("Exception when calling GoalsApi->update_goal: %s\n" % e) + print("Exception when calling GoalsApi->update_goal: %s\n" % e) update_goal_metric: |- import asana from asana.rest import ApiException @@ -197,16 +206,17 @@ GoalsApi: # Configure OAuth2 access token for authorization: oauth2 configuration = asana.Configuration() configuration.access_token = '' + api_client = asana.ApiClient(configuration) # create an instance of the API class - api_instance = asana.GoalsApi(asana.ApiClient(configuration)) + api_instance = asana.GoalsApi(api_client) body = asana.GoalGidSetMetricCurrentValueBody({"param1": "value1", "param2": "value2",}) # GoalGidSetMetricCurrentValueBody | The updated fields for the goal metric. goal_gid = '12345' # str | Globally unique identifier for the goal. opt_fields = ["current_status_update","current_status_update.resource_subtype","current_status_update.title","due_on","followers","followers.name","html_notes","is_workspace_level","liked","likes","likes.user","likes.user.name","metric","metric.can_manage","metric.currency_code","metric.current_display_value","metric.current_number_value","metric.initial_number_value","metric.precision","metric.progress_source","metric.resource_subtype","metric.target_number_value","metric.unit","name","notes","num_likes","owner","owner.name","start_on","status","team","team.name","time_period","time_period.display_name","time_period.end_on","time_period.period","time_period.start_on","workspace","workspace.name"] # list[str] | This endpoint returns a compact resource, which excludes some properties by default. To include those optional properties, set this query parameter to a comma-separated list of the properties you wish to include. (optional) try: - # Update a goal metric - api_response = api_instance.update_goal_metric(body, goal_gid, opt_fields=opt_fields) - pprint(api_response) + # Update a goal metric + api_response = api_instance.update_goal_metric(body, goal_gid, opt_fields=opt_fields) + pprint(api_response) except ApiException as e: - print("Exception when calling GoalsApi->update_goal_metric: %s\n" % e) + print("Exception when calling GoalsApi->update_goal_metric: %s\n" % e) diff --git a/docs/JobsApi.md b/docs/JobsApi.md index 3cff52c0..a199969b 100644 --- a/docs/JobsApi.md +++ b/docs/JobsApi.md @@ -22,18 +22,19 @@ from pprint import pprint # Configure OAuth2 access token for authorization: oauth2 configuration = asana.Configuration() configuration.access_token = '' +api_client = asana.ApiClient(configuration) # create an instance of the API class -api_instance = asana.JobsApi(asana.ApiClient(configuration)) +api_instance = asana.JobsApi(api_client) job_gid = '12345' # str | Globally unique identifier for the job. opt_fields = ["new_project","new_project.name","new_project_template","new_project_template.name","new_task","new_task.created_by","new_task.name","new_task.resource_subtype","resource_subtype","status"] # list[str] | This endpoint returns a compact resource, which excludes some properties by default. To include those optional properties, set this query parameter to a comma-separated list of the properties you wish to include. (optional) try: - # Get a job by id - api_response = api_instance.get_job(job_gid, opt_fields=opt_fields) - pprint(api_response) + # Get a job by id + api_response = api_instance.get_job(job_gid, opt_fields=opt_fields) + pprint(api_response) except ApiException as e: - print("Exception when calling JobsApi->get_job: %s\n" % e) + print("Exception when calling JobsApi->get_job: %s\n" % e) ``` ### Parameters diff --git a/docs/JobsApi.yaml b/docs/JobsApi.yaml index 75bf72f4..cbf4a3a4 100644 --- a/docs/JobsApi.yaml +++ b/docs/JobsApi.yaml @@ -7,15 +7,16 @@ JobsApi: # Configure OAuth2 access token for authorization: oauth2 configuration = asana.Configuration() configuration.access_token = '' + api_client = asana.ApiClient(configuration) # create an instance of the API class - api_instance = asana.JobsApi(asana.ApiClient(configuration)) + api_instance = asana.JobsApi(api_client) job_gid = '12345' # str | Globally unique identifier for the job. opt_fields = ["new_project","new_project.name","new_project_template","new_project_template.name","new_task","new_task.created_by","new_task.name","new_task.resource_subtype","resource_subtype","status"] # list[str] | This endpoint returns a compact resource, which excludes some properties by default. To include those optional properties, set this query parameter to a comma-separated list of the properties you wish to include. (optional) try: - # Get a job by id - api_response = api_instance.get_job(job_gid, opt_fields=opt_fields) - pprint(api_response) + # Get a job by id + api_response = api_instance.get_job(job_gid, opt_fields=opt_fields) + pprint(api_response) except ApiException as e: - print("Exception when calling JobsApi->get_job: %s\n" % e) + print("Exception when calling JobsApi->get_job: %s\n" % e) diff --git a/docs/MembershipsApi.md b/docs/MembershipsApi.md index 1d76867e..a2b42f89 100644 --- a/docs/MembershipsApi.md +++ b/docs/MembershipsApi.md @@ -24,17 +24,18 @@ from pprint import pprint # Configure OAuth2 access token for authorization: oauth2 configuration = asana.Configuration() configuration.access_token = '' +api_client = asana.ApiClient(configuration) # create an instance of the API class -api_instance = asana.MembershipsApi(asana.ApiClient(configuration)) +api_instance = asana.MembershipsApi(api_client) body = asana.MembershipsBody({"param1": "value1", "param2": "value2",}) # MembershipsBody | The updated fields for the membership. (optional) try: - # Create a membership - api_response = api_instance.create_membership(body=body) - pprint(api_response) + # Create a membership + api_response = api_instance.create_membership(body=body) + pprint(api_response) except ApiException as e: - print("Exception when calling MembershipsApi->create_membership: %s\n" % e) + print("Exception when calling MembershipsApi->create_membership: %s\n" % e) ``` ### Parameters @@ -74,17 +75,18 @@ from pprint import pprint # Configure OAuth2 access token for authorization: oauth2 configuration = asana.Configuration() configuration.access_token = '' +api_client = asana.ApiClient(configuration) # create an instance of the API class -api_instance = asana.MembershipsApi(asana.ApiClient(configuration)) +api_instance = asana.MembershipsApi(api_client) membership_gid = '12345' # str | Globally unique identifier for the membership. try: - # Delete a membership - api_response = api_instance.delete_membership(membership_gid) - pprint(api_response) + # Delete a membership + api_response = api_instance.delete_membership(membership_gid) + pprint(api_response) except ApiException as e: - print("Exception when calling MembershipsApi->delete_membership: %s\n" % e) + print("Exception when calling MembershipsApi->delete_membership: %s\n" % e) ``` ### Parameters @@ -113,7 +115,7 @@ Name | Type | Description | Notes Get multiple memberships -Returns compact `goal_membership` records. The possible types for `parent` in this request are `goal`. An additional member (user GID or team GID) can be passed in to filter to a specific membership. +Returns compact `goal_membership` or `project_membership` records. The possible types for `parent` in this request are `goal` or `project`. An additional member (user GID or team GID) can be passed in to filter to a specific membership. ### Example ```python @@ -124,28 +126,29 @@ from pprint import pprint # Configure OAuth2 access token for authorization: oauth2 configuration = asana.Configuration() configuration.access_token = '' +api_client = asana.ApiClient(configuration) # create an instance of the API class -api_instance = asana.MembershipsApi(asana.ApiClient(configuration)) -parent = '159874' # str | Globally unique identifier for `goal`. (optional) +api_instance = asana.MembershipsApi(api_client) +parent = '159874' # str | Globally unique identifier for `goal` or `project`. (optional) member = '1061493' # str | Globally unique identifier for `team` or `user`. (optional) limit = 50 # int | Results per page. The number of objects to return per page. The value must be between 1 and 100. (optional) offset = 'eyJ0eXAiOJiKV1iQLCJhbGciOiJIUzI1NiJ9' # 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.' (optional) opt_fields = ["offset","path","uri"] # list[str] | This endpoint returns a compact resource, which excludes some properties by default. To include those optional properties, set this query parameter to a comma-separated list of the properties you wish to include. (optional) try: - # Get multiple memberships - api_response = api_instance.get_memberships(parent=parent, member=member, limit=limit, offset=offset, opt_fields=opt_fields) - pprint(api_response) + # Get multiple memberships + api_response = api_instance.get_memberships(parent=parent, member=member, limit=limit, offset=offset, opt_fields=opt_fields) + pprint(api_response) except ApiException as e: - print("Exception when calling MembershipsApi->get_memberships: %s\n" % e) + print("Exception when calling MembershipsApi->get_memberships: %s\n" % e) ``` ### Parameters Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **parent** | **str**| Globally unique identifier for `goal`. | [optional] + **parent** | **str**| Globally unique identifier for `goal` or `project`. | [optional] **member** | **str**| Globally unique identifier for `team` or `user`. | [optional] **limit** | **int**| Results per page. The number of objects to return per page. The value must be between 1 and 100. | [optional] **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.' | [optional] diff --git a/docs/MembershipsApi.yaml b/docs/MembershipsApi.yaml index 938c74a5..96626f83 100644 --- a/docs/MembershipsApi.yaml +++ b/docs/MembershipsApi.yaml @@ -7,17 +7,18 @@ MembershipsApi: # Configure OAuth2 access token for authorization: oauth2 configuration = asana.Configuration() configuration.access_token = '' + api_client = asana.ApiClient(configuration) # create an instance of the API class - api_instance = asana.MembershipsApi(asana.ApiClient(configuration)) + api_instance = asana.MembershipsApi(api_client) body = asana.MembershipsBody({"param1": "value1", "param2": "value2",}) # MembershipsBody | The updated fields for the membership. (optional) try: - # Create a membership - api_response = api_instance.create_membership(body=body) - pprint(api_response) + # Create a membership + api_response = api_instance.create_membership(body=body) + pprint(api_response) except ApiException as e: - print("Exception when calling MembershipsApi->create_membership: %s\n" % e) + print("Exception when calling MembershipsApi->create_membership: %s\n" % e) delete_membership: |- import asana from asana.rest import ApiException @@ -26,17 +27,18 @@ MembershipsApi: # Configure OAuth2 access token for authorization: oauth2 configuration = asana.Configuration() configuration.access_token = '' + api_client = asana.ApiClient(configuration) # create an instance of the API class - api_instance = asana.MembershipsApi(asana.ApiClient(configuration)) + api_instance = asana.MembershipsApi(api_client) membership_gid = '12345' # str | Globally unique identifier for the membership. try: - # Delete a membership - api_response = api_instance.delete_membership(membership_gid) - pprint(api_response) + # Delete a membership + api_response = api_instance.delete_membership(membership_gid) + pprint(api_response) except ApiException as e: - print("Exception when calling MembershipsApi->delete_membership: %s\n" % e) + print("Exception when calling MembershipsApi->delete_membership: %s\n" % e) get_memberships: |- import asana from asana.rest import ApiException @@ -45,18 +47,19 @@ MembershipsApi: # Configure OAuth2 access token for authorization: oauth2 configuration = asana.Configuration() configuration.access_token = '' + api_client = asana.ApiClient(configuration) # create an instance of the API class - api_instance = asana.MembershipsApi(asana.ApiClient(configuration)) - parent = '159874' # str | Globally unique identifier for `goal`. (optional) + api_instance = asana.MembershipsApi(api_client) + parent = '159874' # str | Globally unique identifier for `goal` or `project`. (optional) member = '1061493' # str | Globally unique identifier for `team` or `user`. (optional) limit = 50 # int | Results per page. The number of objects to return per page. The value must be between 1 and 100. (optional) offset = 'eyJ0eXAiOJiKV1iQLCJhbGciOiJIUzI1NiJ9' # 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.' (optional) opt_fields = ["offset","path","uri"] # list[str] | This endpoint returns a compact resource, which excludes some properties by default. To include those optional properties, set this query parameter to a comma-separated list of the properties you wish to include. (optional) try: - # Get multiple memberships - api_response = api_instance.get_memberships(parent=parent, member=member, limit=limit, offset=offset, opt_fields=opt_fields) - pprint(api_response) + # Get multiple memberships + api_response = api_instance.get_memberships(parent=parent, member=member, limit=limit, offset=offset, opt_fields=opt_fields) + pprint(api_response) except ApiException as e: - print("Exception when calling MembershipsApi->get_memberships: %s\n" % e) + print("Exception when calling MembershipsApi->get_memberships: %s\n" % e) diff --git a/docs/OrganizationExportsApi.md b/docs/OrganizationExportsApi.md index 82e6607e..71262036 100644 --- a/docs/OrganizationExportsApi.md +++ b/docs/OrganizationExportsApi.md @@ -23,18 +23,19 @@ from pprint import pprint # Configure OAuth2 access token for authorization: oauth2 configuration = asana.Configuration() configuration.access_token = '' +api_client = asana.ApiClient(configuration) # create an instance of the API class -api_instance = asana.OrganizationExportsApi(asana.ApiClient(configuration)) +api_instance = asana.OrganizationExportsApi(api_client) body = asana.OrganizationExportsBody({"param1": "value1", "param2": "value2",}) # OrganizationExportsBody | The organization to export. opt_fields = ["created_at","download_url","organization","organization.name","state"] # list[str] | This endpoint returns a compact resource, which excludes some properties by default. To include those optional properties, set this query parameter to a comma-separated list of the properties you wish to include. (optional) try: - # Create an organization export request - api_response = api_instance.create_organization_export(body, opt_fields=opt_fields) - pprint(api_response) + # Create an organization export request + api_response = api_instance.create_organization_export(body, opt_fields=opt_fields) + pprint(api_response) except ApiException as e: - print("Exception when calling OrganizationExportsApi->create_organization_export: %s\n" % e) + print("Exception when calling OrganizationExportsApi->create_organization_export: %s\n" % e) ``` ### Parameters @@ -75,18 +76,19 @@ from pprint import pprint # Configure OAuth2 access token for authorization: oauth2 configuration = asana.Configuration() configuration.access_token = '' +api_client = asana.ApiClient(configuration) # create an instance of the API class -api_instance = asana.OrganizationExportsApi(asana.ApiClient(configuration)) +api_instance = asana.OrganizationExportsApi(api_client) organization_export_gid = '12345' # str | Globally unique identifier for the organization export. opt_fields = ["created_at","download_url","organization","organization.name","state"] # list[str] | This endpoint returns a compact resource, which excludes some properties by default. To include those optional properties, set this query parameter to a comma-separated list of the properties you wish to include. (optional) try: - # Get details on an org export request - api_response = api_instance.get_organization_export(organization_export_gid, opt_fields=opt_fields) - pprint(api_response) + # Get details on an org export request + api_response = api_instance.get_organization_export(organization_export_gid, opt_fields=opt_fields) + pprint(api_response) except ApiException as e: - print("Exception when calling OrganizationExportsApi->get_organization_export: %s\n" % e) + print("Exception when calling OrganizationExportsApi->get_organization_export: %s\n" % e) ``` ### Parameters diff --git a/docs/OrganizationExportsApi.yaml b/docs/OrganizationExportsApi.yaml index 8399e9da..74dda461 100644 --- a/docs/OrganizationExportsApi.yaml +++ b/docs/OrganizationExportsApi.yaml @@ -7,18 +7,19 @@ OrganizationExportsApi: # Configure OAuth2 access token for authorization: oauth2 configuration = asana.Configuration() configuration.access_token = '' + api_client = asana.ApiClient(configuration) # create an instance of the API class - api_instance = asana.OrganizationExportsApi(asana.ApiClient(configuration)) + api_instance = asana.OrganizationExportsApi(api_client) body = asana.OrganizationExportsBody({"param1": "value1", "param2": "value2",}) # OrganizationExportsBody | The organization to export. opt_fields = ["created_at","download_url","organization","organization.name","state"] # list[str] | This endpoint returns a compact resource, which excludes some properties by default. To include those optional properties, set this query parameter to a comma-separated list of the properties you wish to include. (optional) try: - # Create an organization export request - api_response = api_instance.create_organization_export(body, opt_fields=opt_fields) - pprint(api_response) + # Create an organization export request + api_response = api_instance.create_organization_export(body, opt_fields=opt_fields) + pprint(api_response) except ApiException as e: - print("Exception when calling OrganizationExportsApi->create_organization_export: %s\n" % e) + print("Exception when calling OrganizationExportsApi->create_organization_export: %s\n" % e) get_organization_export: |- import asana from asana.rest import ApiException @@ -27,15 +28,16 @@ OrganizationExportsApi: # Configure OAuth2 access token for authorization: oauth2 configuration = asana.Configuration() configuration.access_token = '' + api_client = asana.ApiClient(configuration) # create an instance of the API class - api_instance = asana.OrganizationExportsApi(asana.ApiClient(configuration)) + api_instance = asana.OrganizationExportsApi(api_client) organization_export_gid = '12345' # str | Globally unique identifier for the organization export. opt_fields = ["created_at","download_url","organization","organization.name","state"] # list[str] | This endpoint returns a compact resource, which excludes some properties by default. To include those optional properties, set this query parameter to a comma-separated list of the properties you wish to include. (optional) try: - # Get details on an org export request - api_response = api_instance.get_organization_export(organization_export_gid, opt_fields=opt_fields) - pprint(api_response) + # Get details on an org export request + api_response = api_instance.get_organization_export(organization_export_gid, opt_fields=opt_fields) + pprint(api_response) except ApiException as e: - print("Exception when calling OrganizationExportsApi->get_organization_export: %s\n" % e) + print("Exception when calling OrganizationExportsApi->get_organization_export: %s\n" % e) diff --git a/docs/PortfolioMembershipsApi.md b/docs/PortfolioMembershipsApi.md index 5fd6b212..e226b949 100644 --- a/docs/PortfolioMembershipsApi.md +++ b/docs/PortfolioMembershipsApi.md @@ -24,18 +24,19 @@ from pprint import pprint # Configure OAuth2 access token for authorization: oauth2 configuration = asana.Configuration() configuration.access_token = '' +api_client = asana.ApiClient(configuration) # create an instance of the API class -api_instance = asana.PortfolioMembershipsApi(asana.ApiClient(configuration)) +api_instance = asana.PortfolioMembershipsApi(api_client) portfolio_membership_gid = '1331' # str | opt_fields = ["portfolio","portfolio.name","user","user.name"] # list[str] | This endpoint returns a compact resource, which excludes some properties by default. To include those optional properties, set this query parameter to a comma-separated list of the properties you wish to include. (optional) try: - # Get a portfolio membership - api_response = api_instance.get_portfolio_membership(portfolio_membership_gid, opt_fields=opt_fields) - pprint(api_response) + # Get a portfolio membership + api_response = api_instance.get_portfolio_membership(portfolio_membership_gid, opt_fields=opt_fields) + pprint(api_response) except ApiException as e: - print("Exception when calling PortfolioMembershipsApi->get_portfolio_membership: %s\n" % e) + print("Exception when calling PortfolioMembershipsApi->get_portfolio_membership: %s\n" % e) ``` ### Parameters @@ -76,9 +77,10 @@ from pprint import pprint # Configure OAuth2 access token for authorization: oauth2 configuration = asana.Configuration() configuration.access_token = '' +api_client = asana.ApiClient(configuration) # create an instance of the API class -api_instance = asana.PortfolioMembershipsApi(asana.ApiClient(configuration)) +api_instance = asana.PortfolioMembershipsApi(api_client) portfolio = '12345' # str | The portfolio to filter results on. (optional) workspace = '12345' # str | The workspace to filter results on. (optional) user = 'me' # str | A string identifying a user. This can either be the string \"me\", an email, or the gid of a user. (optional) @@ -87,11 +89,11 @@ offset = 'eyJ0eXAiOJiKV1iQLCJhbGciOiJIUzI1NiJ9' # str | Offset token. An offset opt_fields = ["offset","path","portfolio","portfolio.name","uri","user","user.name"] # list[str] | This endpoint returns a compact resource, which excludes some properties by default. To include those optional properties, set this query parameter to a comma-separated list of the properties you wish to include. (optional) try: - # Get multiple portfolio memberships - api_response = api_instance.get_portfolio_memberships(portfolio=portfolio, workspace=workspace, user=user, limit=limit, offset=offset, opt_fields=opt_fields) - pprint(api_response) + # Get multiple portfolio memberships + api_response = api_instance.get_portfolio_memberships(portfolio=portfolio, workspace=workspace, user=user, limit=limit, offset=offset, opt_fields=opt_fields) + pprint(api_response) except ApiException as e: - print("Exception when calling PortfolioMembershipsApi->get_portfolio_memberships: %s\n" % e) + print("Exception when calling PortfolioMembershipsApi->get_portfolio_memberships: %s\n" % e) ``` ### Parameters @@ -136,9 +138,10 @@ from pprint import pprint # Configure OAuth2 access token for authorization: oauth2 configuration = asana.Configuration() configuration.access_token = '' +api_client = asana.ApiClient(configuration) # create an instance of the API class -api_instance = asana.PortfolioMembershipsApi(asana.ApiClient(configuration)) +api_instance = asana.PortfolioMembershipsApi(api_client) portfolio_gid = '12345' # str | Globally unique identifier for the portfolio. user = 'me' # str | A string identifying a user. This can either be the string \"me\", an email, or the gid of a user. (optional) limit = 50 # int | Results per page. The number of objects to return per page. The value must be between 1 and 100. (optional) @@ -146,11 +149,11 @@ offset = 'eyJ0eXAiOJiKV1iQLCJhbGciOiJIUzI1NiJ9' # str | Offset token. An offset opt_fields = ["offset","path","portfolio","portfolio.name","uri","user","user.name"] # list[str] | This endpoint returns a compact resource, which excludes some properties by default. To include those optional properties, set this query parameter to a comma-separated list of the properties you wish to include. (optional) try: - # Get memberships from a portfolio - api_response = api_instance.get_portfolio_memberships_for_portfolio(portfolio_gid, user=user, limit=limit, offset=offset, opt_fields=opt_fields) - pprint(api_response) + # Get memberships from a portfolio + api_response = api_instance.get_portfolio_memberships_for_portfolio(portfolio_gid, user=user, limit=limit, offset=offset, opt_fields=opt_fields) + pprint(api_response) except ApiException as e: - print("Exception when calling PortfolioMembershipsApi->get_portfolio_memberships_for_portfolio: %s\n" % e) + print("Exception when calling PortfolioMembershipsApi->get_portfolio_memberships_for_portfolio: %s\n" % e) ``` ### Parameters diff --git a/docs/PortfolioMembershipsApi.yaml b/docs/PortfolioMembershipsApi.yaml index a28367e5..2e5daeec 100644 --- a/docs/PortfolioMembershipsApi.yaml +++ b/docs/PortfolioMembershipsApi.yaml @@ -7,18 +7,19 @@ PortfolioMembershipsApi: # Configure OAuth2 access token for authorization: oauth2 configuration = asana.Configuration() configuration.access_token = '' + api_client = asana.ApiClient(configuration) # create an instance of the API class - api_instance = asana.PortfolioMembershipsApi(asana.ApiClient(configuration)) + api_instance = asana.PortfolioMembershipsApi(api_client) portfolio_membership_gid = '1331' # str | opt_fields = ["portfolio","portfolio.name","user","user.name"] # list[str] | This endpoint returns a compact resource, which excludes some properties by default. To include those optional properties, set this query parameter to a comma-separated list of the properties you wish to include. (optional) try: - # Get a portfolio membership - api_response = api_instance.get_portfolio_membership(portfolio_membership_gid, opt_fields=opt_fields) - pprint(api_response) + # Get a portfolio membership + api_response = api_instance.get_portfolio_membership(portfolio_membership_gid, opt_fields=opt_fields) + pprint(api_response) except ApiException as e: - print("Exception when calling PortfolioMembershipsApi->get_portfolio_membership: %s\n" % e) + print("Exception when calling PortfolioMembershipsApi->get_portfolio_membership: %s\n" % e) get_portfolio_memberships: |- import asana from asana.rest import ApiException @@ -27,9 +28,10 @@ PortfolioMembershipsApi: # Configure OAuth2 access token for authorization: oauth2 configuration = asana.Configuration() configuration.access_token = '' + api_client = asana.ApiClient(configuration) # create an instance of the API class - api_instance = asana.PortfolioMembershipsApi(asana.ApiClient(configuration)) + api_instance = asana.PortfolioMembershipsApi(api_client) portfolio = '12345' # str | The portfolio to filter results on. (optional) workspace = '12345' # str | The workspace to filter results on. (optional) user = 'me' # str | A string identifying a user. This can either be the string \"me\", an email, or the gid of a user. (optional) @@ -38,11 +40,11 @@ PortfolioMembershipsApi: opt_fields = ["offset","path","portfolio","portfolio.name","uri","user","user.name"] # list[str] | This endpoint returns a compact resource, which excludes some properties by default. To include those optional properties, set this query parameter to a comma-separated list of the properties you wish to include. (optional) try: - # Get multiple portfolio memberships - api_response = api_instance.get_portfolio_memberships(portfolio=portfolio, workspace=workspace, user=user, limit=limit, offset=offset, opt_fields=opt_fields) - pprint(api_response) + # Get multiple portfolio memberships + api_response = api_instance.get_portfolio_memberships(portfolio=portfolio, workspace=workspace, user=user, limit=limit, offset=offset, opt_fields=opt_fields) + pprint(api_response) except ApiException as e: - print("Exception when calling PortfolioMembershipsApi->get_portfolio_memberships: %s\n" % e) + print("Exception when calling PortfolioMembershipsApi->get_portfolio_memberships: %s\n" % e) get_portfolio_memberships_for_portfolio: |- import asana from asana.rest import ApiException @@ -51,9 +53,10 @@ PortfolioMembershipsApi: # Configure OAuth2 access token for authorization: oauth2 configuration = asana.Configuration() configuration.access_token = '' + api_client = asana.ApiClient(configuration) # create an instance of the API class - api_instance = asana.PortfolioMembershipsApi(asana.ApiClient(configuration)) + api_instance = asana.PortfolioMembershipsApi(api_client) portfolio_gid = '12345' # str | Globally unique identifier for the portfolio. user = 'me' # str | A string identifying a user. This can either be the string \"me\", an email, or the gid of a user. (optional) limit = 50 # int | Results per page. The number of objects to return per page. The value must be between 1 and 100. (optional) @@ -61,8 +64,8 @@ PortfolioMembershipsApi: opt_fields = ["offset","path","portfolio","portfolio.name","uri","user","user.name"] # list[str] | This endpoint returns a compact resource, which excludes some properties by default. To include those optional properties, set this query parameter to a comma-separated list of the properties you wish to include. (optional) try: - # Get memberships from a portfolio - api_response = api_instance.get_portfolio_memberships_for_portfolio(portfolio_gid, user=user, limit=limit, offset=offset, opt_fields=opt_fields) - pprint(api_response) + # Get memberships from a portfolio + api_response = api_instance.get_portfolio_memberships_for_portfolio(portfolio_gid, user=user, limit=limit, offset=offset, opt_fields=opt_fields) + pprint(api_response) except ApiException as e: - print("Exception when calling PortfolioMembershipsApi->get_portfolio_memberships_for_portfolio: %s\n" % e) + print("Exception when calling PortfolioMembershipsApi->get_portfolio_memberships_for_portfolio: %s\n" % e) diff --git a/docs/PortfoliosApi.md b/docs/PortfoliosApi.md index 21bd379c..1ce5d284 100644 --- a/docs/PortfoliosApi.md +++ b/docs/PortfoliosApi.md @@ -33,18 +33,19 @@ from pprint import pprint # Configure OAuth2 access token for authorization: oauth2 configuration = asana.Configuration() configuration.access_token = '' +api_client = asana.ApiClient(configuration) # create an instance of the API class -api_instance = asana.PortfoliosApi(asana.ApiClient(configuration)) +api_instance = asana.PortfoliosApi(api_client) body = asana.PortfolioGidAddCustomFieldSettingBody({"param1": "value1", "param2": "value2",}) # PortfolioGidAddCustomFieldSettingBody | Information about the custom field setting. portfolio_gid = '12345' # str | Globally unique identifier for the portfolio. try: - # Add a custom field to a portfolio - api_response = api_instance.add_custom_field_setting_for_portfolio(body, portfolio_gid) - pprint(api_response) + # Add a custom field to a portfolio + api_response = api_instance.add_custom_field_setting_for_portfolio(body, portfolio_gid) + pprint(api_response) except ApiException as e: - print("Exception when calling PortfoliosApi->add_custom_field_setting_for_portfolio: %s\n" % e) + print("Exception when calling PortfoliosApi->add_custom_field_setting_for_portfolio: %s\n" % e) ``` ### Parameters @@ -85,18 +86,19 @@ from pprint import pprint # Configure OAuth2 access token for authorization: oauth2 configuration = asana.Configuration() configuration.access_token = '' +api_client = asana.ApiClient(configuration) # create an instance of the API class -api_instance = asana.PortfoliosApi(asana.ApiClient(configuration)) +api_instance = asana.PortfoliosApi(api_client) body = asana.PortfolioGidAddItemBody({"param1": "value1", "param2": "value2",}) # PortfolioGidAddItemBody | Information about the item being inserted. portfolio_gid = '12345' # str | Globally unique identifier for the portfolio. try: - # Add a portfolio item - api_response = api_instance.add_item_for_portfolio(body, portfolio_gid) - pprint(api_response) + # Add a portfolio item + api_response = api_instance.add_item_for_portfolio(body, portfolio_gid) + pprint(api_response) except ApiException as e: - print("Exception when calling PortfoliosApi->add_item_for_portfolio: %s\n" % e) + print("Exception when calling PortfoliosApi->add_item_for_portfolio: %s\n" % e) ``` ### Parameters @@ -137,19 +139,20 @@ from pprint import pprint # Configure OAuth2 access token for authorization: oauth2 configuration = asana.Configuration() configuration.access_token = '' +api_client = asana.ApiClient(configuration) # create an instance of the API class -api_instance = asana.PortfoliosApi(asana.ApiClient(configuration)) +api_instance = asana.PortfoliosApi(api_client) body = asana.PortfolioGidAddMembersBody({"param1": "value1", "param2": "value2",}) # PortfolioGidAddMembersBody | Information about the members being added. portfolio_gid = '12345' # str | Globally unique identifier for the portfolio. opt_fields = ["color","created_at","created_by","created_by.name","current_status_update","current_status_update.resource_subtype","current_status_update.title","custom_field_settings","custom_field_settings.custom_field","custom_field_settings.custom_field.asana_created_field","custom_field_settings.custom_field.created_by","custom_field_settings.custom_field.created_by.name","custom_field_settings.custom_field.currency_code","custom_field_settings.custom_field.custom_label","custom_field_settings.custom_field.custom_label_position","custom_field_settings.custom_field.date_value","custom_field_settings.custom_field.date_value.date","custom_field_settings.custom_field.date_value.date_time","custom_field_settings.custom_field.description","custom_field_settings.custom_field.display_value","custom_field_settings.custom_field.enabled","custom_field_settings.custom_field.enum_options","custom_field_settings.custom_field.enum_options.color","custom_field_settings.custom_field.enum_options.enabled","custom_field_settings.custom_field.enum_options.name","custom_field_settings.custom_field.enum_value","custom_field_settings.custom_field.enum_value.color","custom_field_settings.custom_field.enum_value.enabled","custom_field_settings.custom_field.enum_value.name","custom_field_settings.custom_field.format","custom_field_settings.custom_field.has_notifications_enabled","custom_field_settings.custom_field.is_formula_field","custom_field_settings.custom_field.is_global_to_workspace","custom_field_settings.custom_field.is_value_read_only","custom_field_settings.custom_field.multi_enum_values","custom_field_settings.custom_field.multi_enum_values.color","custom_field_settings.custom_field.multi_enum_values.enabled","custom_field_settings.custom_field.multi_enum_values.name","custom_field_settings.custom_field.name","custom_field_settings.custom_field.number_value","custom_field_settings.custom_field.people_value","custom_field_settings.custom_field.people_value.name","custom_field_settings.custom_field.precision","custom_field_settings.custom_field.resource_subtype","custom_field_settings.custom_field.text_value","custom_field_settings.custom_field.type","custom_field_settings.is_important","custom_field_settings.parent","custom_field_settings.parent.name","custom_field_settings.project","custom_field_settings.project.name","custom_fields","custom_fields.date_value","custom_fields.date_value.date","custom_fields.date_value.date_time","custom_fields.display_value","custom_fields.enabled","custom_fields.enum_options","custom_fields.enum_options.color","custom_fields.enum_options.enabled","custom_fields.enum_options.name","custom_fields.enum_value","custom_fields.enum_value.color","custom_fields.enum_value.enabled","custom_fields.enum_value.name","custom_fields.is_formula_field","custom_fields.multi_enum_values","custom_fields.multi_enum_values.color","custom_fields.multi_enum_values.enabled","custom_fields.multi_enum_values.name","custom_fields.name","custom_fields.number_value","custom_fields.resource_subtype","custom_fields.text_value","custom_fields.type","due_on","members","members.name","name","owner","owner.name","permalink_url","project_templates","project_templates.name","public","start_on","workspace","workspace.name"] # list[str] | This endpoint returns a compact resource, which excludes some properties by default. To include those optional properties, set this query parameter to a comma-separated list of the properties you wish to include. (optional) try: - # Add users to a portfolio - api_response = api_instance.add_members_for_portfolio(body, portfolio_gid, opt_fields=opt_fields) - pprint(api_response) + # Add users to a portfolio + api_response = api_instance.add_members_for_portfolio(body, portfolio_gid, opt_fields=opt_fields) + pprint(api_response) except ApiException as e: - print("Exception when calling PortfoliosApi->add_members_for_portfolio: %s\n" % e) + print("Exception when calling PortfoliosApi->add_members_for_portfolio: %s\n" % e) ``` ### Parameters @@ -191,18 +194,19 @@ from pprint import pprint # Configure OAuth2 access token for authorization: oauth2 configuration = asana.Configuration() configuration.access_token = '' +api_client = asana.ApiClient(configuration) # create an instance of the API class -api_instance = asana.PortfoliosApi(asana.ApiClient(configuration)) +api_instance = asana.PortfoliosApi(api_client) body = asana.PortfoliosBody({"param1": "value1", "param2": "value2",}) # PortfoliosBody | The portfolio to create. opt_fields = ["color","created_at","created_by","created_by.name","current_status_update","current_status_update.resource_subtype","current_status_update.title","custom_field_settings","custom_field_settings.custom_field","custom_field_settings.custom_field.asana_created_field","custom_field_settings.custom_field.created_by","custom_field_settings.custom_field.created_by.name","custom_field_settings.custom_field.currency_code","custom_field_settings.custom_field.custom_label","custom_field_settings.custom_field.custom_label_position","custom_field_settings.custom_field.date_value","custom_field_settings.custom_field.date_value.date","custom_field_settings.custom_field.date_value.date_time","custom_field_settings.custom_field.description","custom_field_settings.custom_field.display_value","custom_field_settings.custom_field.enabled","custom_field_settings.custom_field.enum_options","custom_field_settings.custom_field.enum_options.color","custom_field_settings.custom_field.enum_options.enabled","custom_field_settings.custom_field.enum_options.name","custom_field_settings.custom_field.enum_value","custom_field_settings.custom_field.enum_value.color","custom_field_settings.custom_field.enum_value.enabled","custom_field_settings.custom_field.enum_value.name","custom_field_settings.custom_field.format","custom_field_settings.custom_field.has_notifications_enabled","custom_field_settings.custom_field.is_formula_field","custom_field_settings.custom_field.is_global_to_workspace","custom_field_settings.custom_field.is_value_read_only","custom_field_settings.custom_field.multi_enum_values","custom_field_settings.custom_field.multi_enum_values.color","custom_field_settings.custom_field.multi_enum_values.enabled","custom_field_settings.custom_field.multi_enum_values.name","custom_field_settings.custom_field.name","custom_field_settings.custom_field.number_value","custom_field_settings.custom_field.people_value","custom_field_settings.custom_field.people_value.name","custom_field_settings.custom_field.precision","custom_field_settings.custom_field.resource_subtype","custom_field_settings.custom_field.text_value","custom_field_settings.custom_field.type","custom_field_settings.is_important","custom_field_settings.parent","custom_field_settings.parent.name","custom_field_settings.project","custom_field_settings.project.name","custom_fields","custom_fields.date_value","custom_fields.date_value.date","custom_fields.date_value.date_time","custom_fields.display_value","custom_fields.enabled","custom_fields.enum_options","custom_fields.enum_options.color","custom_fields.enum_options.enabled","custom_fields.enum_options.name","custom_fields.enum_value","custom_fields.enum_value.color","custom_fields.enum_value.enabled","custom_fields.enum_value.name","custom_fields.is_formula_field","custom_fields.multi_enum_values","custom_fields.multi_enum_values.color","custom_fields.multi_enum_values.enabled","custom_fields.multi_enum_values.name","custom_fields.name","custom_fields.number_value","custom_fields.resource_subtype","custom_fields.text_value","custom_fields.type","due_on","members","members.name","name","owner","owner.name","permalink_url","project_templates","project_templates.name","public","start_on","workspace","workspace.name"] # list[str] | This endpoint returns a compact resource, which excludes some properties by default. To include those optional properties, set this query parameter to a comma-separated list of the properties you wish to include. (optional) try: - # Create a portfolio - api_response = api_instance.create_portfolio(body, opt_fields=opt_fields) - pprint(api_response) + # Create a portfolio + api_response = api_instance.create_portfolio(body, opt_fields=opt_fields) + pprint(api_response) except ApiException as e: - print("Exception when calling PortfoliosApi->create_portfolio: %s\n" % e) + print("Exception when calling PortfoliosApi->create_portfolio: %s\n" % e) ``` ### Parameters @@ -243,17 +247,18 @@ from pprint import pprint # Configure OAuth2 access token for authorization: oauth2 configuration = asana.Configuration() configuration.access_token = '' +api_client = asana.ApiClient(configuration) # create an instance of the API class -api_instance = asana.PortfoliosApi(asana.ApiClient(configuration)) +api_instance = asana.PortfoliosApi(api_client) portfolio_gid = '12345' # str | Globally unique identifier for the portfolio. try: - # Delete a portfolio - api_response = api_instance.delete_portfolio(portfolio_gid) - pprint(api_response) + # Delete a portfolio + api_response = api_instance.delete_portfolio(portfolio_gid) + pprint(api_response) except ApiException as e: - print("Exception when calling PortfoliosApi->delete_portfolio: %s\n" % e) + print("Exception when calling PortfoliosApi->delete_portfolio: %s\n" % e) ``` ### Parameters @@ -293,20 +298,21 @@ from pprint import pprint # Configure OAuth2 access token for authorization: oauth2 configuration = asana.Configuration() configuration.access_token = '' +api_client = asana.ApiClient(configuration) # create an instance of the API class -api_instance = asana.PortfoliosApi(asana.ApiClient(configuration)) +api_instance = asana.PortfoliosApi(api_client) portfolio_gid = '12345' # str | Globally unique identifier for the portfolio. limit = 50 # int | Results per page. The number of objects to return per page. The value must be between 1 and 100. (optional) offset = 'eyJ0eXAiOJiKV1iQLCJhbGciOiJIUzI1NiJ9' # 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.' (optional) opt_fields = ["archived","color","completed","completed_at","completed_by","completed_by.name","created_at","created_from_template","created_from_template.name","current_status","current_status.author","current_status.author.name","current_status.color","current_status.created_at","current_status.created_by","current_status.created_by.name","current_status.html_text","current_status.modified_at","current_status.text","current_status.title","current_status_update","current_status_update.resource_subtype","current_status_update.title","custom_field_settings","custom_field_settings.custom_field","custom_field_settings.custom_field.asana_created_field","custom_field_settings.custom_field.created_by","custom_field_settings.custom_field.created_by.name","custom_field_settings.custom_field.currency_code","custom_field_settings.custom_field.custom_label","custom_field_settings.custom_field.custom_label_position","custom_field_settings.custom_field.date_value","custom_field_settings.custom_field.date_value.date","custom_field_settings.custom_field.date_value.date_time","custom_field_settings.custom_field.description","custom_field_settings.custom_field.display_value","custom_field_settings.custom_field.enabled","custom_field_settings.custom_field.enum_options","custom_field_settings.custom_field.enum_options.color","custom_field_settings.custom_field.enum_options.enabled","custom_field_settings.custom_field.enum_options.name","custom_field_settings.custom_field.enum_value","custom_field_settings.custom_field.enum_value.color","custom_field_settings.custom_field.enum_value.enabled","custom_field_settings.custom_field.enum_value.name","custom_field_settings.custom_field.format","custom_field_settings.custom_field.has_notifications_enabled","custom_field_settings.custom_field.is_formula_field","custom_field_settings.custom_field.is_global_to_workspace","custom_field_settings.custom_field.is_value_read_only","custom_field_settings.custom_field.multi_enum_values","custom_field_settings.custom_field.multi_enum_values.color","custom_field_settings.custom_field.multi_enum_values.enabled","custom_field_settings.custom_field.multi_enum_values.name","custom_field_settings.custom_field.name","custom_field_settings.custom_field.number_value","custom_field_settings.custom_field.people_value","custom_field_settings.custom_field.people_value.name","custom_field_settings.custom_field.precision","custom_field_settings.custom_field.resource_subtype","custom_field_settings.custom_field.text_value","custom_field_settings.custom_field.type","custom_field_settings.is_important","custom_field_settings.parent","custom_field_settings.parent.name","custom_field_settings.project","custom_field_settings.project.name","custom_fields","custom_fields.date_value","custom_fields.date_value.date","custom_fields.date_value.date_time","custom_fields.display_value","custom_fields.enabled","custom_fields.enum_options","custom_fields.enum_options.color","custom_fields.enum_options.enabled","custom_fields.enum_options.name","custom_fields.enum_value","custom_fields.enum_value.color","custom_fields.enum_value.enabled","custom_fields.enum_value.name","custom_fields.is_formula_field","custom_fields.multi_enum_values","custom_fields.multi_enum_values.color","custom_fields.multi_enum_values.enabled","custom_fields.multi_enum_values.name","custom_fields.name","custom_fields.number_value","custom_fields.resource_subtype","custom_fields.text_value","custom_fields.type","default_access_level","default_view","due_date","due_on","followers","followers.name","html_notes","icon","members","members.name","modified_at","name","notes","offset","owner","path","permalink_url","project_brief","public","start_on","team","team.name","uri","workspace","workspace.name"] # list[str] | This endpoint returns a compact resource, which excludes some properties by default. To include those optional properties, set this query parameter to a comma-separated list of the properties you wish to include. (optional) try: - # Get portfolio items - api_response = api_instance.get_items_for_portfolio(portfolio_gid, limit=limit, offset=offset, opt_fields=opt_fields) - pprint(api_response) + # Get portfolio items + api_response = api_instance.get_items_for_portfolio(portfolio_gid, limit=limit, offset=offset, opt_fields=opt_fields) + pprint(api_response) except ApiException as e: - print("Exception when calling PortfoliosApi->get_items_for_portfolio: %s\n" % e) + print("Exception when calling PortfoliosApi->get_items_for_portfolio: %s\n" % e) ``` ### Parameters @@ -349,18 +355,19 @@ from pprint import pprint # Configure OAuth2 access token for authorization: oauth2 configuration = asana.Configuration() configuration.access_token = '' +api_client = asana.ApiClient(configuration) # create an instance of the API class -api_instance = asana.PortfoliosApi(asana.ApiClient(configuration)) +api_instance = asana.PortfoliosApi(api_client) portfolio_gid = '12345' # str | Globally unique identifier for the portfolio. opt_fields = ["color","created_at","created_by","created_by.name","current_status_update","current_status_update.resource_subtype","current_status_update.title","custom_field_settings","custom_field_settings.custom_field","custom_field_settings.custom_field.asana_created_field","custom_field_settings.custom_field.created_by","custom_field_settings.custom_field.created_by.name","custom_field_settings.custom_field.currency_code","custom_field_settings.custom_field.custom_label","custom_field_settings.custom_field.custom_label_position","custom_field_settings.custom_field.date_value","custom_field_settings.custom_field.date_value.date","custom_field_settings.custom_field.date_value.date_time","custom_field_settings.custom_field.description","custom_field_settings.custom_field.display_value","custom_field_settings.custom_field.enabled","custom_field_settings.custom_field.enum_options","custom_field_settings.custom_field.enum_options.color","custom_field_settings.custom_field.enum_options.enabled","custom_field_settings.custom_field.enum_options.name","custom_field_settings.custom_field.enum_value","custom_field_settings.custom_field.enum_value.color","custom_field_settings.custom_field.enum_value.enabled","custom_field_settings.custom_field.enum_value.name","custom_field_settings.custom_field.format","custom_field_settings.custom_field.has_notifications_enabled","custom_field_settings.custom_field.is_formula_field","custom_field_settings.custom_field.is_global_to_workspace","custom_field_settings.custom_field.is_value_read_only","custom_field_settings.custom_field.multi_enum_values","custom_field_settings.custom_field.multi_enum_values.color","custom_field_settings.custom_field.multi_enum_values.enabled","custom_field_settings.custom_field.multi_enum_values.name","custom_field_settings.custom_field.name","custom_field_settings.custom_field.number_value","custom_field_settings.custom_field.people_value","custom_field_settings.custom_field.people_value.name","custom_field_settings.custom_field.precision","custom_field_settings.custom_field.resource_subtype","custom_field_settings.custom_field.text_value","custom_field_settings.custom_field.type","custom_field_settings.is_important","custom_field_settings.parent","custom_field_settings.parent.name","custom_field_settings.project","custom_field_settings.project.name","custom_fields","custom_fields.date_value","custom_fields.date_value.date","custom_fields.date_value.date_time","custom_fields.display_value","custom_fields.enabled","custom_fields.enum_options","custom_fields.enum_options.color","custom_fields.enum_options.enabled","custom_fields.enum_options.name","custom_fields.enum_value","custom_fields.enum_value.color","custom_fields.enum_value.enabled","custom_fields.enum_value.name","custom_fields.is_formula_field","custom_fields.multi_enum_values","custom_fields.multi_enum_values.color","custom_fields.multi_enum_values.enabled","custom_fields.multi_enum_values.name","custom_fields.name","custom_fields.number_value","custom_fields.resource_subtype","custom_fields.text_value","custom_fields.type","due_on","members","members.name","name","owner","owner.name","permalink_url","project_templates","project_templates.name","public","start_on","workspace","workspace.name"] # list[str] | This endpoint returns a compact resource, which excludes some properties by default. To include those optional properties, set this query parameter to a comma-separated list of the properties you wish to include. (optional) try: - # Get a portfolio - api_response = api_instance.get_portfolio(portfolio_gid, opt_fields=opt_fields) - pprint(api_response) + # Get a portfolio + api_response = api_instance.get_portfolio(portfolio_gid, opt_fields=opt_fields) + pprint(api_response) except ApiException as e: - print("Exception when calling PortfoliosApi->get_portfolio: %s\n" % e) + print("Exception when calling PortfoliosApi->get_portfolio: %s\n" % e) ``` ### Parameters @@ -401,9 +408,10 @@ from pprint import pprint # Configure OAuth2 access token for authorization: oauth2 configuration = asana.Configuration() configuration.access_token = '' +api_client = asana.ApiClient(configuration) # create an instance of the API class -api_instance = asana.PortfoliosApi(asana.ApiClient(configuration)) +api_instance = asana.PortfoliosApi(api_client) workspace = '1331' # str | The workspace or organization to filter portfolios on. limit = 50 # int | Results per page. The number of objects to return per page. The value must be between 1 and 100. (optional) offset = 'eyJ0eXAiOJiKV1iQLCJhbGciOiJIUzI1NiJ9' # 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.' (optional) @@ -411,11 +419,11 @@ owner = '14916' # str | The user who owns the portfolio. Currently, API users ca opt_fields = ["color","created_at","created_by","created_by.name","current_status_update","current_status_update.resource_subtype","current_status_update.title","custom_field_settings","custom_field_settings.custom_field","custom_field_settings.custom_field.asana_created_field","custom_field_settings.custom_field.created_by","custom_field_settings.custom_field.created_by.name","custom_field_settings.custom_field.currency_code","custom_field_settings.custom_field.custom_label","custom_field_settings.custom_field.custom_label_position","custom_field_settings.custom_field.date_value","custom_field_settings.custom_field.date_value.date","custom_field_settings.custom_field.date_value.date_time","custom_field_settings.custom_field.description","custom_field_settings.custom_field.display_value","custom_field_settings.custom_field.enabled","custom_field_settings.custom_field.enum_options","custom_field_settings.custom_field.enum_options.color","custom_field_settings.custom_field.enum_options.enabled","custom_field_settings.custom_field.enum_options.name","custom_field_settings.custom_field.enum_value","custom_field_settings.custom_field.enum_value.color","custom_field_settings.custom_field.enum_value.enabled","custom_field_settings.custom_field.enum_value.name","custom_field_settings.custom_field.format","custom_field_settings.custom_field.has_notifications_enabled","custom_field_settings.custom_field.is_formula_field","custom_field_settings.custom_field.is_global_to_workspace","custom_field_settings.custom_field.is_value_read_only","custom_field_settings.custom_field.multi_enum_values","custom_field_settings.custom_field.multi_enum_values.color","custom_field_settings.custom_field.multi_enum_values.enabled","custom_field_settings.custom_field.multi_enum_values.name","custom_field_settings.custom_field.name","custom_field_settings.custom_field.number_value","custom_field_settings.custom_field.people_value","custom_field_settings.custom_field.people_value.name","custom_field_settings.custom_field.precision","custom_field_settings.custom_field.resource_subtype","custom_field_settings.custom_field.text_value","custom_field_settings.custom_field.type","custom_field_settings.is_important","custom_field_settings.parent","custom_field_settings.parent.name","custom_field_settings.project","custom_field_settings.project.name","custom_fields","custom_fields.date_value","custom_fields.date_value.date","custom_fields.date_value.date_time","custom_fields.display_value","custom_fields.enabled","custom_fields.enum_options","custom_fields.enum_options.color","custom_fields.enum_options.enabled","custom_fields.enum_options.name","custom_fields.enum_value","custom_fields.enum_value.color","custom_fields.enum_value.enabled","custom_fields.enum_value.name","custom_fields.is_formula_field","custom_fields.multi_enum_values","custom_fields.multi_enum_values.color","custom_fields.multi_enum_values.enabled","custom_fields.multi_enum_values.name","custom_fields.name","custom_fields.number_value","custom_fields.resource_subtype","custom_fields.text_value","custom_fields.type","due_on","members","members.name","name","offset","owner","owner.name","path","permalink_url","project_templates","project_templates.name","public","start_on","uri","workspace","workspace.name"] # list[str] | This endpoint returns a compact resource, which excludes some properties by default. To include those optional properties, set this query parameter to a comma-separated list of the properties you wish to include. (optional) try: - # Get multiple portfolios - api_response = api_instance.get_portfolios(workspace, limit=limit, offset=offset, owner=owner, opt_fields=opt_fields) - pprint(api_response) + # Get multiple portfolios + api_response = api_instance.get_portfolios(workspace, limit=limit, offset=offset, owner=owner, opt_fields=opt_fields) + pprint(api_response) except ApiException as e: - print("Exception when calling PortfoliosApi->get_portfolios: %s\n" % e) + print("Exception when calling PortfoliosApi->get_portfolios: %s\n" % e) ``` ### Parameters @@ -459,18 +467,19 @@ from pprint import pprint # Configure OAuth2 access token for authorization: oauth2 configuration = asana.Configuration() configuration.access_token = '' +api_client = asana.ApiClient(configuration) # create an instance of the API class -api_instance = asana.PortfoliosApi(asana.ApiClient(configuration)) +api_instance = asana.PortfoliosApi(api_client) body = asana.PortfolioGidRemoveCustomFieldSettingBody({"param1": "value1", "param2": "value2",}) # PortfolioGidRemoveCustomFieldSettingBody | Information about the custom field setting being removed. portfolio_gid = '12345' # str | Globally unique identifier for the portfolio. try: - # Remove a custom field from a portfolio - api_response = api_instance.remove_custom_field_setting_for_portfolio(body, portfolio_gid) - pprint(api_response) + # Remove a custom field from a portfolio + api_response = api_instance.remove_custom_field_setting_for_portfolio(body, portfolio_gid) + pprint(api_response) except ApiException as e: - print("Exception when calling PortfoliosApi->remove_custom_field_setting_for_portfolio: %s\n" % e) + print("Exception when calling PortfoliosApi->remove_custom_field_setting_for_portfolio: %s\n" % e) ``` ### Parameters @@ -511,18 +520,19 @@ from pprint import pprint # Configure OAuth2 access token for authorization: oauth2 configuration = asana.Configuration() configuration.access_token = '' +api_client = asana.ApiClient(configuration) # create an instance of the API class -api_instance = asana.PortfoliosApi(asana.ApiClient(configuration)) +api_instance = asana.PortfoliosApi(api_client) body = asana.PortfolioGidRemoveItemBody({"param1": "value1", "param2": "value2",}) # PortfolioGidRemoveItemBody | Information about the item being removed. portfolio_gid = '12345' # str | Globally unique identifier for the portfolio. try: - # Remove a portfolio item - api_response = api_instance.remove_item_for_portfolio(body, portfolio_gid) - pprint(api_response) + # Remove a portfolio item + api_response = api_instance.remove_item_for_portfolio(body, portfolio_gid) + pprint(api_response) except ApiException as e: - print("Exception when calling PortfoliosApi->remove_item_for_portfolio: %s\n" % e) + print("Exception when calling PortfoliosApi->remove_item_for_portfolio: %s\n" % e) ``` ### Parameters @@ -563,19 +573,20 @@ from pprint import pprint # Configure OAuth2 access token for authorization: oauth2 configuration = asana.Configuration() configuration.access_token = '' +api_client = asana.ApiClient(configuration) # create an instance of the API class -api_instance = asana.PortfoliosApi(asana.ApiClient(configuration)) +api_instance = asana.PortfoliosApi(api_client) body = asana.PortfolioGidRemoveMembersBody({"param1": "value1", "param2": "value2",}) # PortfolioGidRemoveMembersBody | Information about the members being removed. portfolio_gid = '12345' # str | Globally unique identifier for the portfolio. opt_fields = ["color","created_at","created_by","created_by.name","current_status_update","current_status_update.resource_subtype","current_status_update.title","custom_field_settings","custom_field_settings.custom_field","custom_field_settings.custom_field.asana_created_field","custom_field_settings.custom_field.created_by","custom_field_settings.custom_field.created_by.name","custom_field_settings.custom_field.currency_code","custom_field_settings.custom_field.custom_label","custom_field_settings.custom_field.custom_label_position","custom_field_settings.custom_field.date_value","custom_field_settings.custom_field.date_value.date","custom_field_settings.custom_field.date_value.date_time","custom_field_settings.custom_field.description","custom_field_settings.custom_field.display_value","custom_field_settings.custom_field.enabled","custom_field_settings.custom_field.enum_options","custom_field_settings.custom_field.enum_options.color","custom_field_settings.custom_field.enum_options.enabled","custom_field_settings.custom_field.enum_options.name","custom_field_settings.custom_field.enum_value","custom_field_settings.custom_field.enum_value.color","custom_field_settings.custom_field.enum_value.enabled","custom_field_settings.custom_field.enum_value.name","custom_field_settings.custom_field.format","custom_field_settings.custom_field.has_notifications_enabled","custom_field_settings.custom_field.is_formula_field","custom_field_settings.custom_field.is_global_to_workspace","custom_field_settings.custom_field.is_value_read_only","custom_field_settings.custom_field.multi_enum_values","custom_field_settings.custom_field.multi_enum_values.color","custom_field_settings.custom_field.multi_enum_values.enabled","custom_field_settings.custom_field.multi_enum_values.name","custom_field_settings.custom_field.name","custom_field_settings.custom_field.number_value","custom_field_settings.custom_field.people_value","custom_field_settings.custom_field.people_value.name","custom_field_settings.custom_field.precision","custom_field_settings.custom_field.resource_subtype","custom_field_settings.custom_field.text_value","custom_field_settings.custom_field.type","custom_field_settings.is_important","custom_field_settings.parent","custom_field_settings.parent.name","custom_field_settings.project","custom_field_settings.project.name","custom_fields","custom_fields.date_value","custom_fields.date_value.date","custom_fields.date_value.date_time","custom_fields.display_value","custom_fields.enabled","custom_fields.enum_options","custom_fields.enum_options.color","custom_fields.enum_options.enabled","custom_fields.enum_options.name","custom_fields.enum_value","custom_fields.enum_value.color","custom_fields.enum_value.enabled","custom_fields.enum_value.name","custom_fields.is_formula_field","custom_fields.multi_enum_values","custom_fields.multi_enum_values.color","custom_fields.multi_enum_values.enabled","custom_fields.multi_enum_values.name","custom_fields.name","custom_fields.number_value","custom_fields.resource_subtype","custom_fields.text_value","custom_fields.type","due_on","members","members.name","name","owner","owner.name","permalink_url","project_templates","project_templates.name","public","start_on","workspace","workspace.name"] # list[str] | This endpoint returns a compact resource, which excludes some properties by default. To include those optional properties, set this query parameter to a comma-separated list of the properties you wish to include. (optional) try: - # Remove users from a portfolio - api_response = api_instance.remove_members_for_portfolio(body, portfolio_gid, opt_fields=opt_fields) - pprint(api_response) + # Remove users from a portfolio + api_response = api_instance.remove_members_for_portfolio(body, portfolio_gid, opt_fields=opt_fields) + pprint(api_response) except ApiException as e: - print("Exception when calling PortfoliosApi->remove_members_for_portfolio: %s\n" % e) + print("Exception when calling PortfoliosApi->remove_members_for_portfolio: %s\n" % e) ``` ### Parameters @@ -617,19 +628,20 @@ from pprint import pprint # Configure OAuth2 access token for authorization: oauth2 configuration = asana.Configuration() configuration.access_token = '' +api_client = asana.ApiClient(configuration) # create an instance of the API class -api_instance = asana.PortfoliosApi(asana.ApiClient(configuration)) +api_instance = asana.PortfoliosApi(api_client) body = asana.PortfoliosPortfolioGidBody({"param1": "value1", "param2": "value2",}) # PortfoliosPortfolioGidBody | The updated fields for the portfolio. portfolio_gid = '12345' # str | Globally unique identifier for the portfolio. opt_fields = ["color","created_at","created_by","created_by.name","current_status_update","current_status_update.resource_subtype","current_status_update.title","custom_field_settings","custom_field_settings.custom_field","custom_field_settings.custom_field.asana_created_field","custom_field_settings.custom_field.created_by","custom_field_settings.custom_field.created_by.name","custom_field_settings.custom_field.currency_code","custom_field_settings.custom_field.custom_label","custom_field_settings.custom_field.custom_label_position","custom_field_settings.custom_field.date_value","custom_field_settings.custom_field.date_value.date","custom_field_settings.custom_field.date_value.date_time","custom_field_settings.custom_field.description","custom_field_settings.custom_field.display_value","custom_field_settings.custom_field.enabled","custom_field_settings.custom_field.enum_options","custom_field_settings.custom_field.enum_options.color","custom_field_settings.custom_field.enum_options.enabled","custom_field_settings.custom_field.enum_options.name","custom_field_settings.custom_field.enum_value","custom_field_settings.custom_field.enum_value.color","custom_field_settings.custom_field.enum_value.enabled","custom_field_settings.custom_field.enum_value.name","custom_field_settings.custom_field.format","custom_field_settings.custom_field.has_notifications_enabled","custom_field_settings.custom_field.is_formula_field","custom_field_settings.custom_field.is_global_to_workspace","custom_field_settings.custom_field.is_value_read_only","custom_field_settings.custom_field.multi_enum_values","custom_field_settings.custom_field.multi_enum_values.color","custom_field_settings.custom_field.multi_enum_values.enabled","custom_field_settings.custom_field.multi_enum_values.name","custom_field_settings.custom_field.name","custom_field_settings.custom_field.number_value","custom_field_settings.custom_field.people_value","custom_field_settings.custom_field.people_value.name","custom_field_settings.custom_field.precision","custom_field_settings.custom_field.resource_subtype","custom_field_settings.custom_field.text_value","custom_field_settings.custom_field.type","custom_field_settings.is_important","custom_field_settings.parent","custom_field_settings.parent.name","custom_field_settings.project","custom_field_settings.project.name","custom_fields","custom_fields.date_value","custom_fields.date_value.date","custom_fields.date_value.date_time","custom_fields.display_value","custom_fields.enabled","custom_fields.enum_options","custom_fields.enum_options.color","custom_fields.enum_options.enabled","custom_fields.enum_options.name","custom_fields.enum_value","custom_fields.enum_value.color","custom_fields.enum_value.enabled","custom_fields.enum_value.name","custom_fields.is_formula_field","custom_fields.multi_enum_values","custom_fields.multi_enum_values.color","custom_fields.multi_enum_values.enabled","custom_fields.multi_enum_values.name","custom_fields.name","custom_fields.number_value","custom_fields.resource_subtype","custom_fields.text_value","custom_fields.type","due_on","members","members.name","name","owner","owner.name","permalink_url","project_templates","project_templates.name","public","start_on","workspace","workspace.name"] # list[str] | This endpoint returns a compact resource, which excludes some properties by default. To include those optional properties, set this query parameter to a comma-separated list of the properties you wish to include. (optional) try: - # Update a portfolio - api_response = api_instance.update_portfolio(body, portfolio_gid, opt_fields=opt_fields) - pprint(api_response) + # Update a portfolio + api_response = api_instance.update_portfolio(body, portfolio_gid, opt_fields=opt_fields) + pprint(api_response) except ApiException as e: - print("Exception when calling PortfoliosApi->update_portfolio: %s\n" % e) + print("Exception when calling PortfoliosApi->update_portfolio: %s\n" % e) ``` ### Parameters diff --git a/docs/PortfoliosApi.yaml b/docs/PortfoliosApi.yaml index f255194b..e977074f 100644 --- a/docs/PortfoliosApi.yaml +++ b/docs/PortfoliosApi.yaml @@ -7,18 +7,19 @@ PortfoliosApi: # Configure OAuth2 access token for authorization: oauth2 configuration = asana.Configuration() configuration.access_token = '' + api_client = asana.ApiClient(configuration) # create an instance of the API class - api_instance = asana.PortfoliosApi(asana.ApiClient(configuration)) + api_instance = asana.PortfoliosApi(api_client) body = asana.PortfolioGidAddCustomFieldSettingBody({"param1": "value1", "param2": "value2",}) # PortfolioGidAddCustomFieldSettingBody | Information about the custom field setting. portfolio_gid = '12345' # str | Globally unique identifier for the portfolio. try: - # Add a custom field to a portfolio - api_response = api_instance.add_custom_field_setting_for_portfolio(body, portfolio_gid) - pprint(api_response) + # Add a custom field to a portfolio + api_response = api_instance.add_custom_field_setting_for_portfolio(body, portfolio_gid) + pprint(api_response) except ApiException as e: - print("Exception when calling PortfoliosApi->add_custom_field_setting_for_portfolio: %s\n" % e) + print("Exception when calling PortfoliosApi->add_custom_field_setting_for_portfolio: %s\n" % e) add_item_for_portfolio: |- import asana from asana.rest import ApiException @@ -27,18 +28,19 @@ PortfoliosApi: # Configure OAuth2 access token for authorization: oauth2 configuration = asana.Configuration() configuration.access_token = '' + api_client = asana.ApiClient(configuration) # create an instance of the API class - api_instance = asana.PortfoliosApi(asana.ApiClient(configuration)) + api_instance = asana.PortfoliosApi(api_client) body = asana.PortfolioGidAddItemBody({"param1": "value1", "param2": "value2",}) # PortfolioGidAddItemBody | Information about the item being inserted. portfolio_gid = '12345' # str | Globally unique identifier for the portfolio. try: - # Add a portfolio item - api_response = api_instance.add_item_for_portfolio(body, portfolio_gid) - pprint(api_response) + # Add a portfolio item + api_response = api_instance.add_item_for_portfolio(body, portfolio_gid) + pprint(api_response) except ApiException as e: - print("Exception when calling PortfoliosApi->add_item_for_portfolio: %s\n" % e) + print("Exception when calling PortfoliosApi->add_item_for_portfolio: %s\n" % e) add_members_for_portfolio: |- import asana from asana.rest import ApiException @@ -47,19 +49,20 @@ PortfoliosApi: # Configure OAuth2 access token for authorization: oauth2 configuration = asana.Configuration() configuration.access_token = '' + api_client = asana.ApiClient(configuration) # create an instance of the API class - api_instance = asana.PortfoliosApi(asana.ApiClient(configuration)) + api_instance = asana.PortfoliosApi(api_client) body = asana.PortfolioGidAddMembersBody({"param1": "value1", "param2": "value2",}) # PortfolioGidAddMembersBody | Information about the members being added. portfolio_gid = '12345' # str | Globally unique identifier for the portfolio. opt_fields = ["color","created_at","created_by","created_by.name","current_status_update","current_status_update.resource_subtype","current_status_update.title","custom_field_settings","custom_field_settings.custom_field","custom_field_settings.custom_field.asana_created_field","custom_field_settings.custom_field.created_by","custom_field_settings.custom_field.created_by.name","custom_field_settings.custom_field.currency_code","custom_field_settings.custom_field.custom_label","custom_field_settings.custom_field.custom_label_position","custom_field_settings.custom_field.date_value","custom_field_settings.custom_field.date_value.date","custom_field_settings.custom_field.date_value.date_time","custom_field_settings.custom_field.description","custom_field_settings.custom_field.display_value","custom_field_settings.custom_field.enabled","custom_field_settings.custom_field.enum_options","custom_field_settings.custom_field.enum_options.color","custom_field_settings.custom_field.enum_options.enabled","custom_field_settings.custom_field.enum_options.name","custom_field_settings.custom_field.enum_value","custom_field_settings.custom_field.enum_value.color","custom_field_settings.custom_field.enum_value.enabled","custom_field_settings.custom_field.enum_value.name","custom_field_settings.custom_field.format","custom_field_settings.custom_field.has_notifications_enabled","custom_field_settings.custom_field.is_formula_field","custom_field_settings.custom_field.is_global_to_workspace","custom_field_settings.custom_field.is_value_read_only","custom_field_settings.custom_field.multi_enum_values","custom_field_settings.custom_field.multi_enum_values.color","custom_field_settings.custom_field.multi_enum_values.enabled","custom_field_settings.custom_field.multi_enum_values.name","custom_field_settings.custom_field.name","custom_field_settings.custom_field.number_value","custom_field_settings.custom_field.people_value","custom_field_settings.custom_field.people_value.name","custom_field_settings.custom_field.precision","custom_field_settings.custom_field.resource_subtype","custom_field_settings.custom_field.text_value","custom_field_settings.custom_field.type","custom_field_settings.is_important","custom_field_settings.parent","custom_field_settings.parent.name","custom_field_settings.project","custom_field_settings.project.name","custom_fields","custom_fields.date_value","custom_fields.date_value.date","custom_fields.date_value.date_time","custom_fields.display_value","custom_fields.enabled","custom_fields.enum_options","custom_fields.enum_options.color","custom_fields.enum_options.enabled","custom_fields.enum_options.name","custom_fields.enum_value","custom_fields.enum_value.color","custom_fields.enum_value.enabled","custom_fields.enum_value.name","custom_fields.is_formula_field","custom_fields.multi_enum_values","custom_fields.multi_enum_values.color","custom_fields.multi_enum_values.enabled","custom_fields.multi_enum_values.name","custom_fields.name","custom_fields.number_value","custom_fields.resource_subtype","custom_fields.text_value","custom_fields.type","due_on","members","members.name","name","owner","owner.name","permalink_url","project_templates","project_templates.name","public","start_on","workspace","workspace.name"] # list[str] | This endpoint returns a compact resource, which excludes some properties by default. To include those optional properties, set this query parameter to a comma-separated list of the properties you wish to include. (optional) try: - # Add users to a portfolio - api_response = api_instance.add_members_for_portfolio(body, portfolio_gid, opt_fields=opt_fields) - pprint(api_response) + # Add users to a portfolio + api_response = api_instance.add_members_for_portfolio(body, portfolio_gid, opt_fields=opt_fields) + pprint(api_response) except ApiException as e: - print("Exception when calling PortfoliosApi->add_members_for_portfolio: %s\n" % e) + print("Exception when calling PortfoliosApi->add_members_for_portfolio: %s\n" % e) create_portfolio: |- import asana from asana.rest import ApiException @@ -68,18 +71,19 @@ PortfoliosApi: # Configure OAuth2 access token for authorization: oauth2 configuration = asana.Configuration() configuration.access_token = '' + api_client = asana.ApiClient(configuration) # create an instance of the API class - api_instance = asana.PortfoliosApi(asana.ApiClient(configuration)) + api_instance = asana.PortfoliosApi(api_client) body = asana.PortfoliosBody({"param1": "value1", "param2": "value2",}) # PortfoliosBody | The portfolio to create. opt_fields = ["color","created_at","created_by","created_by.name","current_status_update","current_status_update.resource_subtype","current_status_update.title","custom_field_settings","custom_field_settings.custom_field","custom_field_settings.custom_field.asana_created_field","custom_field_settings.custom_field.created_by","custom_field_settings.custom_field.created_by.name","custom_field_settings.custom_field.currency_code","custom_field_settings.custom_field.custom_label","custom_field_settings.custom_field.custom_label_position","custom_field_settings.custom_field.date_value","custom_field_settings.custom_field.date_value.date","custom_field_settings.custom_field.date_value.date_time","custom_field_settings.custom_field.description","custom_field_settings.custom_field.display_value","custom_field_settings.custom_field.enabled","custom_field_settings.custom_field.enum_options","custom_field_settings.custom_field.enum_options.color","custom_field_settings.custom_field.enum_options.enabled","custom_field_settings.custom_field.enum_options.name","custom_field_settings.custom_field.enum_value","custom_field_settings.custom_field.enum_value.color","custom_field_settings.custom_field.enum_value.enabled","custom_field_settings.custom_field.enum_value.name","custom_field_settings.custom_field.format","custom_field_settings.custom_field.has_notifications_enabled","custom_field_settings.custom_field.is_formula_field","custom_field_settings.custom_field.is_global_to_workspace","custom_field_settings.custom_field.is_value_read_only","custom_field_settings.custom_field.multi_enum_values","custom_field_settings.custom_field.multi_enum_values.color","custom_field_settings.custom_field.multi_enum_values.enabled","custom_field_settings.custom_field.multi_enum_values.name","custom_field_settings.custom_field.name","custom_field_settings.custom_field.number_value","custom_field_settings.custom_field.people_value","custom_field_settings.custom_field.people_value.name","custom_field_settings.custom_field.precision","custom_field_settings.custom_field.resource_subtype","custom_field_settings.custom_field.text_value","custom_field_settings.custom_field.type","custom_field_settings.is_important","custom_field_settings.parent","custom_field_settings.parent.name","custom_field_settings.project","custom_field_settings.project.name","custom_fields","custom_fields.date_value","custom_fields.date_value.date","custom_fields.date_value.date_time","custom_fields.display_value","custom_fields.enabled","custom_fields.enum_options","custom_fields.enum_options.color","custom_fields.enum_options.enabled","custom_fields.enum_options.name","custom_fields.enum_value","custom_fields.enum_value.color","custom_fields.enum_value.enabled","custom_fields.enum_value.name","custom_fields.is_formula_field","custom_fields.multi_enum_values","custom_fields.multi_enum_values.color","custom_fields.multi_enum_values.enabled","custom_fields.multi_enum_values.name","custom_fields.name","custom_fields.number_value","custom_fields.resource_subtype","custom_fields.text_value","custom_fields.type","due_on","members","members.name","name","owner","owner.name","permalink_url","project_templates","project_templates.name","public","start_on","workspace","workspace.name"] # list[str] | This endpoint returns a compact resource, which excludes some properties by default. To include those optional properties, set this query parameter to a comma-separated list of the properties you wish to include. (optional) try: - # Create a portfolio - api_response = api_instance.create_portfolio(body, opt_fields=opt_fields) - pprint(api_response) + # Create a portfolio + api_response = api_instance.create_portfolio(body, opt_fields=opt_fields) + pprint(api_response) except ApiException as e: - print("Exception when calling PortfoliosApi->create_portfolio: %s\n" % e) + print("Exception when calling PortfoliosApi->create_portfolio: %s\n" % e) delete_portfolio: |- import asana from asana.rest import ApiException @@ -88,17 +92,18 @@ PortfoliosApi: # Configure OAuth2 access token for authorization: oauth2 configuration = asana.Configuration() configuration.access_token = '' + api_client = asana.ApiClient(configuration) # create an instance of the API class - api_instance = asana.PortfoliosApi(asana.ApiClient(configuration)) + api_instance = asana.PortfoliosApi(api_client) portfolio_gid = '12345' # str | Globally unique identifier for the portfolio. try: - # Delete a portfolio - api_response = api_instance.delete_portfolio(portfolio_gid) - pprint(api_response) + # Delete a portfolio + api_response = api_instance.delete_portfolio(portfolio_gid) + pprint(api_response) except ApiException as e: - print("Exception when calling PortfoliosApi->delete_portfolio: %s\n" % e) + print("Exception when calling PortfoliosApi->delete_portfolio: %s\n" % e) get_items_for_portfolio: |- import asana from asana.rest import ApiException @@ -107,20 +112,21 @@ PortfoliosApi: # Configure OAuth2 access token for authorization: oauth2 configuration = asana.Configuration() configuration.access_token = '' + api_client = asana.ApiClient(configuration) # create an instance of the API class - api_instance = asana.PortfoliosApi(asana.ApiClient(configuration)) + api_instance = asana.PortfoliosApi(api_client) portfolio_gid = '12345' # str | Globally unique identifier for the portfolio. limit = 50 # int | Results per page. The number of objects to return per page. The value must be between 1 and 100. (optional) offset = 'eyJ0eXAiOJiKV1iQLCJhbGciOiJIUzI1NiJ9' # 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.' (optional) opt_fields = ["archived","color","completed","completed_at","completed_by","completed_by.name","created_at","created_from_template","created_from_template.name","current_status","current_status.author","current_status.author.name","current_status.color","current_status.created_at","current_status.created_by","current_status.created_by.name","current_status.html_text","current_status.modified_at","current_status.text","current_status.title","current_status_update","current_status_update.resource_subtype","current_status_update.title","custom_field_settings","custom_field_settings.custom_field","custom_field_settings.custom_field.asana_created_field","custom_field_settings.custom_field.created_by","custom_field_settings.custom_field.created_by.name","custom_field_settings.custom_field.currency_code","custom_field_settings.custom_field.custom_label","custom_field_settings.custom_field.custom_label_position","custom_field_settings.custom_field.date_value","custom_field_settings.custom_field.date_value.date","custom_field_settings.custom_field.date_value.date_time","custom_field_settings.custom_field.description","custom_field_settings.custom_field.display_value","custom_field_settings.custom_field.enabled","custom_field_settings.custom_field.enum_options","custom_field_settings.custom_field.enum_options.color","custom_field_settings.custom_field.enum_options.enabled","custom_field_settings.custom_field.enum_options.name","custom_field_settings.custom_field.enum_value","custom_field_settings.custom_field.enum_value.color","custom_field_settings.custom_field.enum_value.enabled","custom_field_settings.custom_field.enum_value.name","custom_field_settings.custom_field.format","custom_field_settings.custom_field.has_notifications_enabled","custom_field_settings.custom_field.is_formula_field","custom_field_settings.custom_field.is_global_to_workspace","custom_field_settings.custom_field.is_value_read_only","custom_field_settings.custom_field.multi_enum_values","custom_field_settings.custom_field.multi_enum_values.color","custom_field_settings.custom_field.multi_enum_values.enabled","custom_field_settings.custom_field.multi_enum_values.name","custom_field_settings.custom_field.name","custom_field_settings.custom_field.number_value","custom_field_settings.custom_field.people_value","custom_field_settings.custom_field.people_value.name","custom_field_settings.custom_field.precision","custom_field_settings.custom_field.resource_subtype","custom_field_settings.custom_field.text_value","custom_field_settings.custom_field.type","custom_field_settings.is_important","custom_field_settings.parent","custom_field_settings.parent.name","custom_field_settings.project","custom_field_settings.project.name","custom_fields","custom_fields.date_value","custom_fields.date_value.date","custom_fields.date_value.date_time","custom_fields.display_value","custom_fields.enabled","custom_fields.enum_options","custom_fields.enum_options.color","custom_fields.enum_options.enabled","custom_fields.enum_options.name","custom_fields.enum_value","custom_fields.enum_value.color","custom_fields.enum_value.enabled","custom_fields.enum_value.name","custom_fields.is_formula_field","custom_fields.multi_enum_values","custom_fields.multi_enum_values.color","custom_fields.multi_enum_values.enabled","custom_fields.multi_enum_values.name","custom_fields.name","custom_fields.number_value","custom_fields.resource_subtype","custom_fields.text_value","custom_fields.type","default_access_level","default_view","due_date","due_on","followers","followers.name","html_notes","icon","members","members.name","modified_at","name","notes","offset","owner","path","permalink_url","project_brief","public","start_on","team","team.name","uri","workspace","workspace.name"] # list[str] | This endpoint returns a compact resource, which excludes some properties by default. To include those optional properties, set this query parameter to a comma-separated list of the properties you wish to include. (optional) try: - # Get portfolio items - api_response = api_instance.get_items_for_portfolio(portfolio_gid, limit=limit, offset=offset, opt_fields=opt_fields) - pprint(api_response) + # Get portfolio items + api_response = api_instance.get_items_for_portfolio(portfolio_gid, limit=limit, offset=offset, opt_fields=opt_fields) + pprint(api_response) except ApiException as e: - print("Exception when calling PortfoliosApi->get_items_for_portfolio: %s\n" % e) + print("Exception when calling PortfoliosApi->get_items_for_portfolio: %s\n" % e) get_portfolio: |- import asana from asana.rest import ApiException @@ -129,18 +135,19 @@ PortfoliosApi: # Configure OAuth2 access token for authorization: oauth2 configuration = asana.Configuration() configuration.access_token = '' + api_client = asana.ApiClient(configuration) # create an instance of the API class - api_instance = asana.PortfoliosApi(asana.ApiClient(configuration)) + api_instance = asana.PortfoliosApi(api_client) portfolio_gid = '12345' # str | Globally unique identifier for the portfolio. opt_fields = ["color","created_at","created_by","created_by.name","current_status_update","current_status_update.resource_subtype","current_status_update.title","custom_field_settings","custom_field_settings.custom_field","custom_field_settings.custom_field.asana_created_field","custom_field_settings.custom_field.created_by","custom_field_settings.custom_field.created_by.name","custom_field_settings.custom_field.currency_code","custom_field_settings.custom_field.custom_label","custom_field_settings.custom_field.custom_label_position","custom_field_settings.custom_field.date_value","custom_field_settings.custom_field.date_value.date","custom_field_settings.custom_field.date_value.date_time","custom_field_settings.custom_field.description","custom_field_settings.custom_field.display_value","custom_field_settings.custom_field.enabled","custom_field_settings.custom_field.enum_options","custom_field_settings.custom_field.enum_options.color","custom_field_settings.custom_field.enum_options.enabled","custom_field_settings.custom_field.enum_options.name","custom_field_settings.custom_field.enum_value","custom_field_settings.custom_field.enum_value.color","custom_field_settings.custom_field.enum_value.enabled","custom_field_settings.custom_field.enum_value.name","custom_field_settings.custom_field.format","custom_field_settings.custom_field.has_notifications_enabled","custom_field_settings.custom_field.is_formula_field","custom_field_settings.custom_field.is_global_to_workspace","custom_field_settings.custom_field.is_value_read_only","custom_field_settings.custom_field.multi_enum_values","custom_field_settings.custom_field.multi_enum_values.color","custom_field_settings.custom_field.multi_enum_values.enabled","custom_field_settings.custom_field.multi_enum_values.name","custom_field_settings.custom_field.name","custom_field_settings.custom_field.number_value","custom_field_settings.custom_field.people_value","custom_field_settings.custom_field.people_value.name","custom_field_settings.custom_field.precision","custom_field_settings.custom_field.resource_subtype","custom_field_settings.custom_field.text_value","custom_field_settings.custom_field.type","custom_field_settings.is_important","custom_field_settings.parent","custom_field_settings.parent.name","custom_field_settings.project","custom_field_settings.project.name","custom_fields","custom_fields.date_value","custom_fields.date_value.date","custom_fields.date_value.date_time","custom_fields.display_value","custom_fields.enabled","custom_fields.enum_options","custom_fields.enum_options.color","custom_fields.enum_options.enabled","custom_fields.enum_options.name","custom_fields.enum_value","custom_fields.enum_value.color","custom_fields.enum_value.enabled","custom_fields.enum_value.name","custom_fields.is_formula_field","custom_fields.multi_enum_values","custom_fields.multi_enum_values.color","custom_fields.multi_enum_values.enabled","custom_fields.multi_enum_values.name","custom_fields.name","custom_fields.number_value","custom_fields.resource_subtype","custom_fields.text_value","custom_fields.type","due_on","members","members.name","name","owner","owner.name","permalink_url","project_templates","project_templates.name","public","start_on","workspace","workspace.name"] # list[str] | This endpoint returns a compact resource, which excludes some properties by default. To include those optional properties, set this query parameter to a comma-separated list of the properties you wish to include. (optional) try: - # Get a portfolio - api_response = api_instance.get_portfolio(portfolio_gid, opt_fields=opt_fields) - pprint(api_response) + # Get a portfolio + api_response = api_instance.get_portfolio(portfolio_gid, opt_fields=opt_fields) + pprint(api_response) except ApiException as e: - print("Exception when calling PortfoliosApi->get_portfolio: %s\n" % e) + print("Exception when calling PortfoliosApi->get_portfolio: %s\n" % e) get_portfolios: |- import asana from asana.rest import ApiException @@ -149,9 +156,10 @@ PortfoliosApi: # Configure OAuth2 access token for authorization: oauth2 configuration = asana.Configuration() configuration.access_token = '' + api_client = asana.ApiClient(configuration) # create an instance of the API class - api_instance = asana.PortfoliosApi(asana.ApiClient(configuration)) + api_instance = asana.PortfoliosApi(api_client) workspace = '1331' # str | The workspace or organization to filter portfolios on. limit = 50 # int | Results per page. The number of objects to return per page. The value must be between 1 and 100. (optional) offset = 'eyJ0eXAiOJiKV1iQLCJhbGciOiJIUzI1NiJ9' # 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.' (optional) @@ -159,11 +167,11 @@ PortfoliosApi: opt_fields = ["color","created_at","created_by","created_by.name","current_status_update","current_status_update.resource_subtype","current_status_update.title","custom_field_settings","custom_field_settings.custom_field","custom_field_settings.custom_field.asana_created_field","custom_field_settings.custom_field.created_by","custom_field_settings.custom_field.created_by.name","custom_field_settings.custom_field.currency_code","custom_field_settings.custom_field.custom_label","custom_field_settings.custom_field.custom_label_position","custom_field_settings.custom_field.date_value","custom_field_settings.custom_field.date_value.date","custom_field_settings.custom_field.date_value.date_time","custom_field_settings.custom_field.description","custom_field_settings.custom_field.display_value","custom_field_settings.custom_field.enabled","custom_field_settings.custom_field.enum_options","custom_field_settings.custom_field.enum_options.color","custom_field_settings.custom_field.enum_options.enabled","custom_field_settings.custom_field.enum_options.name","custom_field_settings.custom_field.enum_value","custom_field_settings.custom_field.enum_value.color","custom_field_settings.custom_field.enum_value.enabled","custom_field_settings.custom_field.enum_value.name","custom_field_settings.custom_field.format","custom_field_settings.custom_field.has_notifications_enabled","custom_field_settings.custom_field.is_formula_field","custom_field_settings.custom_field.is_global_to_workspace","custom_field_settings.custom_field.is_value_read_only","custom_field_settings.custom_field.multi_enum_values","custom_field_settings.custom_field.multi_enum_values.color","custom_field_settings.custom_field.multi_enum_values.enabled","custom_field_settings.custom_field.multi_enum_values.name","custom_field_settings.custom_field.name","custom_field_settings.custom_field.number_value","custom_field_settings.custom_field.people_value","custom_field_settings.custom_field.people_value.name","custom_field_settings.custom_field.precision","custom_field_settings.custom_field.resource_subtype","custom_field_settings.custom_field.text_value","custom_field_settings.custom_field.type","custom_field_settings.is_important","custom_field_settings.parent","custom_field_settings.parent.name","custom_field_settings.project","custom_field_settings.project.name","custom_fields","custom_fields.date_value","custom_fields.date_value.date","custom_fields.date_value.date_time","custom_fields.display_value","custom_fields.enabled","custom_fields.enum_options","custom_fields.enum_options.color","custom_fields.enum_options.enabled","custom_fields.enum_options.name","custom_fields.enum_value","custom_fields.enum_value.color","custom_fields.enum_value.enabled","custom_fields.enum_value.name","custom_fields.is_formula_field","custom_fields.multi_enum_values","custom_fields.multi_enum_values.color","custom_fields.multi_enum_values.enabled","custom_fields.multi_enum_values.name","custom_fields.name","custom_fields.number_value","custom_fields.resource_subtype","custom_fields.text_value","custom_fields.type","due_on","members","members.name","name","offset","owner","owner.name","path","permalink_url","project_templates","project_templates.name","public","start_on","uri","workspace","workspace.name"] # list[str] | This endpoint returns a compact resource, which excludes some properties by default. To include those optional properties, set this query parameter to a comma-separated list of the properties you wish to include. (optional) try: - # Get multiple portfolios - api_response = api_instance.get_portfolios(workspace, limit=limit, offset=offset, owner=owner, opt_fields=opt_fields) - pprint(api_response) + # Get multiple portfolios + api_response = api_instance.get_portfolios(workspace, limit=limit, offset=offset, owner=owner, opt_fields=opt_fields) + pprint(api_response) except ApiException as e: - print("Exception when calling PortfoliosApi->get_portfolios: %s\n" % e) + print("Exception when calling PortfoliosApi->get_portfolios: %s\n" % e) remove_custom_field_setting_for_portfolio: |- import asana from asana.rest import ApiException @@ -172,18 +180,19 @@ PortfoliosApi: # Configure OAuth2 access token for authorization: oauth2 configuration = asana.Configuration() configuration.access_token = '' + api_client = asana.ApiClient(configuration) # create an instance of the API class - api_instance = asana.PortfoliosApi(asana.ApiClient(configuration)) + api_instance = asana.PortfoliosApi(api_client) body = asana.PortfolioGidRemoveCustomFieldSettingBody({"param1": "value1", "param2": "value2",}) # PortfolioGidRemoveCustomFieldSettingBody | Information about the custom field setting being removed. portfolio_gid = '12345' # str | Globally unique identifier for the portfolio. try: - # Remove a custom field from a portfolio - api_response = api_instance.remove_custom_field_setting_for_portfolio(body, portfolio_gid) - pprint(api_response) + # Remove a custom field from a portfolio + api_response = api_instance.remove_custom_field_setting_for_portfolio(body, portfolio_gid) + pprint(api_response) except ApiException as e: - print("Exception when calling PortfoliosApi->remove_custom_field_setting_for_portfolio: %s\n" % e) + print("Exception when calling PortfoliosApi->remove_custom_field_setting_for_portfolio: %s\n" % e) remove_item_for_portfolio: |- import asana from asana.rest import ApiException @@ -192,18 +201,19 @@ PortfoliosApi: # Configure OAuth2 access token for authorization: oauth2 configuration = asana.Configuration() configuration.access_token = '' + api_client = asana.ApiClient(configuration) # create an instance of the API class - api_instance = asana.PortfoliosApi(asana.ApiClient(configuration)) + api_instance = asana.PortfoliosApi(api_client) body = asana.PortfolioGidRemoveItemBody({"param1": "value1", "param2": "value2",}) # PortfolioGidRemoveItemBody | Information about the item being removed. portfolio_gid = '12345' # str | Globally unique identifier for the portfolio. try: - # Remove a portfolio item - api_response = api_instance.remove_item_for_portfolio(body, portfolio_gid) - pprint(api_response) + # Remove a portfolio item + api_response = api_instance.remove_item_for_portfolio(body, portfolio_gid) + pprint(api_response) except ApiException as e: - print("Exception when calling PortfoliosApi->remove_item_for_portfolio: %s\n" % e) + print("Exception when calling PortfoliosApi->remove_item_for_portfolio: %s\n" % e) remove_members_for_portfolio: |- import asana from asana.rest import ApiException @@ -212,19 +222,20 @@ PortfoliosApi: # Configure OAuth2 access token for authorization: oauth2 configuration = asana.Configuration() configuration.access_token = '' + api_client = asana.ApiClient(configuration) # create an instance of the API class - api_instance = asana.PortfoliosApi(asana.ApiClient(configuration)) + api_instance = asana.PortfoliosApi(api_client) body = asana.PortfolioGidRemoveMembersBody({"param1": "value1", "param2": "value2",}) # PortfolioGidRemoveMembersBody | Information about the members being removed. portfolio_gid = '12345' # str | Globally unique identifier for the portfolio. opt_fields = ["color","created_at","created_by","created_by.name","current_status_update","current_status_update.resource_subtype","current_status_update.title","custom_field_settings","custom_field_settings.custom_field","custom_field_settings.custom_field.asana_created_field","custom_field_settings.custom_field.created_by","custom_field_settings.custom_field.created_by.name","custom_field_settings.custom_field.currency_code","custom_field_settings.custom_field.custom_label","custom_field_settings.custom_field.custom_label_position","custom_field_settings.custom_field.date_value","custom_field_settings.custom_field.date_value.date","custom_field_settings.custom_field.date_value.date_time","custom_field_settings.custom_field.description","custom_field_settings.custom_field.display_value","custom_field_settings.custom_field.enabled","custom_field_settings.custom_field.enum_options","custom_field_settings.custom_field.enum_options.color","custom_field_settings.custom_field.enum_options.enabled","custom_field_settings.custom_field.enum_options.name","custom_field_settings.custom_field.enum_value","custom_field_settings.custom_field.enum_value.color","custom_field_settings.custom_field.enum_value.enabled","custom_field_settings.custom_field.enum_value.name","custom_field_settings.custom_field.format","custom_field_settings.custom_field.has_notifications_enabled","custom_field_settings.custom_field.is_formula_field","custom_field_settings.custom_field.is_global_to_workspace","custom_field_settings.custom_field.is_value_read_only","custom_field_settings.custom_field.multi_enum_values","custom_field_settings.custom_field.multi_enum_values.color","custom_field_settings.custom_field.multi_enum_values.enabled","custom_field_settings.custom_field.multi_enum_values.name","custom_field_settings.custom_field.name","custom_field_settings.custom_field.number_value","custom_field_settings.custom_field.people_value","custom_field_settings.custom_field.people_value.name","custom_field_settings.custom_field.precision","custom_field_settings.custom_field.resource_subtype","custom_field_settings.custom_field.text_value","custom_field_settings.custom_field.type","custom_field_settings.is_important","custom_field_settings.parent","custom_field_settings.parent.name","custom_field_settings.project","custom_field_settings.project.name","custom_fields","custom_fields.date_value","custom_fields.date_value.date","custom_fields.date_value.date_time","custom_fields.display_value","custom_fields.enabled","custom_fields.enum_options","custom_fields.enum_options.color","custom_fields.enum_options.enabled","custom_fields.enum_options.name","custom_fields.enum_value","custom_fields.enum_value.color","custom_fields.enum_value.enabled","custom_fields.enum_value.name","custom_fields.is_formula_field","custom_fields.multi_enum_values","custom_fields.multi_enum_values.color","custom_fields.multi_enum_values.enabled","custom_fields.multi_enum_values.name","custom_fields.name","custom_fields.number_value","custom_fields.resource_subtype","custom_fields.text_value","custom_fields.type","due_on","members","members.name","name","owner","owner.name","permalink_url","project_templates","project_templates.name","public","start_on","workspace","workspace.name"] # list[str] | This endpoint returns a compact resource, which excludes some properties by default. To include those optional properties, set this query parameter to a comma-separated list of the properties you wish to include. (optional) try: - # Remove users from a portfolio - api_response = api_instance.remove_members_for_portfolio(body, portfolio_gid, opt_fields=opt_fields) - pprint(api_response) + # Remove users from a portfolio + api_response = api_instance.remove_members_for_portfolio(body, portfolio_gid, opt_fields=opt_fields) + pprint(api_response) except ApiException as e: - print("Exception when calling PortfoliosApi->remove_members_for_portfolio: %s\n" % e) + print("Exception when calling PortfoliosApi->remove_members_for_portfolio: %s\n" % e) update_portfolio: |- import asana from asana.rest import ApiException @@ -233,16 +244,17 @@ PortfoliosApi: # Configure OAuth2 access token for authorization: oauth2 configuration = asana.Configuration() configuration.access_token = '' + api_client = asana.ApiClient(configuration) # create an instance of the API class - api_instance = asana.PortfoliosApi(asana.ApiClient(configuration)) + api_instance = asana.PortfoliosApi(api_client) body = asana.PortfoliosPortfolioGidBody({"param1": "value1", "param2": "value2",}) # PortfoliosPortfolioGidBody | The updated fields for the portfolio. portfolio_gid = '12345' # str | Globally unique identifier for the portfolio. opt_fields = ["color","created_at","created_by","created_by.name","current_status_update","current_status_update.resource_subtype","current_status_update.title","custom_field_settings","custom_field_settings.custom_field","custom_field_settings.custom_field.asana_created_field","custom_field_settings.custom_field.created_by","custom_field_settings.custom_field.created_by.name","custom_field_settings.custom_field.currency_code","custom_field_settings.custom_field.custom_label","custom_field_settings.custom_field.custom_label_position","custom_field_settings.custom_field.date_value","custom_field_settings.custom_field.date_value.date","custom_field_settings.custom_field.date_value.date_time","custom_field_settings.custom_field.description","custom_field_settings.custom_field.display_value","custom_field_settings.custom_field.enabled","custom_field_settings.custom_field.enum_options","custom_field_settings.custom_field.enum_options.color","custom_field_settings.custom_field.enum_options.enabled","custom_field_settings.custom_field.enum_options.name","custom_field_settings.custom_field.enum_value","custom_field_settings.custom_field.enum_value.color","custom_field_settings.custom_field.enum_value.enabled","custom_field_settings.custom_field.enum_value.name","custom_field_settings.custom_field.format","custom_field_settings.custom_field.has_notifications_enabled","custom_field_settings.custom_field.is_formula_field","custom_field_settings.custom_field.is_global_to_workspace","custom_field_settings.custom_field.is_value_read_only","custom_field_settings.custom_field.multi_enum_values","custom_field_settings.custom_field.multi_enum_values.color","custom_field_settings.custom_field.multi_enum_values.enabled","custom_field_settings.custom_field.multi_enum_values.name","custom_field_settings.custom_field.name","custom_field_settings.custom_field.number_value","custom_field_settings.custom_field.people_value","custom_field_settings.custom_field.people_value.name","custom_field_settings.custom_field.precision","custom_field_settings.custom_field.resource_subtype","custom_field_settings.custom_field.text_value","custom_field_settings.custom_field.type","custom_field_settings.is_important","custom_field_settings.parent","custom_field_settings.parent.name","custom_field_settings.project","custom_field_settings.project.name","custom_fields","custom_fields.date_value","custom_fields.date_value.date","custom_fields.date_value.date_time","custom_fields.display_value","custom_fields.enabled","custom_fields.enum_options","custom_fields.enum_options.color","custom_fields.enum_options.enabled","custom_fields.enum_options.name","custom_fields.enum_value","custom_fields.enum_value.color","custom_fields.enum_value.enabled","custom_fields.enum_value.name","custom_fields.is_formula_field","custom_fields.multi_enum_values","custom_fields.multi_enum_values.color","custom_fields.multi_enum_values.enabled","custom_fields.multi_enum_values.name","custom_fields.name","custom_fields.number_value","custom_fields.resource_subtype","custom_fields.text_value","custom_fields.type","due_on","members","members.name","name","owner","owner.name","permalink_url","project_templates","project_templates.name","public","start_on","workspace","workspace.name"] # list[str] | This endpoint returns a compact resource, which excludes some properties by default. To include those optional properties, set this query parameter to a comma-separated list of the properties you wish to include. (optional) try: - # Update a portfolio - api_response = api_instance.update_portfolio(body, portfolio_gid, opt_fields=opt_fields) - pprint(api_response) + # Update a portfolio + api_response = api_instance.update_portfolio(body, portfolio_gid, opt_fields=opt_fields) + pprint(api_response) except ApiException as e: - print("Exception when calling PortfoliosApi->update_portfolio: %s\n" % e) + print("Exception when calling PortfoliosApi->update_portfolio: %s\n" % e) diff --git a/docs/ProjectBase.md b/docs/ProjectBase.md index ead2a33e..8dc3bffb 100644 --- a/docs/ProjectBase.md +++ b/docs/ProjectBase.md @@ -21,6 +21,7 @@ Name | Type | Description | Notes **notes** | **str** | Free-form textual information associated with the project (ie., its description). | [optional] **public** | **bool** | True if the project is public to its team. | [optional] **start_on** | **date** | The day on which work for this project begins, or null if the project has no start date. This takes a date with `YYYY-MM-DD` format. *Note: `due_on` or `due_at` must be present in the request when setting or unsetting the `start_on` parameter. Additionally, `start_on` and `due_on` cannot be the same date.* | [optional] +**default_access_level** | **str** | The default access for users or teams who join or are added as members to the project. | [optional] [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/ProjectBriefsApi.md b/docs/ProjectBriefsApi.md index a2a05ec3..6c86118b 100644 --- a/docs/ProjectBriefsApi.md +++ b/docs/ProjectBriefsApi.md @@ -25,19 +25,20 @@ from pprint import pprint # Configure OAuth2 access token for authorization: oauth2 configuration = asana.Configuration() configuration.access_token = '' +api_client = asana.ApiClient(configuration) # create an instance of the API class -api_instance = asana.ProjectBriefsApi(asana.ApiClient(configuration)) +api_instance = asana.ProjectBriefsApi(api_client) body = asana.ProjectGidProjectBriefsBody({"param1": "value1", "param2": "value2",}) # ProjectGidProjectBriefsBody | The project brief to create. project_gid = '1331' # str | Globally unique identifier for the project. opt_fields = ["html_text","permalink_url","project","project.name","text","title"] # list[str] | This endpoint returns a compact resource, which excludes some properties by default. To include those optional properties, set this query parameter to a comma-separated list of the properties you wish to include. (optional) try: - # Create a project brief - api_response = api_instance.create_project_brief(body, project_gid, opt_fields=opt_fields) - pprint(api_response) + # Create a project brief + api_response = api_instance.create_project_brief(body, project_gid, opt_fields=opt_fields) + pprint(api_response) except ApiException as e: - print("Exception when calling ProjectBriefsApi->create_project_brief: %s\n" % e) + print("Exception when calling ProjectBriefsApi->create_project_brief: %s\n" % e) ``` ### Parameters @@ -79,17 +80,18 @@ from pprint import pprint # Configure OAuth2 access token for authorization: oauth2 configuration = asana.Configuration() configuration.access_token = '' +api_client = asana.ApiClient(configuration) # create an instance of the API class -api_instance = asana.ProjectBriefsApi(asana.ApiClient(configuration)) +api_instance = asana.ProjectBriefsApi(api_client) project_brief_gid = '12345' # str | Globally unique identifier for the project brief. try: - # Delete a project brief - api_response = api_instance.delete_project_brief(project_brief_gid) - pprint(api_response) + # Delete a project brief + api_response = api_instance.delete_project_brief(project_brief_gid) + pprint(api_response) except ApiException as e: - print("Exception when calling ProjectBriefsApi->delete_project_brief: %s\n" % e) + print("Exception when calling ProjectBriefsApi->delete_project_brief: %s\n" % e) ``` ### Parameters @@ -129,18 +131,19 @@ from pprint import pprint # Configure OAuth2 access token for authorization: oauth2 configuration = asana.Configuration() configuration.access_token = '' +api_client = asana.ApiClient(configuration) # create an instance of the API class -api_instance = asana.ProjectBriefsApi(asana.ApiClient(configuration)) +api_instance = asana.ProjectBriefsApi(api_client) project_brief_gid = '12345' # str | Globally unique identifier for the project brief. opt_fields = ["html_text","permalink_url","project","project.name","text","title"] # list[str] | This endpoint returns a compact resource, which excludes some properties by default. To include those optional properties, set this query parameter to a comma-separated list of the properties you wish to include. (optional) try: - # Get a project brief - api_response = api_instance.get_project_brief(project_brief_gid, opt_fields=opt_fields) - pprint(api_response) + # Get a project brief + api_response = api_instance.get_project_brief(project_brief_gid, opt_fields=opt_fields) + pprint(api_response) except ApiException as e: - print("Exception when calling ProjectBriefsApi->get_project_brief: %s\n" % e) + print("Exception when calling ProjectBriefsApi->get_project_brief: %s\n" % e) ``` ### Parameters @@ -181,19 +184,20 @@ from pprint import pprint # Configure OAuth2 access token for authorization: oauth2 configuration = asana.Configuration() configuration.access_token = '' +api_client = asana.ApiClient(configuration) # create an instance of the API class -api_instance = asana.ProjectBriefsApi(asana.ApiClient(configuration)) +api_instance = asana.ProjectBriefsApi(api_client) body = asana.ProjectBriefsProjectBriefGidBody({"param1": "value1", "param2": "value2",}) # ProjectBriefsProjectBriefGidBody | The updated fields for the project brief. project_brief_gid = '12345' # str | Globally unique identifier for the project brief. opt_fields = ["html_text","permalink_url","project","project.name","text","title"] # list[str] | This endpoint returns a compact resource, which excludes some properties by default. To include those optional properties, set this query parameter to a comma-separated list of the properties you wish to include. (optional) try: - # Update a project brief - api_response = api_instance.update_project_brief(body, project_brief_gid, opt_fields=opt_fields) - pprint(api_response) + # Update a project brief + api_response = api_instance.update_project_brief(body, project_brief_gid, opt_fields=opt_fields) + pprint(api_response) except ApiException as e: - print("Exception when calling ProjectBriefsApi->update_project_brief: %s\n" % e) + print("Exception when calling ProjectBriefsApi->update_project_brief: %s\n" % e) ``` ### Parameters diff --git a/docs/ProjectBriefsApi.yaml b/docs/ProjectBriefsApi.yaml index 48277999..6adf3599 100644 --- a/docs/ProjectBriefsApi.yaml +++ b/docs/ProjectBriefsApi.yaml @@ -7,19 +7,20 @@ ProjectBriefsApi: # Configure OAuth2 access token for authorization: oauth2 configuration = asana.Configuration() configuration.access_token = '' + api_client = asana.ApiClient(configuration) # create an instance of the API class - api_instance = asana.ProjectBriefsApi(asana.ApiClient(configuration)) + api_instance = asana.ProjectBriefsApi(api_client) body = asana.ProjectGidProjectBriefsBody({"param1": "value1", "param2": "value2",}) # ProjectGidProjectBriefsBody | The project brief to create. project_gid = '1331' # str | Globally unique identifier for the project. opt_fields = ["html_text","permalink_url","project","project.name","text","title"] # list[str] | This endpoint returns a compact resource, which excludes some properties by default. To include those optional properties, set this query parameter to a comma-separated list of the properties you wish to include. (optional) try: - # Create a project brief - api_response = api_instance.create_project_brief(body, project_gid, opt_fields=opt_fields) - pprint(api_response) + # Create a project brief + api_response = api_instance.create_project_brief(body, project_gid, opt_fields=opt_fields) + pprint(api_response) except ApiException as e: - print("Exception when calling ProjectBriefsApi->create_project_brief: %s\n" % e) + print("Exception when calling ProjectBriefsApi->create_project_brief: %s\n" % e) delete_project_brief: |- import asana from asana.rest import ApiException @@ -28,17 +29,18 @@ ProjectBriefsApi: # Configure OAuth2 access token for authorization: oauth2 configuration = asana.Configuration() configuration.access_token = '' + api_client = asana.ApiClient(configuration) # create an instance of the API class - api_instance = asana.ProjectBriefsApi(asana.ApiClient(configuration)) + api_instance = asana.ProjectBriefsApi(api_client) project_brief_gid = '12345' # str | Globally unique identifier for the project brief. try: - # Delete a project brief - api_response = api_instance.delete_project_brief(project_brief_gid) - pprint(api_response) + # Delete a project brief + api_response = api_instance.delete_project_brief(project_brief_gid) + pprint(api_response) except ApiException as e: - print("Exception when calling ProjectBriefsApi->delete_project_brief: %s\n" % e) + print("Exception when calling ProjectBriefsApi->delete_project_brief: %s\n" % e) get_project_brief: |- import asana from asana.rest import ApiException @@ -47,18 +49,19 @@ ProjectBriefsApi: # Configure OAuth2 access token for authorization: oauth2 configuration = asana.Configuration() configuration.access_token = '' + api_client = asana.ApiClient(configuration) # create an instance of the API class - api_instance = asana.ProjectBriefsApi(asana.ApiClient(configuration)) + api_instance = asana.ProjectBriefsApi(api_client) project_brief_gid = '12345' # str | Globally unique identifier for the project brief. opt_fields = ["html_text","permalink_url","project","project.name","text","title"] # list[str] | This endpoint returns a compact resource, which excludes some properties by default. To include those optional properties, set this query parameter to a comma-separated list of the properties you wish to include. (optional) try: - # Get a project brief - api_response = api_instance.get_project_brief(project_brief_gid, opt_fields=opt_fields) - pprint(api_response) + # Get a project brief + api_response = api_instance.get_project_brief(project_brief_gid, opt_fields=opt_fields) + pprint(api_response) except ApiException as e: - print("Exception when calling ProjectBriefsApi->get_project_brief: %s\n" % e) + print("Exception when calling ProjectBriefsApi->get_project_brief: %s\n" % e) update_project_brief: |- import asana from asana.rest import ApiException @@ -67,16 +70,17 @@ ProjectBriefsApi: # Configure OAuth2 access token for authorization: oauth2 configuration = asana.Configuration() configuration.access_token = '' + api_client = asana.ApiClient(configuration) # create an instance of the API class - api_instance = asana.ProjectBriefsApi(asana.ApiClient(configuration)) + api_instance = asana.ProjectBriefsApi(api_client) body = asana.ProjectBriefsProjectBriefGidBody({"param1": "value1", "param2": "value2",}) # ProjectBriefsProjectBriefGidBody | The updated fields for the project brief. project_brief_gid = '12345' # str | Globally unique identifier for the project brief. opt_fields = ["html_text","permalink_url","project","project.name","text","title"] # list[str] | This endpoint returns a compact resource, which excludes some properties by default. To include those optional properties, set this query parameter to a comma-separated list of the properties you wish to include. (optional) try: - # Update a project brief - api_response = api_instance.update_project_brief(body, project_brief_gid, opt_fields=opt_fields) - pprint(api_response) + # Update a project brief + api_response = api_instance.update_project_brief(body, project_brief_gid, opt_fields=opt_fields) + pprint(api_response) except ApiException as e: - print("Exception when calling ProjectBriefsApi->update_project_brief: %s\n" % e) + print("Exception when calling ProjectBriefsApi->update_project_brief: %s\n" % e) diff --git a/docs/ProjectMembershipsApi.md b/docs/ProjectMembershipsApi.md index a25f6d0c..1301025f 100644 --- a/docs/ProjectMembershipsApi.md +++ b/docs/ProjectMembershipsApi.md @@ -23,18 +23,19 @@ from pprint import pprint # Configure OAuth2 access token for authorization: oauth2 configuration = asana.Configuration() configuration.access_token = '' +api_client = asana.ApiClient(configuration) # create an instance of the API class -api_instance = asana.ProjectMembershipsApi(asana.ApiClient(configuration)) +api_instance = asana.ProjectMembershipsApi(api_client) project_membership_gid = '1331' # str | opt_fields = ["access_level","member","member.name","parent","parent.name","project","project.name","user","user.name","write_access"] # list[str] | This endpoint returns a compact resource, which excludes some properties by default. To include those optional properties, set this query parameter to a comma-separated list of the properties you wish to include. (optional) try: - # Get a project membership - api_response = api_instance.get_project_membership(project_membership_gid, opt_fields=opt_fields) - pprint(api_response) + # Get a project membership + api_response = api_instance.get_project_membership(project_membership_gid, opt_fields=opt_fields) + pprint(api_response) except ApiException as e: - print("Exception when calling ProjectMembershipsApi->get_project_membership: %s\n" % e) + print("Exception when calling ProjectMembershipsApi->get_project_membership: %s\n" % e) ``` ### Parameters @@ -75,9 +76,10 @@ from pprint import pprint # Configure OAuth2 access token for authorization: oauth2 configuration = asana.Configuration() configuration.access_token = '' +api_client = asana.ApiClient(configuration) # create an instance of the API class -api_instance = asana.ProjectMembershipsApi(asana.ApiClient(configuration)) +api_instance = asana.ProjectMembershipsApi(api_client) project_gid = '1331' # str | Globally unique identifier for the project. user = 'me' # str | A string identifying a user. This can either be the string \"me\", an email, or the gid of a user. (optional) limit = 50 # int | Results per page. The number of objects to return per page. The value must be between 1 and 100. (optional) @@ -85,11 +87,11 @@ offset = 'eyJ0eXAiOJiKV1iQLCJhbGciOiJIUzI1NiJ9' # str | Offset token. An offset opt_fields = ["access_level","member","member.name","offset","parent","parent.name","path","uri","user","user.name"] # list[str] | This endpoint returns a compact resource, which excludes some properties by default. To include those optional properties, set this query parameter to a comma-separated list of the properties you wish to include. (optional) try: - # Get memberships from a project - api_response = api_instance.get_project_memberships_for_project(project_gid, user=user, limit=limit, offset=offset, opt_fields=opt_fields) - pprint(api_response) + # Get memberships from a project + api_response = api_instance.get_project_memberships_for_project(project_gid, user=user, limit=limit, offset=offset, opt_fields=opt_fields) + pprint(api_response) except ApiException as e: - print("Exception when calling ProjectMembershipsApi->get_project_memberships_for_project: %s\n" % e) + print("Exception when calling ProjectMembershipsApi->get_project_memberships_for_project: %s\n" % e) ``` ### Parameters diff --git a/docs/ProjectMembershipsApi.yaml b/docs/ProjectMembershipsApi.yaml index 5e7e41af..e68a3aa4 100644 --- a/docs/ProjectMembershipsApi.yaml +++ b/docs/ProjectMembershipsApi.yaml @@ -7,18 +7,19 @@ ProjectMembershipsApi: # Configure OAuth2 access token for authorization: oauth2 configuration = asana.Configuration() configuration.access_token = '' + api_client = asana.ApiClient(configuration) # create an instance of the API class - api_instance = asana.ProjectMembershipsApi(asana.ApiClient(configuration)) + api_instance = asana.ProjectMembershipsApi(api_client) project_membership_gid = '1331' # str | opt_fields = ["access_level","member","member.name","parent","parent.name","project","project.name","user","user.name","write_access"] # list[str] | This endpoint returns a compact resource, which excludes some properties by default. To include those optional properties, set this query parameter to a comma-separated list of the properties you wish to include. (optional) try: - # Get a project membership - api_response = api_instance.get_project_membership(project_membership_gid, opt_fields=opt_fields) - pprint(api_response) + # Get a project membership + api_response = api_instance.get_project_membership(project_membership_gid, opt_fields=opt_fields) + pprint(api_response) except ApiException as e: - print("Exception when calling ProjectMembershipsApi->get_project_membership: %s\n" % e) + print("Exception when calling ProjectMembershipsApi->get_project_membership: %s\n" % e) get_project_memberships_for_project: |- import asana from asana.rest import ApiException @@ -27,9 +28,10 @@ ProjectMembershipsApi: # Configure OAuth2 access token for authorization: oauth2 configuration = asana.Configuration() configuration.access_token = '' + api_client = asana.ApiClient(configuration) # create an instance of the API class - api_instance = asana.ProjectMembershipsApi(asana.ApiClient(configuration)) + api_instance = asana.ProjectMembershipsApi(api_client) project_gid = '1331' # str | Globally unique identifier for the project. user = 'me' # str | A string identifying a user. This can either be the string \"me\", an email, or the gid of a user. (optional) limit = 50 # int | Results per page. The number of objects to return per page. The value must be between 1 and 100. (optional) @@ -37,8 +39,8 @@ ProjectMembershipsApi: opt_fields = ["access_level","member","member.name","offset","parent","parent.name","path","uri","user","user.name"] # list[str] | This endpoint returns a compact resource, which excludes some properties by default. To include those optional properties, set this query parameter to a comma-separated list of the properties you wish to include. (optional) try: - # Get memberships from a project - api_response = api_instance.get_project_memberships_for_project(project_gid, user=user, limit=limit, offset=offset, opt_fields=opt_fields) - pprint(api_response) + # Get memberships from a project + api_response = api_instance.get_project_memberships_for_project(project_gid, user=user, limit=limit, offset=offset, opt_fields=opt_fields) + pprint(api_response) except ApiException as e: - print("Exception when calling ProjectMembershipsApi->get_project_memberships_for_project: %s\n" % e) + print("Exception when calling ProjectMembershipsApi->get_project_memberships_for_project: %s\n" % e) diff --git a/docs/ProjectRequest.md b/docs/ProjectRequest.md index 40b16647..0742f3fc 100644 --- a/docs/ProjectRequest.md +++ b/docs/ProjectRequest.md @@ -21,11 +21,11 @@ Name | Type | Description | Notes **notes** | **str** | Free-form textual information associated with the project (ie., its description). | [optional] **public** | **bool** | True if the project is public to its team. | [optional] **start_on** | **date** | The day on which work for this project begins, or null if the project has no start date. This takes a date with `YYYY-MM-DD` format. *Note: `due_on` or `due_at` must be present in the request when setting or unsetting the `start_on` parameter. Additionally, `start_on` and `due_on` cannot be the same date.* | [optional] +**default_access_level** | **str** | The default access for users or teams who join or are added as members to the project. | [optional] **custom_fields** | **dict(str, str)** | An object where each key is a Custom Field GID and each value is an enum GID, string, number, or object. | [optional] **followers** | **str** | *Create-only*. Comma separated string of users. Followers are a subset of members who have opted in to receive \"tasks added\" notifications for a project. | [optional] **owner** | **str** | The current owner of the project, may be null. | [optional] **team** | **str** | The team that this project is shared with. | [optional] -**default_access_level** | **str** | The default access users for users who join or are added as members to the project. | [optional] **workspace** | **str** | The `gid` of a workspace. | [optional] [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/ProjectResponse.md b/docs/ProjectResponse.md index ca305a5e..6bed5c33 100644 --- a/docs/ProjectResponse.md +++ b/docs/ProjectResponse.md @@ -21,6 +21,7 @@ Name | Type | Description | Notes **notes** | **str** | Free-form textual information associated with the project (ie., its description). | [optional] **public** | **bool** | True if the project is public to its team. | [optional] **start_on** | **date** | The day on which work for this project begins, or null if the project has no start date. This takes a date with `YYYY-MM-DD` format. *Note: `due_on` or `due_at` must be present in the request when setting or unsetting the `start_on` parameter. Additionally, `start_on` and `due_on` cannot be the same date.* | [optional] +**default_access_level** | **str** | The default access for users or teams who join or are added as members to the project. | [optional] **custom_fields** | [**list[PortfolioResponseCustomFields]**](PortfolioResponseCustomFields.md) | Array of Custom Fields. | [optional] **completed** | **bool** | True if the project is currently marked complete, false if not. | [optional] **completed_at** | **datetime** | The time at which this project was completed, or null if the project is not completed. | [optional] @@ -32,7 +33,6 @@ Name | Type | Description | Notes **permalink_url** | **str** | A url that points directly to the object within Asana. | [optional] **project_brief** | [**ProjectResponseProjectBrief**](ProjectResponseProjectBrief.md) | | [optional] **created_from_template** | [**ProjectResponseCreatedFromTemplate**](ProjectResponseCreatedFromTemplate.md) | | [optional] -**default_access_level** | **str** | The default access users for users who join or are added as members to the project. | [optional] **workspace** | [**ProjectResponseWorkspace**](ProjectResponseWorkspace.md) | | [optional] [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/ProjectStatusesApi.md b/docs/ProjectStatusesApi.md index c4621c50..0b567317 100644 --- a/docs/ProjectStatusesApi.md +++ b/docs/ProjectStatusesApi.md @@ -25,19 +25,20 @@ from pprint import pprint # Configure OAuth2 access token for authorization: oauth2 configuration = asana.Configuration() configuration.access_token = '' +api_client = asana.ApiClient(configuration) # create an instance of the API class -api_instance = asana.ProjectStatusesApi(asana.ApiClient(configuration)) +api_instance = asana.ProjectStatusesApi(api_client) body = asana.ProjectGidProjectStatusesBody({"param1": "value1", "param2": "value2",}) # ProjectGidProjectStatusesBody | The project status to create. project_gid = '1331' # str | Globally unique identifier for the project. opt_fields = ["author","author.name","color","created_at","created_by","created_by.name","html_text","modified_at","text","title"] # list[str] | This endpoint returns a compact resource, which excludes some properties by default. To include those optional properties, set this query parameter to a comma-separated list of the properties you wish to include. (optional) try: - # Create a project status - api_response = api_instance.create_project_status_for_project(body, project_gid, opt_fields=opt_fields) - pprint(api_response) + # Create a project status + api_response = api_instance.create_project_status_for_project(body, project_gid, opt_fields=opt_fields) + pprint(api_response) except ApiException as e: - print("Exception when calling ProjectStatusesApi->create_project_status_for_project: %s\n" % e) + print("Exception when calling ProjectStatusesApi->create_project_status_for_project: %s\n" % e) ``` ### Parameters @@ -79,17 +80,18 @@ from pprint import pprint # Configure OAuth2 access token for authorization: oauth2 configuration = asana.Configuration() configuration.access_token = '' +api_client = asana.ApiClient(configuration) # create an instance of the API class -api_instance = asana.ProjectStatusesApi(asana.ApiClient(configuration)) +api_instance = asana.ProjectStatusesApi(api_client) project_status_gid = '321654' # str | The project status update to get. try: - # Delete a project status - api_response = api_instance.delete_project_status(project_status_gid) - pprint(api_response) + # Delete a project status + api_response = api_instance.delete_project_status(project_status_gid) + pprint(api_response) except ApiException as e: - print("Exception when calling ProjectStatusesApi->delete_project_status: %s\n" % e) + print("Exception when calling ProjectStatusesApi->delete_project_status: %s\n" % e) ``` ### Parameters @@ -129,18 +131,19 @@ from pprint import pprint # Configure OAuth2 access token for authorization: oauth2 configuration = asana.Configuration() configuration.access_token = '' +api_client = asana.ApiClient(configuration) # create an instance of the API class -api_instance = asana.ProjectStatusesApi(asana.ApiClient(configuration)) +api_instance = asana.ProjectStatusesApi(api_client) project_status_gid = '321654' # str | The project status update to get. opt_fields = ["author","author.name","color","created_at","created_by","created_by.name","html_text","modified_at","text","title"] # list[str] | This endpoint returns a compact resource, which excludes some properties by default. To include those optional properties, set this query parameter to a comma-separated list of the properties you wish to include. (optional) try: - # Get a project status - api_response = api_instance.get_project_status(project_status_gid, opt_fields=opt_fields) - pprint(api_response) + # Get a project status + api_response = api_instance.get_project_status(project_status_gid, opt_fields=opt_fields) + pprint(api_response) except ApiException as e: - print("Exception when calling ProjectStatusesApi->get_project_status: %s\n" % e) + print("Exception when calling ProjectStatusesApi->get_project_status: %s\n" % e) ``` ### Parameters @@ -181,20 +184,21 @@ from pprint import pprint # Configure OAuth2 access token for authorization: oauth2 configuration = asana.Configuration() configuration.access_token = '' +api_client = asana.ApiClient(configuration) # create an instance of the API class -api_instance = asana.ProjectStatusesApi(asana.ApiClient(configuration)) +api_instance = asana.ProjectStatusesApi(api_client) project_gid = '1331' # str | Globally unique identifier for the project. limit = 50 # int | Results per page. The number of objects to return per page. The value must be between 1 and 100. (optional) offset = 'eyJ0eXAiOJiKV1iQLCJhbGciOiJIUzI1NiJ9' # 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.' (optional) opt_fields = ["author","author.name","color","created_at","created_by","created_by.name","html_text","modified_at","offset","path","text","title","uri"] # list[str] | This endpoint returns a compact resource, which excludes some properties by default. To include those optional properties, set this query parameter to a comma-separated list of the properties you wish to include. (optional) try: - # Get statuses from a project - api_response = api_instance.get_project_statuses_for_project(project_gid, limit=limit, offset=offset, opt_fields=opt_fields) - pprint(api_response) + # Get statuses from a project + api_response = api_instance.get_project_statuses_for_project(project_gid, limit=limit, offset=offset, opt_fields=opt_fields) + pprint(api_response) except ApiException as e: - print("Exception when calling ProjectStatusesApi->get_project_statuses_for_project: %s\n" % e) + print("Exception when calling ProjectStatusesApi->get_project_statuses_for_project: %s\n" % e) ``` ### Parameters diff --git a/docs/ProjectStatusesApi.yaml b/docs/ProjectStatusesApi.yaml index b1bcffb1..213608e9 100644 --- a/docs/ProjectStatusesApi.yaml +++ b/docs/ProjectStatusesApi.yaml @@ -7,19 +7,20 @@ ProjectStatusesApi: # Configure OAuth2 access token for authorization: oauth2 configuration = asana.Configuration() configuration.access_token = '' + api_client = asana.ApiClient(configuration) # create an instance of the API class - api_instance = asana.ProjectStatusesApi(asana.ApiClient(configuration)) + api_instance = asana.ProjectStatusesApi(api_client) body = asana.ProjectGidProjectStatusesBody({"param1": "value1", "param2": "value2",}) # ProjectGidProjectStatusesBody | The project status to create. project_gid = '1331' # str | Globally unique identifier for the project. opt_fields = ["author","author.name","color","created_at","created_by","created_by.name","html_text","modified_at","text","title"] # list[str] | This endpoint returns a compact resource, which excludes some properties by default. To include those optional properties, set this query parameter to a comma-separated list of the properties you wish to include. (optional) try: - # Create a project status - api_response = api_instance.create_project_status_for_project(body, project_gid, opt_fields=opt_fields) - pprint(api_response) + # Create a project status + api_response = api_instance.create_project_status_for_project(body, project_gid, opt_fields=opt_fields) + pprint(api_response) except ApiException as e: - print("Exception when calling ProjectStatusesApi->create_project_status_for_project: %s\n" % e) + print("Exception when calling ProjectStatusesApi->create_project_status_for_project: %s\n" % e) delete_project_status: |- import asana from asana.rest import ApiException @@ -28,17 +29,18 @@ ProjectStatusesApi: # Configure OAuth2 access token for authorization: oauth2 configuration = asana.Configuration() configuration.access_token = '' + api_client = asana.ApiClient(configuration) # create an instance of the API class - api_instance = asana.ProjectStatusesApi(asana.ApiClient(configuration)) + api_instance = asana.ProjectStatusesApi(api_client) project_status_gid = '321654' # str | The project status update to get. try: - # Delete a project status - api_response = api_instance.delete_project_status(project_status_gid) - pprint(api_response) + # Delete a project status + api_response = api_instance.delete_project_status(project_status_gid) + pprint(api_response) except ApiException as e: - print("Exception when calling ProjectStatusesApi->delete_project_status: %s\n" % e) + print("Exception when calling ProjectStatusesApi->delete_project_status: %s\n" % e) get_project_status: |- import asana from asana.rest import ApiException @@ -47,18 +49,19 @@ ProjectStatusesApi: # Configure OAuth2 access token for authorization: oauth2 configuration = asana.Configuration() configuration.access_token = '' + api_client = asana.ApiClient(configuration) # create an instance of the API class - api_instance = asana.ProjectStatusesApi(asana.ApiClient(configuration)) + api_instance = asana.ProjectStatusesApi(api_client) project_status_gid = '321654' # str | The project status update to get. opt_fields = ["author","author.name","color","created_at","created_by","created_by.name","html_text","modified_at","text","title"] # list[str] | This endpoint returns a compact resource, which excludes some properties by default. To include those optional properties, set this query parameter to a comma-separated list of the properties you wish to include. (optional) try: - # Get a project status - api_response = api_instance.get_project_status(project_status_gid, opt_fields=opt_fields) - pprint(api_response) + # Get a project status + api_response = api_instance.get_project_status(project_status_gid, opt_fields=opt_fields) + pprint(api_response) except ApiException as e: - print("Exception when calling ProjectStatusesApi->get_project_status: %s\n" % e) + print("Exception when calling ProjectStatusesApi->get_project_status: %s\n" % e) get_project_statuses_for_project: |- import asana from asana.rest import ApiException @@ -67,17 +70,18 @@ ProjectStatusesApi: # Configure OAuth2 access token for authorization: oauth2 configuration = asana.Configuration() configuration.access_token = '' + api_client = asana.ApiClient(configuration) # create an instance of the API class - api_instance = asana.ProjectStatusesApi(asana.ApiClient(configuration)) + api_instance = asana.ProjectStatusesApi(api_client) project_gid = '1331' # str | Globally unique identifier for the project. limit = 50 # int | Results per page. The number of objects to return per page. The value must be between 1 and 100. (optional) offset = 'eyJ0eXAiOJiKV1iQLCJhbGciOiJIUzI1NiJ9' # 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.' (optional) opt_fields = ["author","author.name","color","created_at","created_by","created_by.name","html_text","modified_at","offset","path","text","title","uri"] # list[str] | This endpoint returns a compact resource, which excludes some properties by default. To include those optional properties, set this query parameter to a comma-separated list of the properties you wish to include. (optional) try: - # Get statuses from a project - api_response = api_instance.get_project_statuses_for_project(project_gid, limit=limit, offset=offset, opt_fields=opt_fields) - pprint(api_response) + # Get statuses from a project + api_response = api_instance.get_project_statuses_for_project(project_gid, limit=limit, offset=offset, opt_fields=opt_fields) + pprint(api_response) except ApiException as e: - print("Exception when calling ProjectStatusesApi->get_project_statuses_for_project: %s\n" % e) + print("Exception when calling ProjectStatusesApi->get_project_statuses_for_project: %s\n" % e) diff --git a/docs/ProjectTemplatesApi.md b/docs/ProjectTemplatesApi.md index e07a1c5b..0ca5ff12 100644 --- a/docs/ProjectTemplatesApi.md +++ b/docs/ProjectTemplatesApi.md @@ -26,17 +26,18 @@ from pprint import pprint # Configure OAuth2 access token for authorization: oauth2 configuration = asana.Configuration() configuration.access_token = '' +api_client = asana.ApiClient(configuration) # create an instance of the API class -api_instance = asana.ProjectTemplatesApi(asana.ApiClient(configuration)) +api_instance = asana.ProjectTemplatesApi(api_client) project_template_gid = '1331' # str | Globally unique identifier for the project template. try: - # Delete a project template - api_response = api_instance.delete_project_template(project_template_gid) - pprint(api_response) + # Delete a project template + api_response = api_instance.delete_project_template(project_template_gid) + pprint(api_response) except ApiException as e: - print("Exception when calling ProjectTemplatesApi->delete_project_template: %s\n" % e) + print("Exception when calling ProjectTemplatesApi->delete_project_template: %s\n" % e) ``` ### Parameters @@ -76,18 +77,19 @@ from pprint import pprint # Configure OAuth2 access token for authorization: oauth2 configuration = asana.Configuration() configuration.access_token = '' +api_client = asana.ApiClient(configuration) # create an instance of the API class -api_instance = asana.ProjectTemplatesApi(asana.ApiClient(configuration)) +api_instance = asana.ProjectTemplatesApi(api_client) project_template_gid = '1331' # str | Globally unique identifier for the project template. opt_fields = ["color","description","html_description","name","owner","public","requested_dates","requested_dates.description","requested_dates.name","requested_roles","requested_roles.name","team","team.name"] # list[str] | This endpoint returns a compact resource, which excludes some properties by default. To include those optional properties, set this query parameter to a comma-separated list of the properties you wish to include. (optional) try: - # Get a project template - api_response = api_instance.get_project_template(project_template_gid, opt_fields=opt_fields) - pprint(api_response) + # Get a project template + api_response = api_instance.get_project_template(project_template_gid, opt_fields=opt_fields) + pprint(api_response) except ApiException as e: - print("Exception when calling ProjectTemplatesApi->get_project_template: %s\n" % e) + print("Exception when calling ProjectTemplatesApi->get_project_template: %s\n" % e) ``` ### Parameters @@ -128,9 +130,10 @@ from pprint import pprint # Configure OAuth2 access token for authorization: oauth2 configuration = asana.Configuration() configuration.access_token = '' +api_client = asana.ApiClient(configuration) # create an instance of the API class -api_instance = asana.ProjectTemplatesApi(asana.ApiClient(configuration)) +api_instance = asana.ProjectTemplatesApi(api_client) workspace = '12345' # str | The workspace to filter results on. (optional) team = '14916' # str | The team to filter projects on. (optional) limit = 50 # int | Results per page. The number of objects to return per page. The value must be between 1 and 100. (optional) @@ -138,11 +141,11 @@ offset = 'eyJ0eXAiOJiKV1iQLCJhbGciOiJIUzI1NiJ9' # str | Offset token. An offset opt_fields = ["color","description","html_description","name","offset","owner","path","public","requested_dates","requested_dates.description","requested_dates.name","requested_roles","requested_roles.name","team","team.name","uri"] # list[str] | This endpoint returns a compact resource, which excludes some properties by default. To include those optional properties, set this query parameter to a comma-separated list of the properties you wish to include. (optional) try: - # Get multiple project templates - api_response = api_instance.get_project_templates(workspace=workspace, team=team, limit=limit, offset=offset, opt_fields=opt_fields) - pprint(api_response) + # Get multiple project templates + api_response = api_instance.get_project_templates(workspace=workspace, team=team, limit=limit, offset=offset, opt_fields=opt_fields) + pprint(api_response) except ApiException as e: - print("Exception when calling ProjectTemplatesApi->get_project_templates: %s\n" % e) + print("Exception when calling ProjectTemplatesApi->get_project_templates: %s\n" % e) ``` ### Parameters @@ -186,20 +189,21 @@ from pprint import pprint # Configure OAuth2 access token for authorization: oauth2 configuration = asana.Configuration() configuration.access_token = '' +api_client = asana.ApiClient(configuration) # create an instance of the API class -api_instance = asana.ProjectTemplatesApi(asana.ApiClient(configuration)) +api_instance = asana.ProjectTemplatesApi(api_client) team_gid = '159874' # str | Globally unique identifier for the team. limit = 50 # int | Results per page. The number of objects to return per page. The value must be between 1 and 100. (optional) offset = 'eyJ0eXAiOJiKV1iQLCJhbGciOiJIUzI1NiJ9' # 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.' (optional) opt_fields = ["color","description","html_description","name","offset","owner","path","public","requested_dates","requested_dates.description","requested_dates.name","requested_roles","requested_roles.name","team","team.name","uri"] # list[str] | This endpoint returns a compact resource, which excludes some properties by default. To include those optional properties, set this query parameter to a comma-separated list of the properties you wish to include. (optional) try: - # Get a team's project templates - api_response = api_instance.get_project_templates_for_team(team_gid, limit=limit, offset=offset, opt_fields=opt_fields) - pprint(api_response) + # Get a team's project templates + api_response = api_instance.get_project_templates_for_team(team_gid, limit=limit, offset=offset, opt_fields=opt_fields) + pprint(api_response) except ApiException as e: - print("Exception when calling ProjectTemplatesApi->get_project_templates_for_team: %s\n" % e) + print("Exception when calling ProjectTemplatesApi->get_project_templates_for_team: %s\n" % e) ``` ### Parameters @@ -242,19 +246,20 @@ from pprint import pprint # Configure OAuth2 access token for authorization: oauth2 configuration = asana.Configuration() configuration.access_token = '' +api_client = asana.ApiClient(configuration) # create an instance of the API class -api_instance = asana.ProjectTemplatesApi(asana.ApiClient(configuration)) +api_instance = asana.ProjectTemplatesApi(api_client) project_template_gid = '1331' # str | Globally unique identifier for the project template. body = asana.ProjectTemplateGidInstantiateProjectBody({"param1": "value1", "param2": "value2",}) # ProjectTemplateGidInstantiateProjectBody | Describes the inputs used for instantiating a project, such as the resulting project's name, which team it should be created in, and values for date variables. (optional) opt_fields = ["new_project","new_project.name","new_project_template","new_project_template.name","new_task","new_task.created_by","new_task.name","new_task.resource_subtype","resource_subtype","status"] # list[str] | This endpoint returns a compact resource, which excludes some properties by default. To include those optional properties, set this query parameter to a comma-separated list of the properties you wish to include. (optional) try: - # Instantiate a project from a project template - api_response = api_instance.instantiate_project(project_template_gid, body=body, opt_fields=opt_fields) - pprint(api_response) + # Instantiate a project from a project template + api_response = api_instance.instantiate_project(project_template_gid, body=body, opt_fields=opt_fields) + pprint(api_response) except ApiException as e: - print("Exception when calling ProjectTemplatesApi->instantiate_project: %s\n" % e) + print("Exception when calling ProjectTemplatesApi->instantiate_project: %s\n" % e) ``` ### Parameters diff --git a/docs/ProjectTemplatesApi.yaml b/docs/ProjectTemplatesApi.yaml index c2e1bad1..33452c53 100644 --- a/docs/ProjectTemplatesApi.yaml +++ b/docs/ProjectTemplatesApi.yaml @@ -7,17 +7,18 @@ ProjectTemplatesApi: # Configure OAuth2 access token for authorization: oauth2 configuration = asana.Configuration() configuration.access_token = '' + api_client = asana.ApiClient(configuration) # create an instance of the API class - api_instance = asana.ProjectTemplatesApi(asana.ApiClient(configuration)) + api_instance = asana.ProjectTemplatesApi(api_client) project_template_gid = '1331' # str | Globally unique identifier for the project template. try: - # Delete a project template - api_response = api_instance.delete_project_template(project_template_gid) - pprint(api_response) + # Delete a project template + api_response = api_instance.delete_project_template(project_template_gid) + pprint(api_response) except ApiException as e: - print("Exception when calling ProjectTemplatesApi->delete_project_template: %s\n" % e) + print("Exception when calling ProjectTemplatesApi->delete_project_template: %s\n" % e) get_project_template: |- import asana from asana.rest import ApiException @@ -26,18 +27,19 @@ ProjectTemplatesApi: # Configure OAuth2 access token for authorization: oauth2 configuration = asana.Configuration() configuration.access_token = '' + api_client = asana.ApiClient(configuration) # create an instance of the API class - api_instance = asana.ProjectTemplatesApi(asana.ApiClient(configuration)) + api_instance = asana.ProjectTemplatesApi(api_client) project_template_gid = '1331' # str | Globally unique identifier for the project template. opt_fields = ["color","description","html_description","name","owner","public","requested_dates","requested_dates.description","requested_dates.name","requested_roles","requested_roles.name","team","team.name"] # list[str] | This endpoint returns a compact resource, which excludes some properties by default. To include those optional properties, set this query parameter to a comma-separated list of the properties you wish to include. (optional) try: - # Get a project template - api_response = api_instance.get_project_template(project_template_gid, opt_fields=opt_fields) - pprint(api_response) + # Get a project template + api_response = api_instance.get_project_template(project_template_gid, opt_fields=opt_fields) + pprint(api_response) except ApiException as e: - print("Exception when calling ProjectTemplatesApi->get_project_template: %s\n" % e) + print("Exception when calling ProjectTemplatesApi->get_project_template: %s\n" % e) get_project_templates: |- import asana from asana.rest import ApiException @@ -46,9 +48,10 @@ ProjectTemplatesApi: # Configure OAuth2 access token for authorization: oauth2 configuration = asana.Configuration() configuration.access_token = '' + api_client = asana.ApiClient(configuration) # create an instance of the API class - api_instance = asana.ProjectTemplatesApi(asana.ApiClient(configuration)) + api_instance = asana.ProjectTemplatesApi(api_client) workspace = '12345' # str | The workspace to filter results on. (optional) team = '14916' # str | The team to filter projects on. (optional) limit = 50 # int | Results per page. The number of objects to return per page. The value must be between 1 and 100. (optional) @@ -56,11 +59,11 @@ ProjectTemplatesApi: opt_fields = ["color","description","html_description","name","offset","owner","path","public","requested_dates","requested_dates.description","requested_dates.name","requested_roles","requested_roles.name","team","team.name","uri"] # list[str] | This endpoint returns a compact resource, which excludes some properties by default. To include those optional properties, set this query parameter to a comma-separated list of the properties you wish to include. (optional) try: - # Get multiple project templates - api_response = api_instance.get_project_templates(workspace=workspace, team=team, limit=limit, offset=offset, opt_fields=opt_fields) - pprint(api_response) + # Get multiple project templates + api_response = api_instance.get_project_templates(workspace=workspace, team=team, limit=limit, offset=offset, opt_fields=opt_fields) + pprint(api_response) except ApiException as e: - print("Exception when calling ProjectTemplatesApi->get_project_templates: %s\n" % e) + print("Exception when calling ProjectTemplatesApi->get_project_templates: %s\n" % e) get_project_templates_for_team: |- import asana from asana.rest import ApiException @@ -69,20 +72,21 @@ ProjectTemplatesApi: # Configure OAuth2 access token for authorization: oauth2 configuration = asana.Configuration() configuration.access_token = '' + api_client = asana.ApiClient(configuration) # create an instance of the API class - api_instance = asana.ProjectTemplatesApi(asana.ApiClient(configuration)) + api_instance = asana.ProjectTemplatesApi(api_client) team_gid = '159874' # str | Globally unique identifier for the team. limit = 50 # int | Results per page. The number of objects to return per page. The value must be between 1 and 100. (optional) offset = 'eyJ0eXAiOJiKV1iQLCJhbGciOiJIUzI1NiJ9' # 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.' (optional) opt_fields = ["color","description","html_description","name","offset","owner","path","public","requested_dates","requested_dates.description","requested_dates.name","requested_roles","requested_roles.name","team","team.name","uri"] # list[str] | This endpoint returns a compact resource, which excludes some properties by default. To include those optional properties, set this query parameter to a comma-separated list of the properties you wish to include. (optional) try: - # Get a team's project templates - api_response = api_instance.get_project_templates_for_team(team_gid, limit=limit, offset=offset, opt_fields=opt_fields) - pprint(api_response) + # Get a team's project templates + api_response = api_instance.get_project_templates_for_team(team_gid, limit=limit, offset=offset, opt_fields=opt_fields) + pprint(api_response) except ApiException as e: - print("Exception when calling ProjectTemplatesApi->get_project_templates_for_team: %s\n" % e) + print("Exception when calling ProjectTemplatesApi->get_project_templates_for_team: %s\n" % e) instantiate_project: |- import asana from asana.rest import ApiException @@ -91,16 +95,17 @@ ProjectTemplatesApi: # Configure OAuth2 access token for authorization: oauth2 configuration = asana.Configuration() configuration.access_token = '' + api_client = asana.ApiClient(configuration) # create an instance of the API class - api_instance = asana.ProjectTemplatesApi(asana.ApiClient(configuration)) + api_instance = asana.ProjectTemplatesApi(api_client) project_template_gid = '1331' # str | Globally unique identifier for the project template. body = asana.ProjectTemplateGidInstantiateProjectBody({"param1": "value1", "param2": "value2",}) # ProjectTemplateGidInstantiateProjectBody | Describes the inputs used for instantiating a project, such as the resulting project's name, which team it should be created in, and values for date variables. (optional) opt_fields = ["new_project","new_project.name","new_project_template","new_project_template.name","new_task","new_task.created_by","new_task.name","new_task.resource_subtype","resource_subtype","status"] # list[str] | This endpoint returns a compact resource, which excludes some properties by default. To include those optional properties, set this query parameter to a comma-separated list of the properties you wish to include. (optional) try: - # Instantiate a project from a project template - api_response = api_instance.instantiate_project(project_template_gid, body=body, opt_fields=opt_fields) - pprint(api_response) + # Instantiate a project from a project template + api_response = api_instance.instantiate_project(project_template_gid, body=body, opt_fields=opt_fields) + pprint(api_response) except ApiException as e: - print("Exception when calling ProjectTemplatesApi->instantiate_project: %s\n" % e) + print("Exception when calling ProjectTemplatesApi->instantiate_project: %s\n" % e) diff --git a/docs/ProjectUpdateRequest.md b/docs/ProjectUpdateRequest.md index ea85c6f3..4224ae05 100644 --- a/docs/ProjectUpdateRequest.md +++ b/docs/ProjectUpdateRequest.md @@ -21,6 +21,7 @@ Name | Type | Description | Notes **notes** | **str** | Free-form textual information associated with the project (ie., its description). | [optional] **public** | **bool** | True if the project is public to its team. | [optional] **start_on** | **date** | The day on which work for this project begins, or null if the project has no start date. This takes a date with `YYYY-MM-DD` format. *Note: `due_on` or `due_at` must be present in the request when setting or unsetting the `start_on` parameter. Additionally, `start_on` and `due_on` cannot be the same date.* | [optional] +**default_access_level** | **str** | The default access for users or teams who join or are added as members to the project. | [optional] **custom_fields** | **dict(str, str)** | An object where each key is a Custom Field GID and each value is an enum GID, string, number, or object. | [optional] **followers** | **str** | *Create-only*. Comma separated string of users. Followers are a subset of members who have opted in to receive \"tasks added\" notifications for a project. | [optional] **owner** | **str** | The current owner of the project, may be null. | [optional] diff --git a/docs/ProjectsApi.md b/docs/ProjectsApi.md index 398e4d1b..90b2d2c4 100644 --- a/docs/ProjectsApi.md +++ b/docs/ProjectsApi.md @@ -40,18 +40,19 @@ from pprint import pprint # Configure OAuth2 access token for authorization: oauth2 configuration = asana.Configuration() configuration.access_token = '' +api_client = asana.ApiClient(configuration) # create an instance of the API class -api_instance = asana.ProjectsApi(asana.ApiClient(configuration)) +api_instance = asana.ProjectsApi(api_client) body = asana.ProjectGidAddCustomFieldSettingBody({"param1": "value1", "param2": "value2",}) # ProjectGidAddCustomFieldSettingBody | Information about the custom field setting. project_gid = '1331' # str | Globally unique identifier for the project. try: - # Add a custom field to a project - api_response = api_instance.add_custom_field_setting_for_project(body, project_gid) - pprint(api_response) + # Add a custom field to a project + api_response = api_instance.add_custom_field_setting_for_project(body, project_gid) + pprint(api_response) except ApiException as e: - print("Exception when calling ProjectsApi->add_custom_field_setting_for_project: %s\n" % e) + print("Exception when calling ProjectsApi->add_custom_field_setting_for_project: %s\n" % e) ``` ### Parameters @@ -92,19 +93,20 @@ from pprint import pprint # Configure OAuth2 access token for authorization: oauth2 configuration = asana.Configuration() configuration.access_token = '' +api_client = asana.ApiClient(configuration) # create an instance of the API class -api_instance = asana.ProjectsApi(asana.ApiClient(configuration)) +api_instance = asana.ProjectsApi(api_client) body = asana.ProjectGidAddFollowersBody({"param1": "value1", "param2": "value2",}) # ProjectGidAddFollowersBody | Information about the followers being added. project_gid = '1331' # str | Globally unique identifier for the project. opt_fields = ["archived","color","completed","completed_at","completed_by","completed_by.name","created_at","created_from_template","created_from_template.name","current_status","current_status.author","current_status.author.name","current_status.color","current_status.created_at","current_status.created_by","current_status.created_by.name","current_status.html_text","current_status.modified_at","current_status.text","current_status.title","current_status_update","current_status_update.resource_subtype","current_status_update.title","custom_field_settings","custom_field_settings.custom_field","custom_field_settings.custom_field.asana_created_field","custom_field_settings.custom_field.created_by","custom_field_settings.custom_field.created_by.name","custom_field_settings.custom_field.currency_code","custom_field_settings.custom_field.custom_label","custom_field_settings.custom_field.custom_label_position","custom_field_settings.custom_field.date_value","custom_field_settings.custom_field.date_value.date","custom_field_settings.custom_field.date_value.date_time","custom_field_settings.custom_field.description","custom_field_settings.custom_field.display_value","custom_field_settings.custom_field.enabled","custom_field_settings.custom_field.enum_options","custom_field_settings.custom_field.enum_options.color","custom_field_settings.custom_field.enum_options.enabled","custom_field_settings.custom_field.enum_options.name","custom_field_settings.custom_field.enum_value","custom_field_settings.custom_field.enum_value.color","custom_field_settings.custom_field.enum_value.enabled","custom_field_settings.custom_field.enum_value.name","custom_field_settings.custom_field.format","custom_field_settings.custom_field.has_notifications_enabled","custom_field_settings.custom_field.is_formula_field","custom_field_settings.custom_field.is_global_to_workspace","custom_field_settings.custom_field.is_value_read_only","custom_field_settings.custom_field.multi_enum_values","custom_field_settings.custom_field.multi_enum_values.color","custom_field_settings.custom_field.multi_enum_values.enabled","custom_field_settings.custom_field.multi_enum_values.name","custom_field_settings.custom_field.name","custom_field_settings.custom_field.number_value","custom_field_settings.custom_field.people_value","custom_field_settings.custom_field.people_value.name","custom_field_settings.custom_field.precision","custom_field_settings.custom_field.resource_subtype","custom_field_settings.custom_field.text_value","custom_field_settings.custom_field.type","custom_field_settings.is_important","custom_field_settings.parent","custom_field_settings.parent.name","custom_field_settings.project","custom_field_settings.project.name","custom_fields","custom_fields.date_value","custom_fields.date_value.date","custom_fields.date_value.date_time","custom_fields.display_value","custom_fields.enabled","custom_fields.enum_options","custom_fields.enum_options.color","custom_fields.enum_options.enabled","custom_fields.enum_options.name","custom_fields.enum_value","custom_fields.enum_value.color","custom_fields.enum_value.enabled","custom_fields.enum_value.name","custom_fields.is_formula_field","custom_fields.multi_enum_values","custom_fields.multi_enum_values.color","custom_fields.multi_enum_values.enabled","custom_fields.multi_enum_values.name","custom_fields.name","custom_fields.number_value","custom_fields.resource_subtype","custom_fields.text_value","custom_fields.type","default_access_level","default_view","due_date","due_on","followers","followers.name","html_notes","icon","members","members.name","modified_at","name","notes","owner","permalink_url","project_brief","public","start_on","team","team.name","workspace","workspace.name"] # list[str] | This endpoint returns a compact resource, which excludes some properties by default. To include those optional properties, set this query parameter to a comma-separated list of the properties you wish to include. (optional) try: - # Add followers to a project - api_response = api_instance.add_followers_for_project(body, project_gid, opt_fields=opt_fields) - pprint(api_response) + # Add followers to a project + api_response = api_instance.add_followers_for_project(body, project_gid, opt_fields=opt_fields) + pprint(api_response) except ApiException as e: - print("Exception when calling ProjectsApi->add_followers_for_project: %s\n" % e) + print("Exception when calling ProjectsApi->add_followers_for_project: %s\n" % e) ``` ### Parameters @@ -146,19 +148,20 @@ from pprint import pprint # Configure OAuth2 access token for authorization: oauth2 configuration = asana.Configuration() configuration.access_token = '' +api_client = asana.ApiClient(configuration) # create an instance of the API class -api_instance = asana.ProjectsApi(asana.ApiClient(configuration)) +api_instance = asana.ProjectsApi(api_client) body = asana.ProjectGidAddMembersBody({"param1": "value1", "param2": "value2",}) # ProjectGidAddMembersBody | Information about the members being added. project_gid = '1331' # str | Globally unique identifier for the project. opt_fields = ["archived","color","completed","completed_at","completed_by","completed_by.name","created_at","created_from_template","created_from_template.name","current_status","current_status.author","current_status.author.name","current_status.color","current_status.created_at","current_status.created_by","current_status.created_by.name","current_status.html_text","current_status.modified_at","current_status.text","current_status.title","current_status_update","current_status_update.resource_subtype","current_status_update.title","custom_field_settings","custom_field_settings.custom_field","custom_field_settings.custom_field.asana_created_field","custom_field_settings.custom_field.created_by","custom_field_settings.custom_field.created_by.name","custom_field_settings.custom_field.currency_code","custom_field_settings.custom_field.custom_label","custom_field_settings.custom_field.custom_label_position","custom_field_settings.custom_field.date_value","custom_field_settings.custom_field.date_value.date","custom_field_settings.custom_field.date_value.date_time","custom_field_settings.custom_field.description","custom_field_settings.custom_field.display_value","custom_field_settings.custom_field.enabled","custom_field_settings.custom_field.enum_options","custom_field_settings.custom_field.enum_options.color","custom_field_settings.custom_field.enum_options.enabled","custom_field_settings.custom_field.enum_options.name","custom_field_settings.custom_field.enum_value","custom_field_settings.custom_field.enum_value.color","custom_field_settings.custom_field.enum_value.enabled","custom_field_settings.custom_field.enum_value.name","custom_field_settings.custom_field.format","custom_field_settings.custom_field.has_notifications_enabled","custom_field_settings.custom_field.is_formula_field","custom_field_settings.custom_field.is_global_to_workspace","custom_field_settings.custom_field.is_value_read_only","custom_field_settings.custom_field.multi_enum_values","custom_field_settings.custom_field.multi_enum_values.color","custom_field_settings.custom_field.multi_enum_values.enabled","custom_field_settings.custom_field.multi_enum_values.name","custom_field_settings.custom_field.name","custom_field_settings.custom_field.number_value","custom_field_settings.custom_field.people_value","custom_field_settings.custom_field.people_value.name","custom_field_settings.custom_field.precision","custom_field_settings.custom_field.resource_subtype","custom_field_settings.custom_field.text_value","custom_field_settings.custom_field.type","custom_field_settings.is_important","custom_field_settings.parent","custom_field_settings.parent.name","custom_field_settings.project","custom_field_settings.project.name","custom_fields","custom_fields.date_value","custom_fields.date_value.date","custom_fields.date_value.date_time","custom_fields.display_value","custom_fields.enabled","custom_fields.enum_options","custom_fields.enum_options.color","custom_fields.enum_options.enabled","custom_fields.enum_options.name","custom_fields.enum_value","custom_fields.enum_value.color","custom_fields.enum_value.enabled","custom_fields.enum_value.name","custom_fields.is_formula_field","custom_fields.multi_enum_values","custom_fields.multi_enum_values.color","custom_fields.multi_enum_values.enabled","custom_fields.multi_enum_values.name","custom_fields.name","custom_fields.number_value","custom_fields.resource_subtype","custom_fields.text_value","custom_fields.type","default_access_level","default_view","due_date","due_on","followers","followers.name","html_notes","icon","members","members.name","modified_at","name","notes","owner","permalink_url","project_brief","public","start_on","team","team.name","workspace","workspace.name"] # list[str] | This endpoint returns a compact resource, which excludes some properties by default. To include those optional properties, set this query parameter to a comma-separated list of the properties you wish to include. (optional) try: - # Add users to a project - api_response = api_instance.add_members_for_project(body, project_gid, opt_fields=opt_fields) - pprint(api_response) + # Add users to a project + api_response = api_instance.add_members_for_project(body, project_gid, opt_fields=opt_fields) + pprint(api_response) except ApiException as e: - print("Exception when calling ProjectsApi->add_members_for_project: %s\n" % e) + print("Exception when calling ProjectsApi->add_members_for_project: %s\n" % e) ``` ### Parameters @@ -200,18 +203,19 @@ from pprint import pprint # Configure OAuth2 access token for authorization: oauth2 configuration = asana.Configuration() configuration.access_token = '' +api_client = asana.ApiClient(configuration) # create an instance of the API class -api_instance = asana.ProjectsApi(asana.ApiClient(configuration)) +api_instance = asana.ProjectsApi(api_client) body = asana.ProjectsBody({"param1": "value1", "param2": "value2",}) # ProjectsBody | The project to create. opt_fields = ["archived","color","completed","completed_at","completed_by","completed_by.name","created_at","created_from_template","created_from_template.name","current_status","current_status.author","current_status.author.name","current_status.color","current_status.created_at","current_status.created_by","current_status.created_by.name","current_status.html_text","current_status.modified_at","current_status.text","current_status.title","current_status_update","current_status_update.resource_subtype","current_status_update.title","custom_field_settings","custom_field_settings.custom_field","custom_field_settings.custom_field.asana_created_field","custom_field_settings.custom_field.created_by","custom_field_settings.custom_field.created_by.name","custom_field_settings.custom_field.currency_code","custom_field_settings.custom_field.custom_label","custom_field_settings.custom_field.custom_label_position","custom_field_settings.custom_field.date_value","custom_field_settings.custom_field.date_value.date","custom_field_settings.custom_field.date_value.date_time","custom_field_settings.custom_field.description","custom_field_settings.custom_field.display_value","custom_field_settings.custom_field.enabled","custom_field_settings.custom_field.enum_options","custom_field_settings.custom_field.enum_options.color","custom_field_settings.custom_field.enum_options.enabled","custom_field_settings.custom_field.enum_options.name","custom_field_settings.custom_field.enum_value","custom_field_settings.custom_field.enum_value.color","custom_field_settings.custom_field.enum_value.enabled","custom_field_settings.custom_field.enum_value.name","custom_field_settings.custom_field.format","custom_field_settings.custom_field.has_notifications_enabled","custom_field_settings.custom_field.is_formula_field","custom_field_settings.custom_field.is_global_to_workspace","custom_field_settings.custom_field.is_value_read_only","custom_field_settings.custom_field.multi_enum_values","custom_field_settings.custom_field.multi_enum_values.color","custom_field_settings.custom_field.multi_enum_values.enabled","custom_field_settings.custom_field.multi_enum_values.name","custom_field_settings.custom_field.name","custom_field_settings.custom_field.number_value","custom_field_settings.custom_field.people_value","custom_field_settings.custom_field.people_value.name","custom_field_settings.custom_field.precision","custom_field_settings.custom_field.resource_subtype","custom_field_settings.custom_field.text_value","custom_field_settings.custom_field.type","custom_field_settings.is_important","custom_field_settings.parent","custom_field_settings.parent.name","custom_field_settings.project","custom_field_settings.project.name","custom_fields","custom_fields.date_value","custom_fields.date_value.date","custom_fields.date_value.date_time","custom_fields.display_value","custom_fields.enabled","custom_fields.enum_options","custom_fields.enum_options.color","custom_fields.enum_options.enabled","custom_fields.enum_options.name","custom_fields.enum_value","custom_fields.enum_value.color","custom_fields.enum_value.enabled","custom_fields.enum_value.name","custom_fields.is_formula_field","custom_fields.multi_enum_values","custom_fields.multi_enum_values.color","custom_fields.multi_enum_values.enabled","custom_fields.multi_enum_values.name","custom_fields.name","custom_fields.number_value","custom_fields.resource_subtype","custom_fields.text_value","custom_fields.type","default_access_level","default_view","due_date","due_on","followers","followers.name","html_notes","icon","members","members.name","modified_at","name","notes","owner","permalink_url","project_brief","public","start_on","team","team.name","workspace","workspace.name"] # list[str] | This endpoint returns a compact resource, which excludes some properties by default. To include those optional properties, set this query parameter to a comma-separated list of the properties you wish to include. (optional) try: - # Create a project - api_response = api_instance.create_project(body, opt_fields=opt_fields) - pprint(api_response) + # Create a project + api_response = api_instance.create_project(body, opt_fields=opt_fields) + pprint(api_response) except ApiException as e: - print("Exception when calling ProjectsApi->create_project: %s\n" % e) + print("Exception when calling ProjectsApi->create_project: %s\n" % e) ``` ### Parameters @@ -252,19 +256,20 @@ from pprint import pprint # Configure OAuth2 access token for authorization: oauth2 configuration = asana.Configuration() configuration.access_token = '' +api_client = asana.ApiClient(configuration) # create an instance of the API class -api_instance = asana.ProjectsApi(asana.ApiClient(configuration)) +api_instance = asana.ProjectsApi(api_client) body = asana.TeamGidProjectsBody({"param1": "value1", "param2": "value2",}) # TeamGidProjectsBody | The new project to create. team_gid = '159874' # str | Globally unique identifier for the team. opt_fields = ["archived","color","completed","completed_at","completed_by","completed_by.name","created_at","created_from_template","created_from_template.name","current_status","current_status.author","current_status.author.name","current_status.color","current_status.created_at","current_status.created_by","current_status.created_by.name","current_status.html_text","current_status.modified_at","current_status.text","current_status.title","current_status_update","current_status_update.resource_subtype","current_status_update.title","custom_field_settings","custom_field_settings.custom_field","custom_field_settings.custom_field.asana_created_field","custom_field_settings.custom_field.created_by","custom_field_settings.custom_field.created_by.name","custom_field_settings.custom_field.currency_code","custom_field_settings.custom_field.custom_label","custom_field_settings.custom_field.custom_label_position","custom_field_settings.custom_field.date_value","custom_field_settings.custom_field.date_value.date","custom_field_settings.custom_field.date_value.date_time","custom_field_settings.custom_field.description","custom_field_settings.custom_field.display_value","custom_field_settings.custom_field.enabled","custom_field_settings.custom_field.enum_options","custom_field_settings.custom_field.enum_options.color","custom_field_settings.custom_field.enum_options.enabled","custom_field_settings.custom_field.enum_options.name","custom_field_settings.custom_field.enum_value","custom_field_settings.custom_field.enum_value.color","custom_field_settings.custom_field.enum_value.enabled","custom_field_settings.custom_field.enum_value.name","custom_field_settings.custom_field.format","custom_field_settings.custom_field.has_notifications_enabled","custom_field_settings.custom_field.is_formula_field","custom_field_settings.custom_field.is_global_to_workspace","custom_field_settings.custom_field.is_value_read_only","custom_field_settings.custom_field.multi_enum_values","custom_field_settings.custom_field.multi_enum_values.color","custom_field_settings.custom_field.multi_enum_values.enabled","custom_field_settings.custom_field.multi_enum_values.name","custom_field_settings.custom_field.name","custom_field_settings.custom_field.number_value","custom_field_settings.custom_field.people_value","custom_field_settings.custom_field.people_value.name","custom_field_settings.custom_field.precision","custom_field_settings.custom_field.resource_subtype","custom_field_settings.custom_field.text_value","custom_field_settings.custom_field.type","custom_field_settings.is_important","custom_field_settings.parent","custom_field_settings.parent.name","custom_field_settings.project","custom_field_settings.project.name","custom_fields","custom_fields.date_value","custom_fields.date_value.date","custom_fields.date_value.date_time","custom_fields.display_value","custom_fields.enabled","custom_fields.enum_options","custom_fields.enum_options.color","custom_fields.enum_options.enabled","custom_fields.enum_options.name","custom_fields.enum_value","custom_fields.enum_value.color","custom_fields.enum_value.enabled","custom_fields.enum_value.name","custom_fields.is_formula_field","custom_fields.multi_enum_values","custom_fields.multi_enum_values.color","custom_fields.multi_enum_values.enabled","custom_fields.multi_enum_values.name","custom_fields.name","custom_fields.number_value","custom_fields.resource_subtype","custom_fields.text_value","custom_fields.type","default_access_level","default_view","due_date","due_on","followers","followers.name","html_notes","icon","members","members.name","modified_at","name","notes","owner","permalink_url","project_brief","public","start_on","team","team.name","workspace","workspace.name"] # list[str] | This endpoint returns a compact resource, which excludes some properties by default. To include those optional properties, set this query parameter to a comma-separated list of the properties you wish to include. (optional) try: - # Create a project in a team - api_response = api_instance.create_project_for_team(body, team_gid, opt_fields=opt_fields) - pprint(api_response) + # Create a project in a team + api_response = api_instance.create_project_for_team(body, team_gid, opt_fields=opt_fields) + pprint(api_response) except ApiException as e: - print("Exception when calling ProjectsApi->create_project_for_team: %s\n" % e) + print("Exception when calling ProjectsApi->create_project_for_team: %s\n" % e) ``` ### Parameters @@ -306,19 +311,20 @@ from pprint import pprint # Configure OAuth2 access token for authorization: oauth2 configuration = asana.Configuration() configuration.access_token = '' +api_client = asana.ApiClient(configuration) # create an instance of the API class -api_instance = asana.ProjectsApi(asana.ApiClient(configuration)) +api_instance = asana.ProjectsApi(api_client) body = asana.WorkspaceGidProjectsBody({"param1": "value1", "param2": "value2",}) # WorkspaceGidProjectsBody | The new project to create. workspace_gid = '12345' # str | Globally unique identifier for the workspace or organization. opt_fields = ["archived","color","completed","completed_at","completed_by","completed_by.name","created_at","created_from_template","created_from_template.name","current_status","current_status.author","current_status.author.name","current_status.color","current_status.created_at","current_status.created_by","current_status.created_by.name","current_status.html_text","current_status.modified_at","current_status.text","current_status.title","current_status_update","current_status_update.resource_subtype","current_status_update.title","custom_field_settings","custom_field_settings.custom_field","custom_field_settings.custom_field.asana_created_field","custom_field_settings.custom_field.created_by","custom_field_settings.custom_field.created_by.name","custom_field_settings.custom_field.currency_code","custom_field_settings.custom_field.custom_label","custom_field_settings.custom_field.custom_label_position","custom_field_settings.custom_field.date_value","custom_field_settings.custom_field.date_value.date","custom_field_settings.custom_field.date_value.date_time","custom_field_settings.custom_field.description","custom_field_settings.custom_field.display_value","custom_field_settings.custom_field.enabled","custom_field_settings.custom_field.enum_options","custom_field_settings.custom_field.enum_options.color","custom_field_settings.custom_field.enum_options.enabled","custom_field_settings.custom_field.enum_options.name","custom_field_settings.custom_field.enum_value","custom_field_settings.custom_field.enum_value.color","custom_field_settings.custom_field.enum_value.enabled","custom_field_settings.custom_field.enum_value.name","custom_field_settings.custom_field.format","custom_field_settings.custom_field.has_notifications_enabled","custom_field_settings.custom_field.is_formula_field","custom_field_settings.custom_field.is_global_to_workspace","custom_field_settings.custom_field.is_value_read_only","custom_field_settings.custom_field.multi_enum_values","custom_field_settings.custom_field.multi_enum_values.color","custom_field_settings.custom_field.multi_enum_values.enabled","custom_field_settings.custom_field.multi_enum_values.name","custom_field_settings.custom_field.name","custom_field_settings.custom_field.number_value","custom_field_settings.custom_field.people_value","custom_field_settings.custom_field.people_value.name","custom_field_settings.custom_field.precision","custom_field_settings.custom_field.resource_subtype","custom_field_settings.custom_field.text_value","custom_field_settings.custom_field.type","custom_field_settings.is_important","custom_field_settings.parent","custom_field_settings.parent.name","custom_field_settings.project","custom_field_settings.project.name","custom_fields","custom_fields.date_value","custom_fields.date_value.date","custom_fields.date_value.date_time","custom_fields.display_value","custom_fields.enabled","custom_fields.enum_options","custom_fields.enum_options.color","custom_fields.enum_options.enabled","custom_fields.enum_options.name","custom_fields.enum_value","custom_fields.enum_value.color","custom_fields.enum_value.enabled","custom_fields.enum_value.name","custom_fields.is_formula_field","custom_fields.multi_enum_values","custom_fields.multi_enum_values.color","custom_fields.multi_enum_values.enabled","custom_fields.multi_enum_values.name","custom_fields.name","custom_fields.number_value","custom_fields.resource_subtype","custom_fields.text_value","custom_fields.type","default_access_level","default_view","due_date","due_on","followers","followers.name","html_notes","icon","members","members.name","modified_at","name","notes","owner","permalink_url","project_brief","public","start_on","team","team.name","workspace","workspace.name"] # list[str] | This endpoint returns a compact resource, which excludes some properties by default. To include those optional properties, set this query parameter to a comma-separated list of the properties you wish to include. (optional) try: - # Create a project in a workspace - api_response = api_instance.create_project_for_workspace(body, workspace_gid, opt_fields=opt_fields) - pprint(api_response) + # Create a project in a workspace + api_response = api_instance.create_project_for_workspace(body, workspace_gid, opt_fields=opt_fields) + pprint(api_response) except ApiException as e: - print("Exception when calling ProjectsApi->create_project_for_workspace: %s\n" % e) + print("Exception when calling ProjectsApi->create_project_for_workspace: %s\n" % e) ``` ### Parameters @@ -360,17 +366,18 @@ from pprint import pprint # Configure OAuth2 access token for authorization: oauth2 configuration = asana.Configuration() configuration.access_token = '' +api_client = asana.ApiClient(configuration) # create an instance of the API class -api_instance = asana.ProjectsApi(asana.ApiClient(configuration)) +api_instance = asana.ProjectsApi(api_client) project_gid = '1331' # str | Globally unique identifier for the project. try: - # Delete a project - api_response = api_instance.delete_project(project_gid) - pprint(api_response) + # Delete a project + api_response = api_instance.delete_project(project_gid) + pprint(api_response) except ApiException as e: - print("Exception when calling ProjectsApi->delete_project: %s\n" % e) + print("Exception when calling ProjectsApi->delete_project: %s\n" % e) ``` ### Parameters @@ -410,19 +417,20 @@ from pprint import pprint # Configure OAuth2 access token for authorization: oauth2 configuration = asana.Configuration() configuration.access_token = '' +api_client = asana.ApiClient(configuration) # create an instance of the API class -api_instance = asana.ProjectsApi(asana.ApiClient(configuration)) +api_instance = asana.ProjectsApi(api_client) project_gid = '1331' # str | Globally unique identifier for the project. body = asana.ProjectGidDuplicateBody({"param1": "value1", "param2": "value2",}) # ProjectGidDuplicateBody | Describes the duplicate's name and the elements that will be duplicated. (optional) opt_fields = ["new_project","new_project.name","new_project_template","new_project_template.name","new_task","new_task.created_by","new_task.name","new_task.resource_subtype","resource_subtype","status"] # list[str] | This endpoint returns a compact resource, which excludes some properties by default. To include those optional properties, set this query parameter to a comma-separated list of the properties you wish to include. (optional) try: - # Duplicate a project - api_response = api_instance.duplicate_project(project_gid, body=body, opt_fields=opt_fields) - pprint(api_response) + # Duplicate a project + api_response = api_instance.duplicate_project(project_gid, body=body, opt_fields=opt_fields) + pprint(api_response) except ApiException as e: - print("Exception when calling ProjectsApi->duplicate_project: %s\n" % e) + print("Exception when calling ProjectsApi->duplicate_project: %s\n" % e) ``` ### Parameters @@ -464,18 +472,19 @@ from pprint import pprint # Configure OAuth2 access token for authorization: oauth2 configuration = asana.Configuration() configuration.access_token = '' +api_client = asana.ApiClient(configuration) # create an instance of the API class -api_instance = asana.ProjectsApi(asana.ApiClient(configuration)) +api_instance = asana.ProjectsApi(api_client) project_gid = '1331' # str | Globally unique identifier for the project. opt_fields = ["archived","color","completed","completed_at","completed_by","completed_by.name","created_at","created_from_template","created_from_template.name","current_status","current_status.author","current_status.author.name","current_status.color","current_status.created_at","current_status.created_by","current_status.created_by.name","current_status.html_text","current_status.modified_at","current_status.text","current_status.title","current_status_update","current_status_update.resource_subtype","current_status_update.title","custom_field_settings","custom_field_settings.custom_field","custom_field_settings.custom_field.asana_created_field","custom_field_settings.custom_field.created_by","custom_field_settings.custom_field.created_by.name","custom_field_settings.custom_field.currency_code","custom_field_settings.custom_field.custom_label","custom_field_settings.custom_field.custom_label_position","custom_field_settings.custom_field.date_value","custom_field_settings.custom_field.date_value.date","custom_field_settings.custom_field.date_value.date_time","custom_field_settings.custom_field.description","custom_field_settings.custom_field.display_value","custom_field_settings.custom_field.enabled","custom_field_settings.custom_field.enum_options","custom_field_settings.custom_field.enum_options.color","custom_field_settings.custom_field.enum_options.enabled","custom_field_settings.custom_field.enum_options.name","custom_field_settings.custom_field.enum_value","custom_field_settings.custom_field.enum_value.color","custom_field_settings.custom_field.enum_value.enabled","custom_field_settings.custom_field.enum_value.name","custom_field_settings.custom_field.format","custom_field_settings.custom_field.has_notifications_enabled","custom_field_settings.custom_field.is_formula_field","custom_field_settings.custom_field.is_global_to_workspace","custom_field_settings.custom_field.is_value_read_only","custom_field_settings.custom_field.multi_enum_values","custom_field_settings.custom_field.multi_enum_values.color","custom_field_settings.custom_field.multi_enum_values.enabled","custom_field_settings.custom_field.multi_enum_values.name","custom_field_settings.custom_field.name","custom_field_settings.custom_field.number_value","custom_field_settings.custom_field.people_value","custom_field_settings.custom_field.people_value.name","custom_field_settings.custom_field.precision","custom_field_settings.custom_field.resource_subtype","custom_field_settings.custom_field.text_value","custom_field_settings.custom_field.type","custom_field_settings.is_important","custom_field_settings.parent","custom_field_settings.parent.name","custom_field_settings.project","custom_field_settings.project.name","custom_fields","custom_fields.date_value","custom_fields.date_value.date","custom_fields.date_value.date_time","custom_fields.display_value","custom_fields.enabled","custom_fields.enum_options","custom_fields.enum_options.color","custom_fields.enum_options.enabled","custom_fields.enum_options.name","custom_fields.enum_value","custom_fields.enum_value.color","custom_fields.enum_value.enabled","custom_fields.enum_value.name","custom_fields.is_formula_field","custom_fields.multi_enum_values","custom_fields.multi_enum_values.color","custom_fields.multi_enum_values.enabled","custom_fields.multi_enum_values.name","custom_fields.name","custom_fields.number_value","custom_fields.resource_subtype","custom_fields.text_value","custom_fields.type","default_access_level","default_view","due_date","due_on","followers","followers.name","html_notes","icon","members","members.name","modified_at","name","notes","owner","permalink_url","project_brief","public","start_on","team","team.name","workspace","workspace.name"] # list[str] | This endpoint returns a compact resource, which excludes some properties by default. To include those optional properties, set this query parameter to a comma-separated list of the properties you wish to include. (optional) try: - # Get a project - api_response = api_instance.get_project(project_gid, opt_fields=opt_fields) - pprint(api_response) + # Get a project + api_response = api_instance.get_project(project_gid, opt_fields=opt_fields) + pprint(api_response) except ApiException as e: - print("Exception when calling ProjectsApi->get_project: %s\n" % e) + print("Exception when calling ProjectsApi->get_project: %s\n" % e) ``` ### Parameters @@ -516,9 +525,10 @@ from pprint import pprint # Configure OAuth2 access token for authorization: oauth2 configuration = asana.Configuration() configuration.access_token = '' +api_client = asana.ApiClient(configuration) # create an instance of the API class -api_instance = asana.ProjectsApi(asana.ApiClient(configuration)) +api_instance = asana.ProjectsApi(api_client) limit = 50 # int | Results per page. The number of objects to return per page. The value must be between 1 and 100. (optional) offset = 'eyJ0eXAiOJiKV1iQLCJhbGciOiJIUzI1NiJ9' # 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.' (optional) workspace = '1331' # str | The workspace or organization to filter projects on. (optional) @@ -527,11 +537,11 @@ archived = false # bool | Only return projects whose `archived` field takes on t opt_fields = ["archived","color","completed","completed_at","completed_by","completed_by.name","created_at","created_from_template","created_from_template.name","current_status","current_status.author","current_status.author.name","current_status.color","current_status.created_at","current_status.created_by","current_status.created_by.name","current_status.html_text","current_status.modified_at","current_status.text","current_status.title","current_status_update","current_status_update.resource_subtype","current_status_update.title","custom_field_settings","custom_field_settings.custom_field","custom_field_settings.custom_field.asana_created_field","custom_field_settings.custom_field.created_by","custom_field_settings.custom_field.created_by.name","custom_field_settings.custom_field.currency_code","custom_field_settings.custom_field.custom_label","custom_field_settings.custom_field.custom_label_position","custom_field_settings.custom_field.date_value","custom_field_settings.custom_field.date_value.date","custom_field_settings.custom_field.date_value.date_time","custom_field_settings.custom_field.description","custom_field_settings.custom_field.display_value","custom_field_settings.custom_field.enabled","custom_field_settings.custom_field.enum_options","custom_field_settings.custom_field.enum_options.color","custom_field_settings.custom_field.enum_options.enabled","custom_field_settings.custom_field.enum_options.name","custom_field_settings.custom_field.enum_value","custom_field_settings.custom_field.enum_value.color","custom_field_settings.custom_field.enum_value.enabled","custom_field_settings.custom_field.enum_value.name","custom_field_settings.custom_field.format","custom_field_settings.custom_field.has_notifications_enabled","custom_field_settings.custom_field.is_formula_field","custom_field_settings.custom_field.is_global_to_workspace","custom_field_settings.custom_field.is_value_read_only","custom_field_settings.custom_field.multi_enum_values","custom_field_settings.custom_field.multi_enum_values.color","custom_field_settings.custom_field.multi_enum_values.enabled","custom_field_settings.custom_field.multi_enum_values.name","custom_field_settings.custom_field.name","custom_field_settings.custom_field.number_value","custom_field_settings.custom_field.people_value","custom_field_settings.custom_field.people_value.name","custom_field_settings.custom_field.precision","custom_field_settings.custom_field.resource_subtype","custom_field_settings.custom_field.text_value","custom_field_settings.custom_field.type","custom_field_settings.is_important","custom_field_settings.parent","custom_field_settings.parent.name","custom_field_settings.project","custom_field_settings.project.name","custom_fields","custom_fields.date_value","custom_fields.date_value.date","custom_fields.date_value.date_time","custom_fields.display_value","custom_fields.enabled","custom_fields.enum_options","custom_fields.enum_options.color","custom_fields.enum_options.enabled","custom_fields.enum_options.name","custom_fields.enum_value","custom_fields.enum_value.color","custom_fields.enum_value.enabled","custom_fields.enum_value.name","custom_fields.is_formula_field","custom_fields.multi_enum_values","custom_fields.multi_enum_values.color","custom_fields.multi_enum_values.enabled","custom_fields.multi_enum_values.name","custom_fields.name","custom_fields.number_value","custom_fields.resource_subtype","custom_fields.text_value","custom_fields.type","default_access_level","default_view","due_date","due_on","followers","followers.name","html_notes","icon","members","members.name","modified_at","name","notes","offset","owner","path","permalink_url","project_brief","public","start_on","team","team.name","uri","workspace","workspace.name"] # list[str] | This endpoint returns a compact resource, which excludes some properties by default. To include those optional properties, set this query parameter to a comma-separated list of the properties you wish to include. (optional) try: - # Get multiple projects - api_response = api_instance.get_projects(limit=limit, offset=offset, workspace=workspace, team=team, archived=archived, opt_fields=opt_fields) - pprint(api_response) + # Get multiple projects + api_response = api_instance.get_projects(limit=limit, offset=offset, workspace=workspace, team=team, archived=archived, opt_fields=opt_fields) + pprint(api_response) except ApiException as e: - print("Exception when calling ProjectsApi->get_projects: %s\n" % e) + print("Exception when calling ProjectsApi->get_projects: %s\n" % e) ``` ### Parameters @@ -576,20 +586,21 @@ from pprint import pprint # Configure OAuth2 access token for authorization: oauth2 configuration = asana.Configuration() configuration.access_token = '' +api_client = asana.ApiClient(configuration) # create an instance of the API class -api_instance = asana.ProjectsApi(asana.ApiClient(configuration)) +api_instance = asana.ProjectsApi(api_client) task_gid = '321654' # str | The task to operate on. limit = 50 # int | Results per page. The number of objects to return per page. The value must be between 1 and 100. (optional) offset = 'eyJ0eXAiOJiKV1iQLCJhbGciOiJIUzI1NiJ9' # 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.' (optional) opt_fields = ["archived","color","completed","completed_at","completed_by","completed_by.name","created_at","created_from_template","created_from_template.name","current_status","current_status.author","current_status.author.name","current_status.color","current_status.created_at","current_status.created_by","current_status.created_by.name","current_status.html_text","current_status.modified_at","current_status.text","current_status.title","current_status_update","current_status_update.resource_subtype","current_status_update.title","custom_field_settings","custom_field_settings.custom_field","custom_field_settings.custom_field.asana_created_field","custom_field_settings.custom_field.created_by","custom_field_settings.custom_field.created_by.name","custom_field_settings.custom_field.currency_code","custom_field_settings.custom_field.custom_label","custom_field_settings.custom_field.custom_label_position","custom_field_settings.custom_field.date_value","custom_field_settings.custom_field.date_value.date","custom_field_settings.custom_field.date_value.date_time","custom_field_settings.custom_field.description","custom_field_settings.custom_field.display_value","custom_field_settings.custom_field.enabled","custom_field_settings.custom_field.enum_options","custom_field_settings.custom_field.enum_options.color","custom_field_settings.custom_field.enum_options.enabled","custom_field_settings.custom_field.enum_options.name","custom_field_settings.custom_field.enum_value","custom_field_settings.custom_field.enum_value.color","custom_field_settings.custom_field.enum_value.enabled","custom_field_settings.custom_field.enum_value.name","custom_field_settings.custom_field.format","custom_field_settings.custom_field.has_notifications_enabled","custom_field_settings.custom_field.is_formula_field","custom_field_settings.custom_field.is_global_to_workspace","custom_field_settings.custom_field.is_value_read_only","custom_field_settings.custom_field.multi_enum_values","custom_field_settings.custom_field.multi_enum_values.color","custom_field_settings.custom_field.multi_enum_values.enabled","custom_field_settings.custom_field.multi_enum_values.name","custom_field_settings.custom_field.name","custom_field_settings.custom_field.number_value","custom_field_settings.custom_field.people_value","custom_field_settings.custom_field.people_value.name","custom_field_settings.custom_field.precision","custom_field_settings.custom_field.resource_subtype","custom_field_settings.custom_field.text_value","custom_field_settings.custom_field.type","custom_field_settings.is_important","custom_field_settings.parent","custom_field_settings.parent.name","custom_field_settings.project","custom_field_settings.project.name","custom_fields","custom_fields.date_value","custom_fields.date_value.date","custom_fields.date_value.date_time","custom_fields.display_value","custom_fields.enabled","custom_fields.enum_options","custom_fields.enum_options.color","custom_fields.enum_options.enabled","custom_fields.enum_options.name","custom_fields.enum_value","custom_fields.enum_value.color","custom_fields.enum_value.enabled","custom_fields.enum_value.name","custom_fields.is_formula_field","custom_fields.multi_enum_values","custom_fields.multi_enum_values.color","custom_fields.multi_enum_values.enabled","custom_fields.multi_enum_values.name","custom_fields.name","custom_fields.number_value","custom_fields.resource_subtype","custom_fields.text_value","custom_fields.type","default_access_level","default_view","due_date","due_on","followers","followers.name","html_notes","icon","members","members.name","modified_at","name","notes","offset","owner","path","permalink_url","project_brief","public","start_on","team","team.name","uri","workspace","workspace.name"] # list[str] | This endpoint returns a compact resource, which excludes some properties by default. To include those optional properties, set this query parameter to a comma-separated list of the properties you wish to include. (optional) try: - # Get projects a task is in - api_response = api_instance.get_projects_for_task(task_gid, limit=limit, offset=offset, opt_fields=opt_fields) - pprint(api_response) + # Get projects a task is in + api_response = api_instance.get_projects_for_task(task_gid, limit=limit, offset=offset, opt_fields=opt_fields) + pprint(api_response) except ApiException as e: - print("Exception when calling ProjectsApi->get_projects_for_task: %s\n" % e) + print("Exception when calling ProjectsApi->get_projects_for_task: %s\n" % e) ``` ### Parameters @@ -632,9 +643,10 @@ from pprint import pprint # Configure OAuth2 access token for authorization: oauth2 configuration = asana.Configuration() configuration.access_token = '' +api_client = asana.ApiClient(configuration) # create an instance of the API class -api_instance = asana.ProjectsApi(asana.ApiClient(configuration)) +api_instance = asana.ProjectsApi(api_client) team_gid = '159874' # str | Globally unique identifier for the team. limit = 50 # int | Results per page. The number of objects to return per page. The value must be between 1 and 100. (optional) offset = 'eyJ0eXAiOJiKV1iQLCJhbGciOiJIUzI1NiJ9' # 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.' (optional) @@ -642,11 +654,11 @@ archived = false # bool | Only return projects whose `archived` field takes on t opt_fields = ["archived","color","completed","completed_at","completed_by","completed_by.name","created_at","created_from_template","created_from_template.name","current_status","current_status.author","current_status.author.name","current_status.color","current_status.created_at","current_status.created_by","current_status.created_by.name","current_status.html_text","current_status.modified_at","current_status.text","current_status.title","current_status_update","current_status_update.resource_subtype","current_status_update.title","custom_field_settings","custom_field_settings.custom_field","custom_field_settings.custom_field.asana_created_field","custom_field_settings.custom_field.created_by","custom_field_settings.custom_field.created_by.name","custom_field_settings.custom_field.currency_code","custom_field_settings.custom_field.custom_label","custom_field_settings.custom_field.custom_label_position","custom_field_settings.custom_field.date_value","custom_field_settings.custom_field.date_value.date","custom_field_settings.custom_field.date_value.date_time","custom_field_settings.custom_field.description","custom_field_settings.custom_field.display_value","custom_field_settings.custom_field.enabled","custom_field_settings.custom_field.enum_options","custom_field_settings.custom_field.enum_options.color","custom_field_settings.custom_field.enum_options.enabled","custom_field_settings.custom_field.enum_options.name","custom_field_settings.custom_field.enum_value","custom_field_settings.custom_field.enum_value.color","custom_field_settings.custom_field.enum_value.enabled","custom_field_settings.custom_field.enum_value.name","custom_field_settings.custom_field.format","custom_field_settings.custom_field.has_notifications_enabled","custom_field_settings.custom_field.is_formula_field","custom_field_settings.custom_field.is_global_to_workspace","custom_field_settings.custom_field.is_value_read_only","custom_field_settings.custom_field.multi_enum_values","custom_field_settings.custom_field.multi_enum_values.color","custom_field_settings.custom_field.multi_enum_values.enabled","custom_field_settings.custom_field.multi_enum_values.name","custom_field_settings.custom_field.name","custom_field_settings.custom_field.number_value","custom_field_settings.custom_field.people_value","custom_field_settings.custom_field.people_value.name","custom_field_settings.custom_field.precision","custom_field_settings.custom_field.resource_subtype","custom_field_settings.custom_field.text_value","custom_field_settings.custom_field.type","custom_field_settings.is_important","custom_field_settings.parent","custom_field_settings.parent.name","custom_field_settings.project","custom_field_settings.project.name","custom_fields","custom_fields.date_value","custom_fields.date_value.date","custom_fields.date_value.date_time","custom_fields.display_value","custom_fields.enabled","custom_fields.enum_options","custom_fields.enum_options.color","custom_fields.enum_options.enabled","custom_fields.enum_options.name","custom_fields.enum_value","custom_fields.enum_value.color","custom_fields.enum_value.enabled","custom_fields.enum_value.name","custom_fields.is_formula_field","custom_fields.multi_enum_values","custom_fields.multi_enum_values.color","custom_fields.multi_enum_values.enabled","custom_fields.multi_enum_values.name","custom_fields.name","custom_fields.number_value","custom_fields.resource_subtype","custom_fields.text_value","custom_fields.type","default_access_level","default_view","due_date","due_on","followers","followers.name","html_notes","icon","members","members.name","modified_at","name","notes","offset","owner","path","permalink_url","project_brief","public","start_on","team","team.name","uri","workspace","workspace.name"] # list[str] | This endpoint returns a compact resource, which excludes some properties by default. To include those optional properties, set this query parameter to a comma-separated list of the properties you wish to include. (optional) try: - # Get a team's projects - api_response = api_instance.get_projects_for_team(team_gid, limit=limit, offset=offset, archived=archived, opt_fields=opt_fields) - pprint(api_response) + # Get a team's projects + api_response = api_instance.get_projects_for_team(team_gid, limit=limit, offset=offset, archived=archived, opt_fields=opt_fields) + pprint(api_response) except ApiException as e: - print("Exception when calling ProjectsApi->get_projects_for_team: %s\n" % e) + print("Exception when calling ProjectsApi->get_projects_for_team: %s\n" % e) ``` ### Parameters @@ -690,9 +702,10 @@ from pprint import pprint # Configure OAuth2 access token for authorization: oauth2 configuration = asana.Configuration() configuration.access_token = '' +api_client = asana.ApiClient(configuration) # create an instance of the API class -api_instance = asana.ProjectsApi(asana.ApiClient(configuration)) +api_instance = asana.ProjectsApi(api_client) workspace_gid = '12345' # str | Globally unique identifier for the workspace or organization. limit = 50 # int | Results per page. The number of objects to return per page. The value must be between 1 and 100. (optional) offset = 'eyJ0eXAiOJiKV1iQLCJhbGciOiJIUzI1NiJ9' # 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.' (optional) @@ -700,11 +713,11 @@ archived = false # bool | Only return projects whose `archived` field takes on t opt_fields = ["archived","color","completed","completed_at","completed_by","completed_by.name","created_at","created_from_template","created_from_template.name","current_status","current_status.author","current_status.author.name","current_status.color","current_status.created_at","current_status.created_by","current_status.created_by.name","current_status.html_text","current_status.modified_at","current_status.text","current_status.title","current_status_update","current_status_update.resource_subtype","current_status_update.title","custom_field_settings","custom_field_settings.custom_field","custom_field_settings.custom_field.asana_created_field","custom_field_settings.custom_field.created_by","custom_field_settings.custom_field.created_by.name","custom_field_settings.custom_field.currency_code","custom_field_settings.custom_field.custom_label","custom_field_settings.custom_field.custom_label_position","custom_field_settings.custom_field.date_value","custom_field_settings.custom_field.date_value.date","custom_field_settings.custom_field.date_value.date_time","custom_field_settings.custom_field.description","custom_field_settings.custom_field.display_value","custom_field_settings.custom_field.enabled","custom_field_settings.custom_field.enum_options","custom_field_settings.custom_field.enum_options.color","custom_field_settings.custom_field.enum_options.enabled","custom_field_settings.custom_field.enum_options.name","custom_field_settings.custom_field.enum_value","custom_field_settings.custom_field.enum_value.color","custom_field_settings.custom_field.enum_value.enabled","custom_field_settings.custom_field.enum_value.name","custom_field_settings.custom_field.format","custom_field_settings.custom_field.has_notifications_enabled","custom_field_settings.custom_field.is_formula_field","custom_field_settings.custom_field.is_global_to_workspace","custom_field_settings.custom_field.is_value_read_only","custom_field_settings.custom_field.multi_enum_values","custom_field_settings.custom_field.multi_enum_values.color","custom_field_settings.custom_field.multi_enum_values.enabled","custom_field_settings.custom_field.multi_enum_values.name","custom_field_settings.custom_field.name","custom_field_settings.custom_field.number_value","custom_field_settings.custom_field.people_value","custom_field_settings.custom_field.people_value.name","custom_field_settings.custom_field.precision","custom_field_settings.custom_field.resource_subtype","custom_field_settings.custom_field.text_value","custom_field_settings.custom_field.type","custom_field_settings.is_important","custom_field_settings.parent","custom_field_settings.parent.name","custom_field_settings.project","custom_field_settings.project.name","custom_fields","custom_fields.date_value","custom_fields.date_value.date","custom_fields.date_value.date_time","custom_fields.display_value","custom_fields.enabled","custom_fields.enum_options","custom_fields.enum_options.color","custom_fields.enum_options.enabled","custom_fields.enum_options.name","custom_fields.enum_value","custom_fields.enum_value.color","custom_fields.enum_value.enabled","custom_fields.enum_value.name","custom_fields.is_formula_field","custom_fields.multi_enum_values","custom_fields.multi_enum_values.color","custom_fields.multi_enum_values.enabled","custom_fields.multi_enum_values.name","custom_fields.name","custom_fields.number_value","custom_fields.resource_subtype","custom_fields.text_value","custom_fields.type","default_access_level","default_view","due_date","due_on","followers","followers.name","html_notes","icon","members","members.name","modified_at","name","notes","offset","owner","path","permalink_url","project_brief","public","start_on","team","team.name","uri","workspace","workspace.name"] # list[str] | This endpoint returns a compact resource, which excludes some properties by default. To include those optional properties, set this query parameter to a comma-separated list of the properties you wish to include. (optional) try: - # Get all projects in a workspace - api_response = api_instance.get_projects_for_workspace(workspace_gid, limit=limit, offset=offset, archived=archived, opt_fields=opt_fields) - pprint(api_response) + # Get all projects in a workspace + api_response = api_instance.get_projects_for_workspace(workspace_gid, limit=limit, offset=offset, archived=archived, opt_fields=opt_fields) + pprint(api_response) except ApiException as e: - print("Exception when calling ProjectsApi->get_projects_for_workspace: %s\n" % e) + print("Exception when calling ProjectsApi->get_projects_for_workspace: %s\n" % e) ``` ### Parameters @@ -748,18 +761,19 @@ from pprint import pprint # Configure OAuth2 access token for authorization: oauth2 configuration = asana.Configuration() configuration.access_token = '' +api_client = asana.ApiClient(configuration) # create an instance of the API class -api_instance = asana.ProjectsApi(asana.ApiClient(configuration)) +api_instance = asana.ProjectsApi(api_client) project_gid = '1331' # str | Globally unique identifier for the project. opt_fields = ["num_completed_milestones","num_completed_tasks","num_incomplete_milestones","num_incomplete_tasks","num_milestones","num_tasks"] # list[str] | This endpoint returns a compact resource, which excludes some properties by default. To include those optional properties, set this query parameter to a comma-separated list of the properties you wish to include. (optional) try: - # Get task count of a project - api_response = api_instance.get_task_counts_for_project(project_gid, opt_fields=opt_fields) - pprint(api_response) + # Get task count of a project + api_response = api_instance.get_task_counts_for_project(project_gid, opt_fields=opt_fields) + pprint(api_response) except ApiException as e: - print("Exception when calling ProjectsApi->get_task_counts_for_project: %s\n" % e) + print("Exception when calling ProjectsApi->get_task_counts_for_project: %s\n" % e) ``` ### Parameters @@ -800,19 +814,20 @@ from pprint import pprint # Configure OAuth2 access token for authorization: oauth2 configuration = asana.Configuration() configuration.access_token = '' +api_client = asana.ApiClient(configuration) # create an instance of the API class -api_instance = asana.ProjectsApi(asana.ApiClient(configuration)) +api_instance = asana.ProjectsApi(api_client) body = asana.ProjectGidSaveAsTemplateBody({"param1": "value1", "param2": "value2",}) # ProjectGidSaveAsTemplateBody | Describes the inputs used for creating a project template, such as the resulting project template's name, which team it should be created in. project_gid = '1331' # str | Globally unique identifier for the project. opt_fields = ["new_project","new_project.name","new_project_template","new_project_template.name","new_task","new_task.created_by","new_task.name","new_task.resource_subtype","resource_subtype","status"] # list[str] | This endpoint returns a compact resource, which excludes some properties by default. To include those optional properties, set this query parameter to a comma-separated list of the properties you wish to include. (optional) try: - # Create a project template from a project - api_response = api_instance.project_save_as_template(body, project_gid, opt_fields=opt_fields) - pprint(api_response) + # Create a project template from a project + api_response = api_instance.project_save_as_template(body, project_gid, opt_fields=opt_fields) + pprint(api_response) except ApiException as e: - print("Exception when calling ProjectsApi->project_save_as_template: %s\n" % e) + print("Exception when calling ProjectsApi->project_save_as_template: %s\n" % e) ``` ### Parameters @@ -854,18 +869,19 @@ from pprint import pprint # Configure OAuth2 access token for authorization: oauth2 configuration = asana.Configuration() configuration.access_token = '' +api_client = asana.ApiClient(configuration) # create an instance of the API class -api_instance = asana.ProjectsApi(asana.ApiClient(configuration)) +api_instance = asana.ProjectsApi(api_client) body = asana.ProjectGidRemoveCustomFieldSettingBody({"param1": "value1", "param2": "value2",}) # ProjectGidRemoveCustomFieldSettingBody | Information about the custom field setting being removed. project_gid = '1331' # str | Globally unique identifier for the project. try: - # Remove a custom field from a project - api_response = api_instance.remove_custom_field_setting_for_project(body, project_gid) - pprint(api_response) + # Remove a custom field from a project + api_response = api_instance.remove_custom_field_setting_for_project(body, project_gid) + pprint(api_response) except ApiException as e: - print("Exception when calling ProjectsApi->remove_custom_field_setting_for_project: %s\n" % e) + print("Exception when calling ProjectsApi->remove_custom_field_setting_for_project: %s\n" % e) ``` ### Parameters @@ -906,19 +922,20 @@ from pprint import pprint # Configure OAuth2 access token for authorization: oauth2 configuration = asana.Configuration() configuration.access_token = '' +api_client = asana.ApiClient(configuration) # create an instance of the API class -api_instance = asana.ProjectsApi(asana.ApiClient(configuration)) +api_instance = asana.ProjectsApi(api_client) body = asana.ProjectGidRemoveFollowersBody({"param1": "value1", "param2": "value2",}) # ProjectGidRemoveFollowersBody | Information about the followers being removed. project_gid = '1331' # str | Globally unique identifier for the project. opt_fields = ["archived","color","completed","completed_at","completed_by","completed_by.name","created_at","created_from_template","created_from_template.name","current_status","current_status.author","current_status.author.name","current_status.color","current_status.created_at","current_status.created_by","current_status.created_by.name","current_status.html_text","current_status.modified_at","current_status.text","current_status.title","current_status_update","current_status_update.resource_subtype","current_status_update.title","custom_field_settings","custom_field_settings.custom_field","custom_field_settings.custom_field.asana_created_field","custom_field_settings.custom_field.created_by","custom_field_settings.custom_field.created_by.name","custom_field_settings.custom_field.currency_code","custom_field_settings.custom_field.custom_label","custom_field_settings.custom_field.custom_label_position","custom_field_settings.custom_field.date_value","custom_field_settings.custom_field.date_value.date","custom_field_settings.custom_field.date_value.date_time","custom_field_settings.custom_field.description","custom_field_settings.custom_field.display_value","custom_field_settings.custom_field.enabled","custom_field_settings.custom_field.enum_options","custom_field_settings.custom_field.enum_options.color","custom_field_settings.custom_field.enum_options.enabled","custom_field_settings.custom_field.enum_options.name","custom_field_settings.custom_field.enum_value","custom_field_settings.custom_field.enum_value.color","custom_field_settings.custom_field.enum_value.enabled","custom_field_settings.custom_field.enum_value.name","custom_field_settings.custom_field.format","custom_field_settings.custom_field.has_notifications_enabled","custom_field_settings.custom_field.is_formula_field","custom_field_settings.custom_field.is_global_to_workspace","custom_field_settings.custom_field.is_value_read_only","custom_field_settings.custom_field.multi_enum_values","custom_field_settings.custom_field.multi_enum_values.color","custom_field_settings.custom_field.multi_enum_values.enabled","custom_field_settings.custom_field.multi_enum_values.name","custom_field_settings.custom_field.name","custom_field_settings.custom_field.number_value","custom_field_settings.custom_field.people_value","custom_field_settings.custom_field.people_value.name","custom_field_settings.custom_field.precision","custom_field_settings.custom_field.resource_subtype","custom_field_settings.custom_field.text_value","custom_field_settings.custom_field.type","custom_field_settings.is_important","custom_field_settings.parent","custom_field_settings.parent.name","custom_field_settings.project","custom_field_settings.project.name","custom_fields","custom_fields.date_value","custom_fields.date_value.date","custom_fields.date_value.date_time","custom_fields.display_value","custom_fields.enabled","custom_fields.enum_options","custom_fields.enum_options.color","custom_fields.enum_options.enabled","custom_fields.enum_options.name","custom_fields.enum_value","custom_fields.enum_value.color","custom_fields.enum_value.enabled","custom_fields.enum_value.name","custom_fields.is_formula_field","custom_fields.multi_enum_values","custom_fields.multi_enum_values.color","custom_fields.multi_enum_values.enabled","custom_fields.multi_enum_values.name","custom_fields.name","custom_fields.number_value","custom_fields.resource_subtype","custom_fields.text_value","custom_fields.type","default_access_level","default_view","due_date","due_on","followers","followers.name","html_notes","icon","members","members.name","modified_at","name","notes","owner","permalink_url","project_brief","public","start_on","team","team.name","workspace","workspace.name"] # list[str] | This endpoint returns a compact resource, which excludes some properties by default. To include those optional properties, set this query parameter to a comma-separated list of the properties you wish to include. (optional) try: - # Remove followers from a project - api_response = api_instance.remove_followers_for_project(body, project_gid, opt_fields=opt_fields) - pprint(api_response) + # Remove followers from a project + api_response = api_instance.remove_followers_for_project(body, project_gid, opt_fields=opt_fields) + pprint(api_response) except ApiException as e: - print("Exception when calling ProjectsApi->remove_followers_for_project: %s\n" % e) + print("Exception when calling ProjectsApi->remove_followers_for_project: %s\n" % e) ``` ### Parameters @@ -960,19 +977,20 @@ from pprint import pprint # Configure OAuth2 access token for authorization: oauth2 configuration = asana.Configuration() configuration.access_token = '' +api_client = asana.ApiClient(configuration) # create an instance of the API class -api_instance = asana.ProjectsApi(asana.ApiClient(configuration)) +api_instance = asana.ProjectsApi(api_client) body = asana.ProjectGidRemoveMembersBody({"param1": "value1", "param2": "value2",}) # ProjectGidRemoveMembersBody | Information about the members being removed. project_gid = '1331' # str | Globally unique identifier for the project. opt_fields = ["archived","color","completed","completed_at","completed_by","completed_by.name","created_at","created_from_template","created_from_template.name","current_status","current_status.author","current_status.author.name","current_status.color","current_status.created_at","current_status.created_by","current_status.created_by.name","current_status.html_text","current_status.modified_at","current_status.text","current_status.title","current_status_update","current_status_update.resource_subtype","current_status_update.title","custom_field_settings","custom_field_settings.custom_field","custom_field_settings.custom_field.asana_created_field","custom_field_settings.custom_field.created_by","custom_field_settings.custom_field.created_by.name","custom_field_settings.custom_field.currency_code","custom_field_settings.custom_field.custom_label","custom_field_settings.custom_field.custom_label_position","custom_field_settings.custom_field.date_value","custom_field_settings.custom_field.date_value.date","custom_field_settings.custom_field.date_value.date_time","custom_field_settings.custom_field.description","custom_field_settings.custom_field.display_value","custom_field_settings.custom_field.enabled","custom_field_settings.custom_field.enum_options","custom_field_settings.custom_field.enum_options.color","custom_field_settings.custom_field.enum_options.enabled","custom_field_settings.custom_field.enum_options.name","custom_field_settings.custom_field.enum_value","custom_field_settings.custom_field.enum_value.color","custom_field_settings.custom_field.enum_value.enabled","custom_field_settings.custom_field.enum_value.name","custom_field_settings.custom_field.format","custom_field_settings.custom_field.has_notifications_enabled","custom_field_settings.custom_field.is_formula_field","custom_field_settings.custom_field.is_global_to_workspace","custom_field_settings.custom_field.is_value_read_only","custom_field_settings.custom_field.multi_enum_values","custom_field_settings.custom_field.multi_enum_values.color","custom_field_settings.custom_field.multi_enum_values.enabled","custom_field_settings.custom_field.multi_enum_values.name","custom_field_settings.custom_field.name","custom_field_settings.custom_field.number_value","custom_field_settings.custom_field.people_value","custom_field_settings.custom_field.people_value.name","custom_field_settings.custom_field.precision","custom_field_settings.custom_field.resource_subtype","custom_field_settings.custom_field.text_value","custom_field_settings.custom_field.type","custom_field_settings.is_important","custom_field_settings.parent","custom_field_settings.parent.name","custom_field_settings.project","custom_field_settings.project.name","custom_fields","custom_fields.date_value","custom_fields.date_value.date","custom_fields.date_value.date_time","custom_fields.display_value","custom_fields.enabled","custom_fields.enum_options","custom_fields.enum_options.color","custom_fields.enum_options.enabled","custom_fields.enum_options.name","custom_fields.enum_value","custom_fields.enum_value.color","custom_fields.enum_value.enabled","custom_fields.enum_value.name","custom_fields.is_formula_field","custom_fields.multi_enum_values","custom_fields.multi_enum_values.color","custom_fields.multi_enum_values.enabled","custom_fields.multi_enum_values.name","custom_fields.name","custom_fields.number_value","custom_fields.resource_subtype","custom_fields.text_value","custom_fields.type","default_access_level","default_view","due_date","due_on","followers","followers.name","html_notes","icon","members","members.name","modified_at","name","notes","owner","permalink_url","project_brief","public","start_on","team","team.name","workspace","workspace.name"] # list[str] | This endpoint returns a compact resource, which excludes some properties by default. To include those optional properties, set this query parameter to a comma-separated list of the properties you wish to include. (optional) try: - # Remove users from a project - api_response = api_instance.remove_members_for_project(body, project_gid, opt_fields=opt_fields) - pprint(api_response) + # Remove users from a project + api_response = api_instance.remove_members_for_project(body, project_gid, opt_fields=opt_fields) + pprint(api_response) except ApiException as e: - print("Exception when calling ProjectsApi->remove_members_for_project: %s\n" % e) + print("Exception when calling ProjectsApi->remove_members_for_project: %s\n" % e) ``` ### Parameters @@ -1014,19 +1032,20 @@ from pprint import pprint # Configure OAuth2 access token for authorization: oauth2 configuration = asana.Configuration() configuration.access_token = '' +api_client = asana.ApiClient(configuration) # create an instance of the API class -api_instance = asana.ProjectsApi(asana.ApiClient(configuration)) +api_instance = asana.ProjectsApi(api_client) body = asana.ProjectsProjectGidBody({"param1": "value1", "param2": "value2",}) # ProjectsProjectGidBody | The updated fields for the project. project_gid = '1331' # str | Globally unique identifier for the project. opt_fields = ["archived","color","completed","completed_at","completed_by","completed_by.name","created_at","created_from_template","created_from_template.name","current_status","current_status.author","current_status.author.name","current_status.color","current_status.created_at","current_status.created_by","current_status.created_by.name","current_status.html_text","current_status.modified_at","current_status.text","current_status.title","current_status_update","current_status_update.resource_subtype","current_status_update.title","custom_field_settings","custom_field_settings.custom_field","custom_field_settings.custom_field.asana_created_field","custom_field_settings.custom_field.created_by","custom_field_settings.custom_field.created_by.name","custom_field_settings.custom_field.currency_code","custom_field_settings.custom_field.custom_label","custom_field_settings.custom_field.custom_label_position","custom_field_settings.custom_field.date_value","custom_field_settings.custom_field.date_value.date","custom_field_settings.custom_field.date_value.date_time","custom_field_settings.custom_field.description","custom_field_settings.custom_field.display_value","custom_field_settings.custom_field.enabled","custom_field_settings.custom_field.enum_options","custom_field_settings.custom_field.enum_options.color","custom_field_settings.custom_field.enum_options.enabled","custom_field_settings.custom_field.enum_options.name","custom_field_settings.custom_field.enum_value","custom_field_settings.custom_field.enum_value.color","custom_field_settings.custom_field.enum_value.enabled","custom_field_settings.custom_field.enum_value.name","custom_field_settings.custom_field.format","custom_field_settings.custom_field.has_notifications_enabled","custom_field_settings.custom_field.is_formula_field","custom_field_settings.custom_field.is_global_to_workspace","custom_field_settings.custom_field.is_value_read_only","custom_field_settings.custom_field.multi_enum_values","custom_field_settings.custom_field.multi_enum_values.color","custom_field_settings.custom_field.multi_enum_values.enabled","custom_field_settings.custom_field.multi_enum_values.name","custom_field_settings.custom_field.name","custom_field_settings.custom_field.number_value","custom_field_settings.custom_field.people_value","custom_field_settings.custom_field.people_value.name","custom_field_settings.custom_field.precision","custom_field_settings.custom_field.resource_subtype","custom_field_settings.custom_field.text_value","custom_field_settings.custom_field.type","custom_field_settings.is_important","custom_field_settings.parent","custom_field_settings.parent.name","custom_field_settings.project","custom_field_settings.project.name","custom_fields","custom_fields.date_value","custom_fields.date_value.date","custom_fields.date_value.date_time","custom_fields.display_value","custom_fields.enabled","custom_fields.enum_options","custom_fields.enum_options.color","custom_fields.enum_options.enabled","custom_fields.enum_options.name","custom_fields.enum_value","custom_fields.enum_value.color","custom_fields.enum_value.enabled","custom_fields.enum_value.name","custom_fields.is_formula_field","custom_fields.multi_enum_values","custom_fields.multi_enum_values.color","custom_fields.multi_enum_values.enabled","custom_fields.multi_enum_values.name","custom_fields.name","custom_fields.number_value","custom_fields.resource_subtype","custom_fields.text_value","custom_fields.type","default_access_level","default_view","due_date","due_on","followers","followers.name","html_notes","icon","members","members.name","modified_at","name","notes","owner","permalink_url","project_brief","public","start_on","team","team.name","workspace","workspace.name"] # list[str] | This endpoint returns a compact resource, which excludes some properties by default. To include those optional properties, set this query parameter to a comma-separated list of the properties you wish to include. (optional) try: - # Update a project - api_response = api_instance.update_project(body, project_gid, opt_fields=opt_fields) - pprint(api_response) + # Update a project + api_response = api_instance.update_project(body, project_gid, opt_fields=opt_fields) + pprint(api_response) except ApiException as e: - print("Exception when calling ProjectsApi->update_project: %s\n" % e) + print("Exception when calling ProjectsApi->update_project: %s\n" % e) ``` ### Parameters diff --git a/docs/ProjectsApi.yaml b/docs/ProjectsApi.yaml index fa1d924f..98f821f3 100644 --- a/docs/ProjectsApi.yaml +++ b/docs/ProjectsApi.yaml @@ -7,18 +7,19 @@ ProjectsApi: # Configure OAuth2 access token for authorization: oauth2 configuration = asana.Configuration() configuration.access_token = '' + api_client = asana.ApiClient(configuration) # create an instance of the API class - api_instance = asana.ProjectsApi(asana.ApiClient(configuration)) + api_instance = asana.ProjectsApi(api_client) body = asana.ProjectGidAddCustomFieldSettingBody({"param1": "value1", "param2": "value2",}) # ProjectGidAddCustomFieldSettingBody | Information about the custom field setting. project_gid = '1331' # str | Globally unique identifier for the project. try: - # Add a custom field to a project - api_response = api_instance.add_custom_field_setting_for_project(body, project_gid) - pprint(api_response) + # Add a custom field to a project + api_response = api_instance.add_custom_field_setting_for_project(body, project_gid) + pprint(api_response) except ApiException as e: - print("Exception when calling ProjectsApi->add_custom_field_setting_for_project: %s\n" % e) + print("Exception when calling ProjectsApi->add_custom_field_setting_for_project: %s\n" % e) add_followers_for_project: |- import asana from asana.rest import ApiException @@ -27,19 +28,20 @@ ProjectsApi: # Configure OAuth2 access token for authorization: oauth2 configuration = asana.Configuration() configuration.access_token = '' + api_client = asana.ApiClient(configuration) # create an instance of the API class - api_instance = asana.ProjectsApi(asana.ApiClient(configuration)) + api_instance = asana.ProjectsApi(api_client) body = asana.ProjectGidAddFollowersBody({"param1": "value1", "param2": "value2",}) # ProjectGidAddFollowersBody | Information about the followers being added. project_gid = '1331' # str | Globally unique identifier for the project. opt_fields = ["archived","color","completed","completed_at","completed_by","completed_by.name","created_at","created_from_template","created_from_template.name","current_status","current_status.author","current_status.author.name","current_status.color","current_status.created_at","current_status.created_by","current_status.created_by.name","current_status.html_text","current_status.modified_at","current_status.text","current_status.title","current_status_update","current_status_update.resource_subtype","current_status_update.title","custom_field_settings","custom_field_settings.custom_field","custom_field_settings.custom_field.asana_created_field","custom_field_settings.custom_field.created_by","custom_field_settings.custom_field.created_by.name","custom_field_settings.custom_field.currency_code","custom_field_settings.custom_field.custom_label","custom_field_settings.custom_field.custom_label_position","custom_field_settings.custom_field.date_value","custom_field_settings.custom_field.date_value.date","custom_field_settings.custom_field.date_value.date_time","custom_field_settings.custom_field.description","custom_field_settings.custom_field.display_value","custom_field_settings.custom_field.enabled","custom_field_settings.custom_field.enum_options","custom_field_settings.custom_field.enum_options.color","custom_field_settings.custom_field.enum_options.enabled","custom_field_settings.custom_field.enum_options.name","custom_field_settings.custom_field.enum_value","custom_field_settings.custom_field.enum_value.color","custom_field_settings.custom_field.enum_value.enabled","custom_field_settings.custom_field.enum_value.name","custom_field_settings.custom_field.format","custom_field_settings.custom_field.has_notifications_enabled","custom_field_settings.custom_field.is_formula_field","custom_field_settings.custom_field.is_global_to_workspace","custom_field_settings.custom_field.is_value_read_only","custom_field_settings.custom_field.multi_enum_values","custom_field_settings.custom_field.multi_enum_values.color","custom_field_settings.custom_field.multi_enum_values.enabled","custom_field_settings.custom_field.multi_enum_values.name","custom_field_settings.custom_field.name","custom_field_settings.custom_field.number_value","custom_field_settings.custom_field.people_value","custom_field_settings.custom_field.people_value.name","custom_field_settings.custom_field.precision","custom_field_settings.custom_field.resource_subtype","custom_field_settings.custom_field.text_value","custom_field_settings.custom_field.type","custom_field_settings.is_important","custom_field_settings.parent","custom_field_settings.parent.name","custom_field_settings.project","custom_field_settings.project.name","custom_fields","custom_fields.date_value","custom_fields.date_value.date","custom_fields.date_value.date_time","custom_fields.display_value","custom_fields.enabled","custom_fields.enum_options","custom_fields.enum_options.color","custom_fields.enum_options.enabled","custom_fields.enum_options.name","custom_fields.enum_value","custom_fields.enum_value.color","custom_fields.enum_value.enabled","custom_fields.enum_value.name","custom_fields.is_formula_field","custom_fields.multi_enum_values","custom_fields.multi_enum_values.color","custom_fields.multi_enum_values.enabled","custom_fields.multi_enum_values.name","custom_fields.name","custom_fields.number_value","custom_fields.resource_subtype","custom_fields.text_value","custom_fields.type","default_access_level","default_view","due_date","due_on","followers","followers.name","html_notes","icon","members","members.name","modified_at","name","notes","owner","permalink_url","project_brief","public","start_on","team","team.name","workspace","workspace.name"] # list[str] | This endpoint returns a compact resource, which excludes some properties by default. To include those optional properties, set this query parameter to a comma-separated list of the properties you wish to include. (optional) try: - # Add followers to a project - api_response = api_instance.add_followers_for_project(body, project_gid, opt_fields=opt_fields) - pprint(api_response) + # Add followers to a project + api_response = api_instance.add_followers_for_project(body, project_gid, opt_fields=opt_fields) + pprint(api_response) except ApiException as e: - print("Exception when calling ProjectsApi->add_followers_for_project: %s\n" % e) + print("Exception when calling ProjectsApi->add_followers_for_project: %s\n" % e) add_members_for_project: |- import asana from asana.rest import ApiException @@ -48,19 +50,20 @@ ProjectsApi: # Configure OAuth2 access token for authorization: oauth2 configuration = asana.Configuration() configuration.access_token = '' + api_client = asana.ApiClient(configuration) # create an instance of the API class - api_instance = asana.ProjectsApi(asana.ApiClient(configuration)) + api_instance = asana.ProjectsApi(api_client) body = asana.ProjectGidAddMembersBody({"param1": "value1", "param2": "value2",}) # ProjectGidAddMembersBody | Information about the members being added. project_gid = '1331' # str | Globally unique identifier for the project. opt_fields = ["archived","color","completed","completed_at","completed_by","completed_by.name","created_at","created_from_template","created_from_template.name","current_status","current_status.author","current_status.author.name","current_status.color","current_status.created_at","current_status.created_by","current_status.created_by.name","current_status.html_text","current_status.modified_at","current_status.text","current_status.title","current_status_update","current_status_update.resource_subtype","current_status_update.title","custom_field_settings","custom_field_settings.custom_field","custom_field_settings.custom_field.asana_created_field","custom_field_settings.custom_field.created_by","custom_field_settings.custom_field.created_by.name","custom_field_settings.custom_field.currency_code","custom_field_settings.custom_field.custom_label","custom_field_settings.custom_field.custom_label_position","custom_field_settings.custom_field.date_value","custom_field_settings.custom_field.date_value.date","custom_field_settings.custom_field.date_value.date_time","custom_field_settings.custom_field.description","custom_field_settings.custom_field.display_value","custom_field_settings.custom_field.enabled","custom_field_settings.custom_field.enum_options","custom_field_settings.custom_field.enum_options.color","custom_field_settings.custom_field.enum_options.enabled","custom_field_settings.custom_field.enum_options.name","custom_field_settings.custom_field.enum_value","custom_field_settings.custom_field.enum_value.color","custom_field_settings.custom_field.enum_value.enabled","custom_field_settings.custom_field.enum_value.name","custom_field_settings.custom_field.format","custom_field_settings.custom_field.has_notifications_enabled","custom_field_settings.custom_field.is_formula_field","custom_field_settings.custom_field.is_global_to_workspace","custom_field_settings.custom_field.is_value_read_only","custom_field_settings.custom_field.multi_enum_values","custom_field_settings.custom_field.multi_enum_values.color","custom_field_settings.custom_field.multi_enum_values.enabled","custom_field_settings.custom_field.multi_enum_values.name","custom_field_settings.custom_field.name","custom_field_settings.custom_field.number_value","custom_field_settings.custom_field.people_value","custom_field_settings.custom_field.people_value.name","custom_field_settings.custom_field.precision","custom_field_settings.custom_field.resource_subtype","custom_field_settings.custom_field.text_value","custom_field_settings.custom_field.type","custom_field_settings.is_important","custom_field_settings.parent","custom_field_settings.parent.name","custom_field_settings.project","custom_field_settings.project.name","custom_fields","custom_fields.date_value","custom_fields.date_value.date","custom_fields.date_value.date_time","custom_fields.display_value","custom_fields.enabled","custom_fields.enum_options","custom_fields.enum_options.color","custom_fields.enum_options.enabled","custom_fields.enum_options.name","custom_fields.enum_value","custom_fields.enum_value.color","custom_fields.enum_value.enabled","custom_fields.enum_value.name","custom_fields.is_formula_field","custom_fields.multi_enum_values","custom_fields.multi_enum_values.color","custom_fields.multi_enum_values.enabled","custom_fields.multi_enum_values.name","custom_fields.name","custom_fields.number_value","custom_fields.resource_subtype","custom_fields.text_value","custom_fields.type","default_access_level","default_view","due_date","due_on","followers","followers.name","html_notes","icon","members","members.name","modified_at","name","notes","owner","permalink_url","project_brief","public","start_on","team","team.name","workspace","workspace.name"] # list[str] | This endpoint returns a compact resource, which excludes some properties by default. To include those optional properties, set this query parameter to a comma-separated list of the properties you wish to include. (optional) try: - # Add users to a project - api_response = api_instance.add_members_for_project(body, project_gid, opt_fields=opt_fields) - pprint(api_response) + # Add users to a project + api_response = api_instance.add_members_for_project(body, project_gid, opt_fields=opt_fields) + pprint(api_response) except ApiException as e: - print("Exception when calling ProjectsApi->add_members_for_project: %s\n" % e) + print("Exception when calling ProjectsApi->add_members_for_project: %s\n" % e) create_project: |- import asana from asana.rest import ApiException @@ -69,18 +72,19 @@ ProjectsApi: # Configure OAuth2 access token for authorization: oauth2 configuration = asana.Configuration() configuration.access_token = '' + api_client = asana.ApiClient(configuration) # create an instance of the API class - api_instance = asana.ProjectsApi(asana.ApiClient(configuration)) + api_instance = asana.ProjectsApi(api_client) body = asana.ProjectsBody({"param1": "value1", "param2": "value2",}) # ProjectsBody | The project to create. opt_fields = ["archived","color","completed","completed_at","completed_by","completed_by.name","created_at","created_from_template","created_from_template.name","current_status","current_status.author","current_status.author.name","current_status.color","current_status.created_at","current_status.created_by","current_status.created_by.name","current_status.html_text","current_status.modified_at","current_status.text","current_status.title","current_status_update","current_status_update.resource_subtype","current_status_update.title","custom_field_settings","custom_field_settings.custom_field","custom_field_settings.custom_field.asana_created_field","custom_field_settings.custom_field.created_by","custom_field_settings.custom_field.created_by.name","custom_field_settings.custom_field.currency_code","custom_field_settings.custom_field.custom_label","custom_field_settings.custom_field.custom_label_position","custom_field_settings.custom_field.date_value","custom_field_settings.custom_field.date_value.date","custom_field_settings.custom_field.date_value.date_time","custom_field_settings.custom_field.description","custom_field_settings.custom_field.display_value","custom_field_settings.custom_field.enabled","custom_field_settings.custom_field.enum_options","custom_field_settings.custom_field.enum_options.color","custom_field_settings.custom_field.enum_options.enabled","custom_field_settings.custom_field.enum_options.name","custom_field_settings.custom_field.enum_value","custom_field_settings.custom_field.enum_value.color","custom_field_settings.custom_field.enum_value.enabled","custom_field_settings.custom_field.enum_value.name","custom_field_settings.custom_field.format","custom_field_settings.custom_field.has_notifications_enabled","custom_field_settings.custom_field.is_formula_field","custom_field_settings.custom_field.is_global_to_workspace","custom_field_settings.custom_field.is_value_read_only","custom_field_settings.custom_field.multi_enum_values","custom_field_settings.custom_field.multi_enum_values.color","custom_field_settings.custom_field.multi_enum_values.enabled","custom_field_settings.custom_field.multi_enum_values.name","custom_field_settings.custom_field.name","custom_field_settings.custom_field.number_value","custom_field_settings.custom_field.people_value","custom_field_settings.custom_field.people_value.name","custom_field_settings.custom_field.precision","custom_field_settings.custom_field.resource_subtype","custom_field_settings.custom_field.text_value","custom_field_settings.custom_field.type","custom_field_settings.is_important","custom_field_settings.parent","custom_field_settings.parent.name","custom_field_settings.project","custom_field_settings.project.name","custom_fields","custom_fields.date_value","custom_fields.date_value.date","custom_fields.date_value.date_time","custom_fields.display_value","custom_fields.enabled","custom_fields.enum_options","custom_fields.enum_options.color","custom_fields.enum_options.enabled","custom_fields.enum_options.name","custom_fields.enum_value","custom_fields.enum_value.color","custom_fields.enum_value.enabled","custom_fields.enum_value.name","custom_fields.is_formula_field","custom_fields.multi_enum_values","custom_fields.multi_enum_values.color","custom_fields.multi_enum_values.enabled","custom_fields.multi_enum_values.name","custom_fields.name","custom_fields.number_value","custom_fields.resource_subtype","custom_fields.text_value","custom_fields.type","default_access_level","default_view","due_date","due_on","followers","followers.name","html_notes","icon","members","members.name","modified_at","name","notes","owner","permalink_url","project_brief","public","start_on","team","team.name","workspace","workspace.name"] # list[str] | This endpoint returns a compact resource, which excludes some properties by default. To include those optional properties, set this query parameter to a comma-separated list of the properties you wish to include. (optional) try: - # Create a project - api_response = api_instance.create_project(body, opt_fields=opt_fields) - pprint(api_response) + # Create a project + api_response = api_instance.create_project(body, opt_fields=opt_fields) + pprint(api_response) except ApiException as e: - print("Exception when calling ProjectsApi->create_project: %s\n" % e) + print("Exception when calling ProjectsApi->create_project: %s\n" % e) create_project_for_team: |- import asana from asana.rest import ApiException @@ -89,19 +93,20 @@ ProjectsApi: # Configure OAuth2 access token for authorization: oauth2 configuration = asana.Configuration() configuration.access_token = '' + api_client = asana.ApiClient(configuration) # create an instance of the API class - api_instance = asana.ProjectsApi(asana.ApiClient(configuration)) + api_instance = asana.ProjectsApi(api_client) body = asana.TeamGidProjectsBody({"param1": "value1", "param2": "value2",}) # TeamGidProjectsBody | The new project to create. team_gid = '159874' # str | Globally unique identifier for the team. opt_fields = ["archived","color","completed","completed_at","completed_by","completed_by.name","created_at","created_from_template","created_from_template.name","current_status","current_status.author","current_status.author.name","current_status.color","current_status.created_at","current_status.created_by","current_status.created_by.name","current_status.html_text","current_status.modified_at","current_status.text","current_status.title","current_status_update","current_status_update.resource_subtype","current_status_update.title","custom_field_settings","custom_field_settings.custom_field","custom_field_settings.custom_field.asana_created_field","custom_field_settings.custom_field.created_by","custom_field_settings.custom_field.created_by.name","custom_field_settings.custom_field.currency_code","custom_field_settings.custom_field.custom_label","custom_field_settings.custom_field.custom_label_position","custom_field_settings.custom_field.date_value","custom_field_settings.custom_field.date_value.date","custom_field_settings.custom_field.date_value.date_time","custom_field_settings.custom_field.description","custom_field_settings.custom_field.display_value","custom_field_settings.custom_field.enabled","custom_field_settings.custom_field.enum_options","custom_field_settings.custom_field.enum_options.color","custom_field_settings.custom_field.enum_options.enabled","custom_field_settings.custom_field.enum_options.name","custom_field_settings.custom_field.enum_value","custom_field_settings.custom_field.enum_value.color","custom_field_settings.custom_field.enum_value.enabled","custom_field_settings.custom_field.enum_value.name","custom_field_settings.custom_field.format","custom_field_settings.custom_field.has_notifications_enabled","custom_field_settings.custom_field.is_formula_field","custom_field_settings.custom_field.is_global_to_workspace","custom_field_settings.custom_field.is_value_read_only","custom_field_settings.custom_field.multi_enum_values","custom_field_settings.custom_field.multi_enum_values.color","custom_field_settings.custom_field.multi_enum_values.enabled","custom_field_settings.custom_field.multi_enum_values.name","custom_field_settings.custom_field.name","custom_field_settings.custom_field.number_value","custom_field_settings.custom_field.people_value","custom_field_settings.custom_field.people_value.name","custom_field_settings.custom_field.precision","custom_field_settings.custom_field.resource_subtype","custom_field_settings.custom_field.text_value","custom_field_settings.custom_field.type","custom_field_settings.is_important","custom_field_settings.parent","custom_field_settings.parent.name","custom_field_settings.project","custom_field_settings.project.name","custom_fields","custom_fields.date_value","custom_fields.date_value.date","custom_fields.date_value.date_time","custom_fields.display_value","custom_fields.enabled","custom_fields.enum_options","custom_fields.enum_options.color","custom_fields.enum_options.enabled","custom_fields.enum_options.name","custom_fields.enum_value","custom_fields.enum_value.color","custom_fields.enum_value.enabled","custom_fields.enum_value.name","custom_fields.is_formula_field","custom_fields.multi_enum_values","custom_fields.multi_enum_values.color","custom_fields.multi_enum_values.enabled","custom_fields.multi_enum_values.name","custom_fields.name","custom_fields.number_value","custom_fields.resource_subtype","custom_fields.text_value","custom_fields.type","default_access_level","default_view","due_date","due_on","followers","followers.name","html_notes","icon","members","members.name","modified_at","name","notes","owner","permalink_url","project_brief","public","start_on","team","team.name","workspace","workspace.name"] # list[str] | This endpoint returns a compact resource, which excludes some properties by default. To include those optional properties, set this query parameter to a comma-separated list of the properties you wish to include. (optional) try: - # Create a project in a team - api_response = api_instance.create_project_for_team(body, team_gid, opt_fields=opt_fields) - pprint(api_response) + # Create a project in a team + api_response = api_instance.create_project_for_team(body, team_gid, opt_fields=opt_fields) + pprint(api_response) except ApiException as e: - print("Exception when calling ProjectsApi->create_project_for_team: %s\n" % e) + print("Exception when calling ProjectsApi->create_project_for_team: %s\n" % e) create_project_for_workspace: |- import asana from asana.rest import ApiException @@ -110,19 +115,20 @@ ProjectsApi: # Configure OAuth2 access token for authorization: oauth2 configuration = asana.Configuration() configuration.access_token = '' + api_client = asana.ApiClient(configuration) # create an instance of the API class - api_instance = asana.ProjectsApi(asana.ApiClient(configuration)) + api_instance = asana.ProjectsApi(api_client) body = asana.WorkspaceGidProjectsBody({"param1": "value1", "param2": "value2",}) # WorkspaceGidProjectsBody | The new project to create. workspace_gid = '12345' # str | Globally unique identifier for the workspace or organization. opt_fields = ["archived","color","completed","completed_at","completed_by","completed_by.name","created_at","created_from_template","created_from_template.name","current_status","current_status.author","current_status.author.name","current_status.color","current_status.created_at","current_status.created_by","current_status.created_by.name","current_status.html_text","current_status.modified_at","current_status.text","current_status.title","current_status_update","current_status_update.resource_subtype","current_status_update.title","custom_field_settings","custom_field_settings.custom_field","custom_field_settings.custom_field.asana_created_field","custom_field_settings.custom_field.created_by","custom_field_settings.custom_field.created_by.name","custom_field_settings.custom_field.currency_code","custom_field_settings.custom_field.custom_label","custom_field_settings.custom_field.custom_label_position","custom_field_settings.custom_field.date_value","custom_field_settings.custom_field.date_value.date","custom_field_settings.custom_field.date_value.date_time","custom_field_settings.custom_field.description","custom_field_settings.custom_field.display_value","custom_field_settings.custom_field.enabled","custom_field_settings.custom_field.enum_options","custom_field_settings.custom_field.enum_options.color","custom_field_settings.custom_field.enum_options.enabled","custom_field_settings.custom_field.enum_options.name","custom_field_settings.custom_field.enum_value","custom_field_settings.custom_field.enum_value.color","custom_field_settings.custom_field.enum_value.enabled","custom_field_settings.custom_field.enum_value.name","custom_field_settings.custom_field.format","custom_field_settings.custom_field.has_notifications_enabled","custom_field_settings.custom_field.is_formula_field","custom_field_settings.custom_field.is_global_to_workspace","custom_field_settings.custom_field.is_value_read_only","custom_field_settings.custom_field.multi_enum_values","custom_field_settings.custom_field.multi_enum_values.color","custom_field_settings.custom_field.multi_enum_values.enabled","custom_field_settings.custom_field.multi_enum_values.name","custom_field_settings.custom_field.name","custom_field_settings.custom_field.number_value","custom_field_settings.custom_field.people_value","custom_field_settings.custom_field.people_value.name","custom_field_settings.custom_field.precision","custom_field_settings.custom_field.resource_subtype","custom_field_settings.custom_field.text_value","custom_field_settings.custom_field.type","custom_field_settings.is_important","custom_field_settings.parent","custom_field_settings.parent.name","custom_field_settings.project","custom_field_settings.project.name","custom_fields","custom_fields.date_value","custom_fields.date_value.date","custom_fields.date_value.date_time","custom_fields.display_value","custom_fields.enabled","custom_fields.enum_options","custom_fields.enum_options.color","custom_fields.enum_options.enabled","custom_fields.enum_options.name","custom_fields.enum_value","custom_fields.enum_value.color","custom_fields.enum_value.enabled","custom_fields.enum_value.name","custom_fields.is_formula_field","custom_fields.multi_enum_values","custom_fields.multi_enum_values.color","custom_fields.multi_enum_values.enabled","custom_fields.multi_enum_values.name","custom_fields.name","custom_fields.number_value","custom_fields.resource_subtype","custom_fields.text_value","custom_fields.type","default_access_level","default_view","due_date","due_on","followers","followers.name","html_notes","icon","members","members.name","modified_at","name","notes","owner","permalink_url","project_brief","public","start_on","team","team.name","workspace","workspace.name"] # list[str] | This endpoint returns a compact resource, which excludes some properties by default. To include those optional properties, set this query parameter to a comma-separated list of the properties you wish to include. (optional) try: - # Create a project in a workspace - api_response = api_instance.create_project_for_workspace(body, workspace_gid, opt_fields=opt_fields) - pprint(api_response) + # Create a project in a workspace + api_response = api_instance.create_project_for_workspace(body, workspace_gid, opt_fields=opt_fields) + pprint(api_response) except ApiException as e: - print("Exception when calling ProjectsApi->create_project_for_workspace: %s\n" % e) + print("Exception when calling ProjectsApi->create_project_for_workspace: %s\n" % e) delete_project: |- import asana from asana.rest import ApiException @@ -131,17 +137,18 @@ ProjectsApi: # Configure OAuth2 access token for authorization: oauth2 configuration = asana.Configuration() configuration.access_token = '' + api_client = asana.ApiClient(configuration) # create an instance of the API class - api_instance = asana.ProjectsApi(asana.ApiClient(configuration)) + api_instance = asana.ProjectsApi(api_client) project_gid = '1331' # str | Globally unique identifier for the project. try: - # Delete a project - api_response = api_instance.delete_project(project_gid) - pprint(api_response) + # Delete a project + api_response = api_instance.delete_project(project_gid) + pprint(api_response) except ApiException as e: - print("Exception when calling ProjectsApi->delete_project: %s\n" % e) + print("Exception when calling ProjectsApi->delete_project: %s\n" % e) duplicate_project: |- import asana from asana.rest import ApiException @@ -150,19 +157,20 @@ ProjectsApi: # Configure OAuth2 access token for authorization: oauth2 configuration = asana.Configuration() configuration.access_token = '' + api_client = asana.ApiClient(configuration) # create an instance of the API class - api_instance = asana.ProjectsApi(asana.ApiClient(configuration)) + api_instance = asana.ProjectsApi(api_client) project_gid = '1331' # str | Globally unique identifier for the project. body = asana.ProjectGidDuplicateBody({"param1": "value1", "param2": "value2",}) # ProjectGidDuplicateBody | Describes the duplicate's name and the elements that will be duplicated. (optional) opt_fields = ["new_project","new_project.name","new_project_template","new_project_template.name","new_task","new_task.created_by","new_task.name","new_task.resource_subtype","resource_subtype","status"] # list[str] | This endpoint returns a compact resource, which excludes some properties by default. To include those optional properties, set this query parameter to a comma-separated list of the properties you wish to include. (optional) try: - # Duplicate a project - api_response = api_instance.duplicate_project(project_gid, body=body, opt_fields=opt_fields) - pprint(api_response) + # Duplicate a project + api_response = api_instance.duplicate_project(project_gid, body=body, opt_fields=opt_fields) + pprint(api_response) except ApiException as e: - print("Exception when calling ProjectsApi->duplicate_project: %s\n" % e) + print("Exception when calling ProjectsApi->duplicate_project: %s\n" % e) get_project: |- import asana from asana.rest import ApiException @@ -171,18 +179,19 @@ ProjectsApi: # Configure OAuth2 access token for authorization: oauth2 configuration = asana.Configuration() configuration.access_token = '' + api_client = asana.ApiClient(configuration) # create an instance of the API class - api_instance = asana.ProjectsApi(asana.ApiClient(configuration)) + api_instance = asana.ProjectsApi(api_client) project_gid = '1331' # str | Globally unique identifier for the project. opt_fields = ["archived","color","completed","completed_at","completed_by","completed_by.name","created_at","created_from_template","created_from_template.name","current_status","current_status.author","current_status.author.name","current_status.color","current_status.created_at","current_status.created_by","current_status.created_by.name","current_status.html_text","current_status.modified_at","current_status.text","current_status.title","current_status_update","current_status_update.resource_subtype","current_status_update.title","custom_field_settings","custom_field_settings.custom_field","custom_field_settings.custom_field.asana_created_field","custom_field_settings.custom_field.created_by","custom_field_settings.custom_field.created_by.name","custom_field_settings.custom_field.currency_code","custom_field_settings.custom_field.custom_label","custom_field_settings.custom_field.custom_label_position","custom_field_settings.custom_field.date_value","custom_field_settings.custom_field.date_value.date","custom_field_settings.custom_field.date_value.date_time","custom_field_settings.custom_field.description","custom_field_settings.custom_field.display_value","custom_field_settings.custom_field.enabled","custom_field_settings.custom_field.enum_options","custom_field_settings.custom_field.enum_options.color","custom_field_settings.custom_field.enum_options.enabled","custom_field_settings.custom_field.enum_options.name","custom_field_settings.custom_field.enum_value","custom_field_settings.custom_field.enum_value.color","custom_field_settings.custom_field.enum_value.enabled","custom_field_settings.custom_field.enum_value.name","custom_field_settings.custom_field.format","custom_field_settings.custom_field.has_notifications_enabled","custom_field_settings.custom_field.is_formula_field","custom_field_settings.custom_field.is_global_to_workspace","custom_field_settings.custom_field.is_value_read_only","custom_field_settings.custom_field.multi_enum_values","custom_field_settings.custom_field.multi_enum_values.color","custom_field_settings.custom_field.multi_enum_values.enabled","custom_field_settings.custom_field.multi_enum_values.name","custom_field_settings.custom_field.name","custom_field_settings.custom_field.number_value","custom_field_settings.custom_field.people_value","custom_field_settings.custom_field.people_value.name","custom_field_settings.custom_field.precision","custom_field_settings.custom_field.resource_subtype","custom_field_settings.custom_field.text_value","custom_field_settings.custom_field.type","custom_field_settings.is_important","custom_field_settings.parent","custom_field_settings.parent.name","custom_field_settings.project","custom_field_settings.project.name","custom_fields","custom_fields.date_value","custom_fields.date_value.date","custom_fields.date_value.date_time","custom_fields.display_value","custom_fields.enabled","custom_fields.enum_options","custom_fields.enum_options.color","custom_fields.enum_options.enabled","custom_fields.enum_options.name","custom_fields.enum_value","custom_fields.enum_value.color","custom_fields.enum_value.enabled","custom_fields.enum_value.name","custom_fields.is_formula_field","custom_fields.multi_enum_values","custom_fields.multi_enum_values.color","custom_fields.multi_enum_values.enabled","custom_fields.multi_enum_values.name","custom_fields.name","custom_fields.number_value","custom_fields.resource_subtype","custom_fields.text_value","custom_fields.type","default_access_level","default_view","due_date","due_on","followers","followers.name","html_notes","icon","members","members.name","modified_at","name","notes","owner","permalink_url","project_brief","public","start_on","team","team.name","workspace","workspace.name"] # list[str] | This endpoint returns a compact resource, which excludes some properties by default. To include those optional properties, set this query parameter to a comma-separated list of the properties you wish to include. (optional) try: - # Get a project - api_response = api_instance.get_project(project_gid, opt_fields=opt_fields) - pprint(api_response) + # Get a project + api_response = api_instance.get_project(project_gid, opt_fields=opt_fields) + pprint(api_response) except ApiException as e: - print("Exception when calling ProjectsApi->get_project: %s\n" % e) + print("Exception when calling ProjectsApi->get_project: %s\n" % e) get_projects: |- import asana from asana.rest import ApiException @@ -191,9 +200,10 @@ ProjectsApi: # Configure OAuth2 access token for authorization: oauth2 configuration = asana.Configuration() configuration.access_token = '' + api_client = asana.ApiClient(configuration) # create an instance of the API class - api_instance = asana.ProjectsApi(asana.ApiClient(configuration)) + api_instance = asana.ProjectsApi(api_client) limit = 50 # int | Results per page. The number of objects to return per page. The value must be between 1 and 100. (optional) offset = 'eyJ0eXAiOJiKV1iQLCJhbGciOiJIUzI1NiJ9' # 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.' (optional) workspace = '1331' # str | The workspace or organization to filter projects on. (optional) @@ -202,11 +212,11 @@ ProjectsApi: opt_fields = ["archived","color","completed","completed_at","completed_by","completed_by.name","created_at","created_from_template","created_from_template.name","current_status","current_status.author","current_status.author.name","current_status.color","current_status.created_at","current_status.created_by","current_status.created_by.name","current_status.html_text","current_status.modified_at","current_status.text","current_status.title","current_status_update","current_status_update.resource_subtype","current_status_update.title","custom_field_settings","custom_field_settings.custom_field","custom_field_settings.custom_field.asana_created_field","custom_field_settings.custom_field.created_by","custom_field_settings.custom_field.created_by.name","custom_field_settings.custom_field.currency_code","custom_field_settings.custom_field.custom_label","custom_field_settings.custom_field.custom_label_position","custom_field_settings.custom_field.date_value","custom_field_settings.custom_field.date_value.date","custom_field_settings.custom_field.date_value.date_time","custom_field_settings.custom_field.description","custom_field_settings.custom_field.display_value","custom_field_settings.custom_field.enabled","custom_field_settings.custom_field.enum_options","custom_field_settings.custom_field.enum_options.color","custom_field_settings.custom_field.enum_options.enabled","custom_field_settings.custom_field.enum_options.name","custom_field_settings.custom_field.enum_value","custom_field_settings.custom_field.enum_value.color","custom_field_settings.custom_field.enum_value.enabled","custom_field_settings.custom_field.enum_value.name","custom_field_settings.custom_field.format","custom_field_settings.custom_field.has_notifications_enabled","custom_field_settings.custom_field.is_formula_field","custom_field_settings.custom_field.is_global_to_workspace","custom_field_settings.custom_field.is_value_read_only","custom_field_settings.custom_field.multi_enum_values","custom_field_settings.custom_field.multi_enum_values.color","custom_field_settings.custom_field.multi_enum_values.enabled","custom_field_settings.custom_field.multi_enum_values.name","custom_field_settings.custom_field.name","custom_field_settings.custom_field.number_value","custom_field_settings.custom_field.people_value","custom_field_settings.custom_field.people_value.name","custom_field_settings.custom_field.precision","custom_field_settings.custom_field.resource_subtype","custom_field_settings.custom_field.text_value","custom_field_settings.custom_field.type","custom_field_settings.is_important","custom_field_settings.parent","custom_field_settings.parent.name","custom_field_settings.project","custom_field_settings.project.name","custom_fields","custom_fields.date_value","custom_fields.date_value.date","custom_fields.date_value.date_time","custom_fields.display_value","custom_fields.enabled","custom_fields.enum_options","custom_fields.enum_options.color","custom_fields.enum_options.enabled","custom_fields.enum_options.name","custom_fields.enum_value","custom_fields.enum_value.color","custom_fields.enum_value.enabled","custom_fields.enum_value.name","custom_fields.is_formula_field","custom_fields.multi_enum_values","custom_fields.multi_enum_values.color","custom_fields.multi_enum_values.enabled","custom_fields.multi_enum_values.name","custom_fields.name","custom_fields.number_value","custom_fields.resource_subtype","custom_fields.text_value","custom_fields.type","default_access_level","default_view","due_date","due_on","followers","followers.name","html_notes","icon","members","members.name","modified_at","name","notes","offset","owner","path","permalink_url","project_brief","public","start_on","team","team.name","uri","workspace","workspace.name"] # list[str] | This endpoint returns a compact resource, which excludes some properties by default. To include those optional properties, set this query parameter to a comma-separated list of the properties you wish to include. (optional) try: - # Get multiple projects - api_response = api_instance.get_projects(limit=limit, offset=offset, workspace=workspace, team=team, archived=archived, opt_fields=opt_fields) - pprint(api_response) + # Get multiple projects + api_response = api_instance.get_projects(limit=limit, offset=offset, workspace=workspace, team=team, archived=archived, opt_fields=opt_fields) + pprint(api_response) except ApiException as e: - print("Exception when calling ProjectsApi->get_projects: %s\n" % e) + print("Exception when calling ProjectsApi->get_projects: %s\n" % e) get_projects_for_task: |- import asana from asana.rest import ApiException @@ -215,20 +225,21 @@ ProjectsApi: # Configure OAuth2 access token for authorization: oauth2 configuration = asana.Configuration() configuration.access_token = '' + api_client = asana.ApiClient(configuration) # create an instance of the API class - api_instance = asana.ProjectsApi(asana.ApiClient(configuration)) + api_instance = asana.ProjectsApi(api_client) task_gid = '321654' # str | The task to operate on. limit = 50 # int | Results per page. The number of objects to return per page. The value must be between 1 and 100. (optional) offset = 'eyJ0eXAiOJiKV1iQLCJhbGciOiJIUzI1NiJ9' # 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.' (optional) opt_fields = ["archived","color","completed","completed_at","completed_by","completed_by.name","created_at","created_from_template","created_from_template.name","current_status","current_status.author","current_status.author.name","current_status.color","current_status.created_at","current_status.created_by","current_status.created_by.name","current_status.html_text","current_status.modified_at","current_status.text","current_status.title","current_status_update","current_status_update.resource_subtype","current_status_update.title","custom_field_settings","custom_field_settings.custom_field","custom_field_settings.custom_field.asana_created_field","custom_field_settings.custom_field.created_by","custom_field_settings.custom_field.created_by.name","custom_field_settings.custom_field.currency_code","custom_field_settings.custom_field.custom_label","custom_field_settings.custom_field.custom_label_position","custom_field_settings.custom_field.date_value","custom_field_settings.custom_field.date_value.date","custom_field_settings.custom_field.date_value.date_time","custom_field_settings.custom_field.description","custom_field_settings.custom_field.display_value","custom_field_settings.custom_field.enabled","custom_field_settings.custom_field.enum_options","custom_field_settings.custom_field.enum_options.color","custom_field_settings.custom_field.enum_options.enabled","custom_field_settings.custom_field.enum_options.name","custom_field_settings.custom_field.enum_value","custom_field_settings.custom_field.enum_value.color","custom_field_settings.custom_field.enum_value.enabled","custom_field_settings.custom_field.enum_value.name","custom_field_settings.custom_field.format","custom_field_settings.custom_field.has_notifications_enabled","custom_field_settings.custom_field.is_formula_field","custom_field_settings.custom_field.is_global_to_workspace","custom_field_settings.custom_field.is_value_read_only","custom_field_settings.custom_field.multi_enum_values","custom_field_settings.custom_field.multi_enum_values.color","custom_field_settings.custom_field.multi_enum_values.enabled","custom_field_settings.custom_field.multi_enum_values.name","custom_field_settings.custom_field.name","custom_field_settings.custom_field.number_value","custom_field_settings.custom_field.people_value","custom_field_settings.custom_field.people_value.name","custom_field_settings.custom_field.precision","custom_field_settings.custom_field.resource_subtype","custom_field_settings.custom_field.text_value","custom_field_settings.custom_field.type","custom_field_settings.is_important","custom_field_settings.parent","custom_field_settings.parent.name","custom_field_settings.project","custom_field_settings.project.name","custom_fields","custom_fields.date_value","custom_fields.date_value.date","custom_fields.date_value.date_time","custom_fields.display_value","custom_fields.enabled","custom_fields.enum_options","custom_fields.enum_options.color","custom_fields.enum_options.enabled","custom_fields.enum_options.name","custom_fields.enum_value","custom_fields.enum_value.color","custom_fields.enum_value.enabled","custom_fields.enum_value.name","custom_fields.is_formula_field","custom_fields.multi_enum_values","custom_fields.multi_enum_values.color","custom_fields.multi_enum_values.enabled","custom_fields.multi_enum_values.name","custom_fields.name","custom_fields.number_value","custom_fields.resource_subtype","custom_fields.text_value","custom_fields.type","default_access_level","default_view","due_date","due_on","followers","followers.name","html_notes","icon","members","members.name","modified_at","name","notes","offset","owner","path","permalink_url","project_brief","public","start_on","team","team.name","uri","workspace","workspace.name"] # list[str] | This endpoint returns a compact resource, which excludes some properties by default. To include those optional properties, set this query parameter to a comma-separated list of the properties you wish to include. (optional) try: - # Get projects a task is in - api_response = api_instance.get_projects_for_task(task_gid, limit=limit, offset=offset, opt_fields=opt_fields) - pprint(api_response) + # Get projects a task is in + api_response = api_instance.get_projects_for_task(task_gid, limit=limit, offset=offset, opt_fields=opt_fields) + pprint(api_response) except ApiException as e: - print("Exception when calling ProjectsApi->get_projects_for_task: %s\n" % e) + print("Exception when calling ProjectsApi->get_projects_for_task: %s\n" % e) get_projects_for_team: |- import asana from asana.rest import ApiException @@ -237,9 +248,10 @@ ProjectsApi: # Configure OAuth2 access token for authorization: oauth2 configuration = asana.Configuration() configuration.access_token = '' + api_client = asana.ApiClient(configuration) # create an instance of the API class - api_instance = asana.ProjectsApi(asana.ApiClient(configuration)) + api_instance = asana.ProjectsApi(api_client) team_gid = '159874' # str | Globally unique identifier for the team. limit = 50 # int | Results per page. The number of objects to return per page. The value must be between 1 and 100. (optional) offset = 'eyJ0eXAiOJiKV1iQLCJhbGciOiJIUzI1NiJ9' # 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.' (optional) @@ -247,11 +259,11 @@ ProjectsApi: opt_fields = ["archived","color","completed","completed_at","completed_by","completed_by.name","created_at","created_from_template","created_from_template.name","current_status","current_status.author","current_status.author.name","current_status.color","current_status.created_at","current_status.created_by","current_status.created_by.name","current_status.html_text","current_status.modified_at","current_status.text","current_status.title","current_status_update","current_status_update.resource_subtype","current_status_update.title","custom_field_settings","custom_field_settings.custom_field","custom_field_settings.custom_field.asana_created_field","custom_field_settings.custom_field.created_by","custom_field_settings.custom_field.created_by.name","custom_field_settings.custom_field.currency_code","custom_field_settings.custom_field.custom_label","custom_field_settings.custom_field.custom_label_position","custom_field_settings.custom_field.date_value","custom_field_settings.custom_field.date_value.date","custom_field_settings.custom_field.date_value.date_time","custom_field_settings.custom_field.description","custom_field_settings.custom_field.display_value","custom_field_settings.custom_field.enabled","custom_field_settings.custom_field.enum_options","custom_field_settings.custom_field.enum_options.color","custom_field_settings.custom_field.enum_options.enabled","custom_field_settings.custom_field.enum_options.name","custom_field_settings.custom_field.enum_value","custom_field_settings.custom_field.enum_value.color","custom_field_settings.custom_field.enum_value.enabled","custom_field_settings.custom_field.enum_value.name","custom_field_settings.custom_field.format","custom_field_settings.custom_field.has_notifications_enabled","custom_field_settings.custom_field.is_formula_field","custom_field_settings.custom_field.is_global_to_workspace","custom_field_settings.custom_field.is_value_read_only","custom_field_settings.custom_field.multi_enum_values","custom_field_settings.custom_field.multi_enum_values.color","custom_field_settings.custom_field.multi_enum_values.enabled","custom_field_settings.custom_field.multi_enum_values.name","custom_field_settings.custom_field.name","custom_field_settings.custom_field.number_value","custom_field_settings.custom_field.people_value","custom_field_settings.custom_field.people_value.name","custom_field_settings.custom_field.precision","custom_field_settings.custom_field.resource_subtype","custom_field_settings.custom_field.text_value","custom_field_settings.custom_field.type","custom_field_settings.is_important","custom_field_settings.parent","custom_field_settings.parent.name","custom_field_settings.project","custom_field_settings.project.name","custom_fields","custom_fields.date_value","custom_fields.date_value.date","custom_fields.date_value.date_time","custom_fields.display_value","custom_fields.enabled","custom_fields.enum_options","custom_fields.enum_options.color","custom_fields.enum_options.enabled","custom_fields.enum_options.name","custom_fields.enum_value","custom_fields.enum_value.color","custom_fields.enum_value.enabled","custom_fields.enum_value.name","custom_fields.is_formula_field","custom_fields.multi_enum_values","custom_fields.multi_enum_values.color","custom_fields.multi_enum_values.enabled","custom_fields.multi_enum_values.name","custom_fields.name","custom_fields.number_value","custom_fields.resource_subtype","custom_fields.text_value","custom_fields.type","default_access_level","default_view","due_date","due_on","followers","followers.name","html_notes","icon","members","members.name","modified_at","name","notes","offset","owner","path","permalink_url","project_brief","public","start_on","team","team.name","uri","workspace","workspace.name"] # list[str] | This endpoint returns a compact resource, which excludes some properties by default. To include those optional properties, set this query parameter to a comma-separated list of the properties you wish to include. (optional) try: - # Get a team's projects - api_response = api_instance.get_projects_for_team(team_gid, limit=limit, offset=offset, archived=archived, opt_fields=opt_fields) - pprint(api_response) + # Get a team's projects + api_response = api_instance.get_projects_for_team(team_gid, limit=limit, offset=offset, archived=archived, opt_fields=opt_fields) + pprint(api_response) except ApiException as e: - print("Exception when calling ProjectsApi->get_projects_for_team: %s\n" % e) + print("Exception when calling ProjectsApi->get_projects_for_team: %s\n" % e) get_projects_for_workspace: |- import asana from asana.rest import ApiException @@ -260,9 +272,10 @@ ProjectsApi: # Configure OAuth2 access token for authorization: oauth2 configuration = asana.Configuration() configuration.access_token = '' + api_client = asana.ApiClient(configuration) # create an instance of the API class - api_instance = asana.ProjectsApi(asana.ApiClient(configuration)) + api_instance = asana.ProjectsApi(api_client) workspace_gid = '12345' # str | Globally unique identifier for the workspace or organization. limit = 50 # int | Results per page. The number of objects to return per page. The value must be between 1 and 100. (optional) offset = 'eyJ0eXAiOJiKV1iQLCJhbGciOiJIUzI1NiJ9' # 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.' (optional) @@ -270,11 +283,11 @@ ProjectsApi: opt_fields = ["archived","color","completed","completed_at","completed_by","completed_by.name","created_at","created_from_template","created_from_template.name","current_status","current_status.author","current_status.author.name","current_status.color","current_status.created_at","current_status.created_by","current_status.created_by.name","current_status.html_text","current_status.modified_at","current_status.text","current_status.title","current_status_update","current_status_update.resource_subtype","current_status_update.title","custom_field_settings","custom_field_settings.custom_field","custom_field_settings.custom_field.asana_created_field","custom_field_settings.custom_field.created_by","custom_field_settings.custom_field.created_by.name","custom_field_settings.custom_field.currency_code","custom_field_settings.custom_field.custom_label","custom_field_settings.custom_field.custom_label_position","custom_field_settings.custom_field.date_value","custom_field_settings.custom_field.date_value.date","custom_field_settings.custom_field.date_value.date_time","custom_field_settings.custom_field.description","custom_field_settings.custom_field.display_value","custom_field_settings.custom_field.enabled","custom_field_settings.custom_field.enum_options","custom_field_settings.custom_field.enum_options.color","custom_field_settings.custom_field.enum_options.enabled","custom_field_settings.custom_field.enum_options.name","custom_field_settings.custom_field.enum_value","custom_field_settings.custom_field.enum_value.color","custom_field_settings.custom_field.enum_value.enabled","custom_field_settings.custom_field.enum_value.name","custom_field_settings.custom_field.format","custom_field_settings.custom_field.has_notifications_enabled","custom_field_settings.custom_field.is_formula_field","custom_field_settings.custom_field.is_global_to_workspace","custom_field_settings.custom_field.is_value_read_only","custom_field_settings.custom_field.multi_enum_values","custom_field_settings.custom_field.multi_enum_values.color","custom_field_settings.custom_field.multi_enum_values.enabled","custom_field_settings.custom_field.multi_enum_values.name","custom_field_settings.custom_field.name","custom_field_settings.custom_field.number_value","custom_field_settings.custom_field.people_value","custom_field_settings.custom_field.people_value.name","custom_field_settings.custom_field.precision","custom_field_settings.custom_field.resource_subtype","custom_field_settings.custom_field.text_value","custom_field_settings.custom_field.type","custom_field_settings.is_important","custom_field_settings.parent","custom_field_settings.parent.name","custom_field_settings.project","custom_field_settings.project.name","custom_fields","custom_fields.date_value","custom_fields.date_value.date","custom_fields.date_value.date_time","custom_fields.display_value","custom_fields.enabled","custom_fields.enum_options","custom_fields.enum_options.color","custom_fields.enum_options.enabled","custom_fields.enum_options.name","custom_fields.enum_value","custom_fields.enum_value.color","custom_fields.enum_value.enabled","custom_fields.enum_value.name","custom_fields.is_formula_field","custom_fields.multi_enum_values","custom_fields.multi_enum_values.color","custom_fields.multi_enum_values.enabled","custom_fields.multi_enum_values.name","custom_fields.name","custom_fields.number_value","custom_fields.resource_subtype","custom_fields.text_value","custom_fields.type","default_access_level","default_view","due_date","due_on","followers","followers.name","html_notes","icon","members","members.name","modified_at","name","notes","offset","owner","path","permalink_url","project_brief","public","start_on","team","team.name","uri","workspace","workspace.name"] # list[str] | This endpoint returns a compact resource, which excludes some properties by default. To include those optional properties, set this query parameter to a comma-separated list of the properties you wish to include. (optional) try: - # Get all projects in a workspace - api_response = api_instance.get_projects_for_workspace(workspace_gid, limit=limit, offset=offset, archived=archived, opt_fields=opt_fields) - pprint(api_response) + # Get all projects in a workspace + api_response = api_instance.get_projects_for_workspace(workspace_gid, limit=limit, offset=offset, archived=archived, opt_fields=opt_fields) + pprint(api_response) except ApiException as e: - print("Exception when calling ProjectsApi->get_projects_for_workspace: %s\n" % e) + print("Exception when calling ProjectsApi->get_projects_for_workspace: %s\n" % e) get_task_counts_for_project: |- import asana from asana.rest import ApiException @@ -283,18 +296,19 @@ ProjectsApi: # Configure OAuth2 access token for authorization: oauth2 configuration = asana.Configuration() configuration.access_token = '' + api_client = asana.ApiClient(configuration) # create an instance of the API class - api_instance = asana.ProjectsApi(asana.ApiClient(configuration)) + api_instance = asana.ProjectsApi(api_client) project_gid = '1331' # str | Globally unique identifier for the project. opt_fields = ["num_completed_milestones","num_completed_tasks","num_incomplete_milestones","num_incomplete_tasks","num_milestones","num_tasks"] # list[str] | This endpoint returns a compact resource, which excludes some properties by default. To include those optional properties, set this query parameter to a comma-separated list of the properties you wish to include. (optional) try: - # Get task count of a project - api_response = api_instance.get_task_counts_for_project(project_gid, opt_fields=opt_fields) - pprint(api_response) + # Get task count of a project + api_response = api_instance.get_task_counts_for_project(project_gid, opt_fields=opt_fields) + pprint(api_response) except ApiException as e: - print("Exception when calling ProjectsApi->get_task_counts_for_project: %s\n" % e) + print("Exception when calling ProjectsApi->get_task_counts_for_project: %s\n" % e) project_save_as_template: |- import asana from asana.rest import ApiException @@ -303,19 +317,20 @@ ProjectsApi: # Configure OAuth2 access token for authorization: oauth2 configuration = asana.Configuration() configuration.access_token = '' + api_client = asana.ApiClient(configuration) # create an instance of the API class - api_instance = asana.ProjectsApi(asana.ApiClient(configuration)) + api_instance = asana.ProjectsApi(api_client) body = asana.ProjectGidSaveAsTemplateBody({"param1": "value1", "param2": "value2",}) # ProjectGidSaveAsTemplateBody | Describes the inputs used for creating a project template, such as the resulting project template's name, which team it should be created in. project_gid = '1331' # str | Globally unique identifier for the project. opt_fields = ["new_project","new_project.name","new_project_template","new_project_template.name","new_task","new_task.created_by","new_task.name","new_task.resource_subtype","resource_subtype","status"] # list[str] | This endpoint returns a compact resource, which excludes some properties by default. To include those optional properties, set this query parameter to a comma-separated list of the properties you wish to include. (optional) try: - # Create a project template from a project - api_response = api_instance.project_save_as_template(body, project_gid, opt_fields=opt_fields) - pprint(api_response) + # Create a project template from a project + api_response = api_instance.project_save_as_template(body, project_gid, opt_fields=opt_fields) + pprint(api_response) except ApiException as e: - print("Exception when calling ProjectsApi->project_save_as_template: %s\n" % e) + print("Exception when calling ProjectsApi->project_save_as_template: %s\n" % e) remove_custom_field_setting_for_project: |- import asana from asana.rest import ApiException @@ -324,18 +339,19 @@ ProjectsApi: # Configure OAuth2 access token for authorization: oauth2 configuration = asana.Configuration() configuration.access_token = '' + api_client = asana.ApiClient(configuration) # create an instance of the API class - api_instance = asana.ProjectsApi(asana.ApiClient(configuration)) + api_instance = asana.ProjectsApi(api_client) body = asana.ProjectGidRemoveCustomFieldSettingBody({"param1": "value1", "param2": "value2",}) # ProjectGidRemoveCustomFieldSettingBody | Information about the custom field setting being removed. project_gid = '1331' # str | Globally unique identifier for the project. try: - # Remove a custom field from a project - api_response = api_instance.remove_custom_field_setting_for_project(body, project_gid) - pprint(api_response) + # Remove a custom field from a project + api_response = api_instance.remove_custom_field_setting_for_project(body, project_gid) + pprint(api_response) except ApiException as e: - print("Exception when calling ProjectsApi->remove_custom_field_setting_for_project: %s\n" % e) + print("Exception when calling ProjectsApi->remove_custom_field_setting_for_project: %s\n" % e) remove_followers_for_project: |- import asana from asana.rest import ApiException @@ -344,19 +360,20 @@ ProjectsApi: # Configure OAuth2 access token for authorization: oauth2 configuration = asana.Configuration() configuration.access_token = '' + api_client = asana.ApiClient(configuration) # create an instance of the API class - api_instance = asana.ProjectsApi(asana.ApiClient(configuration)) + api_instance = asana.ProjectsApi(api_client) body = asana.ProjectGidRemoveFollowersBody({"param1": "value1", "param2": "value2",}) # ProjectGidRemoveFollowersBody | Information about the followers being removed. project_gid = '1331' # str | Globally unique identifier for the project. opt_fields = ["archived","color","completed","completed_at","completed_by","completed_by.name","created_at","created_from_template","created_from_template.name","current_status","current_status.author","current_status.author.name","current_status.color","current_status.created_at","current_status.created_by","current_status.created_by.name","current_status.html_text","current_status.modified_at","current_status.text","current_status.title","current_status_update","current_status_update.resource_subtype","current_status_update.title","custom_field_settings","custom_field_settings.custom_field","custom_field_settings.custom_field.asana_created_field","custom_field_settings.custom_field.created_by","custom_field_settings.custom_field.created_by.name","custom_field_settings.custom_field.currency_code","custom_field_settings.custom_field.custom_label","custom_field_settings.custom_field.custom_label_position","custom_field_settings.custom_field.date_value","custom_field_settings.custom_field.date_value.date","custom_field_settings.custom_field.date_value.date_time","custom_field_settings.custom_field.description","custom_field_settings.custom_field.display_value","custom_field_settings.custom_field.enabled","custom_field_settings.custom_field.enum_options","custom_field_settings.custom_field.enum_options.color","custom_field_settings.custom_field.enum_options.enabled","custom_field_settings.custom_field.enum_options.name","custom_field_settings.custom_field.enum_value","custom_field_settings.custom_field.enum_value.color","custom_field_settings.custom_field.enum_value.enabled","custom_field_settings.custom_field.enum_value.name","custom_field_settings.custom_field.format","custom_field_settings.custom_field.has_notifications_enabled","custom_field_settings.custom_field.is_formula_field","custom_field_settings.custom_field.is_global_to_workspace","custom_field_settings.custom_field.is_value_read_only","custom_field_settings.custom_field.multi_enum_values","custom_field_settings.custom_field.multi_enum_values.color","custom_field_settings.custom_field.multi_enum_values.enabled","custom_field_settings.custom_field.multi_enum_values.name","custom_field_settings.custom_field.name","custom_field_settings.custom_field.number_value","custom_field_settings.custom_field.people_value","custom_field_settings.custom_field.people_value.name","custom_field_settings.custom_field.precision","custom_field_settings.custom_field.resource_subtype","custom_field_settings.custom_field.text_value","custom_field_settings.custom_field.type","custom_field_settings.is_important","custom_field_settings.parent","custom_field_settings.parent.name","custom_field_settings.project","custom_field_settings.project.name","custom_fields","custom_fields.date_value","custom_fields.date_value.date","custom_fields.date_value.date_time","custom_fields.display_value","custom_fields.enabled","custom_fields.enum_options","custom_fields.enum_options.color","custom_fields.enum_options.enabled","custom_fields.enum_options.name","custom_fields.enum_value","custom_fields.enum_value.color","custom_fields.enum_value.enabled","custom_fields.enum_value.name","custom_fields.is_formula_field","custom_fields.multi_enum_values","custom_fields.multi_enum_values.color","custom_fields.multi_enum_values.enabled","custom_fields.multi_enum_values.name","custom_fields.name","custom_fields.number_value","custom_fields.resource_subtype","custom_fields.text_value","custom_fields.type","default_access_level","default_view","due_date","due_on","followers","followers.name","html_notes","icon","members","members.name","modified_at","name","notes","owner","permalink_url","project_brief","public","start_on","team","team.name","workspace","workspace.name"] # list[str] | This endpoint returns a compact resource, which excludes some properties by default. To include those optional properties, set this query parameter to a comma-separated list of the properties you wish to include. (optional) try: - # Remove followers from a project - api_response = api_instance.remove_followers_for_project(body, project_gid, opt_fields=opt_fields) - pprint(api_response) + # Remove followers from a project + api_response = api_instance.remove_followers_for_project(body, project_gid, opt_fields=opt_fields) + pprint(api_response) except ApiException as e: - print("Exception when calling ProjectsApi->remove_followers_for_project: %s\n" % e) + print("Exception when calling ProjectsApi->remove_followers_for_project: %s\n" % e) remove_members_for_project: |- import asana from asana.rest import ApiException @@ -365,19 +382,20 @@ ProjectsApi: # Configure OAuth2 access token for authorization: oauth2 configuration = asana.Configuration() configuration.access_token = '' + api_client = asana.ApiClient(configuration) # create an instance of the API class - api_instance = asana.ProjectsApi(asana.ApiClient(configuration)) + api_instance = asana.ProjectsApi(api_client) body = asana.ProjectGidRemoveMembersBody({"param1": "value1", "param2": "value2",}) # ProjectGidRemoveMembersBody | Information about the members being removed. project_gid = '1331' # str | Globally unique identifier for the project. opt_fields = ["archived","color","completed","completed_at","completed_by","completed_by.name","created_at","created_from_template","created_from_template.name","current_status","current_status.author","current_status.author.name","current_status.color","current_status.created_at","current_status.created_by","current_status.created_by.name","current_status.html_text","current_status.modified_at","current_status.text","current_status.title","current_status_update","current_status_update.resource_subtype","current_status_update.title","custom_field_settings","custom_field_settings.custom_field","custom_field_settings.custom_field.asana_created_field","custom_field_settings.custom_field.created_by","custom_field_settings.custom_field.created_by.name","custom_field_settings.custom_field.currency_code","custom_field_settings.custom_field.custom_label","custom_field_settings.custom_field.custom_label_position","custom_field_settings.custom_field.date_value","custom_field_settings.custom_field.date_value.date","custom_field_settings.custom_field.date_value.date_time","custom_field_settings.custom_field.description","custom_field_settings.custom_field.display_value","custom_field_settings.custom_field.enabled","custom_field_settings.custom_field.enum_options","custom_field_settings.custom_field.enum_options.color","custom_field_settings.custom_field.enum_options.enabled","custom_field_settings.custom_field.enum_options.name","custom_field_settings.custom_field.enum_value","custom_field_settings.custom_field.enum_value.color","custom_field_settings.custom_field.enum_value.enabled","custom_field_settings.custom_field.enum_value.name","custom_field_settings.custom_field.format","custom_field_settings.custom_field.has_notifications_enabled","custom_field_settings.custom_field.is_formula_field","custom_field_settings.custom_field.is_global_to_workspace","custom_field_settings.custom_field.is_value_read_only","custom_field_settings.custom_field.multi_enum_values","custom_field_settings.custom_field.multi_enum_values.color","custom_field_settings.custom_field.multi_enum_values.enabled","custom_field_settings.custom_field.multi_enum_values.name","custom_field_settings.custom_field.name","custom_field_settings.custom_field.number_value","custom_field_settings.custom_field.people_value","custom_field_settings.custom_field.people_value.name","custom_field_settings.custom_field.precision","custom_field_settings.custom_field.resource_subtype","custom_field_settings.custom_field.text_value","custom_field_settings.custom_field.type","custom_field_settings.is_important","custom_field_settings.parent","custom_field_settings.parent.name","custom_field_settings.project","custom_field_settings.project.name","custom_fields","custom_fields.date_value","custom_fields.date_value.date","custom_fields.date_value.date_time","custom_fields.display_value","custom_fields.enabled","custom_fields.enum_options","custom_fields.enum_options.color","custom_fields.enum_options.enabled","custom_fields.enum_options.name","custom_fields.enum_value","custom_fields.enum_value.color","custom_fields.enum_value.enabled","custom_fields.enum_value.name","custom_fields.is_formula_field","custom_fields.multi_enum_values","custom_fields.multi_enum_values.color","custom_fields.multi_enum_values.enabled","custom_fields.multi_enum_values.name","custom_fields.name","custom_fields.number_value","custom_fields.resource_subtype","custom_fields.text_value","custom_fields.type","default_access_level","default_view","due_date","due_on","followers","followers.name","html_notes","icon","members","members.name","modified_at","name","notes","owner","permalink_url","project_brief","public","start_on","team","team.name","workspace","workspace.name"] # list[str] | This endpoint returns a compact resource, which excludes some properties by default. To include those optional properties, set this query parameter to a comma-separated list of the properties you wish to include. (optional) try: - # Remove users from a project - api_response = api_instance.remove_members_for_project(body, project_gid, opt_fields=opt_fields) - pprint(api_response) + # Remove users from a project + api_response = api_instance.remove_members_for_project(body, project_gid, opt_fields=opt_fields) + pprint(api_response) except ApiException as e: - print("Exception when calling ProjectsApi->remove_members_for_project: %s\n" % e) + print("Exception when calling ProjectsApi->remove_members_for_project: %s\n" % e) update_project: |- import asana from asana.rest import ApiException @@ -386,16 +404,17 @@ ProjectsApi: # Configure OAuth2 access token for authorization: oauth2 configuration = asana.Configuration() configuration.access_token = '' + api_client = asana.ApiClient(configuration) # create an instance of the API class - api_instance = asana.ProjectsApi(asana.ApiClient(configuration)) + api_instance = asana.ProjectsApi(api_client) body = asana.ProjectsProjectGidBody({"param1": "value1", "param2": "value2",}) # ProjectsProjectGidBody | The updated fields for the project. project_gid = '1331' # str | Globally unique identifier for the project. opt_fields = ["archived","color","completed","completed_at","completed_by","completed_by.name","created_at","created_from_template","created_from_template.name","current_status","current_status.author","current_status.author.name","current_status.color","current_status.created_at","current_status.created_by","current_status.created_by.name","current_status.html_text","current_status.modified_at","current_status.text","current_status.title","current_status_update","current_status_update.resource_subtype","current_status_update.title","custom_field_settings","custom_field_settings.custom_field","custom_field_settings.custom_field.asana_created_field","custom_field_settings.custom_field.created_by","custom_field_settings.custom_field.created_by.name","custom_field_settings.custom_field.currency_code","custom_field_settings.custom_field.custom_label","custom_field_settings.custom_field.custom_label_position","custom_field_settings.custom_field.date_value","custom_field_settings.custom_field.date_value.date","custom_field_settings.custom_field.date_value.date_time","custom_field_settings.custom_field.description","custom_field_settings.custom_field.display_value","custom_field_settings.custom_field.enabled","custom_field_settings.custom_field.enum_options","custom_field_settings.custom_field.enum_options.color","custom_field_settings.custom_field.enum_options.enabled","custom_field_settings.custom_field.enum_options.name","custom_field_settings.custom_field.enum_value","custom_field_settings.custom_field.enum_value.color","custom_field_settings.custom_field.enum_value.enabled","custom_field_settings.custom_field.enum_value.name","custom_field_settings.custom_field.format","custom_field_settings.custom_field.has_notifications_enabled","custom_field_settings.custom_field.is_formula_field","custom_field_settings.custom_field.is_global_to_workspace","custom_field_settings.custom_field.is_value_read_only","custom_field_settings.custom_field.multi_enum_values","custom_field_settings.custom_field.multi_enum_values.color","custom_field_settings.custom_field.multi_enum_values.enabled","custom_field_settings.custom_field.multi_enum_values.name","custom_field_settings.custom_field.name","custom_field_settings.custom_field.number_value","custom_field_settings.custom_field.people_value","custom_field_settings.custom_field.people_value.name","custom_field_settings.custom_field.precision","custom_field_settings.custom_field.resource_subtype","custom_field_settings.custom_field.text_value","custom_field_settings.custom_field.type","custom_field_settings.is_important","custom_field_settings.parent","custom_field_settings.parent.name","custom_field_settings.project","custom_field_settings.project.name","custom_fields","custom_fields.date_value","custom_fields.date_value.date","custom_fields.date_value.date_time","custom_fields.display_value","custom_fields.enabled","custom_fields.enum_options","custom_fields.enum_options.color","custom_fields.enum_options.enabled","custom_fields.enum_options.name","custom_fields.enum_value","custom_fields.enum_value.color","custom_fields.enum_value.enabled","custom_fields.enum_value.name","custom_fields.is_formula_field","custom_fields.multi_enum_values","custom_fields.multi_enum_values.color","custom_fields.multi_enum_values.enabled","custom_fields.multi_enum_values.name","custom_fields.name","custom_fields.number_value","custom_fields.resource_subtype","custom_fields.text_value","custom_fields.type","default_access_level","default_view","due_date","due_on","followers","followers.name","html_notes","icon","members","members.name","modified_at","name","notes","owner","permalink_url","project_brief","public","start_on","team","team.name","workspace","workspace.name"] # list[str] | This endpoint returns a compact resource, which excludes some properties by default. To include those optional properties, set this query parameter to a comma-separated list of the properties you wish to include. (optional) try: - # Update a project - api_response = api_instance.update_project(body, project_gid, opt_fields=opt_fields) - pprint(api_response) + # Update a project + api_response = api_instance.update_project(body, project_gid, opt_fields=opt_fields) + pprint(api_response) except ApiException as e: - print("Exception when calling ProjectsApi->update_project: %s\n" % e) + print("Exception when calling ProjectsApi->update_project: %s\n" % e) diff --git a/docs/RulesApi.md b/docs/RulesApi.md index e576a649..3c02bea7 100644 --- a/docs/RulesApi.md +++ b/docs/RulesApi.md @@ -22,18 +22,19 @@ from pprint import pprint # Configure OAuth2 access token for authorization: oauth2 configuration = asana.Configuration() configuration.access_token = '' +api_client = asana.ApiClient(configuration) # create an instance of the API class -api_instance = asana.RulesApi(asana.ApiClient(configuration)) +api_instance = asana.RulesApi(api_client) body = asana.RuleTriggerGidRunBody({"param1": "value1", "param2": "value2",}) # RuleTriggerGidRunBody | A dictionary of variables accessible from within the rule. rule_trigger_gid = '12345' # str | The ID of the incoming web request trigger. This value is a path parameter that is automatically generated for the API endpoint. try: - # Trigger a rule - api_response = api_instance.trigger_rule(body, rule_trigger_gid) - pprint(api_response) + # Trigger a rule + api_response = api_instance.trigger_rule(body, rule_trigger_gid) + pprint(api_response) except ApiException as e: - print("Exception when calling RulesApi->trigger_rule: %s\n" % e) + print("Exception when calling RulesApi->trigger_rule: %s\n" % e) ``` ### Parameters diff --git a/docs/RulesApi.yaml b/docs/RulesApi.yaml index b3950eeb..5a8fec3d 100644 --- a/docs/RulesApi.yaml +++ b/docs/RulesApi.yaml @@ -7,15 +7,16 @@ RulesApi: # Configure OAuth2 access token for authorization: oauth2 configuration = asana.Configuration() configuration.access_token = '' + api_client = asana.ApiClient(configuration) # create an instance of the API class - api_instance = asana.RulesApi(asana.ApiClient(configuration)) + api_instance = asana.RulesApi(api_client) body = asana.RuleTriggerGidRunBody({"param1": "value1", "param2": "value2",}) # RuleTriggerGidRunBody | A dictionary of variables accessible from within the rule. rule_trigger_gid = '12345' # str | The ID of the incoming web request trigger. This value is a path parameter that is automatically generated for the API endpoint. try: - # Trigger a rule - api_response = api_instance.trigger_rule(body, rule_trigger_gid) - pprint(api_response) + # Trigger a rule + api_response = api_instance.trigger_rule(body, rule_trigger_gid) + pprint(api_response) except ApiException as e: - print("Exception when calling RulesApi->trigger_rule: %s\n" % e) + print("Exception when calling RulesApi->trigger_rule: %s\n" % e) diff --git a/docs/SectionsApi.md b/docs/SectionsApi.md index 0c884d26..f3fedf11 100644 --- a/docs/SectionsApi.md +++ b/docs/SectionsApi.md @@ -28,18 +28,19 @@ from pprint import pprint # Configure OAuth2 access token for authorization: oauth2 configuration = asana.Configuration() configuration.access_token = '' +api_client = asana.ApiClient(configuration) # create an instance of the API class -api_instance = asana.SectionsApi(asana.ApiClient(configuration)) +api_instance = asana.SectionsApi(api_client) section_gid = '321654' # str | The globally unique identifier for the section. body = asana.SectionGidAddTaskBody({"param1": "value1", "param2": "value2",}) # SectionGidAddTaskBody | The task and optionally the insert location. (optional) try: - # Add task to section - api_response = api_instance.add_task_for_section(section_gid, body=body) - pprint(api_response) + # Add task to section + api_response = api_instance.add_task_for_section(section_gid, body=body) + pprint(api_response) except ApiException as e: - print("Exception when calling SectionsApi->add_task_for_section: %s\n" % e) + print("Exception when calling SectionsApi->add_task_for_section: %s\n" % e) ``` ### Parameters @@ -80,19 +81,20 @@ from pprint import pprint # Configure OAuth2 access token for authorization: oauth2 configuration = asana.Configuration() configuration.access_token = '' +api_client = asana.ApiClient(configuration) # create an instance of the API class -api_instance = asana.SectionsApi(asana.ApiClient(configuration)) +api_instance = asana.SectionsApi(api_client) project_gid = '1331' # str | Globally unique identifier for the project. body = asana.ProjectGidSectionsBody({"param1": "value1", "param2": "value2",}) # ProjectGidSectionsBody | The section to create. (optional) opt_fields = ["created_at","name","project","project.name","projects","projects.name"] # list[str] | This endpoint returns a compact resource, which excludes some properties by default. To include those optional properties, set this query parameter to a comma-separated list of the properties you wish to include. (optional) try: - # Create a section in a project - api_response = api_instance.create_section_for_project(project_gid, body=body, opt_fields=opt_fields) - pprint(api_response) + # Create a section in a project + api_response = api_instance.create_section_for_project(project_gid, body=body, opt_fields=opt_fields) + pprint(api_response) except ApiException as e: - print("Exception when calling SectionsApi->create_section_for_project: %s\n" % e) + print("Exception when calling SectionsApi->create_section_for_project: %s\n" % e) ``` ### Parameters @@ -134,17 +136,18 @@ from pprint import pprint # Configure OAuth2 access token for authorization: oauth2 configuration = asana.Configuration() configuration.access_token = '' +api_client = asana.ApiClient(configuration) # create an instance of the API class -api_instance = asana.SectionsApi(asana.ApiClient(configuration)) +api_instance = asana.SectionsApi(api_client) section_gid = '321654' # str | The globally unique identifier for the section. try: - # Delete a section - api_response = api_instance.delete_section(section_gid) - pprint(api_response) + # Delete a section + api_response = api_instance.delete_section(section_gid) + pprint(api_response) except ApiException as e: - print("Exception when calling SectionsApi->delete_section: %s\n" % e) + print("Exception when calling SectionsApi->delete_section: %s\n" % e) ``` ### Parameters @@ -184,18 +187,19 @@ from pprint import pprint # Configure OAuth2 access token for authorization: oauth2 configuration = asana.Configuration() configuration.access_token = '' +api_client = asana.ApiClient(configuration) # create an instance of the API class -api_instance = asana.SectionsApi(asana.ApiClient(configuration)) +api_instance = asana.SectionsApi(api_client) section_gid = '321654' # str | The globally unique identifier for the section. opt_fields = ["created_at","name","project","project.name","projects","projects.name"] # list[str] | This endpoint returns a compact resource, which excludes some properties by default. To include those optional properties, set this query parameter to a comma-separated list of the properties you wish to include. (optional) try: - # Get a section - api_response = api_instance.get_section(section_gid, opt_fields=opt_fields) - pprint(api_response) + # Get a section + api_response = api_instance.get_section(section_gid, opt_fields=opt_fields) + pprint(api_response) except ApiException as e: - print("Exception when calling SectionsApi->get_section: %s\n" % e) + print("Exception when calling SectionsApi->get_section: %s\n" % e) ``` ### Parameters @@ -236,20 +240,21 @@ from pprint import pprint # Configure OAuth2 access token for authorization: oauth2 configuration = asana.Configuration() configuration.access_token = '' +api_client = asana.ApiClient(configuration) # create an instance of the API class -api_instance = asana.SectionsApi(asana.ApiClient(configuration)) +api_instance = asana.SectionsApi(api_client) project_gid = '1331' # str | Globally unique identifier for the project. limit = 50 # int | Results per page. The number of objects to return per page. The value must be between 1 and 100. (optional) offset = 'eyJ0eXAiOJiKV1iQLCJhbGciOiJIUzI1NiJ9' # 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.' (optional) opt_fields = ["created_at","name","offset","path","project","project.name","projects","projects.name","uri"] # list[str] | This endpoint returns a compact resource, which excludes some properties by default. To include those optional properties, set this query parameter to a comma-separated list of the properties you wish to include. (optional) try: - # Get sections in a project - api_response = api_instance.get_sections_for_project(project_gid, limit=limit, offset=offset, opt_fields=opt_fields) - pprint(api_response) + # Get sections in a project + api_response = api_instance.get_sections_for_project(project_gid, limit=limit, offset=offset, opt_fields=opt_fields) + pprint(api_response) except ApiException as e: - print("Exception when calling SectionsApi->get_sections_for_project: %s\n" % e) + print("Exception when calling SectionsApi->get_sections_for_project: %s\n" % e) ``` ### Parameters @@ -292,18 +297,19 @@ from pprint import pprint # Configure OAuth2 access token for authorization: oauth2 configuration = asana.Configuration() configuration.access_token = '' +api_client = asana.ApiClient(configuration) # create an instance of the API class -api_instance = asana.SectionsApi(asana.ApiClient(configuration)) +api_instance = asana.SectionsApi(api_client) project_gid = '1331' # str | Globally unique identifier for the project. body = asana.SectionsInsertBody({"param1": "value1", "param2": "value2",}) # SectionsInsertBody | The section's move action. (optional) try: - # Move or Insert sections - api_response = api_instance.insert_section_for_project(project_gid, body=body) - pprint(api_response) + # Move or Insert sections + api_response = api_instance.insert_section_for_project(project_gid, body=body) + pprint(api_response) except ApiException as e: - print("Exception when calling SectionsApi->insert_section_for_project: %s\n" % e) + print("Exception when calling SectionsApi->insert_section_for_project: %s\n" % e) ``` ### Parameters @@ -344,19 +350,20 @@ from pprint import pprint # Configure OAuth2 access token for authorization: oauth2 configuration = asana.Configuration() configuration.access_token = '' +api_client = asana.ApiClient(configuration) # create an instance of the API class -api_instance = asana.SectionsApi(asana.ApiClient(configuration)) +api_instance = asana.SectionsApi(api_client) section_gid = '321654' # str | The globally unique identifier for the section. body = asana.SectionsSectionGidBody({"param1": "value1", "param2": "value2",}) # SectionsSectionGidBody | The section to create. (optional) opt_fields = ["created_at","name","project","project.name","projects","projects.name"] # list[str] | This endpoint returns a compact resource, which excludes some properties by default. To include those optional properties, set this query parameter to a comma-separated list of the properties you wish to include. (optional) try: - # Update a section - api_response = api_instance.update_section(section_gid, body=body, opt_fields=opt_fields) - pprint(api_response) + # Update a section + api_response = api_instance.update_section(section_gid, body=body, opt_fields=opt_fields) + pprint(api_response) except ApiException as e: - print("Exception when calling SectionsApi->update_section: %s\n" % e) + print("Exception when calling SectionsApi->update_section: %s\n" % e) ``` ### Parameters diff --git a/docs/SectionsApi.yaml b/docs/SectionsApi.yaml index d5403f61..00915662 100644 --- a/docs/SectionsApi.yaml +++ b/docs/SectionsApi.yaml @@ -7,18 +7,19 @@ SectionsApi: # Configure OAuth2 access token for authorization: oauth2 configuration = asana.Configuration() configuration.access_token = '' + api_client = asana.ApiClient(configuration) # create an instance of the API class - api_instance = asana.SectionsApi(asana.ApiClient(configuration)) + api_instance = asana.SectionsApi(api_client) section_gid = '321654' # str | The globally unique identifier for the section. body = asana.SectionGidAddTaskBody({"param1": "value1", "param2": "value2",}) # SectionGidAddTaskBody | The task and optionally the insert location. (optional) try: - # Add task to section - api_response = api_instance.add_task_for_section(section_gid, body=body) - pprint(api_response) + # Add task to section + api_response = api_instance.add_task_for_section(section_gid, body=body) + pprint(api_response) except ApiException as e: - print("Exception when calling SectionsApi->add_task_for_section: %s\n" % e) + print("Exception when calling SectionsApi->add_task_for_section: %s\n" % e) create_section_for_project: |- import asana from asana.rest import ApiException @@ -27,19 +28,20 @@ SectionsApi: # Configure OAuth2 access token for authorization: oauth2 configuration = asana.Configuration() configuration.access_token = '' + api_client = asana.ApiClient(configuration) # create an instance of the API class - api_instance = asana.SectionsApi(asana.ApiClient(configuration)) + api_instance = asana.SectionsApi(api_client) project_gid = '1331' # str | Globally unique identifier for the project. body = asana.ProjectGidSectionsBody({"param1": "value1", "param2": "value2",}) # ProjectGidSectionsBody | The section to create. (optional) opt_fields = ["created_at","name","project","project.name","projects","projects.name"] # list[str] | This endpoint returns a compact resource, which excludes some properties by default. To include those optional properties, set this query parameter to a comma-separated list of the properties you wish to include. (optional) try: - # Create a section in a project - api_response = api_instance.create_section_for_project(project_gid, body=body, opt_fields=opt_fields) - pprint(api_response) + # Create a section in a project + api_response = api_instance.create_section_for_project(project_gid, body=body, opt_fields=opt_fields) + pprint(api_response) except ApiException as e: - print("Exception when calling SectionsApi->create_section_for_project: %s\n" % e) + print("Exception when calling SectionsApi->create_section_for_project: %s\n" % e) delete_section: |- import asana from asana.rest import ApiException @@ -48,17 +50,18 @@ SectionsApi: # Configure OAuth2 access token for authorization: oauth2 configuration = asana.Configuration() configuration.access_token = '' + api_client = asana.ApiClient(configuration) # create an instance of the API class - api_instance = asana.SectionsApi(asana.ApiClient(configuration)) + api_instance = asana.SectionsApi(api_client) section_gid = '321654' # str | The globally unique identifier for the section. try: - # Delete a section - api_response = api_instance.delete_section(section_gid) - pprint(api_response) + # Delete a section + api_response = api_instance.delete_section(section_gid) + pprint(api_response) except ApiException as e: - print("Exception when calling SectionsApi->delete_section: %s\n" % e) + print("Exception when calling SectionsApi->delete_section: %s\n" % e) get_section: |- import asana from asana.rest import ApiException @@ -67,18 +70,19 @@ SectionsApi: # Configure OAuth2 access token for authorization: oauth2 configuration = asana.Configuration() configuration.access_token = '' + api_client = asana.ApiClient(configuration) # create an instance of the API class - api_instance = asana.SectionsApi(asana.ApiClient(configuration)) + api_instance = asana.SectionsApi(api_client) section_gid = '321654' # str | The globally unique identifier for the section. opt_fields = ["created_at","name","project","project.name","projects","projects.name"] # list[str] | This endpoint returns a compact resource, which excludes some properties by default. To include those optional properties, set this query parameter to a comma-separated list of the properties you wish to include. (optional) try: - # Get a section - api_response = api_instance.get_section(section_gid, opt_fields=opt_fields) - pprint(api_response) + # Get a section + api_response = api_instance.get_section(section_gid, opt_fields=opt_fields) + pprint(api_response) except ApiException as e: - print("Exception when calling SectionsApi->get_section: %s\n" % e) + print("Exception when calling SectionsApi->get_section: %s\n" % e) get_sections_for_project: |- import asana from asana.rest import ApiException @@ -87,20 +91,21 @@ SectionsApi: # Configure OAuth2 access token for authorization: oauth2 configuration = asana.Configuration() configuration.access_token = '' + api_client = asana.ApiClient(configuration) # create an instance of the API class - api_instance = asana.SectionsApi(asana.ApiClient(configuration)) + api_instance = asana.SectionsApi(api_client) project_gid = '1331' # str | Globally unique identifier for the project. limit = 50 # int | Results per page. The number of objects to return per page. The value must be between 1 and 100. (optional) offset = 'eyJ0eXAiOJiKV1iQLCJhbGciOiJIUzI1NiJ9' # 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.' (optional) opt_fields = ["created_at","name","offset","path","project","project.name","projects","projects.name","uri"] # list[str] | This endpoint returns a compact resource, which excludes some properties by default. To include those optional properties, set this query parameter to a comma-separated list of the properties you wish to include. (optional) try: - # Get sections in a project - api_response = api_instance.get_sections_for_project(project_gid, limit=limit, offset=offset, opt_fields=opt_fields) - pprint(api_response) + # Get sections in a project + api_response = api_instance.get_sections_for_project(project_gid, limit=limit, offset=offset, opt_fields=opt_fields) + pprint(api_response) except ApiException as e: - print("Exception when calling SectionsApi->get_sections_for_project: %s\n" % e) + print("Exception when calling SectionsApi->get_sections_for_project: %s\n" % e) insert_section_for_project: |- import asana from asana.rest import ApiException @@ -109,18 +114,19 @@ SectionsApi: # Configure OAuth2 access token for authorization: oauth2 configuration = asana.Configuration() configuration.access_token = '' + api_client = asana.ApiClient(configuration) # create an instance of the API class - api_instance = asana.SectionsApi(asana.ApiClient(configuration)) + api_instance = asana.SectionsApi(api_client) project_gid = '1331' # str | Globally unique identifier for the project. body = asana.SectionsInsertBody({"param1": "value1", "param2": "value2",}) # SectionsInsertBody | The section's move action. (optional) try: - # Move or Insert sections - api_response = api_instance.insert_section_for_project(project_gid, body=body) - pprint(api_response) + # Move or Insert sections + api_response = api_instance.insert_section_for_project(project_gid, body=body) + pprint(api_response) except ApiException as e: - print("Exception when calling SectionsApi->insert_section_for_project: %s\n" % e) + print("Exception when calling SectionsApi->insert_section_for_project: %s\n" % e) update_section: |- import asana from asana.rest import ApiException @@ -129,16 +135,17 @@ SectionsApi: # Configure OAuth2 access token for authorization: oauth2 configuration = asana.Configuration() configuration.access_token = '' + api_client = asana.ApiClient(configuration) # create an instance of the API class - api_instance = asana.SectionsApi(asana.ApiClient(configuration)) + api_instance = asana.SectionsApi(api_client) section_gid = '321654' # str | The globally unique identifier for the section. body = asana.SectionsSectionGidBody({"param1": "value1", "param2": "value2",}) # SectionsSectionGidBody | The section to create. (optional) opt_fields = ["created_at","name","project","project.name","projects","projects.name"] # list[str] | This endpoint returns a compact resource, which excludes some properties by default. To include those optional properties, set this query parameter to a comma-separated list of the properties you wish to include. (optional) try: - # Update a section - api_response = api_instance.update_section(section_gid, body=body, opt_fields=opt_fields) - pprint(api_response) + # Update a section + api_response = api_instance.update_section(section_gid, body=body, opt_fields=opt_fields) + pprint(api_response) except ApiException as e: - print("Exception when calling SectionsApi->update_section: %s\n" % e) + print("Exception when calling SectionsApi->update_section: %s\n" % e) diff --git a/docs/StatusUpdatesApi.md b/docs/StatusUpdatesApi.md index fc1ccb1a..3cd052bd 100644 --- a/docs/StatusUpdatesApi.md +++ b/docs/StatusUpdatesApi.md @@ -25,20 +25,21 @@ from pprint import pprint # Configure OAuth2 access token for authorization: oauth2 configuration = asana.Configuration() configuration.access_token = '' +api_client = asana.ApiClient(configuration) # create an instance of the API class -api_instance = asana.StatusUpdatesApi(asana.ApiClient(configuration)) +api_instance = asana.StatusUpdatesApi(api_client) body = asana.StatusUpdatesBody({"param1": "value1", "param2": "value2",}) # StatusUpdatesBody | The status update to create. limit = 50 # int | Results per page. The number of objects to return per page. The value must be between 1 and 100. (optional) offset = 'eyJ0eXAiOJiKV1iQLCJhbGciOiJIUzI1NiJ9' # 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.' (optional) opt_fields = ["author","author.name","created_at","created_by","created_by.name","hearted","hearts","hearts.user","hearts.user.name","html_text","liked","likes","likes.user","likes.user.name","modified_at","num_hearts","num_likes","parent","parent.name","resource_subtype","status_type","text","title"] # list[str] | This endpoint returns a compact resource, which excludes some properties by default. To include those optional properties, set this query parameter to a comma-separated list of the properties you wish to include. (optional) try: - # Create a status update - api_response = api_instance.create_status_for_object(body, limit=limit, offset=offset, opt_fields=opt_fields) - pprint(api_response) + # Create a status update + api_response = api_instance.create_status_for_object(body, limit=limit, offset=offset, opt_fields=opt_fields) + pprint(api_response) except ApiException as e: - print("Exception when calling StatusUpdatesApi->create_status_for_object: %s\n" % e) + print("Exception when calling StatusUpdatesApi->create_status_for_object: %s\n" % e) ``` ### Parameters @@ -81,17 +82,18 @@ from pprint import pprint # Configure OAuth2 access token for authorization: oauth2 configuration = asana.Configuration() configuration.access_token = '' +api_client = asana.ApiClient(configuration) # create an instance of the API class -api_instance = asana.StatusUpdatesApi(asana.ApiClient(configuration)) +api_instance = asana.StatusUpdatesApi(api_client) status_update_gid = '321654' # str | The status update to get. try: - # Delete a status update - api_response = api_instance.delete_status(status_update_gid) - pprint(api_response) + # Delete a status update + api_response = api_instance.delete_status(status_update_gid) + pprint(api_response) except ApiException as e: - print("Exception when calling StatusUpdatesApi->delete_status: %s\n" % e) + print("Exception when calling StatusUpdatesApi->delete_status: %s\n" % e) ``` ### Parameters @@ -131,18 +133,19 @@ from pprint import pprint # Configure OAuth2 access token for authorization: oauth2 configuration = asana.Configuration() configuration.access_token = '' +api_client = asana.ApiClient(configuration) # create an instance of the API class -api_instance = asana.StatusUpdatesApi(asana.ApiClient(configuration)) +api_instance = asana.StatusUpdatesApi(api_client) status_update_gid = '321654' # str | The status update to get. opt_fields = ["author","author.name","created_at","created_by","created_by.name","hearted","hearts","hearts.user","hearts.user.name","html_text","liked","likes","likes.user","likes.user.name","modified_at","num_hearts","num_likes","parent","parent.name","resource_subtype","status_type","text","title"] # list[str] | This endpoint returns a compact resource, which excludes some properties by default. To include those optional properties, set this query parameter to a comma-separated list of the properties you wish to include. (optional) try: - # Get a status update - api_response = api_instance.get_status(status_update_gid, opt_fields=opt_fields) - pprint(api_response) + # Get a status update + api_response = api_instance.get_status(status_update_gid, opt_fields=opt_fields) + pprint(api_response) except ApiException as e: - print("Exception when calling StatusUpdatesApi->get_status: %s\n" % e) + print("Exception when calling StatusUpdatesApi->get_status: %s\n" % e) ``` ### Parameters @@ -183,9 +186,10 @@ from pprint import pprint # Configure OAuth2 access token for authorization: oauth2 configuration = asana.Configuration() configuration.access_token = '' +api_client = asana.ApiClient(configuration) # create an instance of the API class -api_instance = asana.StatusUpdatesApi(asana.ApiClient(configuration)) +api_instance = asana.StatusUpdatesApi(api_client) parent = '159874' # str | Globally unique identifier for object to fetch statuses from. Must be a GID for a project, portfolio, or goal. limit = 50 # int | Results per page. The number of objects to return per page. The value must be between 1 and 100. (optional) offset = 'eyJ0eXAiOJiKV1iQLCJhbGciOiJIUzI1NiJ9' # 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.' (optional) @@ -193,11 +197,11 @@ created_since = '2012-02-22T02:06:58.158Z' # datetime | Only return statuses tha opt_fields = ["author","author.name","created_at","created_by","created_by.name","hearted","hearts","hearts.user","hearts.user.name","html_text","liked","likes","likes.user","likes.user.name","modified_at","num_hearts","num_likes","offset","parent","parent.name","path","resource_subtype","status_type","text","title","uri"] # list[str] | This endpoint returns a compact resource, which excludes some properties by default. To include those optional properties, set this query parameter to a comma-separated list of the properties you wish to include. (optional) try: - # Get status updates from an object - api_response = api_instance.get_statuses_for_object(parent, limit=limit, offset=offset, created_since=created_since, opt_fields=opt_fields) - pprint(api_response) + # Get status updates from an object + api_response = api_instance.get_statuses_for_object(parent, limit=limit, offset=offset, created_since=created_since, opt_fields=opt_fields) + pprint(api_response) except ApiException as e: - print("Exception when calling StatusUpdatesApi->get_statuses_for_object: %s\n" % e) + print("Exception when calling StatusUpdatesApi->get_statuses_for_object: %s\n" % e) ``` ### Parameters diff --git a/docs/StatusUpdatesApi.yaml b/docs/StatusUpdatesApi.yaml index 3354d1da..31c91173 100644 --- a/docs/StatusUpdatesApi.yaml +++ b/docs/StatusUpdatesApi.yaml @@ -7,20 +7,21 @@ StatusUpdatesApi: # Configure OAuth2 access token for authorization: oauth2 configuration = asana.Configuration() configuration.access_token = '' + api_client = asana.ApiClient(configuration) # create an instance of the API class - api_instance = asana.StatusUpdatesApi(asana.ApiClient(configuration)) + api_instance = asana.StatusUpdatesApi(api_client) body = asana.StatusUpdatesBody({"param1": "value1", "param2": "value2",}) # StatusUpdatesBody | The status update to create. limit = 50 # int | Results per page. The number of objects to return per page. The value must be between 1 and 100. (optional) offset = 'eyJ0eXAiOJiKV1iQLCJhbGciOiJIUzI1NiJ9' # 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.' (optional) opt_fields = ["author","author.name","created_at","created_by","created_by.name","hearted","hearts","hearts.user","hearts.user.name","html_text","liked","likes","likes.user","likes.user.name","modified_at","num_hearts","num_likes","parent","parent.name","resource_subtype","status_type","text","title"] # list[str] | This endpoint returns a compact resource, which excludes some properties by default. To include those optional properties, set this query parameter to a comma-separated list of the properties you wish to include. (optional) try: - # Create a status update - api_response = api_instance.create_status_for_object(body, limit=limit, offset=offset, opt_fields=opt_fields) - pprint(api_response) + # Create a status update + api_response = api_instance.create_status_for_object(body, limit=limit, offset=offset, opt_fields=opt_fields) + pprint(api_response) except ApiException as e: - print("Exception when calling StatusUpdatesApi->create_status_for_object: %s\n" % e) + print("Exception when calling StatusUpdatesApi->create_status_for_object: %s\n" % e) delete_status: |- import asana from asana.rest import ApiException @@ -29,17 +30,18 @@ StatusUpdatesApi: # Configure OAuth2 access token for authorization: oauth2 configuration = asana.Configuration() configuration.access_token = '' + api_client = asana.ApiClient(configuration) # create an instance of the API class - api_instance = asana.StatusUpdatesApi(asana.ApiClient(configuration)) + api_instance = asana.StatusUpdatesApi(api_client) status_update_gid = '321654' # str | The status update to get. try: - # Delete a status update - api_response = api_instance.delete_status(status_update_gid) - pprint(api_response) + # Delete a status update + api_response = api_instance.delete_status(status_update_gid) + pprint(api_response) except ApiException as e: - print("Exception when calling StatusUpdatesApi->delete_status: %s\n" % e) + print("Exception when calling StatusUpdatesApi->delete_status: %s\n" % e) get_status: |- import asana from asana.rest import ApiException @@ -48,18 +50,19 @@ StatusUpdatesApi: # Configure OAuth2 access token for authorization: oauth2 configuration = asana.Configuration() configuration.access_token = '' + api_client = asana.ApiClient(configuration) # create an instance of the API class - api_instance = asana.StatusUpdatesApi(asana.ApiClient(configuration)) + api_instance = asana.StatusUpdatesApi(api_client) status_update_gid = '321654' # str | The status update to get. opt_fields = ["author","author.name","created_at","created_by","created_by.name","hearted","hearts","hearts.user","hearts.user.name","html_text","liked","likes","likes.user","likes.user.name","modified_at","num_hearts","num_likes","parent","parent.name","resource_subtype","status_type","text","title"] # list[str] | This endpoint returns a compact resource, which excludes some properties by default. To include those optional properties, set this query parameter to a comma-separated list of the properties you wish to include. (optional) try: - # Get a status update - api_response = api_instance.get_status(status_update_gid, opt_fields=opt_fields) - pprint(api_response) + # Get a status update + api_response = api_instance.get_status(status_update_gid, opt_fields=opt_fields) + pprint(api_response) except ApiException as e: - print("Exception when calling StatusUpdatesApi->get_status: %s\n" % e) + print("Exception when calling StatusUpdatesApi->get_status: %s\n" % e) get_statuses_for_object: |- import asana from asana.rest import ApiException @@ -68,9 +71,10 @@ StatusUpdatesApi: # Configure OAuth2 access token for authorization: oauth2 configuration = asana.Configuration() configuration.access_token = '' + api_client = asana.ApiClient(configuration) # create an instance of the API class - api_instance = asana.StatusUpdatesApi(asana.ApiClient(configuration)) + api_instance = asana.StatusUpdatesApi(api_client) parent = '159874' # str | Globally unique identifier for object to fetch statuses from. Must be a GID for a project, portfolio, or goal. limit = 50 # int | Results per page. The number of objects to return per page. The value must be between 1 and 100. (optional) offset = 'eyJ0eXAiOJiKV1iQLCJhbGciOiJIUzI1NiJ9' # 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.' (optional) @@ -78,8 +82,8 @@ StatusUpdatesApi: opt_fields = ["author","author.name","created_at","created_by","created_by.name","hearted","hearts","hearts.user","hearts.user.name","html_text","liked","likes","likes.user","likes.user.name","modified_at","num_hearts","num_likes","offset","parent","parent.name","path","resource_subtype","status_type","text","title","uri"] # list[str] | This endpoint returns a compact resource, which excludes some properties by default. To include those optional properties, set this query parameter to a comma-separated list of the properties you wish to include. (optional) try: - # Get status updates from an object - api_response = api_instance.get_statuses_for_object(parent, limit=limit, offset=offset, created_since=created_since, opt_fields=opt_fields) - pprint(api_response) + # Get status updates from an object + api_response = api_instance.get_statuses_for_object(parent, limit=limit, offset=offset, created_since=created_since, opt_fields=opt_fields) + pprint(api_response) except ApiException as e: - print("Exception when calling StatusUpdatesApi->get_statuses_for_object: %s\n" % e) + print("Exception when calling StatusUpdatesApi->get_statuses_for_object: %s\n" % e) diff --git a/docs/StoriesApi.md b/docs/StoriesApi.md index e57d2d58..042d0d12 100644 --- a/docs/StoriesApi.md +++ b/docs/StoriesApi.md @@ -26,19 +26,20 @@ from pprint import pprint # Configure OAuth2 access token for authorization: oauth2 configuration = asana.Configuration() configuration.access_token = '' +api_client = asana.ApiClient(configuration) # create an instance of the API class -api_instance = asana.StoriesApi(asana.ApiClient(configuration)) +api_instance = asana.StoriesApi(api_client) body = asana.TaskGidStoriesBody({"param1": "value1", "param2": "value2",}) # TaskGidStoriesBody | The story to create. task_gid = '321654' # str | The task to operate on. opt_fields = ["assignee","assignee.name","created_at","created_by","created_by.name","custom_field","custom_field.date_value","custom_field.date_value.date","custom_field.date_value.date_time","custom_field.display_value","custom_field.enabled","custom_field.enum_options","custom_field.enum_options.color","custom_field.enum_options.enabled","custom_field.enum_options.name","custom_field.enum_value","custom_field.enum_value.color","custom_field.enum_value.enabled","custom_field.enum_value.name","custom_field.is_formula_field","custom_field.multi_enum_values","custom_field.multi_enum_values.color","custom_field.multi_enum_values.enabled","custom_field.multi_enum_values.name","custom_field.name","custom_field.number_value","custom_field.resource_subtype","custom_field.text_value","custom_field.type","dependency","dependency.created_by","dependency.name","dependency.resource_subtype","duplicate_of","duplicate_of.created_by","duplicate_of.name","duplicate_of.resource_subtype","duplicated_from","duplicated_from.created_by","duplicated_from.name","duplicated_from.resource_subtype","follower","follower.name","hearted","hearts","hearts.user","hearts.user.name","html_text","is_editable","is_edited","is_pinned","liked","likes","likes.user","likes.user.name","new_approval_status","new_date_value","new_dates","new_dates.due_at","new_dates.due_on","new_dates.start_on","new_enum_value","new_enum_value.color","new_enum_value.enabled","new_enum_value.name","new_multi_enum_values","new_multi_enum_values.color","new_multi_enum_values.enabled","new_multi_enum_values.name","new_name","new_number_value","new_people_value","new_people_value.name","new_resource_subtype","new_section","new_section.name","new_text_value","num_hearts","num_likes","old_approval_status","old_date_value","old_dates","old_dates.due_at","old_dates.due_on","old_dates.start_on","old_enum_value","old_enum_value.color","old_enum_value.enabled","old_enum_value.name","old_multi_enum_values","old_multi_enum_values.color","old_multi_enum_values.enabled","old_multi_enum_values.name","old_name","old_number_value","old_people_value","old_people_value.name","old_resource_subtype","old_section","old_section.name","old_text_value","previews","previews.fallback","previews.footer","previews.header","previews.header_link","previews.html_text","previews.text","previews.title","previews.title_link","project","project.name","resource_subtype","source","sticker_name","story","story.created_at","story.created_by","story.created_by.name","story.resource_subtype","story.text","tag","tag.name","target","target.created_by","target.name","target.resource_subtype","task","task.created_by","task.name","task.resource_subtype","text","type"] # list[str] | This endpoint returns a compact resource, which excludes some properties by default. To include those optional properties, set this query parameter to a comma-separated list of the properties you wish to include. (optional) try: - # Create a story on a task - api_response = api_instance.create_story_for_task(body, task_gid, opt_fields=opt_fields) - pprint(api_response) + # Create a story on a task + api_response = api_instance.create_story_for_task(body, task_gid, opt_fields=opt_fields) + pprint(api_response) except ApiException as e: - print("Exception when calling StoriesApi->create_story_for_task: %s\n" % e) + print("Exception when calling StoriesApi->create_story_for_task: %s\n" % e) ``` ### Parameters @@ -80,17 +81,18 @@ from pprint import pprint # Configure OAuth2 access token for authorization: oauth2 configuration = asana.Configuration() configuration.access_token = '' +api_client = asana.ApiClient(configuration) # create an instance of the API class -api_instance = asana.StoriesApi(asana.ApiClient(configuration)) +api_instance = asana.StoriesApi(api_client) story_gid = '35678' # str | Globally unique identifier for the story. try: - # Delete a story - api_response = api_instance.delete_story(story_gid) - pprint(api_response) + # Delete a story + api_response = api_instance.delete_story(story_gid) + pprint(api_response) except ApiException as e: - print("Exception when calling StoriesApi->delete_story: %s\n" % e) + print("Exception when calling StoriesApi->delete_story: %s\n" % e) ``` ### Parameters @@ -130,20 +132,21 @@ from pprint import pprint # Configure OAuth2 access token for authorization: oauth2 configuration = asana.Configuration() configuration.access_token = '' +api_client = asana.ApiClient(configuration) # create an instance of the API class -api_instance = asana.StoriesApi(asana.ApiClient(configuration)) +api_instance = asana.StoriesApi(api_client) task_gid = '321654' # str | The task to operate on. limit = 50 # int | Results per page. The number of objects to return per page. The value must be between 1 and 100. (optional) offset = 'eyJ0eXAiOJiKV1iQLCJhbGciOiJIUzI1NiJ9' # 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.' (optional) opt_fields = ["assignee","assignee.name","created_at","created_by","created_by.name","custom_field","custom_field.date_value","custom_field.date_value.date","custom_field.date_value.date_time","custom_field.display_value","custom_field.enabled","custom_field.enum_options","custom_field.enum_options.color","custom_field.enum_options.enabled","custom_field.enum_options.name","custom_field.enum_value","custom_field.enum_value.color","custom_field.enum_value.enabled","custom_field.enum_value.name","custom_field.is_formula_field","custom_field.multi_enum_values","custom_field.multi_enum_values.color","custom_field.multi_enum_values.enabled","custom_field.multi_enum_values.name","custom_field.name","custom_field.number_value","custom_field.resource_subtype","custom_field.text_value","custom_field.type","dependency","dependency.created_by","dependency.name","dependency.resource_subtype","duplicate_of","duplicate_of.created_by","duplicate_of.name","duplicate_of.resource_subtype","duplicated_from","duplicated_from.created_by","duplicated_from.name","duplicated_from.resource_subtype","follower","follower.name","hearted","hearts","hearts.user","hearts.user.name","html_text","is_editable","is_edited","is_pinned","liked","likes","likes.user","likes.user.name","new_approval_status","new_date_value","new_dates","new_dates.due_at","new_dates.due_on","new_dates.start_on","new_enum_value","new_enum_value.color","new_enum_value.enabled","new_enum_value.name","new_multi_enum_values","new_multi_enum_values.color","new_multi_enum_values.enabled","new_multi_enum_values.name","new_name","new_number_value","new_people_value","new_people_value.name","new_resource_subtype","new_section","new_section.name","new_text_value","num_hearts","num_likes","offset","old_approval_status","old_date_value","old_dates","old_dates.due_at","old_dates.due_on","old_dates.start_on","old_enum_value","old_enum_value.color","old_enum_value.enabled","old_enum_value.name","old_multi_enum_values","old_multi_enum_values.color","old_multi_enum_values.enabled","old_multi_enum_values.name","old_name","old_number_value","old_people_value","old_people_value.name","old_resource_subtype","old_section","old_section.name","old_text_value","path","previews","previews.fallback","previews.footer","previews.header","previews.header_link","previews.html_text","previews.text","previews.title","previews.title_link","project","project.name","resource_subtype","source","sticker_name","story","story.created_at","story.created_by","story.created_by.name","story.resource_subtype","story.text","tag","tag.name","target","target.created_by","target.name","target.resource_subtype","task","task.created_by","task.name","task.resource_subtype","text","type","uri"] # list[str] | This endpoint returns a compact resource, which excludes some properties by default. To include those optional properties, set this query parameter to a comma-separated list of the properties you wish to include. (optional) try: - # Get stories from a task - api_response = api_instance.get_stories_for_task(task_gid, limit=limit, offset=offset, opt_fields=opt_fields) - pprint(api_response) + # Get stories from a task + api_response = api_instance.get_stories_for_task(task_gid, limit=limit, offset=offset, opt_fields=opt_fields) + pprint(api_response) except ApiException as e: - print("Exception when calling StoriesApi->get_stories_for_task: %s\n" % e) + print("Exception when calling StoriesApi->get_stories_for_task: %s\n" % e) ``` ### Parameters @@ -186,18 +189,19 @@ from pprint import pprint # Configure OAuth2 access token for authorization: oauth2 configuration = asana.Configuration() configuration.access_token = '' +api_client = asana.ApiClient(configuration) # create an instance of the API class -api_instance = asana.StoriesApi(asana.ApiClient(configuration)) +api_instance = asana.StoriesApi(api_client) story_gid = '35678' # str | Globally unique identifier for the story. opt_fields = ["assignee","assignee.name","created_at","created_by","created_by.name","custom_field","custom_field.date_value","custom_field.date_value.date","custom_field.date_value.date_time","custom_field.display_value","custom_field.enabled","custom_field.enum_options","custom_field.enum_options.color","custom_field.enum_options.enabled","custom_field.enum_options.name","custom_field.enum_value","custom_field.enum_value.color","custom_field.enum_value.enabled","custom_field.enum_value.name","custom_field.is_formula_field","custom_field.multi_enum_values","custom_field.multi_enum_values.color","custom_field.multi_enum_values.enabled","custom_field.multi_enum_values.name","custom_field.name","custom_field.number_value","custom_field.resource_subtype","custom_field.text_value","custom_field.type","dependency","dependency.created_by","dependency.name","dependency.resource_subtype","duplicate_of","duplicate_of.created_by","duplicate_of.name","duplicate_of.resource_subtype","duplicated_from","duplicated_from.created_by","duplicated_from.name","duplicated_from.resource_subtype","follower","follower.name","hearted","hearts","hearts.user","hearts.user.name","html_text","is_editable","is_edited","is_pinned","liked","likes","likes.user","likes.user.name","new_approval_status","new_date_value","new_dates","new_dates.due_at","new_dates.due_on","new_dates.start_on","new_enum_value","new_enum_value.color","new_enum_value.enabled","new_enum_value.name","new_multi_enum_values","new_multi_enum_values.color","new_multi_enum_values.enabled","new_multi_enum_values.name","new_name","new_number_value","new_people_value","new_people_value.name","new_resource_subtype","new_section","new_section.name","new_text_value","num_hearts","num_likes","old_approval_status","old_date_value","old_dates","old_dates.due_at","old_dates.due_on","old_dates.start_on","old_enum_value","old_enum_value.color","old_enum_value.enabled","old_enum_value.name","old_multi_enum_values","old_multi_enum_values.color","old_multi_enum_values.enabled","old_multi_enum_values.name","old_name","old_number_value","old_people_value","old_people_value.name","old_resource_subtype","old_section","old_section.name","old_text_value","previews","previews.fallback","previews.footer","previews.header","previews.header_link","previews.html_text","previews.text","previews.title","previews.title_link","project","project.name","resource_subtype","source","sticker_name","story","story.created_at","story.created_by","story.created_by.name","story.resource_subtype","story.text","tag","tag.name","target","target.created_by","target.name","target.resource_subtype","task","task.created_by","task.name","task.resource_subtype","text","type"] # list[str] | This endpoint returns a compact resource, which excludes some properties by default. To include those optional properties, set this query parameter to a comma-separated list of the properties you wish to include. (optional) try: - # Get a story - api_response = api_instance.get_story(story_gid, opt_fields=opt_fields) - pprint(api_response) + # Get a story + api_response = api_instance.get_story(story_gid, opt_fields=opt_fields) + pprint(api_response) except ApiException as e: - print("Exception when calling StoriesApi->get_story: %s\n" % e) + print("Exception when calling StoriesApi->get_story: %s\n" % e) ``` ### Parameters @@ -238,19 +242,20 @@ from pprint import pprint # Configure OAuth2 access token for authorization: oauth2 configuration = asana.Configuration() configuration.access_token = '' +api_client = asana.ApiClient(configuration) # create an instance of the API class -api_instance = asana.StoriesApi(asana.ApiClient(configuration)) +api_instance = asana.StoriesApi(api_client) body = asana.StoriesStoryGidBody({"param1": "value1", "param2": "value2",}) # StoriesStoryGidBody | The comment story to update. story_gid = '35678' # str | Globally unique identifier for the story. opt_fields = ["assignee","assignee.name","created_at","created_by","created_by.name","custom_field","custom_field.date_value","custom_field.date_value.date","custom_field.date_value.date_time","custom_field.display_value","custom_field.enabled","custom_field.enum_options","custom_field.enum_options.color","custom_field.enum_options.enabled","custom_field.enum_options.name","custom_field.enum_value","custom_field.enum_value.color","custom_field.enum_value.enabled","custom_field.enum_value.name","custom_field.is_formula_field","custom_field.multi_enum_values","custom_field.multi_enum_values.color","custom_field.multi_enum_values.enabled","custom_field.multi_enum_values.name","custom_field.name","custom_field.number_value","custom_field.resource_subtype","custom_field.text_value","custom_field.type","dependency","dependency.created_by","dependency.name","dependency.resource_subtype","duplicate_of","duplicate_of.created_by","duplicate_of.name","duplicate_of.resource_subtype","duplicated_from","duplicated_from.created_by","duplicated_from.name","duplicated_from.resource_subtype","follower","follower.name","hearted","hearts","hearts.user","hearts.user.name","html_text","is_editable","is_edited","is_pinned","liked","likes","likes.user","likes.user.name","new_approval_status","new_date_value","new_dates","new_dates.due_at","new_dates.due_on","new_dates.start_on","new_enum_value","new_enum_value.color","new_enum_value.enabled","new_enum_value.name","new_multi_enum_values","new_multi_enum_values.color","new_multi_enum_values.enabled","new_multi_enum_values.name","new_name","new_number_value","new_people_value","new_people_value.name","new_resource_subtype","new_section","new_section.name","new_text_value","num_hearts","num_likes","old_approval_status","old_date_value","old_dates","old_dates.due_at","old_dates.due_on","old_dates.start_on","old_enum_value","old_enum_value.color","old_enum_value.enabled","old_enum_value.name","old_multi_enum_values","old_multi_enum_values.color","old_multi_enum_values.enabled","old_multi_enum_values.name","old_name","old_number_value","old_people_value","old_people_value.name","old_resource_subtype","old_section","old_section.name","old_text_value","previews","previews.fallback","previews.footer","previews.header","previews.header_link","previews.html_text","previews.text","previews.title","previews.title_link","project","project.name","resource_subtype","source","sticker_name","story","story.created_at","story.created_by","story.created_by.name","story.resource_subtype","story.text","tag","tag.name","target","target.created_by","target.name","target.resource_subtype","task","task.created_by","task.name","task.resource_subtype","text","type"] # list[str] | This endpoint returns a compact resource, which excludes some properties by default. To include those optional properties, set this query parameter to a comma-separated list of the properties you wish to include. (optional) try: - # Update a story - api_response = api_instance.update_story(body, story_gid, opt_fields=opt_fields) - pprint(api_response) + # Update a story + api_response = api_instance.update_story(body, story_gid, opt_fields=opt_fields) + pprint(api_response) except ApiException as e: - print("Exception when calling StoriesApi->update_story: %s\n" % e) + print("Exception when calling StoriesApi->update_story: %s\n" % e) ``` ### Parameters diff --git a/docs/StoriesApi.yaml b/docs/StoriesApi.yaml index 4791d078..976bc36e 100644 --- a/docs/StoriesApi.yaml +++ b/docs/StoriesApi.yaml @@ -7,19 +7,20 @@ StoriesApi: # Configure OAuth2 access token for authorization: oauth2 configuration = asana.Configuration() configuration.access_token = '' + api_client = asana.ApiClient(configuration) # create an instance of the API class - api_instance = asana.StoriesApi(asana.ApiClient(configuration)) + api_instance = asana.StoriesApi(api_client) body = asana.TaskGidStoriesBody({"param1": "value1", "param2": "value2",}) # TaskGidStoriesBody | The story to create. task_gid = '321654' # str | The task to operate on. opt_fields = ["assignee","assignee.name","created_at","created_by","created_by.name","custom_field","custom_field.date_value","custom_field.date_value.date","custom_field.date_value.date_time","custom_field.display_value","custom_field.enabled","custom_field.enum_options","custom_field.enum_options.color","custom_field.enum_options.enabled","custom_field.enum_options.name","custom_field.enum_value","custom_field.enum_value.color","custom_field.enum_value.enabled","custom_field.enum_value.name","custom_field.is_formula_field","custom_field.multi_enum_values","custom_field.multi_enum_values.color","custom_field.multi_enum_values.enabled","custom_field.multi_enum_values.name","custom_field.name","custom_field.number_value","custom_field.resource_subtype","custom_field.text_value","custom_field.type","dependency","dependency.created_by","dependency.name","dependency.resource_subtype","duplicate_of","duplicate_of.created_by","duplicate_of.name","duplicate_of.resource_subtype","duplicated_from","duplicated_from.created_by","duplicated_from.name","duplicated_from.resource_subtype","follower","follower.name","hearted","hearts","hearts.user","hearts.user.name","html_text","is_editable","is_edited","is_pinned","liked","likes","likes.user","likes.user.name","new_approval_status","new_date_value","new_dates","new_dates.due_at","new_dates.due_on","new_dates.start_on","new_enum_value","new_enum_value.color","new_enum_value.enabled","new_enum_value.name","new_multi_enum_values","new_multi_enum_values.color","new_multi_enum_values.enabled","new_multi_enum_values.name","new_name","new_number_value","new_people_value","new_people_value.name","new_resource_subtype","new_section","new_section.name","new_text_value","num_hearts","num_likes","old_approval_status","old_date_value","old_dates","old_dates.due_at","old_dates.due_on","old_dates.start_on","old_enum_value","old_enum_value.color","old_enum_value.enabled","old_enum_value.name","old_multi_enum_values","old_multi_enum_values.color","old_multi_enum_values.enabled","old_multi_enum_values.name","old_name","old_number_value","old_people_value","old_people_value.name","old_resource_subtype","old_section","old_section.name","old_text_value","previews","previews.fallback","previews.footer","previews.header","previews.header_link","previews.html_text","previews.text","previews.title","previews.title_link","project","project.name","resource_subtype","source","sticker_name","story","story.created_at","story.created_by","story.created_by.name","story.resource_subtype","story.text","tag","tag.name","target","target.created_by","target.name","target.resource_subtype","task","task.created_by","task.name","task.resource_subtype","text","type"] # list[str] | This endpoint returns a compact resource, which excludes some properties by default. To include those optional properties, set this query parameter to a comma-separated list of the properties you wish to include. (optional) try: - # Create a story on a task - api_response = api_instance.create_story_for_task(body, task_gid, opt_fields=opt_fields) - pprint(api_response) + # Create a story on a task + api_response = api_instance.create_story_for_task(body, task_gid, opt_fields=opt_fields) + pprint(api_response) except ApiException as e: - print("Exception when calling StoriesApi->create_story_for_task: %s\n" % e) + print("Exception when calling StoriesApi->create_story_for_task: %s\n" % e) delete_story: |- import asana from asana.rest import ApiException @@ -28,17 +29,18 @@ StoriesApi: # Configure OAuth2 access token for authorization: oauth2 configuration = asana.Configuration() configuration.access_token = '' + api_client = asana.ApiClient(configuration) # create an instance of the API class - api_instance = asana.StoriesApi(asana.ApiClient(configuration)) + api_instance = asana.StoriesApi(api_client) story_gid = '35678' # str | Globally unique identifier for the story. try: - # Delete a story - api_response = api_instance.delete_story(story_gid) - pprint(api_response) + # Delete a story + api_response = api_instance.delete_story(story_gid) + pprint(api_response) except ApiException as e: - print("Exception when calling StoriesApi->delete_story: %s\n" % e) + print("Exception when calling StoriesApi->delete_story: %s\n" % e) get_stories_for_task: |- import asana from asana.rest import ApiException @@ -47,20 +49,21 @@ StoriesApi: # Configure OAuth2 access token for authorization: oauth2 configuration = asana.Configuration() configuration.access_token = '' + api_client = asana.ApiClient(configuration) # create an instance of the API class - api_instance = asana.StoriesApi(asana.ApiClient(configuration)) + api_instance = asana.StoriesApi(api_client) task_gid = '321654' # str | The task to operate on. limit = 50 # int | Results per page. The number of objects to return per page. The value must be between 1 and 100. (optional) offset = 'eyJ0eXAiOJiKV1iQLCJhbGciOiJIUzI1NiJ9' # 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.' (optional) opt_fields = ["assignee","assignee.name","created_at","created_by","created_by.name","custom_field","custom_field.date_value","custom_field.date_value.date","custom_field.date_value.date_time","custom_field.display_value","custom_field.enabled","custom_field.enum_options","custom_field.enum_options.color","custom_field.enum_options.enabled","custom_field.enum_options.name","custom_field.enum_value","custom_field.enum_value.color","custom_field.enum_value.enabled","custom_field.enum_value.name","custom_field.is_formula_field","custom_field.multi_enum_values","custom_field.multi_enum_values.color","custom_field.multi_enum_values.enabled","custom_field.multi_enum_values.name","custom_field.name","custom_field.number_value","custom_field.resource_subtype","custom_field.text_value","custom_field.type","dependency","dependency.created_by","dependency.name","dependency.resource_subtype","duplicate_of","duplicate_of.created_by","duplicate_of.name","duplicate_of.resource_subtype","duplicated_from","duplicated_from.created_by","duplicated_from.name","duplicated_from.resource_subtype","follower","follower.name","hearted","hearts","hearts.user","hearts.user.name","html_text","is_editable","is_edited","is_pinned","liked","likes","likes.user","likes.user.name","new_approval_status","new_date_value","new_dates","new_dates.due_at","new_dates.due_on","new_dates.start_on","new_enum_value","new_enum_value.color","new_enum_value.enabled","new_enum_value.name","new_multi_enum_values","new_multi_enum_values.color","new_multi_enum_values.enabled","new_multi_enum_values.name","new_name","new_number_value","new_people_value","new_people_value.name","new_resource_subtype","new_section","new_section.name","new_text_value","num_hearts","num_likes","offset","old_approval_status","old_date_value","old_dates","old_dates.due_at","old_dates.due_on","old_dates.start_on","old_enum_value","old_enum_value.color","old_enum_value.enabled","old_enum_value.name","old_multi_enum_values","old_multi_enum_values.color","old_multi_enum_values.enabled","old_multi_enum_values.name","old_name","old_number_value","old_people_value","old_people_value.name","old_resource_subtype","old_section","old_section.name","old_text_value","path","previews","previews.fallback","previews.footer","previews.header","previews.header_link","previews.html_text","previews.text","previews.title","previews.title_link","project","project.name","resource_subtype","source","sticker_name","story","story.created_at","story.created_by","story.created_by.name","story.resource_subtype","story.text","tag","tag.name","target","target.created_by","target.name","target.resource_subtype","task","task.created_by","task.name","task.resource_subtype","text","type","uri"] # list[str] | This endpoint returns a compact resource, which excludes some properties by default. To include those optional properties, set this query parameter to a comma-separated list of the properties you wish to include. (optional) try: - # Get stories from a task - api_response = api_instance.get_stories_for_task(task_gid, limit=limit, offset=offset, opt_fields=opt_fields) - pprint(api_response) + # Get stories from a task + api_response = api_instance.get_stories_for_task(task_gid, limit=limit, offset=offset, opt_fields=opt_fields) + pprint(api_response) except ApiException as e: - print("Exception when calling StoriesApi->get_stories_for_task: %s\n" % e) + print("Exception when calling StoriesApi->get_stories_for_task: %s\n" % e) get_story: |- import asana from asana.rest import ApiException @@ -69,18 +72,19 @@ StoriesApi: # Configure OAuth2 access token for authorization: oauth2 configuration = asana.Configuration() configuration.access_token = '' + api_client = asana.ApiClient(configuration) # create an instance of the API class - api_instance = asana.StoriesApi(asana.ApiClient(configuration)) + api_instance = asana.StoriesApi(api_client) story_gid = '35678' # str | Globally unique identifier for the story. opt_fields = ["assignee","assignee.name","created_at","created_by","created_by.name","custom_field","custom_field.date_value","custom_field.date_value.date","custom_field.date_value.date_time","custom_field.display_value","custom_field.enabled","custom_field.enum_options","custom_field.enum_options.color","custom_field.enum_options.enabled","custom_field.enum_options.name","custom_field.enum_value","custom_field.enum_value.color","custom_field.enum_value.enabled","custom_field.enum_value.name","custom_field.is_formula_field","custom_field.multi_enum_values","custom_field.multi_enum_values.color","custom_field.multi_enum_values.enabled","custom_field.multi_enum_values.name","custom_field.name","custom_field.number_value","custom_field.resource_subtype","custom_field.text_value","custom_field.type","dependency","dependency.created_by","dependency.name","dependency.resource_subtype","duplicate_of","duplicate_of.created_by","duplicate_of.name","duplicate_of.resource_subtype","duplicated_from","duplicated_from.created_by","duplicated_from.name","duplicated_from.resource_subtype","follower","follower.name","hearted","hearts","hearts.user","hearts.user.name","html_text","is_editable","is_edited","is_pinned","liked","likes","likes.user","likes.user.name","new_approval_status","new_date_value","new_dates","new_dates.due_at","new_dates.due_on","new_dates.start_on","new_enum_value","new_enum_value.color","new_enum_value.enabled","new_enum_value.name","new_multi_enum_values","new_multi_enum_values.color","new_multi_enum_values.enabled","new_multi_enum_values.name","new_name","new_number_value","new_people_value","new_people_value.name","new_resource_subtype","new_section","new_section.name","new_text_value","num_hearts","num_likes","old_approval_status","old_date_value","old_dates","old_dates.due_at","old_dates.due_on","old_dates.start_on","old_enum_value","old_enum_value.color","old_enum_value.enabled","old_enum_value.name","old_multi_enum_values","old_multi_enum_values.color","old_multi_enum_values.enabled","old_multi_enum_values.name","old_name","old_number_value","old_people_value","old_people_value.name","old_resource_subtype","old_section","old_section.name","old_text_value","previews","previews.fallback","previews.footer","previews.header","previews.header_link","previews.html_text","previews.text","previews.title","previews.title_link","project","project.name","resource_subtype","source","sticker_name","story","story.created_at","story.created_by","story.created_by.name","story.resource_subtype","story.text","tag","tag.name","target","target.created_by","target.name","target.resource_subtype","task","task.created_by","task.name","task.resource_subtype","text","type"] # list[str] | This endpoint returns a compact resource, which excludes some properties by default. To include those optional properties, set this query parameter to a comma-separated list of the properties you wish to include. (optional) try: - # Get a story - api_response = api_instance.get_story(story_gid, opt_fields=opt_fields) - pprint(api_response) + # Get a story + api_response = api_instance.get_story(story_gid, opt_fields=opt_fields) + pprint(api_response) except ApiException as e: - print("Exception when calling StoriesApi->get_story: %s\n" % e) + print("Exception when calling StoriesApi->get_story: %s\n" % e) update_story: |- import asana from asana.rest import ApiException @@ -89,16 +93,17 @@ StoriesApi: # Configure OAuth2 access token for authorization: oauth2 configuration = asana.Configuration() configuration.access_token = '' + api_client = asana.ApiClient(configuration) # create an instance of the API class - api_instance = asana.StoriesApi(asana.ApiClient(configuration)) + api_instance = asana.StoriesApi(api_client) body = asana.StoriesStoryGidBody({"param1": "value1", "param2": "value2",}) # StoriesStoryGidBody | The comment story to update. story_gid = '35678' # str | Globally unique identifier for the story. opt_fields = ["assignee","assignee.name","created_at","created_by","created_by.name","custom_field","custom_field.date_value","custom_field.date_value.date","custom_field.date_value.date_time","custom_field.display_value","custom_field.enabled","custom_field.enum_options","custom_field.enum_options.color","custom_field.enum_options.enabled","custom_field.enum_options.name","custom_field.enum_value","custom_field.enum_value.color","custom_field.enum_value.enabled","custom_field.enum_value.name","custom_field.is_formula_field","custom_field.multi_enum_values","custom_field.multi_enum_values.color","custom_field.multi_enum_values.enabled","custom_field.multi_enum_values.name","custom_field.name","custom_field.number_value","custom_field.resource_subtype","custom_field.text_value","custom_field.type","dependency","dependency.created_by","dependency.name","dependency.resource_subtype","duplicate_of","duplicate_of.created_by","duplicate_of.name","duplicate_of.resource_subtype","duplicated_from","duplicated_from.created_by","duplicated_from.name","duplicated_from.resource_subtype","follower","follower.name","hearted","hearts","hearts.user","hearts.user.name","html_text","is_editable","is_edited","is_pinned","liked","likes","likes.user","likes.user.name","new_approval_status","new_date_value","new_dates","new_dates.due_at","new_dates.due_on","new_dates.start_on","new_enum_value","new_enum_value.color","new_enum_value.enabled","new_enum_value.name","new_multi_enum_values","new_multi_enum_values.color","new_multi_enum_values.enabled","new_multi_enum_values.name","new_name","new_number_value","new_people_value","new_people_value.name","new_resource_subtype","new_section","new_section.name","new_text_value","num_hearts","num_likes","old_approval_status","old_date_value","old_dates","old_dates.due_at","old_dates.due_on","old_dates.start_on","old_enum_value","old_enum_value.color","old_enum_value.enabled","old_enum_value.name","old_multi_enum_values","old_multi_enum_values.color","old_multi_enum_values.enabled","old_multi_enum_values.name","old_name","old_number_value","old_people_value","old_people_value.name","old_resource_subtype","old_section","old_section.name","old_text_value","previews","previews.fallback","previews.footer","previews.header","previews.header_link","previews.html_text","previews.text","previews.title","previews.title_link","project","project.name","resource_subtype","source","sticker_name","story","story.created_at","story.created_by","story.created_by.name","story.resource_subtype","story.text","tag","tag.name","target","target.created_by","target.name","target.resource_subtype","task","task.created_by","task.name","task.resource_subtype","text","type"] # list[str] | This endpoint returns a compact resource, which excludes some properties by default. To include those optional properties, set this query parameter to a comma-separated list of the properties you wish to include. (optional) try: - # Update a story - api_response = api_instance.update_story(body, story_gid, opt_fields=opt_fields) - pprint(api_response) + # Update a story + api_response = api_instance.update_story(body, story_gid, opt_fields=opt_fields) + pprint(api_response) except ApiException as e: - print("Exception when calling StoriesApi->update_story: %s\n" % e) + print("Exception when calling StoriesApi->update_story: %s\n" % e) diff --git a/docs/TagsApi.md b/docs/TagsApi.md index 95a6ae01..9e7e799c 100644 --- a/docs/TagsApi.md +++ b/docs/TagsApi.md @@ -29,18 +29,19 @@ from pprint import pprint # Configure OAuth2 access token for authorization: oauth2 configuration = asana.Configuration() configuration.access_token = '' +api_client = asana.ApiClient(configuration) # create an instance of the API class -api_instance = asana.TagsApi(asana.ApiClient(configuration)) +api_instance = asana.TagsApi(api_client) body = asana.TagsBody({"param1": "value1", "param2": "value2",}) # TagsBody | The tag to create. opt_fields = ["color","created_at","followers","followers.name","name","notes","permalink_url","workspace","workspace.name"] # list[str] | This endpoint returns a compact resource, which excludes some properties by default. To include those optional properties, set this query parameter to a comma-separated list of the properties you wish to include. (optional) try: - # Create a tag - api_response = api_instance.create_tag(body, opt_fields=opt_fields) - pprint(api_response) + # Create a tag + api_response = api_instance.create_tag(body, opt_fields=opt_fields) + pprint(api_response) except ApiException as e: - print("Exception when calling TagsApi->create_tag: %s\n" % e) + print("Exception when calling TagsApi->create_tag: %s\n" % e) ``` ### Parameters @@ -81,19 +82,20 @@ from pprint import pprint # Configure OAuth2 access token for authorization: oauth2 configuration = asana.Configuration() configuration.access_token = '' +api_client = asana.ApiClient(configuration) # create an instance of the API class -api_instance = asana.TagsApi(asana.ApiClient(configuration)) +api_instance = asana.TagsApi(api_client) body = asana.WorkspaceGidTagsBody({"param1": "value1", "param2": "value2",}) # WorkspaceGidTagsBody | The tag to create. workspace_gid = '12345' # str | Globally unique identifier for the workspace or organization. opt_fields = ["color","created_at","followers","followers.name","name","notes","permalink_url","workspace","workspace.name"] # list[str] | This endpoint returns a compact resource, which excludes some properties by default. To include those optional properties, set this query parameter to a comma-separated list of the properties you wish to include. (optional) try: - # Create a tag in a workspace - api_response = api_instance.create_tag_for_workspace(body, workspace_gid, opt_fields=opt_fields) - pprint(api_response) + # Create a tag in a workspace + api_response = api_instance.create_tag_for_workspace(body, workspace_gid, opt_fields=opt_fields) + pprint(api_response) except ApiException as e: - print("Exception when calling TagsApi->create_tag_for_workspace: %s\n" % e) + print("Exception when calling TagsApi->create_tag_for_workspace: %s\n" % e) ``` ### Parameters @@ -135,17 +137,18 @@ from pprint import pprint # Configure OAuth2 access token for authorization: oauth2 configuration = asana.Configuration() configuration.access_token = '' +api_client = asana.ApiClient(configuration) # create an instance of the API class -api_instance = asana.TagsApi(asana.ApiClient(configuration)) +api_instance = asana.TagsApi(api_client) tag_gid = '11235' # str | Globally unique identifier for the tag. try: - # Delete a tag - api_response = api_instance.delete_tag(tag_gid) - pprint(api_response) + # Delete a tag + api_response = api_instance.delete_tag(tag_gid) + pprint(api_response) except ApiException as e: - print("Exception when calling TagsApi->delete_tag: %s\n" % e) + print("Exception when calling TagsApi->delete_tag: %s\n" % e) ``` ### Parameters @@ -185,18 +188,19 @@ from pprint import pprint # Configure OAuth2 access token for authorization: oauth2 configuration = asana.Configuration() configuration.access_token = '' +api_client = asana.ApiClient(configuration) # create an instance of the API class -api_instance = asana.TagsApi(asana.ApiClient(configuration)) +api_instance = asana.TagsApi(api_client) tag_gid = '11235' # str | Globally unique identifier for the tag. opt_fields = ["color","created_at","followers","followers.name","name","notes","permalink_url","workspace","workspace.name"] # list[str] | This endpoint returns a compact resource, which excludes some properties by default. To include those optional properties, set this query parameter to a comma-separated list of the properties you wish to include. (optional) try: - # Get a tag - api_response = api_instance.get_tag(tag_gid, opt_fields=opt_fields) - pprint(api_response) + # Get a tag + api_response = api_instance.get_tag(tag_gid, opt_fields=opt_fields) + pprint(api_response) except ApiException as e: - print("Exception when calling TagsApi->get_tag: %s\n" % e) + print("Exception when calling TagsApi->get_tag: %s\n" % e) ``` ### Parameters @@ -237,20 +241,21 @@ from pprint import pprint # Configure OAuth2 access token for authorization: oauth2 configuration = asana.Configuration() configuration.access_token = '' +api_client = asana.ApiClient(configuration) # create an instance of the API class -api_instance = asana.TagsApi(asana.ApiClient(configuration)) +api_instance = asana.TagsApi(api_client) limit = 50 # int | Results per page. The number of objects to return per page. The value must be between 1 and 100. (optional) offset = 'eyJ0eXAiOJiKV1iQLCJhbGciOiJIUzI1NiJ9' # 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.' (optional) workspace = '1331' # str | The workspace to filter tags on. (optional) opt_fields = ["color","created_at","followers","followers.name","name","notes","offset","path","permalink_url","uri","workspace","workspace.name"] # list[str] | This endpoint returns a compact resource, which excludes some properties by default. To include those optional properties, set this query parameter to a comma-separated list of the properties you wish to include. (optional) try: - # Get multiple tags - api_response = api_instance.get_tags(limit=limit, offset=offset, workspace=workspace, opt_fields=opt_fields) - pprint(api_response) + # Get multiple tags + api_response = api_instance.get_tags(limit=limit, offset=offset, workspace=workspace, opt_fields=opt_fields) + pprint(api_response) except ApiException as e: - print("Exception when calling TagsApi->get_tags: %s\n" % e) + print("Exception when calling TagsApi->get_tags: %s\n" % e) ``` ### Parameters @@ -293,20 +298,21 @@ from pprint import pprint # Configure OAuth2 access token for authorization: oauth2 configuration = asana.Configuration() configuration.access_token = '' +api_client = asana.ApiClient(configuration) # create an instance of the API class -api_instance = asana.TagsApi(asana.ApiClient(configuration)) +api_instance = asana.TagsApi(api_client) task_gid = '321654' # str | The task to operate on. limit = 50 # int | Results per page. The number of objects to return per page. The value must be between 1 and 100. (optional) offset = 'eyJ0eXAiOJiKV1iQLCJhbGciOiJIUzI1NiJ9' # 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.' (optional) opt_fields = ["color","created_at","followers","followers.name","name","notes","offset","path","permalink_url","uri","workspace","workspace.name"] # list[str] | This endpoint returns a compact resource, which excludes some properties by default. To include those optional properties, set this query parameter to a comma-separated list of the properties you wish to include. (optional) try: - # Get a task's tags - api_response = api_instance.get_tags_for_task(task_gid, limit=limit, offset=offset, opt_fields=opt_fields) - pprint(api_response) + # Get a task's tags + api_response = api_instance.get_tags_for_task(task_gid, limit=limit, offset=offset, opt_fields=opt_fields) + pprint(api_response) except ApiException as e: - print("Exception when calling TagsApi->get_tags_for_task: %s\n" % e) + print("Exception when calling TagsApi->get_tags_for_task: %s\n" % e) ``` ### Parameters @@ -349,20 +355,21 @@ from pprint import pprint # Configure OAuth2 access token for authorization: oauth2 configuration = asana.Configuration() configuration.access_token = '' +api_client = asana.ApiClient(configuration) # create an instance of the API class -api_instance = asana.TagsApi(asana.ApiClient(configuration)) +api_instance = asana.TagsApi(api_client) workspace_gid = '12345' # str | Globally unique identifier for the workspace or organization. limit = 50 # int | Results per page. The number of objects to return per page. The value must be between 1 and 100. (optional) offset = 'eyJ0eXAiOJiKV1iQLCJhbGciOiJIUzI1NiJ9' # 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.' (optional) opt_fields = ["color","created_at","followers","followers.name","name","notes","offset","path","permalink_url","uri","workspace","workspace.name"] # list[str] | This endpoint returns a compact resource, which excludes some properties by default. To include those optional properties, set this query parameter to a comma-separated list of the properties you wish to include. (optional) try: - # Get tags in a workspace - api_response = api_instance.get_tags_for_workspace(workspace_gid, limit=limit, offset=offset, opt_fields=opt_fields) - pprint(api_response) + # Get tags in a workspace + api_response = api_instance.get_tags_for_workspace(workspace_gid, limit=limit, offset=offset, opt_fields=opt_fields) + pprint(api_response) except ApiException as e: - print("Exception when calling TagsApi->get_tags_for_workspace: %s\n" % e) + print("Exception when calling TagsApi->get_tags_for_workspace: %s\n" % e) ``` ### Parameters @@ -405,18 +412,19 @@ from pprint import pprint # Configure OAuth2 access token for authorization: oauth2 configuration = asana.Configuration() configuration.access_token = '' +api_client = asana.ApiClient(configuration) # create an instance of the API class -api_instance = asana.TagsApi(asana.ApiClient(configuration)) +api_instance = asana.TagsApi(api_client) tag_gid = '11235' # str | Globally unique identifier for the tag. opt_fields = ["color","created_at","followers","followers.name","name","notes","permalink_url","workspace","workspace.name"] # list[str] | This endpoint returns a compact resource, which excludes some properties by default. To include those optional properties, set this query parameter to a comma-separated list of the properties you wish to include. (optional) try: - # Update a tag - api_response = api_instance.update_tag(tag_gid, opt_fields=opt_fields) - pprint(api_response) + # Update a tag + api_response = api_instance.update_tag(tag_gid, opt_fields=opt_fields) + pprint(api_response) except ApiException as e: - print("Exception when calling TagsApi->update_tag: %s\n" % e) + print("Exception when calling TagsApi->update_tag: %s\n" % e) ``` ### Parameters diff --git a/docs/TagsApi.yaml b/docs/TagsApi.yaml index cd9727c9..799c3083 100644 --- a/docs/TagsApi.yaml +++ b/docs/TagsApi.yaml @@ -7,18 +7,19 @@ TagsApi: # Configure OAuth2 access token for authorization: oauth2 configuration = asana.Configuration() configuration.access_token = '' + api_client = asana.ApiClient(configuration) # create an instance of the API class - api_instance = asana.TagsApi(asana.ApiClient(configuration)) + api_instance = asana.TagsApi(api_client) body = asana.TagsBody({"param1": "value1", "param2": "value2",}) # TagsBody | The tag to create. opt_fields = ["color","created_at","followers","followers.name","name","notes","permalink_url","workspace","workspace.name"] # list[str] | This endpoint returns a compact resource, which excludes some properties by default. To include those optional properties, set this query parameter to a comma-separated list of the properties you wish to include. (optional) try: - # Create a tag - api_response = api_instance.create_tag(body, opt_fields=opt_fields) - pprint(api_response) + # Create a tag + api_response = api_instance.create_tag(body, opt_fields=opt_fields) + pprint(api_response) except ApiException as e: - print("Exception when calling TagsApi->create_tag: %s\n" % e) + print("Exception when calling TagsApi->create_tag: %s\n" % e) create_tag_for_workspace: |- import asana from asana.rest import ApiException @@ -27,19 +28,20 @@ TagsApi: # Configure OAuth2 access token for authorization: oauth2 configuration = asana.Configuration() configuration.access_token = '' + api_client = asana.ApiClient(configuration) # create an instance of the API class - api_instance = asana.TagsApi(asana.ApiClient(configuration)) + api_instance = asana.TagsApi(api_client) body = asana.WorkspaceGidTagsBody({"param1": "value1", "param2": "value2",}) # WorkspaceGidTagsBody | The tag to create. workspace_gid = '12345' # str | Globally unique identifier for the workspace or organization. opt_fields = ["color","created_at","followers","followers.name","name","notes","permalink_url","workspace","workspace.name"] # list[str] | This endpoint returns a compact resource, which excludes some properties by default. To include those optional properties, set this query parameter to a comma-separated list of the properties you wish to include. (optional) try: - # Create a tag in a workspace - api_response = api_instance.create_tag_for_workspace(body, workspace_gid, opt_fields=opt_fields) - pprint(api_response) + # Create a tag in a workspace + api_response = api_instance.create_tag_for_workspace(body, workspace_gid, opt_fields=opt_fields) + pprint(api_response) except ApiException as e: - print("Exception when calling TagsApi->create_tag_for_workspace: %s\n" % e) + print("Exception when calling TagsApi->create_tag_for_workspace: %s\n" % e) delete_tag: |- import asana from asana.rest import ApiException @@ -48,17 +50,18 @@ TagsApi: # Configure OAuth2 access token for authorization: oauth2 configuration = asana.Configuration() configuration.access_token = '' + api_client = asana.ApiClient(configuration) # create an instance of the API class - api_instance = asana.TagsApi(asana.ApiClient(configuration)) + api_instance = asana.TagsApi(api_client) tag_gid = '11235' # str | Globally unique identifier for the tag. try: - # Delete a tag - api_response = api_instance.delete_tag(tag_gid) - pprint(api_response) + # Delete a tag + api_response = api_instance.delete_tag(tag_gid) + pprint(api_response) except ApiException as e: - print("Exception when calling TagsApi->delete_tag: %s\n" % e) + print("Exception when calling TagsApi->delete_tag: %s\n" % e) get_tag: |- import asana from asana.rest import ApiException @@ -67,18 +70,19 @@ TagsApi: # Configure OAuth2 access token for authorization: oauth2 configuration = asana.Configuration() configuration.access_token = '' + api_client = asana.ApiClient(configuration) # create an instance of the API class - api_instance = asana.TagsApi(asana.ApiClient(configuration)) + api_instance = asana.TagsApi(api_client) tag_gid = '11235' # str | Globally unique identifier for the tag. opt_fields = ["color","created_at","followers","followers.name","name","notes","permalink_url","workspace","workspace.name"] # list[str] | This endpoint returns a compact resource, which excludes some properties by default. To include those optional properties, set this query parameter to a comma-separated list of the properties you wish to include. (optional) try: - # Get a tag - api_response = api_instance.get_tag(tag_gid, opt_fields=opt_fields) - pprint(api_response) + # Get a tag + api_response = api_instance.get_tag(tag_gid, opt_fields=opt_fields) + pprint(api_response) except ApiException as e: - print("Exception when calling TagsApi->get_tag: %s\n" % e) + print("Exception when calling TagsApi->get_tag: %s\n" % e) get_tags: |- import asana from asana.rest import ApiException @@ -87,20 +91,21 @@ TagsApi: # Configure OAuth2 access token for authorization: oauth2 configuration = asana.Configuration() configuration.access_token = '' + api_client = asana.ApiClient(configuration) # create an instance of the API class - api_instance = asana.TagsApi(asana.ApiClient(configuration)) + api_instance = asana.TagsApi(api_client) limit = 50 # int | Results per page. The number of objects to return per page. The value must be between 1 and 100. (optional) offset = 'eyJ0eXAiOJiKV1iQLCJhbGciOiJIUzI1NiJ9' # 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.' (optional) workspace = '1331' # str | The workspace to filter tags on. (optional) opt_fields = ["color","created_at","followers","followers.name","name","notes","offset","path","permalink_url","uri","workspace","workspace.name"] # list[str] | This endpoint returns a compact resource, which excludes some properties by default. To include those optional properties, set this query parameter to a comma-separated list of the properties you wish to include. (optional) try: - # Get multiple tags - api_response = api_instance.get_tags(limit=limit, offset=offset, workspace=workspace, opt_fields=opt_fields) - pprint(api_response) + # Get multiple tags + api_response = api_instance.get_tags(limit=limit, offset=offset, workspace=workspace, opt_fields=opt_fields) + pprint(api_response) except ApiException as e: - print("Exception when calling TagsApi->get_tags: %s\n" % e) + print("Exception when calling TagsApi->get_tags: %s\n" % e) get_tags_for_task: |- import asana from asana.rest import ApiException @@ -109,20 +114,21 @@ TagsApi: # Configure OAuth2 access token for authorization: oauth2 configuration = asana.Configuration() configuration.access_token = '' + api_client = asana.ApiClient(configuration) # create an instance of the API class - api_instance = asana.TagsApi(asana.ApiClient(configuration)) + api_instance = asana.TagsApi(api_client) task_gid = '321654' # str | The task to operate on. limit = 50 # int | Results per page. The number of objects to return per page. The value must be between 1 and 100. (optional) offset = 'eyJ0eXAiOJiKV1iQLCJhbGciOiJIUzI1NiJ9' # 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.' (optional) opt_fields = ["color","created_at","followers","followers.name","name","notes","offset","path","permalink_url","uri","workspace","workspace.name"] # list[str] | This endpoint returns a compact resource, which excludes some properties by default. To include those optional properties, set this query parameter to a comma-separated list of the properties you wish to include. (optional) try: - # Get a task's tags - api_response = api_instance.get_tags_for_task(task_gid, limit=limit, offset=offset, opt_fields=opt_fields) - pprint(api_response) + # Get a task's tags + api_response = api_instance.get_tags_for_task(task_gid, limit=limit, offset=offset, opt_fields=opt_fields) + pprint(api_response) except ApiException as e: - print("Exception when calling TagsApi->get_tags_for_task: %s\n" % e) + print("Exception when calling TagsApi->get_tags_for_task: %s\n" % e) get_tags_for_workspace: |- import asana from asana.rest import ApiException @@ -131,20 +137,21 @@ TagsApi: # Configure OAuth2 access token for authorization: oauth2 configuration = asana.Configuration() configuration.access_token = '' + api_client = asana.ApiClient(configuration) # create an instance of the API class - api_instance = asana.TagsApi(asana.ApiClient(configuration)) + api_instance = asana.TagsApi(api_client) workspace_gid = '12345' # str | Globally unique identifier for the workspace or organization. limit = 50 # int | Results per page. The number of objects to return per page. The value must be between 1 and 100. (optional) offset = 'eyJ0eXAiOJiKV1iQLCJhbGciOiJIUzI1NiJ9' # 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.' (optional) opt_fields = ["color","created_at","followers","followers.name","name","notes","offset","path","permalink_url","uri","workspace","workspace.name"] # list[str] | This endpoint returns a compact resource, which excludes some properties by default. To include those optional properties, set this query parameter to a comma-separated list of the properties you wish to include. (optional) try: - # Get tags in a workspace - api_response = api_instance.get_tags_for_workspace(workspace_gid, limit=limit, offset=offset, opt_fields=opt_fields) - pprint(api_response) + # Get tags in a workspace + api_response = api_instance.get_tags_for_workspace(workspace_gid, limit=limit, offset=offset, opt_fields=opt_fields) + pprint(api_response) except ApiException as e: - print("Exception when calling TagsApi->get_tags_for_workspace: %s\n" % e) + print("Exception when calling TagsApi->get_tags_for_workspace: %s\n" % e) update_tag: |- import asana from asana.rest import ApiException @@ -153,15 +160,16 @@ TagsApi: # Configure OAuth2 access token for authorization: oauth2 configuration = asana.Configuration() configuration.access_token = '' + api_client = asana.ApiClient(configuration) # create an instance of the API class - api_instance = asana.TagsApi(asana.ApiClient(configuration)) + api_instance = asana.TagsApi(api_client) tag_gid = '11235' # str | Globally unique identifier for the tag. opt_fields = ["color","created_at","followers","followers.name","name","notes","permalink_url","workspace","workspace.name"] # list[str] | This endpoint returns a compact resource, which excludes some properties by default. To include those optional properties, set this query parameter to a comma-separated list of the properties you wish to include. (optional) try: - # Update a tag - api_response = api_instance.update_tag(tag_gid, opt_fields=opt_fields) - pprint(api_response) + # Update a tag + api_response = api_instance.update_tag(tag_gid, opt_fields=opt_fields) + pprint(api_response) except ApiException as e: - print("Exception when calling TagsApi->update_tag: %s\n" % e) + print("Exception when calling TagsApi->update_tag: %s\n" % e) diff --git a/docs/TasksApi.md b/docs/TasksApi.md index 4276f043..8d29f214 100644 --- a/docs/TasksApi.md +++ b/docs/TasksApi.md @@ -47,18 +47,19 @@ from pprint import pprint # Configure OAuth2 access token for authorization: oauth2 configuration = asana.Configuration() configuration.access_token = '' +api_client = asana.ApiClient(configuration) # create an instance of the API class -api_instance = asana.TasksApi(asana.ApiClient(configuration)) +api_instance = asana.TasksApi(api_client) body = asana.TaskGidAddDependenciesBody({"param1": "value1", "param2": "value2",}) # TaskGidAddDependenciesBody | The list of tasks to set as dependencies. task_gid = '321654' # str | The task to operate on. try: - # Set dependencies for a task - api_response = api_instance.add_dependencies_for_task(body, task_gid) - pprint(api_response) + # Set dependencies for a task + api_response = api_instance.add_dependencies_for_task(body, task_gid) + pprint(api_response) except ApiException as e: - print("Exception when calling TasksApi->add_dependencies_for_task: %s\n" % e) + print("Exception when calling TasksApi->add_dependencies_for_task: %s\n" % e) ``` ### Parameters @@ -99,18 +100,19 @@ from pprint import pprint # Configure OAuth2 access token for authorization: oauth2 configuration = asana.Configuration() configuration.access_token = '' +api_client = asana.ApiClient(configuration) # create an instance of the API class -api_instance = asana.TasksApi(asana.ApiClient(configuration)) +api_instance = asana.TasksApi(api_client) body = asana.TaskGidAddDependentsBody({"param1": "value1", "param2": "value2",}) # TaskGidAddDependentsBody | The list of tasks to add as dependents. task_gid = '321654' # str | The task to operate on. try: - # Set dependents for a task - api_response = api_instance.add_dependents_for_task(body, task_gid) - pprint(api_response) + # Set dependents for a task + api_response = api_instance.add_dependents_for_task(body, task_gid) + pprint(api_response) except ApiException as e: - print("Exception when calling TasksApi->add_dependents_for_task: %s\n" % e) + print("Exception when calling TasksApi->add_dependents_for_task: %s\n" % e) ``` ### Parameters @@ -151,19 +153,20 @@ from pprint import pprint # Configure OAuth2 access token for authorization: oauth2 configuration = asana.Configuration() configuration.access_token = '' +api_client = asana.ApiClient(configuration) # create an instance of the API class -api_instance = asana.TasksApi(asana.ApiClient(configuration)) +api_instance = asana.TasksApi(api_client) body = asana.TaskGidAddFollowersBody({"param1": "value1", "param2": "value2",}) # TaskGidAddFollowersBody | The followers to add to the task. task_gid = '321654' # str | The task to operate on. opt_fields = ["actual_time_minutes","approval_status","assignee","assignee.name","assignee_section","assignee_section.name","assignee_status","completed","completed_at","completed_by","completed_by.name","created_at","created_by","custom_fields","custom_fields.asana_created_field","custom_fields.created_by","custom_fields.created_by.name","custom_fields.currency_code","custom_fields.custom_label","custom_fields.custom_label_position","custom_fields.date_value","custom_fields.date_value.date","custom_fields.date_value.date_time","custom_fields.description","custom_fields.display_value","custom_fields.enabled","custom_fields.enum_options","custom_fields.enum_options.color","custom_fields.enum_options.enabled","custom_fields.enum_options.name","custom_fields.enum_value","custom_fields.enum_value.color","custom_fields.enum_value.enabled","custom_fields.enum_value.name","custom_fields.format","custom_fields.has_notifications_enabled","custom_fields.is_formula_field","custom_fields.is_global_to_workspace","custom_fields.is_value_read_only","custom_fields.multi_enum_values","custom_fields.multi_enum_values.color","custom_fields.multi_enum_values.enabled","custom_fields.multi_enum_values.name","custom_fields.name","custom_fields.number_value","custom_fields.people_value","custom_fields.people_value.name","custom_fields.precision","custom_fields.resource_subtype","custom_fields.text_value","custom_fields.type","dependencies","dependents","due_at","due_on","external","external.data","followers","followers.name","hearted","hearts","hearts.user","hearts.user.name","html_notes","is_rendered_as_separator","liked","likes","likes.user","likes.user.name","memberships","memberships.project","memberships.project.name","memberships.section","memberships.section.name","modified_at","name","notes","num_hearts","num_likes","num_subtasks","parent","parent.created_by","parent.name","parent.resource_subtype","permalink_url","projects","projects.name","resource_subtype","start_at","start_on","tags","tags.name","workspace","workspace.name"] # list[str] | This endpoint returns a compact resource, which excludes some properties by default. To include those optional properties, set this query parameter to a comma-separated list of the properties you wish to include. (optional) try: - # Add followers to a task - api_response = api_instance.add_followers_for_task(body, task_gid, opt_fields=opt_fields) - pprint(api_response) + # Add followers to a task + api_response = api_instance.add_followers_for_task(body, task_gid, opt_fields=opt_fields) + pprint(api_response) except ApiException as e: - print("Exception when calling TasksApi->add_followers_for_task: %s\n" % e) + print("Exception when calling TasksApi->add_followers_for_task: %s\n" % e) ``` ### Parameters @@ -205,18 +208,19 @@ from pprint import pprint # Configure OAuth2 access token for authorization: oauth2 configuration = asana.Configuration() configuration.access_token = '' +api_client = asana.ApiClient(configuration) # create an instance of the API class -api_instance = asana.TasksApi(asana.ApiClient(configuration)) +api_instance = asana.TasksApi(api_client) body = asana.TaskGidAddProjectBody({"param1": "value1", "param2": "value2",}) # TaskGidAddProjectBody | The project to add the task to. task_gid = '321654' # str | The task to operate on. try: - # Add a project to a task - api_response = api_instance.add_project_for_task(body, task_gid) - pprint(api_response) + # Add a project to a task + api_response = api_instance.add_project_for_task(body, task_gid) + pprint(api_response) except ApiException as e: - print("Exception when calling TasksApi->add_project_for_task: %s\n" % e) + print("Exception when calling TasksApi->add_project_for_task: %s\n" % e) ``` ### Parameters @@ -257,18 +261,19 @@ from pprint import pprint # Configure OAuth2 access token for authorization: oauth2 configuration = asana.Configuration() configuration.access_token = '' +api_client = asana.ApiClient(configuration) # create an instance of the API class -api_instance = asana.TasksApi(asana.ApiClient(configuration)) +api_instance = asana.TasksApi(api_client) body = asana.TaskGidAddTagBody({"param1": "value1", "param2": "value2",}) # TaskGidAddTagBody | The tag to add to the task. task_gid = '321654' # str | The task to operate on. try: - # Add a tag to a task - api_response = api_instance.add_tag_for_task(body, task_gid) - pprint(api_response) + # Add a tag to a task + api_response = api_instance.add_tag_for_task(body, task_gid) + pprint(api_response) except ApiException as e: - print("Exception when calling TasksApi->add_tag_for_task: %s\n" % e) + print("Exception when calling TasksApi->add_tag_for_task: %s\n" % e) ``` ### Parameters @@ -309,19 +314,20 @@ from pprint import pprint # Configure OAuth2 access token for authorization: oauth2 configuration = asana.Configuration() configuration.access_token = '' +api_client = asana.ApiClient(configuration) # create an instance of the API class -api_instance = asana.TasksApi(asana.ApiClient(configuration)) +api_instance = asana.TasksApi(api_client) body = asana.TaskGidSubtasksBody({"param1": "value1", "param2": "value2",}) # TaskGidSubtasksBody | The new subtask to create. task_gid = '321654' # str | The task to operate on. opt_fields = ["actual_time_minutes","approval_status","assignee","assignee.name","assignee_section","assignee_section.name","assignee_status","completed","completed_at","completed_by","completed_by.name","created_at","created_by","custom_fields","custom_fields.asana_created_field","custom_fields.created_by","custom_fields.created_by.name","custom_fields.currency_code","custom_fields.custom_label","custom_fields.custom_label_position","custom_fields.date_value","custom_fields.date_value.date","custom_fields.date_value.date_time","custom_fields.description","custom_fields.display_value","custom_fields.enabled","custom_fields.enum_options","custom_fields.enum_options.color","custom_fields.enum_options.enabled","custom_fields.enum_options.name","custom_fields.enum_value","custom_fields.enum_value.color","custom_fields.enum_value.enabled","custom_fields.enum_value.name","custom_fields.format","custom_fields.has_notifications_enabled","custom_fields.is_formula_field","custom_fields.is_global_to_workspace","custom_fields.is_value_read_only","custom_fields.multi_enum_values","custom_fields.multi_enum_values.color","custom_fields.multi_enum_values.enabled","custom_fields.multi_enum_values.name","custom_fields.name","custom_fields.number_value","custom_fields.people_value","custom_fields.people_value.name","custom_fields.precision","custom_fields.resource_subtype","custom_fields.text_value","custom_fields.type","dependencies","dependents","due_at","due_on","external","external.data","followers","followers.name","hearted","hearts","hearts.user","hearts.user.name","html_notes","is_rendered_as_separator","liked","likes","likes.user","likes.user.name","memberships","memberships.project","memberships.project.name","memberships.section","memberships.section.name","modified_at","name","notes","num_hearts","num_likes","num_subtasks","parent","parent.created_by","parent.name","parent.resource_subtype","permalink_url","projects","projects.name","resource_subtype","start_at","start_on","tags","tags.name","workspace","workspace.name"] # list[str] | This endpoint returns a compact resource, which excludes some properties by default. To include those optional properties, set this query parameter to a comma-separated list of the properties you wish to include. (optional) try: - # Create a subtask - api_response = api_instance.create_subtask_for_task(body, task_gid, opt_fields=opt_fields) - pprint(api_response) + # Create a subtask + api_response = api_instance.create_subtask_for_task(body, task_gid, opt_fields=opt_fields) + pprint(api_response) except ApiException as e: - print("Exception when calling TasksApi->create_subtask_for_task: %s\n" % e) + print("Exception when calling TasksApi->create_subtask_for_task: %s\n" % e) ``` ### Parameters @@ -363,18 +369,19 @@ from pprint import pprint # Configure OAuth2 access token for authorization: oauth2 configuration = asana.Configuration() configuration.access_token = '' +api_client = asana.ApiClient(configuration) # create an instance of the API class -api_instance = asana.TasksApi(asana.ApiClient(configuration)) +api_instance = asana.TasksApi(api_client) body = asana.TasksBody({"param1": "value1", "param2": "value2",}) # TasksBody | The task to create. opt_fields = ["actual_time_minutes","approval_status","assignee","assignee.name","assignee_section","assignee_section.name","assignee_status","completed","completed_at","completed_by","completed_by.name","created_at","created_by","custom_fields","custom_fields.asana_created_field","custom_fields.created_by","custom_fields.created_by.name","custom_fields.currency_code","custom_fields.custom_label","custom_fields.custom_label_position","custom_fields.date_value","custom_fields.date_value.date","custom_fields.date_value.date_time","custom_fields.description","custom_fields.display_value","custom_fields.enabled","custom_fields.enum_options","custom_fields.enum_options.color","custom_fields.enum_options.enabled","custom_fields.enum_options.name","custom_fields.enum_value","custom_fields.enum_value.color","custom_fields.enum_value.enabled","custom_fields.enum_value.name","custom_fields.format","custom_fields.has_notifications_enabled","custom_fields.is_formula_field","custom_fields.is_global_to_workspace","custom_fields.is_value_read_only","custom_fields.multi_enum_values","custom_fields.multi_enum_values.color","custom_fields.multi_enum_values.enabled","custom_fields.multi_enum_values.name","custom_fields.name","custom_fields.number_value","custom_fields.people_value","custom_fields.people_value.name","custom_fields.precision","custom_fields.resource_subtype","custom_fields.text_value","custom_fields.type","dependencies","dependents","due_at","due_on","external","external.data","followers","followers.name","hearted","hearts","hearts.user","hearts.user.name","html_notes","is_rendered_as_separator","liked","likes","likes.user","likes.user.name","memberships","memberships.project","memberships.project.name","memberships.section","memberships.section.name","modified_at","name","notes","num_hearts","num_likes","num_subtasks","parent","parent.created_by","parent.name","parent.resource_subtype","permalink_url","projects","projects.name","resource_subtype","start_at","start_on","tags","tags.name","workspace","workspace.name"] # list[str] | This endpoint returns a compact resource, which excludes some properties by default. To include those optional properties, set this query parameter to a comma-separated list of the properties you wish to include. (optional) try: - # Create a task - api_response = api_instance.create_task(body, opt_fields=opt_fields) - pprint(api_response) + # Create a task + api_response = api_instance.create_task(body, opt_fields=opt_fields) + pprint(api_response) except ApiException as e: - print("Exception when calling TasksApi->create_task: %s\n" % e) + print("Exception when calling TasksApi->create_task: %s\n" % e) ``` ### Parameters @@ -415,17 +422,18 @@ from pprint import pprint # Configure OAuth2 access token for authorization: oauth2 configuration = asana.Configuration() configuration.access_token = '' +api_client = asana.ApiClient(configuration) # create an instance of the API class -api_instance = asana.TasksApi(asana.ApiClient(configuration)) +api_instance = asana.TasksApi(api_client) task_gid = '321654' # str | The task to operate on. try: - # Delete a task - api_response = api_instance.delete_task(task_gid) - pprint(api_response) + # Delete a task + api_response = api_instance.delete_task(task_gid) + pprint(api_response) except ApiException as e: - print("Exception when calling TasksApi->delete_task: %s\n" % e) + print("Exception when calling TasksApi->delete_task: %s\n" % e) ``` ### Parameters @@ -465,19 +473,20 @@ from pprint import pprint # Configure OAuth2 access token for authorization: oauth2 configuration = asana.Configuration() configuration.access_token = '' +api_client = asana.ApiClient(configuration) # create an instance of the API class -api_instance = asana.TasksApi(asana.ApiClient(configuration)) +api_instance = asana.TasksApi(api_client) body = asana.TaskGidDuplicateBody({"param1": "value1", "param2": "value2",}) # TaskGidDuplicateBody | Describes the duplicate's name and the fields that will be duplicated. task_gid = '321654' # str | The task to operate on. opt_fields = ["new_project","new_project.name","new_project_template","new_project_template.name","new_task","new_task.created_by","new_task.name","new_task.resource_subtype","resource_subtype","status"] # list[str] | This endpoint returns a compact resource, which excludes some properties by default. To include those optional properties, set this query parameter to a comma-separated list of the properties you wish to include. (optional) try: - # Duplicate a task - api_response = api_instance.duplicate_task(body, task_gid, opt_fields=opt_fields) - pprint(api_response) + # Duplicate a task + api_response = api_instance.duplicate_task(body, task_gid, opt_fields=opt_fields) + pprint(api_response) except ApiException as e: - print("Exception when calling TasksApi->duplicate_task: %s\n" % e) + print("Exception when calling TasksApi->duplicate_task: %s\n" % e) ``` ### Parameters @@ -519,20 +528,21 @@ from pprint import pprint # Configure OAuth2 access token for authorization: oauth2 configuration = asana.Configuration() configuration.access_token = '' +api_client = asana.ApiClient(configuration) # create an instance of the API class -api_instance = asana.TasksApi(asana.ApiClient(configuration)) +api_instance = asana.TasksApi(api_client) task_gid = '321654' # str | The task to operate on. limit = 50 # int | Results per page. The number of objects to return per page. The value must be between 1 and 100. (optional) offset = 'eyJ0eXAiOJiKV1iQLCJhbGciOiJIUzI1NiJ9' # 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.' (optional) opt_fields = ["actual_time_minutes","approval_status","assignee","assignee.name","assignee_section","assignee_section.name","assignee_status","completed","completed_at","completed_by","completed_by.name","created_at","created_by","custom_fields","custom_fields.asana_created_field","custom_fields.created_by","custom_fields.created_by.name","custom_fields.currency_code","custom_fields.custom_label","custom_fields.custom_label_position","custom_fields.date_value","custom_fields.date_value.date","custom_fields.date_value.date_time","custom_fields.description","custom_fields.display_value","custom_fields.enabled","custom_fields.enum_options","custom_fields.enum_options.color","custom_fields.enum_options.enabled","custom_fields.enum_options.name","custom_fields.enum_value","custom_fields.enum_value.color","custom_fields.enum_value.enabled","custom_fields.enum_value.name","custom_fields.format","custom_fields.has_notifications_enabled","custom_fields.is_formula_field","custom_fields.is_global_to_workspace","custom_fields.is_value_read_only","custom_fields.multi_enum_values","custom_fields.multi_enum_values.color","custom_fields.multi_enum_values.enabled","custom_fields.multi_enum_values.name","custom_fields.name","custom_fields.number_value","custom_fields.people_value","custom_fields.people_value.name","custom_fields.precision","custom_fields.resource_subtype","custom_fields.text_value","custom_fields.type","dependencies","dependents","due_at","due_on","external","external.data","followers","followers.name","hearted","hearts","hearts.user","hearts.user.name","html_notes","is_rendered_as_separator","liked","likes","likes.user","likes.user.name","memberships","memberships.project","memberships.project.name","memberships.section","memberships.section.name","modified_at","name","notes","num_hearts","num_likes","num_subtasks","offset","parent","parent.created_by","parent.name","parent.resource_subtype","path","permalink_url","projects","projects.name","resource_subtype","start_at","start_on","tags","tags.name","uri","workspace","workspace.name"] # list[str] | This endpoint returns a compact resource, which excludes some properties by default. To include those optional properties, set this query parameter to a comma-separated list of the properties you wish to include. (optional) try: - # Get dependencies from a task - api_response = api_instance.get_dependencies_for_task(task_gid, limit=limit, offset=offset, opt_fields=opt_fields) - pprint(api_response) + # Get dependencies from a task + api_response = api_instance.get_dependencies_for_task(task_gid, limit=limit, offset=offset, opt_fields=opt_fields) + pprint(api_response) except ApiException as e: - print("Exception when calling TasksApi->get_dependencies_for_task: %s\n" % e) + print("Exception when calling TasksApi->get_dependencies_for_task: %s\n" % e) ``` ### Parameters @@ -575,20 +585,21 @@ from pprint import pprint # Configure OAuth2 access token for authorization: oauth2 configuration = asana.Configuration() configuration.access_token = '' +api_client = asana.ApiClient(configuration) # create an instance of the API class -api_instance = asana.TasksApi(asana.ApiClient(configuration)) +api_instance = asana.TasksApi(api_client) task_gid = '321654' # str | The task to operate on. limit = 50 # int | Results per page. The number of objects to return per page. The value must be between 1 and 100. (optional) offset = 'eyJ0eXAiOJiKV1iQLCJhbGciOiJIUzI1NiJ9' # 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.' (optional) opt_fields = ["actual_time_minutes","approval_status","assignee","assignee.name","assignee_section","assignee_section.name","assignee_status","completed","completed_at","completed_by","completed_by.name","created_at","created_by","custom_fields","custom_fields.asana_created_field","custom_fields.created_by","custom_fields.created_by.name","custom_fields.currency_code","custom_fields.custom_label","custom_fields.custom_label_position","custom_fields.date_value","custom_fields.date_value.date","custom_fields.date_value.date_time","custom_fields.description","custom_fields.display_value","custom_fields.enabled","custom_fields.enum_options","custom_fields.enum_options.color","custom_fields.enum_options.enabled","custom_fields.enum_options.name","custom_fields.enum_value","custom_fields.enum_value.color","custom_fields.enum_value.enabled","custom_fields.enum_value.name","custom_fields.format","custom_fields.has_notifications_enabled","custom_fields.is_formula_field","custom_fields.is_global_to_workspace","custom_fields.is_value_read_only","custom_fields.multi_enum_values","custom_fields.multi_enum_values.color","custom_fields.multi_enum_values.enabled","custom_fields.multi_enum_values.name","custom_fields.name","custom_fields.number_value","custom_fields.people_value","custom_fields.people_value.name","custom_fields.precision","custom_fields.resource_subtype","custom_fields.text_value","custom_fields.type","dependencies","dependents","due_at","due_on","external","external.data","followers","followers.name","hearted","hearts","hearts.user","hearts.user.name","html_notes","is_rendered_as_separator","liked","likes","likes.user","likes.user.name","memberships","memberships.project","memberships.project.name","memberships.section","memberships.section.name","modified_at","name","notes","num_hearts","num_likes","num_subtasks","offset","parent","parent.created_by","parent.name","parent.resource_subtype","path","permalink_url","projects","projects.name","resource_subtype","start_at","start_on","tags","tags.name","uri","workspace","workspace.name"] # list[str] | This endpoint returns a compact resource, which excludes some properties by default. To include those optional properties, set this query parameter to a comma-separated list of the properties you wish to include. (optional) try: - # Get dependents from a task - api_response = api_instance.get_dependents_for_task(task_gid, limit=limit, offset=offset, opt_fields=opt_fields) - pprint(api_response) + # Get dependents from a task + api_response = api_instance.get_dependents_for_task(task_gid, limit=limit, offset=offset, opt_fields=opt_fields) + pprint(api_response) except ApiException as e: - print("Exception when calling TasksApi->get_dependents_for_task: %s\n" % e) + print("Exception when calling TasksApi->get_dependents_for_task: %s\n" % e) ``` ### Parameters @@ -631,20 +642,21 @@ from pprint import pprint # Configure OAuth2 access token for authorization: oauth2 configuration = asana.Configuration() configuration.access_token = '' +api_client = asana.ApiClient(configuration) # create an instance of the API class -api_instance = asana.TasksApi(asana.ApiClient(configuration)) +api_instance = asana.TasksApi(api_client) task_gid = '321654' # str | The task to operate on. limit = 50 # int | Results per page. The number of objects to return per page. The value must be between 1 and 100. (optional) offset = 'eyJ0eXAiOJiKV1iQLCJhbGciOiJIUzI1NiJ9' # 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.' (optional) opt_fields = ["actual_time_minutes","approval_status","assignee","assignee.name","assignee_section","assignee_section.name","assignee_status","completed","completed_at","completed_by","completed_by.name","created_at","created_by","custom_fields","custom_fields.asana_created_field","custom_fields.created_by","custom_fields.created_by.name","custom_fields.currency_code","custom_fields.custom_label","custom_fields.custom_label_position","custom_fields.date_value","custom_fields.date_value.date","custom_fields.date_value.date_time","custom_fields.description","custom_fields.display_value","custom_fields.enabled","custom_fields.enum_options","custom_fields.enum_options.color","custom_fields.enum_options.enabled","custom_fields.enum_options.name","custom_fields.enum_value","custom_fields.enum_value.color","custom_fields.enum_value.enabled","custom_fields.enum_value.name","custom_fields.format","custom_fields.has_notifications_enabled","custom_fields.is_formula_field","custom_fields.is_global_to_workspace","custom_fields.is_value_read_only","custom_fields.multi_enum_values","custom_fields.multi_enum_values.color","custom_fields.multi_enum_values.enabled","custom_fields.multi_enum_values.name","custom_fields.name","custom_fields.number_value","custom_fields.people_value","custom_fields.people_value.name","custom_fields.precision","custom_fields.resource_subtype","custom_fields.text_value","custom_fields.type","dependencies","dependents","due_at","due_on","external","external.data","followers","followers.name","hearted","hearts","hearts.user","hearts.user.name","html_notes","is_rendered_as_separator","liked","likes","likes.user","likes.user.name","memberships","memberships.project","memberships.project.name","memberships.section","memberships.section.name","modified_at","name","notes","num_hearts","num_likes","num_subtasks","offset","parent","parent.created_by","parent.name","parent.resource_subtype","path","permalink_url","projects","projects.name","resource_subtype","start_at","start_on","tags","tags.name","uri","workspace","workspace.name"] # list[str] | This endpoint returns a compact resource, which excludes some properties by default. To include those optional properties, set this query parameter to a comma-separated list of the properties you wish to include. (optional) try: - # Get subtasks from a task - api_response = api_instance.get_subtasks_for_task(task_gid, limit=limit, offset=offset, opt_fields=opt_fields) - pprint(api_response) + # Get subtasks from a task + api_response = api_instance.get_subtasks_for_task(task_gid, limit=limit, offset=offset, opt_fields=opt_fields) + pprint(api_response) except ApiException as e: - print("Exception when calling TasksApi->get_subtasks_for_task: %s\n" % e) + print("Exception when calling TasksApi->get_subtasks_for_task: %s\n" % e) ``` ### Parameters @@ -687,18 +699,19 @@ from pprint import pprint # Configure OAuth2 access token for authorization: oauth2 configuration = asana.Configuration() configuration.access_token = '' +api_client = asana.ApiClient(configuration) # create an instance of the API class -api_instance = asana.TasksApi(asana.ApiClient(configuration)) +api_instance = asana.TasksApi(api_client) task_gid = '321654' # str | The task to operate on. opt_fields = ["actual_time_minutes","approval_status","assignee","assignee.name","assignee_section","assignee_section.name","assignee_status","completed","completed_at","completed_by","completed_by.name","created_at","created_by","custom_fields","custom_fields.asana_created_field","custom_fields.created_by","custom_fields.created_by.name","custom_fields.currency_code","custom_fields.custom_label","custom_fields.custom_label_position","custom_fields.date_value","custom_fields.date_value.date","custom_fields.date_value.date_time","custom_fields.description","custom_fields.display_value","custom_fields.enabled","custom_fields.enum_options","custom_fields.enum_options.color","custom_fields.enum_options.enabled","custom_fields.enum_options.name","custom_fields.enum_value","custom_fields.enum_value.color","custom_fields.enum_value.enabled","custom_fields.enum_value.name","custom_fields.format","custom_fields.has_notifications_enabled","custom_fields.is_formula_field","custom_fields.is_global_to_workspace","custom_fields.is_value_read_only","custom_fields.multi_enum_values","custom_fields.multi_enum_values.color","custom_fields.multi_enum_values.enabled","custom_fields.multi_enum_values.name","custom_fields.name","custom_fields.number_value","custom_fields.people_value","custom_fields.people_value.name","custom_fields.precision","custom_fields.resource_subtype","custom_fields.text_value","custom_fields.type","dependencies","dependents","due_at","due_on","external","external.data","followers","followers.name","hearted","hearts","hearts.user","hearts.user.name","html_notes","is_rendered_as_separator","liked","likes","likes.user","likes.user.name","memberships","memberships.project","memberships.project.name","memberships.section","memberships.section.name","modified_at","name","notes","num_hearts","num_likes","num_subtasks","parent","parent.created_by","parent.name","parent.resource_subtype","permalink_url","projects","projects.name","resource_subtype","start_at","start_on","tags","tags.name","workspace","workspace.name"] # list[str] | This endpoint returns a compact resource, which excludes some properties by default. To include those optional properties, set this query parameter to a comma-separated list of the properties you wish to include. (optional) try: - # Get a task - api_response = api_instance.get_task(task_gid, opt_fields=opt_fields) - pprint(api_response) + # Get a task + api_response = api_instance.get_task(task_gid, opt_fields=opt_fields) + pprint(api_response) except ApiException as e: - print("Exception when calling TasksApi->get_task: %s\n" % e) + print("Exception when calling TasksApi->get_task: %s\n" % e) ``` ### Parameters @@ -739,9 +752,10 @@ from pprint import pprint # Configure OAuth2 access token for authorization: oauth2 configuration = asana.Configuration() configuration.access_token = '' +api_client = asana.ApiClient(configuration) # create an instance of the API class -api_instance = asana.TasksApi(asana.ApiClient(configuration)) +api_instance = asana.TasksApi(api_client) limit = 50 # int | Results per page. The number of objects to return per page. The value must be between 1 and 100. (optional) offset = 'eyJ0eXAiOJiKV1iQLCJhbGciOiJIUzI1NiJ9' # 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.' (optional) assignee = '14641' # 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.* (optional) @@ -753,11 +767,11 @@ modified_since = '2012-02-22T02:06:58.158Z' # datetime | Only return tasks that opt_fields = ["actual_time_minutes","approval_status","assignee","assignee.name","assignee_section","assignee_section.name","assignee_status","completed","completed_at","completed_by","completed_by.name","created_at","created_by","custom_fields","custom_fields.asana_created_field","custom_fields.created_by","custom_fields.created_by.name","custom_fields.currency_code","custom_fields.custom_label","custom_fields.custom_label_position","custom_fields.date_value","custom_fields.date_value.date","custom_fields.date_value.date_time","custom_fields.description","custom_fields.display_value","custom_fields.enabled","custom_fields.enum_options","custom_fields.enum_options.color","custom_fields.enum_options.enabled","custom_fields.enum_options.name","custom_fields.enum_value","custom_fields.enum_value.color","custom_fields.enum_value.enabled","custom_fields.enum_value.name","custom_fields.format","custom_fields.has_notifications_enabled","custom_fields.is_formula_field","custom_fields.is_global_to_workspace","custom_fields.is_value_read_only","custom_fields.multi_enum_values","custom_fields.multi_enum_values.color","custom_fields.multi_enum_values.enabled","custom_fields.multi_enum_values.name","custom_fields.name","custom_fields.number_value","custom_fields.people_value","custom_fields.people_value.name","custom_fields.precision","custom_fields.resource_subtype","custom_fields.text_value","custom_fields.type","dependencies","dependents","due_at","due_on","external","external.data","followers","followers.name","hearted","hearts","hearts.user","hearts.user.name","html_notes","is_rendered_as_separator","liked","likes","likes.user","likes.user.name","memberships","memberships.project","memberships.project.name","memberships.section","memberships.section.name","modified_at","name","notes","num_hearts","num_likes","num_subtasks","offset","parent","parent.created_by","parent.name","parent.resource_subtype","path","permalink_url","projects","projects.name","resource_subtype","start_at","start_on","tags","tags.name","uri","workspace","workspace.name"] # list[str] | This endpoint returns a compact resource, which excludes some properties by default. To include those optional properties, set this query parameter to a comma-separated list of the properties you wish to include. (optional) try: - # Get multiple tasks - api_response = api_instance.get_tasks(limit=limit, offset=offset, assignee=assignee, project=project, section=section, workspace=workspace, completed_since=completed_since, modified_since=modified_since, opt_fields=opt_fields) - pprint(api_response) + # Get multiple tasks + api_response = api_instance.get_tasks(limit=limit, offset=offset, assignee=assignee, project=project, section=section, workspace=workspace, completed_since=completed_since, modified_since=modified_since, opt_fields=opt_fields) + pprint(api_response) except ApiException as e: - print("Exception when calling TasksApi->get_tasks: %s\n" % e) + print("Exception when calling TasksApi->get_tasks: %s\n" % e) ``` ### Parameters @@ -805,9 +819,10 @@ from pprint import pprint # Configure OAuth2 access token for authorization: oauth2 configuration = asana.Configuration() configuration.access_token = '' +api_client = asana.ApiClient(configuration) # create an instance of the API class -api_instance = asana.TasksApi(asana.ApiClient(configuration)) +api_instance = asana.TasksApi(api_client) project_gid = '1331' # str | Globally unique identifier for the project. completed_since = '2012-02-22T02:06:58.158Z' # 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*. (optional) limit = 50 # int | Results per page. The number of objects to return per page. The value must be between 1 and 100. (optional) @@ -815,11 +830,11 @@ offset = 'eyJ0eXAiOJiKV1iQLCJhbGciOiJIUzI1NiJ9' # str | Offset token. An offset opt_fields = ["actual_time_minutes","approval_status","assignee","assignee.name","assignee_section","assignee_section.name","assignee_status","completed","completed_at","completed_by","completed_by.name","created_at","created_by","custom_fields","custom_fields.asana_created_field","custom_fields.created_by","custom_fields.created_by.name","custom_fields.currency_code","custom_fields.custom_label","custom_fields.custom_label_position","custom_fields.date_value","custom_fields.date_value.date","custom_fields.date_value.date_time","custom_fields.description","custom_fields.display_value","custom_fields.enabled","custom_fields.enum_options","custom_fields.enum_options.color","custom_fields.enum_options.enabled","custom_fields.enum_options.name","custom_fields.enum_value","custom_fields.enum_value.color","custom_fields.enum_value.enabled","custom_fields.enum_value.name","custom_fields.format","custom_fields.has_notifications_enabled","custom_fields.is_formula_field","custom_fields.is_global_to_workspace","custom_fields.is_value_read_only","custom_fields.multi_enum_values","custom_fields.multi_enum_values.color","custom_fields.multi_enum_values.enabled","custom_fields.multi_enum_values.name","custom_fields.name","custom_fields.number_value","custom_fields.people_value","custom_fields.people_value.name","custom_fields.precision","custom_fields.resource_subtype","custom_fields.text_value","custom_fields.type","dependencies","dependents","due_at","due_on","external","external.data","followers","followers.name","hearted","hearts","hearts.user","hearts.user.name","html_notes","is_rendered_as_separator","liked","likes","likes.user","likes.user.name","memberships","memberships.project","memberships.project.name","memberships.section","memberships.section.name","modified_at","name","notes","num_hearts","num_likes","num_subtasks","offset","parent","parent.created_by","parent.name","parent.resource_subtype","path","permalink_url","projects","projects.name","resource_subtype","start_at","start_on","tags","tags.name","uri","workspace","workspace.name"] # list[str] | This endpoint returns a compact resource, which excludes some properties by default. To include those optional properties, set this query parameter to a comma-separated list of the properties you wish to include. (optional) try: - # Get tasks from a project - api_response = api_instance.get_tasks_for_project(project_gid, completed_since=completed_since, limit=limit, offset=offset, opt_fields=opt_fields) - pprint(api_response) + # Get tasks from a project + api_response = api_instance.get_tasks_for_project(project_gid, completed_since=completed_since, limit=limit, offset=offset, opt_fields=opt_fields) + pprint(api_response) except ApiException as e: - print("Exception when calling TasksApi->get_tasks_for_project: %s\n" % e) + print("Exception when calling TasksApi->get_tasks_for_project: %s\n" % e) ``` ### Parameters @@ -863,20 +878,21 @@ from pprint import pprint # Configure OAuth2 access token for authorization: oauth2 configuration = asana.Configuration() configuration.access_token = '' +api_client = asana.ApiClient(configuration) # create an instance of the API class -api_instance = asana.TasksApi(asana.ApiClient(configuration)) +api_instance = asana.TasksApi(api_client) section_gid = '321654' # str | The globally unique identifier for the section. limit = 50 # int | Results per page. The number of objects to return per page. The value must be between 1 and 100. (optional) offset = 'eyJ0eXAiOJiKV1iQLCJhbGciOiJIUzI1NiJ9' # 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.' (optional) opt_fields = ["actual_time_minutes","approval_status","assignee","assignee.name","assignee_section","assignee_section.name","assignee_status","completed","completed_at","completed_by","completed_by.name","created_at","created_by","custom_fields","custom_fields.asana_created_field","custom_fields.created_by","custom_fields.created_by.name","custom_fields.currency_code","custom_fields.custom_label","custom_fields.custom_label_position","custom_fields.date_value","custom_fields.date_value.date","custom_fields.date_value.date_time","custom_fields.description","custom_fields.display_value","custom_fields.enabled","custom_fields.enum_options","custom_fields.enum_options.color","custom_fields.enum_options.enabled","custom_fields.enum_options.name","custom_fields.enum_value","custom_fields.enum_value.color","custom_fields.enum_value.enabled","custom_fields.enum_value.name","custom_fields.format","custom_fields.has_notifications_enabled","custom_fields.is_formula_field","custom_fields.is_global_to_workspace","custom_fields.is_value_read_only","custom_fields.multi_enum_values","custom_fields.multi_enum_values.color","custom_fields.multi_enum_values.enabled","custom_fields.multi_enum_values.name","custom_fields.name","custom_fields.number_value","custom_fields.people_value","custom_fields.people_value.name","custom_fields.precision","custom_fields.resource_subtype","custom_fields.text_value","custom_fields.type","dependencies","dependents","due_at","due_on","external","external.data","followers","followers.name","hearted","hearts","hearts.user","hearts.user.name","html_notes","is_rendered_as_separator","liked","likes","likes.user","likes.user.name","memberships","memberships.project","memberships.project.name","memberships.section","memberships.section.name","modified_at","name","notes","num_hearts","num_likes","num_subtasks","offset","parent","parent.created_by","parent.name","parent.resource_subtype","path","permalink_url","projects","projects.name","resource_subtype","start_at","start_on","tags","tags.name","uri","workspace","workspace.name"] # list[str] | This endpoint returns a compact resource, which excludes some properties by default. To include those optional properties, set this query parameter to a comma-separated list of the properties you wish to include. (optional) try: - # Get tasks from a section - api_response = api_instance.get_tasks_for_section(section_gid, limit=limit, offset=offset, opt_fields=opt_fields) - pprint(api_response) + # Get tasks from a section + api_response = api_instance.get_tasks_for_section(section_gid, limit=limit, offset=offset, opt_fields=opt_fields) + pprint(api_response) except ApiException as e: - print("Exception when calling TasksApi->get_tasks_for_section: %s\n" % e) + print("Exception when calling TasksApi->get_tasks_for_section: %s\n" % e) ``` ### Parameters @@ -919,20 +935,21 @@ from pprint import pprint # Configure OAuth2 access token for authorization: oauth2 configuration = asana.Configuration() configuration.access_token = '' +api_client = asana.ApiClient(configuration) # create an instance of the API class -api_instance = asana.TasksApi(asana.ApiClient(configuration)) +api_instance = asana.TasksApi(api_client) tag_gid = '11235' # str | Globally unique identifier for the tag. limit = 50 # int | Results per page. The number of objects to return per page. The value must be between 1 and 100. (optional) offset = 'eyJ0eXAiOJiKV1iQLCJhbGciOiJIUzI1NiJ9' # 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.' (optional) opt_fields = ["actual_time_minutes","approval_status","assignee","assignee.name","assignee_section","assignee_section.name","assignee_status","completed","completed_at","completed_by","completed_by.name","created_at","created_by","custom_fields","custom_fields.asana_created_field","custom_fields.created_by","custom_fields.created_by.name","custom_fields.currency_code","custom_fields.custom_label","custom_fields.custom_label_position","custom_fields.date_value","custom_fields.date_value.date","custom_fields.date_value.date_time","custom_fields.description","custom_fields.display_value","custom_fields.enabled","custom_fields.enum_options","custom_fields.enum_options.color","custom_fields.enum_options.enabled","custom_fields.enum_options.name","custom_fields.enum_value","custom_fields.enum_value.color","custom_fields.enum_value.enabled","custom_fields.enum_value.name","custom_fields.format","custom_fields.has_notifications_enabled","custom_fields.is_formula_field","custom_fields.is_global_to_workspace","custom_fields.is_value_read_only","custom_fields.multi_enum_values","custom_fields.multi_enum_values.color","custom_fields.multi_enum_values.enabled","custom_fields.multi_enum_values.name","custom_fields.name","custom_fields.number_value","custom_fields.people_value","custom_fields.people_value.name","custom_fields.precision","custom_fields.resource_subtype","custom_fields.text_value","custom_fields.type","dependencies","dependents","due_at","due_on","external","external.data","followers","followers.name","hearted","hearts","hearts.user","hearts.user.name","html_notes","is_rendered_as_separator","liked","likes","likes.user","likes.user.name","memberships","memberships.project","memberships.project.name","memberships.section","memberships.section.name","modified_at","name","notes","num_hearts","num_likes","num_subtasks","offset","parent","parent.created_by","parent.name","parent.resource_subtype","path","permalink_url","projects","projects.name","resource_subtype","start_at","start_on","tags","tags.name","uri","workspace","workspace.name"] # list[str] | This endpoint returns a compact resource, which excludes some properties by default. To include those optional properties, set this query parameter to a comma-separated list of the properties you wish to include. (optional) try: - # Get tasks from a tag - api_response = api_instance.get_tasks_for_tag(tag_gid, limit=limit, offset=offset, opt_fields=opt_fields) - pprint(api_response) + # Get tasks from a tag + api_response = api_instance.get_tasks_for_tag(tag_gid, limit=limit, offset=offset, opt_fields=opt_fields) + pprint(api_response) except ApiException as e: - print("Exception when calling TasksApi->get_tasks_for_tag: %s\n" % e) + print("Exception when calling TasksApi->get_tasks_for_tag: %s\n" % e) ``` ### Parameters @@ -975,9 +992,10 @@ from pprint import pprint # Configure OAuth2 access token for authorization: oauth2 configuration = asana.Configuration() configuration.access_token = '' +api_client = asana.ApiClient(configuration) # create an instance of the API class -api_instance = asana.TasksApi(asana.ApiClient(configuration)) +api_instance = asana.TasksApi(api_client) user_task_list_gid = '12345' # str | Globally unique identifier for the user task list. completed_since = '2012-02-22T02:06:58.158Z' # 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*. (optional) limit = 50 # int | Results per page. The number of objects to return per page. The value must be between 1 and 100. (optional) @@ -985,11 +1003,11 @@ offset = 'eyJ0eXAiOJiKV1iQLCJhbGciOiJIUzI1NiJ9' # str | Offset token. An offset opt_fields = ["actual_time_minutes","approval_status","assignee","assignee.name","assignee_section","assignee_section.name","assignee_status","completed","completed_at","completed_by","completed_by.name","created_at","created_by","custom_fields","custom_fields.asana_created_field","custom_fields.created_by","custom_fields.created_by.name","custom_fields.currency_code","custom_fields.custom_label","custom_fields.custom_label_position","custom_fields.date_value","custom_fields.date_value.date","custom_fields.date_value.date_time","custom_fields.description","custom_fields.display_value","custom_fields.enabled","custom_fields.enum_options","custom_fields.enum_options.color","custom_fields.enum_options.enabled","custom_fields.enum_options.name","custom_fields.enum_value","custom_fields.enum_value.color","custom_fields.enum_value.enabled","custom_fields.enum_value.name","custom_fields.format","custom_fields.has_notifications_enabled","custom_fields.is_formula_field","custom_fields.is_global_to_workspace","custom_fields.is_value_read_only","custom_fields.multi_enum_values","custom_fields.multi_enum_values.color","custom_fields.multi_enum_values.enabled","custom_fields.multi_enum_values.name","custom_fields.name","custom_fields.number_value","custom_fields.people_value","custom_fields.people_value.name","custom_fields.precision","custom_fields.resource_subtype","custom_fields.text_value","custom_fields.type","dependencies","dependents","due_at","due_on","external","external.data","followers","followers.name","hearted","hearts","hearts.user","hearts.user.name","html_notes","is_rendered_as_separator","liked","likes","likes.user","likes.user.name","memberships","memberships.project","memberships.project.name","memberships.section","memberships.section.name","modified_at","name","notes","num_hearts","num_likes","num_subtasks","offset","parent","parent.created_by","parent.name","parent.resource_subtype","path","permalink_url","projects","projects.name","resource_subtype","start_at","start_on","tags","tags.name","uri","workspace","workspace.name"] # list[str] | This endpoint returns a compact resource, which excludes some properties by default. To include those optional properties, set this query parameter to a comma-separated list of the properties you wish to include. (optional) try: - # Get tasks from a user task list - api_response = api_instance.get_tasks_for_user_task_list(user_task_list_gid, completed_since=completed_since, limit=limit, offset=offset, opt_fields=opt_fields) - pprint(api_response) + # Get tasks from a user task list + api_response = api_instance.get_tasks_for_user_task_list(user_task_list_gid, completed_since=completed_since, limit=limit, offset=offset, opt_fields=opt_fields) + pprint(api_response) except ApiException as e: - print("Exception when calling TasksApi->get_tasks_for_user_task_list: %s\n" % e) + print("Exception when calling TasksApi->get_tasks_for_user_task_list: %s\n" % e) ``` ### Parameters @@ -1033,18 +1051,19 @@ from pprint import pprint # Configure OAuth2 access token for authorization: oauth2 configuration = asana.Configuration() configuration.access_token = '' +api_client = asana.ApiClient(configuration) # create an instance of the API class -api_instance = asana.TasksApi(asana.ApiClient(configuration)) +api_instance = asana.TasksApi(api_client) body = asana.TaskGidRemoveDependenciesBody({"param1": "value1", "param2": "value2",}) # TaskGidRemoveDependenciesBody | The list of tasks to unlink as dependencies. task_gid = '321654' # str | The task to operate on. try: - # Unlink dependencies from a task - api_response = api_instance.remove_dependencies_for_task(body, task_gid) - pprint(api_response) + # Unlink dependencies from a task + api_response = api_instance.remove_dependencies_for_task(body, task_gid) + pprint(api_response) except ApiException as e: - print("Exception when calling TasksApi->remove_dependencies_for_task: %s\n" % e) + print("Exception when calling TasksApi->remove_dependencies_for_task: %s\n" % e) ``` ### Parameters @@ -1085,18 +1104,19 @@ from pprint import pprint # Configure OAuth2 access token for authorization: oauth2 configuration = asana.Configuration() configuration.access_token = '' +api_client = asana.ApiClient(configuration) # create an instance of the API class -api_instance = asana.TasksApi(asana.ApiClient(configuration)) +api_instance = asana.TasksApi(api_client) body = asana.TaskGidRemoveDependentsBody({"param1": "value1", "param2": "value2",}) # TaskGidRemoveDependentsBody | The list of tasks to remove as dependents. task_gid = '321654' # str | The task to operate on. try: - # Unlink dependents from a task - api_response = api_instance.remove_dependents_for_task(body, task_gid) - pprint(api_response) + # Unlink dependents from a task + api_response = api_instance.remove_dependents_for_task(body, task_gid) + pprint(api_response) except ApiException as e: - print("Exception when calling TasksApi->remove_dependents_for_task: %s\n" % e) + print("Exception when calling TasksApi->remove_dependents_for_task: %s\n" % e) ``` ### Parameters @@ -1137,19 +1157,20 @@ from pprint import pprint # Configure OAuth2 access token for authorization: oauth2 configuration = asana.Configuration() configuration.access_token = '' +api_client = asana.ApiClient(configuration) # create an instance of the API class -api_instance = asana.TasksApi(asana.ApiClient(configuration)) +api_instance = asana.TasksApi(api_client) body = asana.TaskGidRemoveFollowersBody({"param1": "value1", "param2": "value2",}) # TaskGidRemoveFollowersBody | The followers to remove from the task. task_gid = '321654' # str | The task to operate on. opt_fields = ["actual_time_minutes","approval_status","assignee","assignee.name","assignee_section","assignee_section.name","assignee_status","completed","completed_at","completed_by","completed_by.name","created_at","created_by","custom_fields","custom_fields.asana_created_field","custom_fields.created_by","custom_fields.created_by.name","custom_fields.currency_code","custom_fields.custom_label","custom_fields.custom_label_position","custom_fields.date_value","custom_fields.date_value.date","custom_fields.date_value.date_time","custom_fields.description","custom_fields.display_value","custom_fields.enabled","custom_fields.enum_options","custom_fields.enum_options.color","custom_fields.enum_options.enabled","custom_fields.enum_options.name","custom_fields.enum_value","custom_fields.enum_value.color","custom_fields.enum_value.enabled","custom_fields.enum_value.name","custom_fields.format","custom_fields.has_notifications_enabled","custom_fields.is_formula_field","custom_fields.is_global_to_workspace","custom_fields.is_value_read_only","custom_fields.multi_enum_values","custom_fields.multi_enum_values.color","custom_fields.multi_enum_values.enabled","custom_fields.multi_enum_values.name","custom_fields.name","custom_fields.number_value","custom_fields.people_value","custom_fields.people_value.name","custom_fields.precision","custom_fields.resource_subtype","custom_fields.text_value","custom_fields.type","dependencies","dependents","due_at","due_on","external","external.data","followers","followers.name","hearted","hearts","hearts.user","hearts.user.name","html_notes","is_rendered_as_separator","liked","likes","likes.user","likes.user.name","memberships","memberships.project","memberships.project.name","memberships.section","memberships.section.name","modified_at","name","notes","num_hearts","num_likes","num_subtasks","parent","parent.created_by","parent.name","parent.resource_subtype","permalink_url","projects","projects.name","resource_subtype","start_at","start_on","tags","tags.name","workspace","workspace.name"] # list[str] | This endpoint returns a compact resource, which excludes some properties by default. To include those optional properties, set this query parameter to a comma-separated list of the properties you wish to include. (optional) try: - # Remove followers from a task - api_response = api_instance.remove_follower_for_task(body, task_gid, opt_fields=opt_fields) - pprint(api_response) + # Remove followers from a task + api_response = api_instance.remove_follower_for_task(body, task_gid, opt_fields=opt_fields) + pprint(api_response) except ApiException as e: - print("Exception when calling TasksApi->remove_follower_for_task: %s\n" % e) + print("Exception when calling TasksApi->remove_follower_for_task: %s\n" % e) ``` ### Parameters @@ -1191,18 +1212,19 @@ from pprint import pprint # Configure OAuth2 access token for authorization: oauth2 configuration = asana.Configuration() configuration.access_token = '' +api_client = asana.ApiClient(configuration) # create an instance of the API class -api_instance = asana.TasksApi(asana.ApiClient(configuration)) +api_instance = asana.TasksApi(api_client) body = asana.TaskGidRemoveProjectBody({"param1": "value1", "param2": "value2",}) # TaskGidRemoveProjectBody | The project to remove the task from. task_gid = '321654' # str | The task to operate on. try: - # Remove a project from a task - api_response = api_instance.remove_project_for_task(body, task_gid) - pprint(api_response) + # Remove a project from a task + api_response = api_instance.remove_project_for_task(body, task_gid) + pprint(api_response) except ApiException as e: - print("Exception when calling TasksApi->remove_project_for_task: %s\n" % e) + print("Exception when calling TasksApi->remove_project_for_task: %s\n" % e) ``` ### Parameters @@ -1243,18 +1265,19 @@ from pprint import pprint # Configure OAuth2 access token for authorization: oauth2 configuration = asana.Configuration() configuration.access_token = '' +api_client = asana.ApiClient(configuration) # create an instance of the API class -api_instance = asana.TasksApi(asana.ApiClient(configuration)) +api_instance = asana.TasksApi(api_client) body = asana.TaskGidRemoveTagBody({"param1": "value1", "param2": "value2",}) # TaskGidRemoveTagBody | The tag to remove from the task. task_gid = '321654' # str | The task to operate on. try: - # Remove a tag from a task - api_response = api_instance.remove_tag_for_task(body, task_gid) - pprint(api_response) + # Remove a tag from a task + api_response = api_instance.remove_tag_for_task(body, task_gid) + pprint(api_response) except ApiException as e: - print("Exception when calling TasksApi->remove_tag_for_task: %s\n" % e) + print("Exception when calling TasksApi->remove_tag_for_task: %s\n" % e) ``` ### Parameters @@ -1295,9 +1318,10 @@ from pprint import pprint # Configure OAuth2 access token for authorization: oauth2 configuration = asana.Configuration() configuration.access_token = '' +api_client = asana.ApiClient(configuration) # create an instance of the API class -api_instance = asana.TasksApi(asana.ApiClient(configuration)) +api_instance = asana.TasksApi(api_client) workspace_gid = '12345' # str | Globally unique identifier for the workspace or organization. text = 'Bug' # str | Performs full-text search on both task name and description (optional) resource_subtype = 'milestone' # str | Filters results by the task's resource_subtype (optional) (default to milestone) @@ -1354,11 +1378,11 @@ sort_ascending = false # bool | Default `false` (optional) (default to false) opt_fields = ["actual_time_minutes","approval_status","assignee","assignee.name","assignee_section","assignee_section.name","assignee_status","completed","completed_at","completed_by","completed_by.name","created_at","created_by","custom_fields","custom_fields.asana_created_field","custom_fields.created_by","custom_fields.created_by.name","custom_fields.currency_code","custom_fields.custom_label","custom_fields.custom_label_position","custom_fields.date_value","custom_fields.date_value.date","custom_fields.date_value.date_time","custom_fields.description","custom_fields.display_value","custom_fields.enabled","custom_fields.enum_options","custom_fields.enum_options.color","custom_fields.enum_options.enabled","custom_fields.enum_options.name","custom_fields.enum_value","custom_fields.enum_value.color","custom_fields.enum_value.enabled","custom_fields.enum_value.name","custom_fields.format","custom_fields.has_notifications_enabled","custom_fields.is_formula_field","custom_fields.is_global_to_workspace","custom_fields.is_value_read_only","custom_fields.multi_enum_values","custom_fields.multi_enum_values.color","custom_fields.multi_enum_values.enabled","custom_fields.multi_enum_values.name","custom_fields.name","custom_fields.number_value","custom_fields.people_value","custom_fields.people_value.name","custom_fields.precision","custom_fields.resource_subtype","custom_fields.text_value","custom_fields.type","dependencies","dependents","due_at","due_on","external","external.data","followers","followers.name","hearted","hearts","hearts.user","hearts.user.name","html_notes","is_rendered_as_separator","liked","likes","likes.user","likes.user.name","memberships","memberships.project","memberships.project.name","memberships.section","memberships.section.name","modified_at","name","notes","num_hearts","num_likes","num_subtasks","parent","parent.created_by","parent.name","parent.resource_subtype","permalink_url","projects","projects.name","resource_subtype","start_at","start_on","tags","tags.name","workspace","workspace.name"] # list[str] | This endpoint returns a compact resource, which excludes some properties by default. To include those optional properties, set this query parameter to a comma-separated list of the properties you wish to include. (optional) try: - # Search tasks in a workspace - api_response = api_instance.search_tasks_for_workspace(workspace_gid, text=text, resource_subtype=resource_subtype, assignee_any=assignee_any, assignee_not=assignee_not, portfolios_any=portfolios_any, projects_any=projects_any, projects_not=projects_not, projects_all=projects_all, sections_any=sections_any, sections_not=sections_not, sections_all=sections_all, tags_any=tags_any, tags_not=tags_not, tags_all=tags_all, teams_any=teams_any, followers_not=followers_not, created_by_any=created_by_any, created_by_not=created_by_not, assigned_by_any=assigned_by_any, assigned_by_not=assigned_by_not, liked_by_not=liked_by_not, commented_on_by_not=commented_on_by_not, due_on_before=due_on_before, due_on_after=due_on_after, due_on=due_on, due_at_before=due_at_before, due_at_after=due_at_after, start_on_before=start_on_before, start_on_after=start_on_after, start_on=start_on, created_on_before=created_on_before, created_on_after=created_on_after, created_on=created_on, created_at_before=created_at_before, created_at_after=created_at_after, completed_on_before=completed_on_before, completed_on_after=completed_on_after, completed_on=completed_on, completed_at_before=completed_at_before, completed_at_after=completed_at_after, modified_on_before=modified_on_before, modified_on_after=modified_on_after, modified_on=modified_on, modified_at_before=modified_at_before, modified_at_after=modified_at_after, is_blocking=is_blocking, is_blocked=is_blocked, has_attachment=has_attachment, completed=completed, is_subtask=is_subtask, sort_by=sort_by, sort_ascending=sort_ascending, opt_fields=opt_fields) - pprint(api_response) + # Search tasks in a workspace + api_response = api_instance.search_tasks_for_workspace(workspace_gid, text=text, resource_subtype=resource_subtype, assignee_any=assignee_any, assignee_not=assignee_not, portfolios_any=portfolios_any, projects_any=projects_any, projects_not=projects_not, projects_all=projects_all, sections_any=sections_any, sections_not=sections_not, sections_all=sections_all, tags_any=tags_any, tags_not=tags_not, tags_all=tags_all, teams_any=teams_any, followers_not=followers_not, created_by_any=created_by_any, created_by_not=created_by_not, assigned_by_any=assigned_by_any, assigned_by_not=assigned_by_not, liked_by_not=liked_by_not, commented_on_by_not=commented_on_by_not, due_on_before=due_on_before, due_on_after=due_on_after, due_on=due_on, due_at_before=due_at_before, due_at_after=due_at_after, start_on_before=start_on_before, start_on_after=start_on_after, start_on=start_on, created_on_before=created_on_before, created_on_after=created_on_after, created_on=created_on, created_at_before=created_at_before, created_at_after=created_at_after, completed_on_before=completed_on_before, completed_on_after=completed_on_after, completed_on=completed_on, completed_at_before=completed_at_before, completed_at_after=completed_at_after, modified_on_before=modified_on_before, modified_on_after=modified_on_after, modified_on=modified_on, modified_at_before=modified_at_before, modified_at_after=modified_at_after, is_blocking=is_blocking, is_blocked=is_blocked, has_attachment=has_attachment, completed=completed, is_subtask=is_subtask, sort_by=sort_by, sort_ascending=sort_ascending, opt_fields=opt_fields) + pprint(api_response) except ApiException as e: - print("Exception when calling TasksApi->search_tasks_for_workspace: %s\n" % e) + print("Exception when calling TasksApi->search_tasks_for_workspace: %s\n" % e) ``` ### Parameters @@ -1451,19 +1475,20 @@ from pprint import pprint # Configure OAuth2 access token for authorization: oauth2 configuration = asana.Configuration() configuration.access_token = '' +api_client = asana.ApiClient(configuration) # create an instance of the API class -api_instance = asana.TasksApi(asana.ApiClient(configuration)) +api_instance = asana.TasksApi(api_client) body = asana.TaskGidSetParentBody({"param1": "value1", "param2": "value2",}) # TaskGidSetParentBody | The new parent of the subtask. task_gid = '321654' # str | The task to operate on. opt_fields = ["actual_time_minutes","approval_status","assignee","assignee.name","assignee_section","assignee_section.name","assignee_status","completed","completed_at","completed_by","completed_by.name","created_at","created_by","custom_fields","custom_fields.asana_created_field","custom_fields.created_by","custom_fields.created_by.name","custom_fields.currency_code","custom_fields.custom_label","custom_fields.custom_label_position","custom_fields.date_value","custom_fields.date_value.date","custom_fields.date_value.date_time","custom_fields.description","custom_fields.display_value","custom_fields.enabled","custom_fields.enum_options","custom_fields.enum_options.color","custom_fields.enum_options.enabled","custom_fields.enum_options.name","custom_fields.enum_value","custom_fields.enum_value.color","custom_fields.enum_value.enabled","custom_fields.enum_value.name","custom_fields.format","custom_fields.has_notifications_enabled","custom_fields.is_formula_field","custom_fields.is_global_to_workspace","custom_fields.is_value_read_only","custom_fields.multi_enum_values","custom_fields.multi_enum_values.color","custom_fields.multi_enum_values.enabled","custom_fields.multi_enum_values.name","custom_fields.name","custom_fields.number_value","custom_fields.people_value","custom_fields.people_value.name","custom_fields.precision","custom_fields.resource_subtype","custom_fields.text_value","custom_fields.type","dependencies","dependents","due_at","due_on","external","external.data","followers","followers.name","hearted","hearts","hearts.user","hearts.user.name","html_notes","is_rendered_as_separator","liked","likes","likes.user","likes.user.name","memberships","memberships.project","memberships.project.name","memberships.section","memberships.section.name","modified_at","name","notes","num_hearts","num_likes","num_subtasks","parent","parent.created_by","parent.name","parent.resource_subtype","permalink_url","projects","projects.name","resource_subtype","start_at","start_on","tags","tags.name","workspace","workspace.name"] # list[str] | This endpoint returns a compact resource, which excludes some properties by default. To include those optional properties, set this query parameter to a comma-separated list of the properties you wish to include. (optional) try: - # Set the parent of a task - api_response = api_instance.set_parent_for_task(body, task_gid, opt_fields=opt_fields) - pprint(api_response) + # Set the parent of a task + api_response = api_instance.set_parent_for_task(body, task_gid, opt_fields=opt_fields) + pprint(api_response) except ApiException as e: - print("Exception when calling TasksApi->set_parent_for_task: %s\n" % e) + print("Exception when calling TasksApi->set_parent_for_task: %s\n" % e) ``` ### Parameters @@ -1505,19 +1530,20 @@ from pprint import pprint # Configure OAuth2 access token for authorization: oauth2 configuration = asana.Configuration() configuration.access_token = '' +api_client = asana.ApiClient(configuration) # create an instance of the API class -api_instance = asana.TasksApi(asana.ApiClient(configuration)) +api_instance = asana.TasksApi(api_client) body = asana.TasksTaskGidBody({"param1": "value1", "param2": "value2",}) # TasksTaskGidBody | The task to update. task_gid = '321654' # str | The task to operate on. opt_fields = ["actual_time_minutes","approval_status","assignee","assignee.name","assignee_section","assignee_section.name","assignee_status","completed","completed_at","completed_by","completed_by.name","created_at","created_by","custom_fields","custom_fields.asana_created_field","custom_fields.created_by","custom_fields.created_by.name","custom_fields.currency_code","custom_fields.custom_label","custom_fields.custom_label_position","custom_fields.date_value","custom_fields.date_value.date","custom_fields.date_value.date_time","custom_fields.description","custom_fields.display_value","custom_fields.enabled","custom_fields.enum_options","custom_fields.enum_options.color","custom_fields.enum_options.enabled","custom_fields.enum_options.name","custom_fields.enum_value","custom_fields.enum_value.color","custom_fields.enum_value.enabled","custom_fields.enum_value.name","custom_fields.format","custom_fields.has_notifications_enabled","custom_fields.is_formula_field","custom_fields.is_global_to_workspace","custom_fields.is_value_read_only","custom_fields.multi_enum_values","custom_fields.multi_enum_values.color","custom_fields.multi_enum_values.enabled","custom_fields.multi_enum_values.name","custom_fields.name","custom_fields.number_value","custom_fields.people_value","custom_fields.people_value.name","custom_fields.precision","custom_fields.resource_subtype","custom_fields.text_value","custom_fields.type","dependencies","dependents","due_at","due_on","external","external.data","followers","followers.name","hearted","hearts","hearts.user","hearts.user.name","html_notes","is_rendered_as_separator","liked","likes","likes.user","likes.user.name","memberships","memberships.project","memberships.project.name","memberships.section","memberships.section.name","modified_at","name","notes","num_hearts","num_likes","num_subtasks","parent","parent.created_by","parent.name","parent.resource_subtype","permalink_url","projects","projects.name","resource_subtype","start_at","start_on","tags","tags.name","workspace","workspace.name"] # list[str] | This endpoint returns a compact resource, which excludes some properties by default. To include those optional properties, set this query parameter to a comma-separated list of the properties you wish to include. (optional) try: - # Update a task - api_response = api_instance.update_task(body, task_gid, opt_fields=opt_fields) - pprint(api_response) + # Update a task + api_response = api_instance.update_task(body, task_gid, opt_fields=opt_fields) + pprint(api_response) except ApiException as e: - print("Exception when calling TasksApi->update_task: %s\n" % e) + print("Exception when calling TasksApi->update_task: %s\n" % e) ``` ### Parameters diff --git a/docs/TasksApi.yaml b/docs/TasksApi.yaml index 763f37bc..6a3ed5da 100644 --- a/docs/TasksApi.yaml +++ b/docs/TasksApi.yaml @@ -7,18 +7,19 @@ TasksApi: # Configure OAuth2 access token for authorization: oauth2 configuration = asana.Configuration() configuration.access_token = '' + api_client = asana.ApiClient(configuration) # create an instance of the API class - api_instance = asana.TasksApi(asana.ApiClient(configuration)) + api_instance = asana.TasksApi(api_client) body = asana.TaskGidAddDependenciesBody({"param1": "value1", "param2": "value2",}) # TaskGidAddDependenciesBody | The list of tasks to set as dependencies. task_gid = '321654' # str | The task to operate on. try: - # Set dependencies for a task - api_response = api_instance.add_dependencies_for_task(body, task_gid) - pprint(api_response) + # Set dependencies for a task + api_response = api_instance.add_dependencies_for_task(body, task_gid) + pprint(api_response) except ApiException as e: - print("Exception when calling TasksApi->add_dependencies_for_task: %s\n" % e) + print("Exception when calling TasksApi->add_dependencies_for_task: %s\n" % e) add_dependents_for_task: |- import asana from asana.rest import ApiException @@ -27,18 +28,19 @@ TasksApi: # Configure OAuth2 access token for authorization: oauth2 configuration = asana.Configuration() configuration.access_token = '' + api_client = asana.ApiClient(configuration) # create an instance of the API class - api_instance = asana.TasksApi(asana.ApiClient(configuration)) + api_instance = asana.TasksApi(api_client) body = asana.TaskGidAddDependentsBody({"param1": "value1", "param2": "value2",}) # TaskGidAddDependentsBody | The list of tasks to add as dependents. task_gid = '321654' # str | The task to operate on. try: - # Set dependents for a task - api_response = api_instance.add_dependents_for_task(body, task_gid) - pprint(api_response) + # Set dependents for a task + api_response = api_instance.add_dependents_for_task(body, task_gid) + pprint(api_response) except ApiException as e: - print("Exception when calling TasksApi->add_dependents_for_task: %s\n" % e) + print("Exception when calling TasksApi->add_dependents_for_task: %s\n" % e) add_followers_for_task: |- import asana from asana.rest import ApiException @@ -47,19 +49,20 @@ TasksApi: # Configure OAuth2 access token for authorization: oauth2 configuration = asana.Configuration() configuration.access_token = '' + api_client = asana.ApiClient(configuration) # create an instance of the API class - api_instance = asana.TasksApi(asana.ApiClient(configuration)) + api_instance = asana.TasksApi(api_client) body = asana.TaskGidAddFollowersBody({"param1": "value1", "param2": "value2",}) # TaskGidAddFollowersBody | The followers to add to the task. task_gid = '321654' # str | The task to operate on. opt_fields = ["actual_time_minutes","approval_status","assignee","assignee.name","assignee_section","assignee_section.name","assignee_status","completed","completed_at","completed_by","completed_by.name","created_at","created_by","custom_fields","custom_fields.asana_created_field","custom_fields.created_by","custom_fields.created_by.name","custom_fields.currency_code","custom_fields.custom_label","custom_fields.custom_label_position","custom_fields.date_value","custom_fields.date_value.date","custom_fields.date_value.date_time","custom_fields.description","custom_fields.display_value","custom_fields.enabled","custom_fields.enum_options","custom_fields.enum_options.color","custom_fields.enum_options.enabled","custom_fields.enum_options.name","custom_fields.enum_value","custom_fields.enum_value.color","custom_fields.enum_value.enabled","custom_fields.enum_value.name","custom_fields.format","custom_fields.has_notifications_enabled","custom_fields.is_formula_field","custom_fields.is_global_to_workspace","custom_fields.is_value_read_only","custom_fields.multi_enum_values","custom_fields.multi_enum_values.color","custom_fields.multi_enum_values.enabled","custom_fields.multi_enum_values.name","custom_fields.name","custom_fields.number_value","custom_fields.people_value","custom_fields.people_value.name","custom_fields.precision","custom_fields.resource_subtype","custom_fields.text_value","custom_fields.type","dependencies","dependents","due_at","due_on","external","external.data","followers","followers.name","hearted","hearts","hearts.user","hearts.user.name","html_notes","is_rendered_as_separator","liked","likes","likes.user","likes.user.name","memberships","memberships.project","memberships.project.name","memberships.section","memberships.section.name","modified_at","name","notes","num_hearts","num_likes","num_subtasks","parent","parent.created_by","parent.name","parent.resource_subtype","permalink_url","projects","projects.name","resource_subtype","start_at","start_on","tags","tags.name","workspace","workspace.name"] # list[str] | This endpoint returns a compact resource, which excludes some properties by default. To include those optional properties, set this query parameter to a comma-separated list of the properties you wish to include. (optional) try: - # Add followers to a task - api_response = api_instance.add_followers_for_task(body, task_gid, opt_fields=opt_fields) - pprint(api_response) + # Add followers to a task + api_response = api_instance.add_followers_for_task(body, task_gid, opt_fields=opt_fields) + pprint(api_response) except ApiException as e: - print("Exception when calling TasksApi->add_followers_for_task: %s\n" % e) + print("Exception when calling TasksApi->add_followers_for_task: %s\n" % e) add_project_for_task: |- import asana from asana.rest import ApiException @@ -68,18 +71,19 @@ TasksApi: # Configure OAuth2 access token for authorization: oauth2 configuration = asana.Configuration() configuration.access_token = '' + api_client = asana.ApiClient(configuration) # create an instance of the API class - api_instance = asana.TasksApi(asana.ApiClient(configuration)) + api_instance = asana.TasksApi(api_client) body = asana.TaskGidAddProjectBody({"param1": "value1", "param2": "value2",}) # TaskGidAddProjectBody | The project to add the task to. task_gid = '321654' # str | The task to operate on. try: - # Add a project to a task - api_response = api_instance.add_project_for_task(body, task_gid) - pprint(api_response) + # Add a project to a task + api_response = api_instance.add_project_for_task(body, task_gid) + pprint(api_response) except ApiException as e: - print("Exception when calling TasksApi->add_project_for_task: %s\n" % e) + print("Exception when calling TasksApi->add_project_for_task: %s\n" % e) add_tag_for_task: |- import asana from asana.rest import ApiException @@ -88,18 +92,19 @@ TasksApi: # Configure OAuth2 access token for authorization: oauth2 configuration = asana.Configuration() configuration.access_token = '' + api_client = asana.ApiClient(configuration) # create an instance of the API class - api_instance = asana.TasksApi(asana.ApiClient(configuration)) + api_instance = asana.TasksApi(api_client) body = asana.TaskGidAddTagBody({"param1": "value1", "param2": "value2",}) # TaskGidAddTagBody | The tag to add to the task. task_gid = '321654' # str | The task to operate on. try: - # Add a tag to a task - api_response = api_instance.add_tag_for_task(body, task_gid) - pprint(api_response) + # Add a tag to a task + api_response = api_instance.add_tag_for_task(body, task_gid) + pprint(api_response) except ApiException as e: - print("Exception when calling TasksApi->add_tag_for_task: %s\n" % e) + print("Exception when calling TasksApi->add_tag_for_task: %s\n" % e) create_subtask_for_task: |- import asana from asana.rest import ApiException @@ -108,19 +113,20 @@ TasksApi: # Configure OAuth2 access token for authorization: oauth2 configuration = asana.Configuration() configuration.access_token = '' + api_client = asana.ApiClient(configuration) # create an instance of the API class - api_instance = asana.TasksApi(asana.ApiClient(configuration)) + api_instance = asana.TasksApi(api_client) body = asana.TaskGidSubtasksBody({"param1": "value1", "param2": "value2",}) # TaskGidSubtasksBody | The new subtask to create. task_gid = '321654' # str | The task to operate on. opt_fields = ["actual_time_minutes","approval_status","assignee","assignee.name","assignee_section","assignee_section.name","assignee_status","completed","completed_at","completed_by","completed_by.name","created_at","created_by","custom_fields","custom_fields.asana_created_field","custom_fields.created_by","custom_fields.created_by.name","custom_fields.currency_code","custom_fields.custom_label","custom_fields.custom_label_position","custom_fields.date_value","custom_fields.date_value.date","custom_fields.date_value.date_time","custom_fields.description","custom_fields.display_value","custom_fields.enabled","custom_fields.enum_options","custom_fields.enum_options.color","custom_fields.enum_options.enabled","custom_fields.enum_options.name","custom_fields.enum_value","custom_fields.enum_value.color","custom_fields.enum_value.enabled","custom_fields.enum_value.name","custom_fields.format","custom_fields.has_notifications_enabled","custom_fields.is_formula_field","custom_fields.is_global_to_workspace","custom_fields.is_value_read_only","custom_fields.multi_enum_values","custom_fields.multi_enum_values.color","custom_fields.multi_enum_values.enabled","custom_fields.multi_enum_values.name","custom_fields.name","custom_fields.number_value","custom_fields.people_value","custom_fields.people_value.name","custom_fields.precision","custom_fields.resource_subtype","custom_fields.text_value","custom_fields.type","dependencies","dependents","due_at","due_on","external","external.data","followers","followers.name","hearted","hearts","hearts.user","hearts.user.name","html_notes","is_rendered_as_separator","liked","likes","likes.user","likes.user.name","memberships","memberships.project","memberships.project.name","memberships.section","memberships.section.name","modified_at","name","notes","num_hearts","num_likes","num_subtasks","parent","parent.created_by","parent.name","parent.resource_subtype","permalink_url","projects","projects.name","resource_subtype","start_at","start_on","tags","tags.name","workspace","workspace.name"] # list[str] | This endpoint returns a compact resource, which excludes some properties by default. To include those optional properties, set this query parameter to a comma-separated list of the properties you wish to include. (optional) try: - # Create a subtask - api_response = api_instance.create_subtask_for_task(body, task_gid, opt_fields=opt_fields) - pprint(api_response) + # Create a subtask + api_response = api_instance.create_subtask_for_task(body, task_gid, opt_fields=opt_fields) + pprint(api_response) except ApiException as e: - print("Exception when calling TasksApi->create_subtask_for_task: %s\n" % e) + print("Exception when calling TasksApi->create_subtask_for_task: %s\n" % e) create_task: |- import asana from asana.rest import ApiException @@ -129,18 +135,19 @@ TasksApi: # Configure OAuth2 access token for authorization: oauth2 configuration = asana.Configuration() configuration.access_token = '' + api_client = asana.ApiClient(configuration) # create an instance of the API class - api_instance = asana.TasksApi(asana.ApiClient(configuration)) + api_instance = asana.TasksApi(api_client) body = asana.TasksBody({"param1": "value1", "param2": "value2",}) # TasksBody | The task to create. opt_fields = ["actual_time_minutes","approval_status","assignee","assignee.name","assignee_section","assignee_section.name","assignee_status","completed","completed_at","completed_by","completed_by.name","created_at","created_by","custom_fields","custom_fields.asana_created_field","custom_fields.created_by","custom_fields.created_by.name","custom_fields.currency_code","custom_fields.custom_label","custom_fields.custom_label_position","custom_fields.date_value","custom_fields.date_value.date","custom_fields.date_value.date_time","custom_fields.description","custom_fields.display_value","custom_fields.enabled","custom_fields.enum_options","custom_fields.enum_options.color","custom_fields.enum_options.enabled","custom_fields.enum_options.name","custom_fields.enum_value","custom_fields.enum_value.color","custom_fields.enum_value.enabled","custom_fields.enum_value.name","custom_fields.format","custom_fields.has_notifications_enabled","custom_fields.is_formula_field","custom_fields.is_global_to_workspace","custom_fields.is_value_read_only","custom_fields.multi_enum_values","custom_fields.multi_enum_values.color","custom_fields.multi_enum_values.enabled","custom_fields.multi_enum_values.name","custom_fields.name","custom_fields.number_value","custom_fields.people_value","custom_fields.people_value.name","custom_fields.precision","custom_fields.resource_subtype","custom_fields.text_value","custom_fields.type","dependencies","dependents","due_at","due_on","external","external.data","followers","followers.name","hearted","hearts","hearts.user","hearts.user.name","html_notes","is_rendered_as_separator","liked","likes","likes.user","likes.user.name","memberships","memberships.project","memberships.project.name","memberships.section","memberships.section.name","modified_at","name","notes","num_hearts","num_likes","num_subtasks","parent","parent.created_by","parent.name","parent.resource_subtype","permalink_url","projects","projects.name","resource_subtype","start_at","start_on","tags","tags.name","workspace","workspace.name"] # list[str] | This endpoint returns a compact resource, which excludes some properties by default. To include those optional properties, set this query parameter to a comma-separated list of the properties you wish to include. (optional) try: - # Create a task - api_response = api_instance.create_task(body, opt_fields=opt_fields) - pprint(api_response) + # Create a task + api_response = api_instance.create_task(body, opt_fields=opt_fields) + pprint(api_response) except ApiException as e: - print("Exception when calling TasksApi->create_task: %s\n" % e) + print("Exception when calling TasksApi->create_task: %s\n" % e) delete_task: |- import asana from asana.rest import ApiException @@ -149,17 +156,18 @@ TasksApi: # Configure OAuth2 access token for authorization: oauth2 configuration = asana.Configuration() configuration.access_token = '' + api_client = asana.ApiClient(configuration) # create an instance of the API class - api_instance = asana.TasksApi(asana.ApiClient(configuration)) + api_instance = asana.TasksApi(api_client) task_gid = '321654' # str | The task to operate on. try: - # Delete a task - api_response = api_instance.delete_task(task_gid) - pprint(api_response) + # Delete a task + api_response = api_instance.delete_task(task_gid) + pprint(api_response) except ApiException as e: - print("Exception when calling TasksApi->delete_task: %s\n" % e) + print("Exception when calling TasksApi->delete_task: %s\n" % e) duplicate_task: |- import asana from asana.rest import ApiException @@ -168,19 +176,20 @@ TasksApi: # Configure OAuth2 access token for authorization: oauth2 configuration = asana.Configuration() configuration.access_token = '' + api_client = asana.ApiClient(configuration) # create an instance of the API class - api_instance = asana.TasksApi(asana.ApiClient(configuration)) + api_instance = asana.TasksApi(api_client) body = asana.TaskGidDuplicateBody({"param1": "value1", "param2": "value2",}) # TaskGidDuplicateBody | Describes the duplicate's name and the fields that will be duplicated. task_gid = '321654' # str | The task to operate on. opt_fields = ["new_project","new_project.name","new_project_template","new_project_template.name","new_task","new_task.created_by","new_task.name","new_task.resource_subtype","resource_subtype","status"] # list[str] | This endpoint returns a compact resource, which excludes some properties by default. To include those optional properties, set this query parameter to a comma-separated list of the properties you wish to include. (optional) try: - # Duplicate a task - api_response = api_instance.duplicate_task(body, task_gid, opt_fields=opt_fields) - pprint(api_response) + # Duplicate a task + api_response = api_instance.duplicate_task(body, task_gid, opt_fields=opt_fields) + pprint(api_response) except ApiException as e: - print("Exception when calling TasksApi->duplicate_task: %s\n" % e) + print("Exception when calling TasksApi->duplicate_task: %s\n" % e) get_dependencies_for_task: |- import asana from asana.rest import ApiException @@ -189,20 +198,21 @@ TasksApi: # Configure OAuth2 access token for authorization: oauth2 configuration = asana.Configuration() configuration.access_token = '' + api_client = asana.ApiClient(configuration) # create an instance of the API class - api_instance = asana.TasksApi(asana.ApiClient(configuration)) + api_instance = asana.TasksApi(api_client) task_gid = '321654' # str | The task to operate on. limit = 50 # int | Results per page. The number of objects to return per page. The value must be between 1 and 100. (optional) offset = 'eyJ0eXAiOJiKV1iQLCJhbGciOiJIUzI1NiJ9' # 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.' (optional) opt_fields = ["actual_time_minutes","approval_status","assignee","assignee.name","assignee_section","assignee_section.name","assignee_status","completed","completed_at","completed_by","completed_by.name","created_at","created_by","custom_fields","custom_fields.asana_created_field","custom_fields.created_by","custom_fields.created_by.name","custom_fields.currency_code","custom_fields.custom_label","custom_fields.custom_label_position","custom_fields.date_value","custom_fields.date_value.date","custom_fields.date_value.date_time","custom_fields.description","custom_fields.display_value","custom_fields.enabled","custom_fields.enum_options","custom_fields.enum_options.color","custom_fields.enum_options.enabled","custom_fields.enum_options.name","custom_fields.enum_value","custom_fields.enum_value.color","custom_fields.enum_value.enabled","custom_fields.enum_value.name","custom_fields.format","custom_fields.has_notifications_enabled","custom_fields.is_formula_field","custom_fields.is_global_to_workspace","custom_fields.is_value_read_only","custom_fields.multi_enum_values","custom_fields.multi_enum_values.color","custom_fields.multi_enum_values.enabled","custom_fields.multi_enum_values.name","custom_fields.name","custom_fields.number_value","custom_fields.people_value","custom_fields.people_value.name","custom_fields.precision","custom_fields.resource_subtype","custom_fields.text_value","custom_fields.type","dependencies","dependents","due_at","due_on","external","external.data","followers","followers.name","hearted","hearts","hearts.user","hearts.user.name","html_notes","is_rendered_as_separator","liked","likes","likes.user","likes.user.name","memberships","memberships.project","memberships.project.name","memberships.section","memberships.section.name","modified_at","name","notes","num_hearts","num_likes","num_subtasks","offset","parent","parent.created_by","parent.name","parent.resource_subtype","path","permalink_url","projects","projects.name","resource_subtype","start_at","start_on","tags","tags.name","uri","workspace","workspace.name"] # list[str] | This endpoint returns a compact resource, which excludes some properties by default. To include those optional properties, set this query parameter to a comma-separated list of the properties you wish to include. (optional) try: - # Get dependencies from a task - api_response = api_instance.get_dependencies_for_task(task_gid, limit=limit, offset=offset, opt_fields=opt_fields) - pprint(api_response) + # Get dependencies from a task + api_response = api_instance.get_dependencies_for_task(task_gid, limit=limit, offset=offset, opt_fields=opt_fields) + pprint(api_response) except ApiException as e: - print("Exception when calling TasksApi->get_dependencies_for_task: %s\n" % e) + print("Exception when calling TasksApi->get_dependencies_for_task: %s\n" % e) get_dependents_for_task: |- import asana from asana.rest import ApiException @@ -211,20 +221,21 @@ TasksApi: # Configure OAuth2 access token for authorization: oauth2 configuration = asana.Configuration() configuration.access_token = '' + api_client = asana.ApiClient(configuration) # create an instance of the API class - api_instance = asana.TasksApi(asana.ApiClient(configuration)) + api_instance = asana.TasksApi(api_client) task_gid = '321654' # str | The task to operate on. limit = 50 # int | Results per page. The number of objects to return per page. The value must be between 1 and 100. (optional) offset = 'eyJ0eXAiOJiKV1iQLCJhbGciOiJIUzI1NiJ9' # 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.' (optional) opt_fields = ["actual_time_minutes","approval_status","assignee","assignee.name","assignee_section","assignee_section.name","assignee_status","completed","completed_at","completed_by","completed_by.name","created_at","created_by","custom_fields","custom_fields.asana_created_field","custom_fields.created_by","custom_fields.created_by.name","custom_fields.currency_code","custom_fields.custom_label","custom_fields.custom_label_position","custom_fields.date_value","custom_fields.date_value.date","custom_fields.date_value.date_time","custom_fields.description","custom_fields.display_value","custom_fields.enabled","custom_fields.enum_options","custom_fields.enum_options.color","custom_fields.enum_options.enabled","custom_fields.enum_options.name","custom_fields.enum_value","custom_fields.enum_value.color","custom_fields.enum_value.enabled","custom_fields.enum_value.name","custom_fields.format","custom_fields.has_notifications_enabled","custom_fields.is_formula_field","custom_fields.is_global_to_workspace","custom_fields.is_value_read_only","custom_fields.multi_enum_values","custom_fields.multi_enum_values.color","custom_fields.multi_enum_values.enabled","custom_fields.multi_enum_values.name","custom_fields.name","custom_fields.number_value","custom_fields.people_value","custom_fields.people_value.name","custom_fields.precision","custom_fields.resource_subtype","custom_fields.text_value","custom_fields.type","dependencies","dependents","due_at","due_on","external","external.data","followers","followers.name","hearted","hearts","hearts.user","hearts.user.name","html_notes","is_rendered_as_separator","liked","likes","likes.user","likes.user.name","memberships","memberships.project","memberships.project.name","memberships.section","memberships.section.name","modified_at","name","notes","num_hearts","num_likes","num_subtasks","offset","parent","parent.created_by","parent.name","parent.resource_subtype","path","permalink_url","projects","projects.name","resource_subtype","start_at","start_on","tags","tags.name","uri","workspace","workspace.name"] # list[str] | This endpoint returns a compact resource, which excludes some properties by default. To include those optional properties, set this query parameter to a comma-separated list of the properties you wish to include. (optional) try: - # Get dependents from a task - api_response = api_instance.get_dependents_for_task(task_gid, limit=limit, offset=offset, opt_fields=opt_fields) - pprint(api_response) + # Get dependents from a task + api_response = api_instance.get_dependents_for_task(task_gid, limit=limit, offset=offset, opt_fields=opt_fields) + pprint(api_response) except ApiException as e: - print("Exception when calling TasksApi->get_dependents_for_task: %s\n" % e) + print("Exception when calling TasksApi->get_dependents_for_task: %s\n" % e) get_subtasks_for_task: |- import asana from asana.rest import ApiException @@ -233,20 +244,21 @@ TasksApi: # Configure OAuth2 access token for authorization: oauth2 configuration = asana.Configuration() configuration.access_token = '' + api_client = asana.ApiClient(configuration) # create an instance of the API class - api_instance = asana.TasksApi(asana.ApiClient(configuration)) + api_instance = asana.TasksApi(api_client) task_gid = '321654' # str | The task to operate on. limit = 50 # int | Results per page. The number of objects to return per page. The value must be between 1 and 100. (optional) offset = 'eyJ0eXAiOJiKV1iQLCJhbGciOiJIUzI1NiJ9' # 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.' (optional) opt_fields = ["actual_time_minutes","approval_status","assignee","assignee.name","assignee_section","assignee_section.name","assignee_status","completed","completed_at","completed_by","completed_by.name","created_at","created_by","custom_fields","custom_fields.asana_created_field","custom_fields.created_by","custom_fields.created_by.name","custom_fields.currency_code","custom_fields.custom_label","custom_fields.custom_label_position","custom_fields.date_value","custom_fields.date_value.date","custom_fields.date_value.date_time","custom_fields.description","custom_fields.display_value","custom_fields.enabled","custom_fields.enum_options","custom_fields.enum_options.color","custom_fields.enum_options.enabled","custom_fields.enum_options.name","custom_fields.enum_value","custom_fields.enum_value.color","custom_fields.enum_value.enabled","custom_fields.enum_value.name","custom_fields.format","custom_fields.has_notifications_enabled","custom_fields.is_formula_field","custom_fields.is_global_to_workspace","custom_fields.is_value_read_only","custom_fields.multi_enum_values","custom_fields.multi_enum_values.color","custom_fields.multi_enum_values.enabled","custom_fields.multi_enum_values.name","custom_fields.name","custom_fields.number_value","custom_fields.people_value","custom_fields.people_value.name","custom_fields.precision","custom_fields.resource_subtype","custom_fields.text_value","custom_fields.type","dependencies","dependents","due_at","due_on","external","external.data","followers","followers.name","hearted","hearts","hearts.user","hearts.user.name","html_notes","is_rendered_as_separator","liked","likes","likes.user","likes.user.name","memberships","memberships.project","memberships.project.name","memberships.section","memberships.section.name","modified_at","name","notes","num_hearts","num_likes","num_subtasks","offset","parent","parent.created_by","parent.name","parent.resource_subtype","path","permalink_url","projects","projects.name","resource_subtype","start_at","start_on","tags","tags.name","uri","workspace","workspace.name"] # list[str] | This endpoint returns a compact resource, which excludes some properties by default. To include those optional properties, set this query parameter to a comma-separated list of the properties you wish to include. (optional) try: - # Get subtasks from a task - api_response = api_instance.get_subtasks_for_task(task_gid, limit=limit, offset=offset, opt_fields=opt_fields) - pprint(api_response) + # Get subtasks from a task + api_response = api_instance.get_subtasks_for_task(task_gid, limit=limit, offset=offset, opt_fields=opt_fields) + pprint(api_response) except ApiException as e: - print("Exception when calling TasksApi->get_subtasks_for_task: %s\n" % e) + print("Exception when calling TasksApi->get_subtasks_for_task: %s\n" % e) get_task: |- import asana from asana.rest import ApiException @@ -255,18 +267,19 @@ TasksApi: # Configure OAuth2 access token for authorization: oauth2 configuration = asana.Configuration() configuration.access_token = '' + api_client = asana.ApiClient(configuration) # create an instance of the API class - api_instance = asana.TasksApi(asana.ApiClient(configuration)) + api_instance = asana.TasksApi(api_client) task_gid = '321654' # str | The task to operate on. opt_fields = ["actual_time_minutes","approval_status","assignee","assignee.name","assignee_section","assignee_section.name","assignee_status","completed","completed_at","completed_by","completed_by.name","created_at","created_by","custom_fields","custom_fields.asana_created_field","custom_fields.created_by","custom_fields.created_by.name","custom_fields.currency_code","custom_fields.custom_label","custom_fields.custom_label_position","custom_fields.date_value","custom_fields.date_value.date","custom_fields.date_value.date_time","custom_fields.description","custom_fields.display_value","custom_fields.enabled","custom_fields.enum_options","custom_fields.enum_options.color","custom_fields.enum_options.enabled","custom_fields.enum_options.name","custom_fields.enum_value","custom_fields.enum_value.color","custom_fields.enum_value.enabled","custom_fields.enum_value.name","custom_fields.format","custom_fields.has_notifications_enabled","custom_fields.is_formula_field","custom_fields.is_global_to_workspace","custom_fields.is_value_read_only","custom_fields.multi_enum_values","custom_fields.multi_enum_values.color","custom_fields.multi_enum_values.enabled","custom_fields.multi_enum_values.name","custom_fields.name","custom_fields.number_value","custom_fields.people_value","custom_fields.people_value.name","custom_fields.precision","custom_fields.resource_subtype","custom_fields.text_value","custom_fields.type","dependencies","dependents","due_at","due_on","external","external.data","followers","followers.name","hearted","hearts","hearts.user","hearts.user.name","html_notes","is_rendered_as_separator","liked","likes","likes.user","likes.user.name","memberships","memberships.project","memberships.project.name","memberships.section","memberships.section.name","modified_at","name","notes","num_hearts","num_likes","num_subtasks","parent","parent.created_by","parent.name","parent.resource_subtype","permalink_url","projects","projects.name","resource_subtype","start_at","start_on","tags","tags.name","workspace","workspace.name"] # list[str] | This endpoint returns a compact resource, which excludes some properties by default. To include those optional properties, set this query parameter to a comma-separated list of the properties you wish to include. (optional) try: - # Get a task - api_response = api_instance.get_task(task_gid, opt_fields=opt_fields) - pprint(api_response) + # Get a task + api_response = api_instance.get_task(task_gid, opt_fields=opt_fields) + pprint(api_response) except ApiException as e: - print("Exception when calling TasksApi->get_task: %s\n" % e) + print("Exception when calling TasksApi->get_task: %s\n" % e) get_tasks: |- import asana from asana.rest import ApiException @@ -275,9 +288,10 @@ TasksApi: # Configure OAuth2 access token for authorization: oauth2 configuration = asana.Configuration() configuration.access_token = '' + api_client = asana.ApiClient(configuration) # create an instance of the API class - api_instance = asana.TasksApi(asana.ApiClient(configuration)) + api_instance = asana.TasksApi(api_client) limit = 50 # int | Results per page. The number of objects to return per page. The value must be between 1 and 100. (optional) offset = 'eyJ0eXAiOJiKV1iQLCJhbGciOiJIUzI1NiJ9' # 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.' (optional) assignee = '14641' # 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.* (optional) @@ -289,11 +303,11 @@ TasksApi: opt_fields = ["actual_time_minutes","approval_status","assignee","assignee.name","assignee_section","assignee_section.name","assignee_status","completed","completed_at","completed_by","completed_by.name","created_at","created_by","custom_fields","custom_fields.asana_created_field","custom_fields.created_by","custom_fields.created_by.name","custom_fields.currency_code","custom_fields.custom_label","custom_fields.custom_label_position","custom_fields.date_value","custom_fields.date_value.date","custom_fields.date_value.date_time","custom_fields.description","custom_fields.display_value","custom_fields.enabled","custom_fields.enum_options","custom_fields.enum_options.color","custom_fields.enum_options.enabled","custom_fields.enum_options.name","custom_fields.enum_value","custom_fields.enum_value.color","custom_fields.enum_value.enabled","custom_fields.enum_value.name","custom_fields.format","custom_fields.has_notifications_enabled","custom_fields.is_formula_field","custom_fields.is_global_to_workspace","custom_fields.is_value_read_only","custom_fields.multi_enum_values","custom_fields.multi_enum_values.color","custom_fields.multi_enum_values.enabled","custom_fields.multi_enum_values.name","custom_fields.name","custom_fields.number_value","custom_fields.people_value","custom_fields.people_value.name","custom_fields.precision","custom_fields.resource_subtype","custom_fields.text_value","custom_fields.type","dependencies","dependents","due_at","due_on","external","external.data","followers","followers.name","hearted","hearts","hearts.user","hearts.user.name","html_notes","is_rendered_as_separator","liked","likes","likes.user","likes.user.name","memberships","memberships.project","memberships.project.name","memberships.section","memberships.section.name","modified_at","name","notes","num_hearts","num_likes","num_subtasks","offset","parent","parent.created_by","parent.name","parent.resource_subtype","path","permalink_url","projects","projects.name","resource_subtype","start_at","start_on","tags","tags.name","uri","workspace","workspace.name"] # list[str] | This endpoint returns a compact resource, which excludes some properties by default. To include those optional properties, set this query parameter to a comma-separated list of the properties you wish to include. (optional) try: - # Get multiple tasks - api_response = api_instance.get_tasks(limit=limit, offset=offset, assignee=assignee, project=project, section=section, workspace=workspace, completed_since=completed_since, modified_since=modified_since, opt_fields=opt_fields) - pprint(api_response) + # Get multiple tasks + api_response = api_instance.get_tasks(limit=limit, offset=offset, assignee=assignee, project=project, section=section, workspace=workspace, completed_since=completed_since, modified_since=modified_since, opt_fields=opt_fields) + pprint(api_response) except ApiException as e: - print("Exception when calling TasksApi->get_tasks: %s\n" % e) + print("Exception when calling TasksApi->get_tasks: %s\n" % e) get_tasks_for_project: |- import asana from asana.rest import ApiException @@ -302,9 +316,10 @@ TasksApi: # Configure OAuth2 access token for authorization: oauth2 configuration = asana.Configuration() configuration.access_token = '' + api_client = asana.ApiClient(configuration) # create an instance of the API class - api_instance = asana.TasksApi(asana.ApiClient(configuration)) + api_instance = asana.TasksApi(api_client) project_gid = '1331' # str | Globally unique identifier for the project. completed_since = '2012-02-22T02:06:58.158Z' # 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*. (optional) limit = 50 # int | Results per page. The number of objects to return per page. The value must be between 1 and 100. (optional) @@ -312,11 +327,11 @@ TasksApi: opt_fields = ["actual_time_minutes","approval_status","assignee","assignee.name","assignee_section","assignee_section.name","assignee_status","completed","completed_at","completed_by","completed_by.name","created_at","created_by","custom_fields","custom_fields.asana_created_field","custom_fields.created_by","custom_fields.created_by.name","custom_fields.currency_code","custom_fields.custom_label","custom_fields.custom_label_position","custom_fields.date_value","custom_fields.date_value.date","custom_fields.date_value.date_time","custom_fields.description","custom_fields.display_value","custom_fields.enabled","custom_fields.enum_options","custom_fields.enum_options.color","custom_fields.enum_options.enabled","custom_fields.enum_options.name","custom_fields.enum_value","custom_fields.enum_value.color","custom_fields.enum_value.enabled","custom_fields.enum_value.name","custom_fields.format","custom_fields.has_notifications_enabled","custom_fields.is_formula_field","custom_fields.is_global_to_workspace","custom_fields.is_value_read_only","custom_fields.multi_enum_values","custom_fields.multi_enum_values.color","custom_fields.multi_enum_values.enabled","custom_fields.multi_enum_values.name","custom_fields.name","custom_fields.number_value","custom_fields.people_value","custom_fields.people_value.name","custom_fields.precision","custom_fields.resource_subtype","custom_fields.text_value","custom_fields.type","dependencies","dependents","due_at","due_on","external","external.data","followers","followers.name","hearted","hearts","hearts.user","hearts.user.name","html_notes","is_rendered_as_separator","liked","likes","likes.user","likes.user.name","memberships","memberships.project","memberships.project.name","memberships.section","memberships.section.name","modified_at","name","notes","num_hearts","num_likes","num_subtasks","offset","parent","parent.created_by","parent.name","parent.resource_subtype","path","permalink_url","projects","projects.name","resource_subtype","start_at","start_on","tags","tags.name","uri","workspace","workspace.name"] # list[str] | This endpoint returns a compact resource, which excludes some properties by default. To include those optional properties, set this query parameter to a comma-separated list of the properties you wish to include. (optional) try: - # Get tasks from a project - api_response = api_instance.get_tasks_for_project(project_gid, completed_since=completed_since, limit=limit, offset=offset, opt_fields=opt_fields) - pprint(api_response) + # Get tasks from a project + api_response = api_instance.get_tasks_for_project(project_gid, completed_since=completed_since, limit=limit, offset=offset, opt_fields=opt_fields) + pprint(api_response) except ApiException as e: - print("Exception when calling TasksApi->get_tasks_for_project: %s\n" % e) + print("Exception when calling TasksApi->get_tasks_for_project: %s\n" % e) get_tasks_for_section: |- import asana from asana.rest import ApiException @@ -325,20 +340,21 @@ TasksApi: # Configure OAuth2 access token for authorization: oauth2 configuration = asana.Configuration() configuration.access_token = '' + api_client = asana.ApiClient(configuration) # create an instance of the API class - api_instance = asana.TasksApi(asana.ApiClient(configuration)) + api_instance = asana.TasksApi(api_client) section_gid = '321654' # str | The globally unique identifier for the section. limit = 50 # int | Results per page. The number of objects to return per page. The value must be between 1 and 100. (optional) offset = 'eyJ0eXAiOJiKV1iQLCJhbGciOiJIUzI1NiJ9' # 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.' (optional) opt_fields = ["actual_time_minutes","approval_status","assignee","assignee.name","assignee_section","assignee_section.name","assignee_status","completed","completed_at","completed_by","completed_by.name","created_at","created_by","custom_fields","custom_fields.asana_created_field","custom_fields.created_by","custom_fields.created_by.name","custom_fields.currency_code","custom_fields.custom_label","custom_fields.custom_label_position","custom_fields.date_value","custom_fields.date_value.date","custom_fields.date_value.date_time","custom_fields.description","custom_fields.display_value","custom_fields.enabled","custom_fields.enum_options","custom_fields.enum_options.color","custom_fields.enum_options.enabled","custom_fields.enum_options.name","custom_fields.enum_value","custom_fields.enum_value.color","custom_fields.enum_value.enabled","custom_fields.enum_value.name","custom_fields.format","custom_fields.has_notifications_enabled","custom_fields.is_formula_field","custom_fields.is_global_to_workspace","custom_fields.is_value_read_only","custom_fields.multi_enum_values","custom_fields.multi_enum_values.color","custom_fields.multi_enum_values.enabled","custom_fields.multi_enum_values.name","custom_fields.name","custom_fields.number_value","custom_fields.people_value","custom_fields.people_value.name","custom_fields.precision","custom_fields.resource_subtype","custom_fields.text_value","custom_fields.type","dependencies","dependents","due_at","due_on","external","external.data","followers","followers.name","hearted","hearts","hearts.user","hearts.user.name","html_notes","is_rendered_as_separator","liked","likes","likes.user","likes.user.name","memberships","memberships.project","memberships.project.name","memberships.section","memberships.section.name","modified_at","name","notes","num_hearts","num_likes","num_subtasks","offset","parent","parent.created_by","parent.name","parent.resource_subtype","path","permalink_url","projects","projects.name","resource_subtype","start_at","start_on","tags","tags.name","uri","workspace","workspace.name"] # list[str] | This endpoint returns a compact resource, which excludes some properties by default. To include those optional properties, set this query parameter to a comma-separated list of the properties you wish to include. (optional) try: - # Get tasks from a section - api_response = api_instance.get_tasks_for_section(section_gid, limit=limit, offset=offset, opt_fields=opt_fields) - pprint(api_response) + # Get tasks from a section + api_response = api_instance.get_tasks_for_section(section_gid, limit=limit, offset=offset, opt_fields=opt_fields) + pprint(api_response) except ApiException as e: - print("Exception when calling TasksApi->get_tasks_for_section: %s\n" % e) + print("Exception when calling TasksApi->get_tasks_for_section: %s\n" % e) get_tasks_for_tag: |- import asana from asana.rest import ApiException @@ -347,20 +363,21 @@ TasksApi: # Configure OAuth2 access token for authorization: oauth2 configuration = asana.Configuration() configuration.access_token = '' + api_client = asana.ApiClient(configuration) # create an instance of the API class - api_instance = asana.TasksApi(asana.ApiClient(configuration)) + api_instance = asana.TasksApi(api_client) tag_gid = '11235' # str | Globally unique identifier for the tag. limit = 50 # int | Results per page. The number of objects to return per page. The value must be between 1 and 100. (optional) offset = 'eyJ0eXAiOJiKV1iQLCJhbGciOiJIUzI1NiJ9' # 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.' (optional) opt_fields = ["actual_time_minutes","approval_status","assignee","assignee.name","assignee_section","assignee_section.name","assignee_status","completed","completed_at","completed_by","completed_by.name","created_at","created_by","custom_fields","custom_fields.asana_created_field","custom_fields.created_by","custom_fields.created_by.name","custom_fields.currency_code","custom_fields.custom_label","custom_fields.custom_label_position","custom_fields.date_value","custom_fields.date_value.date","custom_fields.date_value.date_time","custom_fields.description","custom_fields.display_value","custom_fields.enabled","custom_fields.enum_options","custom_fields.enum_options.color","custom_fields.enum_options.enabled","custom_fields.enum_options.name","custom_fields.enum_value","custom_fields.enum_value.color","custom_fields.enum_value.enabled","custom_fields.enum_value.name","custom_fields.format","custom_fields.has_notifications_enabled","custom_fields.is_formula_field","custom_fields.is_global_to_workspace","custom_fields.is_value_read_only","custom_fields.multi_enum_values","custom_fields.multi_enum_values.color","custom_fields.multi_enum_values.enabled","custom_fields.multi_enum_values.name","custom_fields.name","custom_fields.number_value","custom_fields.people_value","custom_fields.people_value.name","custom_fields.precision","custom_fields.resource_subtype","custom_fields.text_value","custom_fields.type","dependencies","dependents","due_at","due_on","external","external.data","followers","followers.name","hearted","hearts","hearts.user","hearts.user.name","html_notes","is_rendered_as_separator","liked","likes","likes.user","likes.user.name","memberships","memberships.project","memberships.project.name","memberships.section","memberships.section.name","modified_at","name","notes","num_hearts","num_likes","num_subtasks","offset","parent","parent.created_by","parent.name","parent.resource_subtype","path","permalink_url","projects","projects.name","resource_subtype","start_at","start_on","tags","tags.name","uri","workspace","workspace.name"] # list[str] | This endpoint returns a compact resource, which excludes some properties by default. To include those optional properties, set this query parameter to a comma-separated list of the properties you wish to include. (optional) try: - # Get tasks from a tag - api_response = api_instance.get_tasks_for_tag(tag_gid, limit=limit, offset=offset, opt_fields=opt_fields) - pprint(api_response) + # Get tasks from a tag + api_response = api_instance.get_tasks_for_tag(tag_gid, limit=limit, offset=offset, opt_fields=opt_fields) + pprint(api_response) except ApiException as e: - print("Exception when calling TasksApi->get_tasks_for_tag: %s\n" % e) + print("Exception when calling TasksApi->get_tasks_for_tag: %s\n" % e) get_tasks_for_user_task_list: |- import asana from asana.rest import ApiException @@ -369,9 +386,10 @@ TasksApi: # Configure OAuth2 access token for authorization: oauth2 configuration = asana.Configuration() configuration.access_token = '' + api_client = asana.ApiClient(configuration) # create an instance of the API class - api_instance = asana.TasksApi(asana.ApiClient(configuration)) + api_instance = asana.TasksApi(api_client) user_task_list_gid = '12345' # str | Globally unique identifier for the user task list. completed_since = '2012-02-22T02:06:58.158Z' # 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*. (optional) limit = 50 # int | Results per page. The number of objects to return per page. The value must be between 1 and 100. (optional) @@ -379,11 +397,11 @@ TasksApi: opt_fields = ["actual_time_minutes","approval_status","assignee","assignee.name","assignee_section","assignee_section.name","assignee_status","completed","completed_at","completed_by","completed_by.name","created_at","created_by","custom_fields","custom_fields.asana_created_field","custom_fields.created_by","custom_fields.created_by.name","custom_fields.currency_code","custom_fields.custom_label","custom_fields.custom_label_position","custom_fields.date_value","custom_fields.date_value.date","custom_fields.date_value.date_time","custom_fields.description","custom_fields.display_value","custom_fields.enabled","custom_fields.enum_options","custom_fields.enum_options.color","custom_fields.enum_options.enabled","custom_fields.enum_options.name","custom_fields.enum_value","custom_fields.enum_value.color","custom_fields.enum_value.enabled","custom_fields.enum_value.name","custom_fields.format","custom_fields.has_notifications_enabled","custom_fields.is_formula_field","custom_fields.is_global_to_workspace","custom_fields.is_value_read_only","custom_fields.multi_enum_values","custom_fields.multi_enum_values.color","custom_fields.multi_enum_values.enabled","custom_fields.multi_enum_values.name","custom_fields.name","custom_fields.number_value","custom_fields.people_value","custom_fields.people_value.name","custom_fields.precision","custom_fields.resource_subtype","custom_fields.text_value","custom_fields.type","dependencies","dependents","due_at","due_on","external","external.data","followers","followers.name","hearted","hearts","hearts.user","hearts.user.name","html_notes","is_rendered_as_separator","liked","likes","likes.user","likes.user.name","memberships","memberships.project","memberships.project.name","memberships.section","memberships.section.name","modified_at","name","notes","num_hearts","num_likes","num_subtasks","offset","parent","parent.created_by","parent.name","parent.resource_subtype","path","permalink_url","projects","projects.name","resource_subtype","start_at","start_on","tags","tags.name","uri","workspace","workspace.name"] # list[str] | This endpoint returns a compact resource, which excludes some properties by default. To include those optional properties, set this query parameter to a comma-separated list of the properties you wish to include. (optional) try: - # Get tasks from a user task list - api_response = api_instance.get_tasks_for_user_task_list(user_task_list_gid, completed_since=completed_since, limit=limit, offset=offset, opt_fields=opt_fields) - pprint(api_response) + # Get tasks from a user task list + api_response = api_instance.get_tasks_for_user_task_list(user_task_list_gid, completed_since=completed_since, limit=limit, offset=offset, opt_fields=opt_fields) + pprint(api_response) except ApiException as e: - print("Exception when calling TasksApi->get_tasks_for_user_task_list: %s\n" % e) + print("Exception when calling TasksApi->get_tasks_for_user_task_list: %s\n" % e) remove_dependencies_for_task: |- import asana from asana.rest import ApiException @@ -392,18 +410,19 @@ TasksApi: # Configure OAuth2 access token for authorization: oauth2 configuration = asana.Configuration() configuration.access_token = '' + api_client = asana.ApiClient(configuration) # create an instance of the API class - api_instance = asana.TasksApi(asana.ApiClient(configuration)) + api_instance = asana.TasksApi(api_client) body = asana.TaskGidRemoveDependenciesBody({"param1": "value1", "param2": "value2",}) # TaskGidRemoveDependenciesBody | The list of tasks to unlink as dependencies. task_gid = '321654' # str | The task to operate on. try: - # Unlink dependencies from a task - api_response = api_instance.remove_dependencies_for_task(body, task_gid) - pprint(api_response) + # Unlink dependencies from a task + api_response = api_instance.remove_dependencies_for_task(body, task_gid) + pprint(api_response) except ApiException as e: - print("Exception when calling TasksApi->remove_dependencies_for_task: %s\n" % e) + print("Exception when calling TasksApi->remove_dependencies_for_task: %s\n" % e) remove_dependents_for_task: |- import asana from asana.rest import ApiException @@ -412,18 +431,19 @@ TasksApi: # Configure OAuth2 access token for authorization: oauth2 configuration = asana.Configuration() configuration.access_token = '' + api_client = asana.ApiClient(configuration) # create an instance of the API class - api_instance = asana.TasksApi(asana.ApiClient(configuration)) + api_instance = asana.TasksApi(api_client) body = asana.TaskGidRemoveDependentsBody({"param1": "value1", "param2": "value2",}) # TaskGidRemoveDependentsBody | The list of tasks to remove as dependents. task_gid = '321654' # str | The task to operate on. try: - # Unlink dependents from a task - api_response = api_instance.remove_dependents_for_task(body, task_gid) - pprint(api_response) + # Unlink dependents from a task + api_response = api_instance.remove_dependents_for_task(body, task_gid) + pprint(api_response) except ApiException as e: - print("Exception when calling TasksApi->remove_dependents_for_task: %s\n" % e) + print("Exception when calling TasksApi->remove_dependents_for_task: %s\n" % e) remove_follower_for_task: |- import asana from asana.rest import ApiException @@ -432,19 +452,20 @@ TasksApi: # Configure OAuth2 access token for authorization: oauth2 configuration = asana.Configuration() configuration.access_token = '' + api_client = asana.ApiClient(configuration) # create an instance of the API class - api_instance = asana.TasksApi(asana.ApiClient(configuration)) + api_instance = asana.TasksApi(api_client) body = asana.TaskGidRemoveFollowersBody({"param1": "value1", "param2": "value2",}) # TaskGidRemoveFollowersBody | The followers to remove from the task. task_gid = '321654' # str | The task to operate on. opt_fields = ["actual_time_minutes","approval_status","assignee","assignee.name","assignee_section","assignee_section.name","assignee_status","completed","completed_at","completed_by","completed_by.name","created_at","created_by","custom_fields","custom_fields.asana_created_field","custom_fields.created_by","custom_fields.created_by.name","custom_fields.currency_code","custom_fields.custom_label","custom_fields.custom_label_position","custom_fields.date_value","custom_fields.date_value.date","custom_fields.date_value.date_time","custom_fields.description","custom_fields.display_value","custom_fields.enabled","custom_fields.enum_options","custom_fields.enum_options.color","custom_fields.enum_options.enabled","custom_fields.enum_options.name","custom_fields.enum_value","custom_fields.enum_value.color","custom_fields.enum_value.enabled","custom_fields.enum_value.name","custom_fields.format","custom_fields.has_notifications_enabled","custom_fields.is_formula_field","custom_fields.is_global_to_workspace","custom_fields.is_value_read_only","custom_fields.multi_enum_values","custom_fields.multi_enum_values.color","custom_fields.multi_enum_values.enabled","custom_fields.multi_enum_values.name","custom_fields.name","custom_fields.number_value","custom_fields.people_value","custom_fields.people_value.name","custom_fields.precision","custom_fields.resource_subtype","custom_fields.text_value","custom_fields.type","dependencies","dependents","due_at","due_on","external","external.data","followers","followers.name","hearted","hearts","hearts.user","hearts.user.name","html_notes","is_rendered_as_separator","liked","likes","likes.user","likes.user.name","memberships","memberships.project","memberships.project.name","memberships.section","memberships.section.name","modified_at","name","notes","num_hearts","num_likes","num_subtasks","parent","parent.created_by","parent.name","parent.resource_subtype","permalink_url","projects","projects.name","resource_subtype","start_at","start_on","tags","tags.name","workspace","workspace.name"] # list[str] | This endpoint returns a compact resource, which excludes some properties by default. To include those optional properties, set this query parameter to a comma-separated list of the properties you wish to include. (optional) try: - # Remove followers from a task - api_response = api_instance.remove_follower_for_task(body, task_gid, opt_fields=opt_fields) - pprint(api_response) + # Remove followers from a task + api_response = api_instance.remove_follower_for_task(body, task_gid, opt_fields=opt_fields) + pprint(api_response) except ApiException as e: - print("Exception when calling TasksApi->remove_follower_for_task: %s\n" % e) + print("Exception when calling TasksApi->remove_follower_for_task: %s\n" % e) remove_project_for_task: |- import asana from asana.rest import ApiException @@ -453,18 +474,19 @@ TasksApi: # Configure OAuth2 access token for authorization: oauth2 configuration = asana.Configuration() configuration.access_token = '' + api_client = asana.ApiClient(configuration) # create an instance of the API class - api_instance = asana.TasksApi(asana.ApiClient(configuration)) + api_instance = asana.TasksApi(api_client) body = asana.TaskGidRemoveProjectBody({"param1": "value1", "param2": "value2",}) # TaskGidRemoveProjectBody | The project to remove the task from. task_gid = '321654' # str | The task to operate on. try: - # Remove a project from a task - api_response = api_instance.remove_project_for_task(body, task_gid) - pprint(api_response) + # Remove a project from a task + api_response = api_instance.remove_project_for_task(body, task_gid) + pprint(api_response) except ApiException as e: - print("Exception when calling TasksApi->remove_project_for_task: %s\n" % e) + print("Exception when calling TasksApi->remove_project_for_task: %s\n" % e) remove_tag_for_task: |- import asana from asana.rest import ApiException @@ -473,18 +495,19 @@ TasksApi: # Configure OAuth2 access token for authorization: oauth2 configuration = asana.Configuration() configuration.access_token = '' + api_client = asana.ApiClient(configuration) # create an instance of the API class - api_instance = asana.TasksApi(asana.ApiClient(configuration)) + api_instance = asana.TasksApi(api_client) body = asana.TaskGidRemoveTagBody({"param1": "value1", "param2": "value2",}) # TaskGidRemoveTagBody | The tag to remove from the task. task_gid = '321654' # str | The task to operate on. try: - # Remove a tag from a task - api_response = api_instance.remove_tag_for_task(body, task_gid) - pprint(api_response) + # Remove a tag from a task + api_response = api_instance.remove_tag_for_task(body, task_gid) + pprint(api_response) except ApiException as e: - print("Exception when calling TasksApi->remove_tag_for_task: %s\n" % e) + print("Exception when calling TasksApi->remove_tag_for_task: %s\n" % e) search_tasks_for_workspace: |- import asana from asana.rest import ApiException @@ -493,9 +516,10 @@ TasksApi: # Configure OAuth2 access token for authorization: oauth2 configuration = asana.Configuration() configuration.access_token = '' + api_client = asana.ApiClient(configuration) # create an instance of the API class - api_instance = asana.TasksApi(asana.ApiClient(configuration)) + api_instance = asana.TasksApi(api_client) workspace_gid = '12345' # str | Globally unique identifier for the workspace or organization. text = 'Bug' # str | Performs full-text search on both task name and description (optional) resource_subtype = 'milestone' # str | Filters results by the task's resource_subtype (optional) (default to milestone) @@ -552,11 +576,11 @@ TasksApi: opt_fields = ["actual_time_minutes","approval_status","assignee","assignee.name","assignee_section","assignee_section.name","assignee_status","completed","completed_at","completed_by","completed_by.name","created_at","created_by","custom_fields","custom_fields.asana_created_field","custom_fields.created_by","custom_fields.created_by.name","custom_fields.currency_code","custom_fields.custom_label","custom_fields.custom_label_position","custom_fields.date_value","custom_fields.date_value.date","custom_fields.date_value.date_time","custom_fields.description","custom_fields.display_value","custom_fields.enabled","custom_fields.enum_options","custom_fields.enum_options.color","custom_fields.enum_options.enabled","custom_fields.enum_options.name","custom_fields.enum_value","custom_fields.enum_value.color","custom_fields.enum_value.enabled","custom_fields.enum_value.name","custom_fields.format","custom_fields.has_notifications_enabled","custom_fields.is_formula_field","custom_fields.is_global_to_workspace","custom_fields.is_value_read_only","custom_fields.multi_enum_values","custom_fields.multi_enum_values.color","custom_fields.multi_enum_values.enabled","custom_fields.multi_enum_values.name","custom_fields.name","custom_fields.number_value","custom_fields.people_value","custom_fields.people_value.name","custom_fields.precision","custom_fields.resource_subtype","custom_fields.text_value","custom_fields.type","dependencies","dependents","due_at","due_on","external","external.data","followers","followers.name","hearted","hearts","hearts.user","hearts.user.name","html_notes","is_rendered_as_separator","liked","likes","likes.user","likes.user.name","memberships","memberships.project","memberships.project.name","memberships.section","memberships.section.name","modified_at","name","notes","num_hearts","num_likes","num_subtasks","parent","parent.created_by","parent.name","parent.resource_subtype","permalink_url","projects","projects.name","resource_subtype","start_at","start_on","tags","tags.name","workspace","workspace.name"] # list[str] | This endpoint returns a compact resource, which excludes some properties by default. To include those optional properties, set this query parameter to a comma-separated list of the properties you wish to include. (optional) try: - # Search tasks in a workspace - api_response = api_instance.search_tasks_for_workspace(workspace_gid, text=text, resource_subtype=resource_subtype, assignee_any=assignee_any, assignee_not=assignee_not, portfolios_any=portfolios_any, projects_any=projects_any, projects_not=projects_not, projects_all=projects_all, sections_any=sections_any, sections_not=sections_not, sections_all=sections_all, tags_any=tags_any, tags_not=tags_not, tags_all=tags_all, teams_any=teams_any, followers_not=followers_not, created_by_any=created_by_any, created_by_not=created_by_not, assigned_by_any=assigned_by_any, assigned_by_not=assigned_by_not, liked_by_not=liked_by_not, commented_on_by_not=commented_on_by_not, due_on_before=due_on_before, due_on_after=due_on_after, due_on=due_on, due_at_before=due_at_before, due_at_after=due_at_after, start_on_before=start_on_before, start_on_after=start_on_after, start_on=start_on, created_on_before=created_on_before, created_on_after=created_on_after, created_on=created_on, created_at_before=created_at_before, created_at_after=created_at_after, completed_on_before=completed_on_before, completed_on_after=completed_on_after, completed_on=completed_on, completed_at_before=completed_at_before, completed_at_after=completed_at_after, modified_on_before=modified_on_before, modified_on_after=modified_on_after, modified_on=modified_on, modified_at_before=modified_at_before, modified_at_after=modified_at_after, is_blocking=is_blocking, is_blocked=is_blocked, has_attachment=has_attachment, completed=completed, is_subtask=is_subtask, sort_by=sort_by, sort_ascending=sort_ascending, opt_fields=opt_fields) - pprint(api_response) + # Search tasks in a workspace + api_response = api_instance.search_tasks_for_workspace(workspace_gid, text=text, resource_subtype=resource_subtype, assignee_any=assignee_any, assignee_not=assignee_not, portfolios_any=portfolios_any, projects_any=projects_any, projects_not=projects_not, projects_all=projects_all, sections_any=sections_any, sections_not=sections_not, sections_all=sections_all, tags_any=tags_any, tags_not=tags_not, tags_all=tags_all, teams_any=teams_any, followers_not=followers_not, created_by_any=created_by_any, created_by_not=created_by_not, assigned_by_any=assigned_by_any, assigned_by_not=assigned_by_not, liked_by_not=liked_by_not, commented_on_by_not=commented_on_by_not, due_on_before=due_on_before, due_on_after=due_on_after, due_on=due_on, due_at_before=due_at_before, due_at_after=due_at_after, start_on_before=start_on_before, start_on_after=start_on_after, start_on=start_on, created_on_before=created_on_before, created_on_after=created_on_after, created_on=created_on, created_at_before=created_at_before, created_at_after=created_at_after, completed_on_before=completed_on_before, completed_on_after=completed_on_after, completed_on=completed_on, completed_at_before=completed_at_before, completed_at_after=completed_at_after, modified_on_before=modified_on_before, modified_on_after=modified_on_after, modified_on=modified_on, modified_at_before=modified_at_before, modified_at_after=modified_at_after, is_blocking=is_blocking, is_blocked=is_blocked, has_attachment=has_attachment, completed=completed, is_subtask=is_subtask, sort_by=sort_by, sort_ascending=sort_ascending, opt_fields=opt_fields) + pprint(api_response) except ApiException as e: - print("Exception when calling TasksApi->search_tasks_for_workspace: %s\n" % e) + print("Exception when calling TasksApi->search_tasks_for_workspace: %s\n" % e) set_parent_for_task: |- import asana from asana.rest import ApiException @@ -565,19 +589,20 @@ TasksApi: # Configure OAuth2 access token for authorization: oauth2 configuration = asana.Configuration() configuration.access_token = '' + api_client = asana.ApiClient(configuration) # create an instance of the API class - api_instance = asana.TasksApi(asana.ApiClient(configuration)) + api_instance = asana.TasksApi(api_client) body = asana.TaskGidSetParentBody({"param1": "value1", "param2": "value2",}) # TaskGidSetParentBody | The new parent of the subtask. task_gid = '321654' # str | The task to operate on. opt_fields = ["actual_time_minutes","approval_status","assignee","assignee.name","assignee_section","assignee_section.name","assignee_status","completed","completed_at","completed_by","completed_by.name","created_at","created_by","custom_fields","custom_fields.asana_created_field","custom_fields.created_by","custom_fields.created_by.name","custom_fields.currency_code","custom_fields.custom_label","custom_fields.custom_label_position","custom_fields.date_value","custom_fields.date_value.date","custom_fields.date_value.date_time","custom_fields.description","custom_fields.display_value","custom_fields.enabled","custom_fields.enum_options","custom_fields.enum_options.color","custom_fields.enum_options.enabled","custom_fields.enum_options.name","custom_fields.enum_value","custom_fields.enum_value.color","custom_fields.enum_value.enabled","custom_fields.enum_value.name","custom_fields.format","custom_fields.has_notifications_enabled","custom_fields.is_formula_field","custom_fields.is_global_to_workspace","custom_fields.is_value_read_only","custom_fields.multi_enum_values","custom_fields.multi_enum_values.color","custom_fields.multi_enum_values.enabled","custom_fields.multi_enum_values.name","custom_fields.name","custom_fields.number_value","custom_fields.people_value","custom_fields.people_value.name","custom_fields.precision","custom_fields.resource_subtype","custom_fields.text_value","custom_fields.type","dependencies","dependents","due_at","due_on","external","external.data","followers","followers.name","hearted","hearts","hearts.user","hearts.user.name","html_notes","is_rendered_as_separator","liked","likes","likes.user","likes.user.name","memberships","memberships.project","memberships.project.name","memberships.section","memberships.section.name","modified_at","name","notes","num_hearts","num_likes","num_subtasks","parent","parent.created_by","parent.name","parent.resource_subtype","permalink_url","projects","projects.name","resource_subtype","start_at","start_on","tags","tags.name","workspace","workspace.name"] # list[str] | This endpoint returns a compact resource, which excludes some properties by default. To include those optional properties, set this query parameter to a comma-separated list of the properties you wish to include. (optional) try: - # Set the parent of a task - api_response = api_instance.set_parent_for_task(body, task_gid, opt_fields=opt_fields) - pprint(api_response) + # Set the parent of a task + api_response = api_instance.set_parent_for_task(body, task_gid, opt_fields=opt_fields) + pprint(api_response) except ApiException as e: - print("Exception when calling TasksApi->set_parent_for_task: %s\n" % e) + print("Exception when calling TasksApi->set_parent_for_task: %s\n" % e) update_task: |- import asana from asana.rest import ApiException @@ -586,16 +611,17 @@ TasksApi: # Configure OAuth2 access token for authorization: oauth2 configuration = asana.Configuration() configuration.access_token = '' + api_client = asana.ApiClient(configuration) # create an instance of the API class - api_instance = asana.TasksApi(asana.ApiClient(configuration)) + api_instance = asana.TasksApi(api_client) body = asana.TasksTaskGidBody({"param1": "value1", "param2": "value2",}) # TasksTaskGidBody | The task to update. task_gid = '321654' # str | The task to operate on. opt_fields = ["actual_time_minutes","approval_status","assignee","assignee.name","assignee_section","assignee_section.name","assignee_status","completed","completed_at","completed_by","completed_by.name","created_at","created_by","custom_fields","custom_fields.asana_created_field","custom_fields.created_by","custom_fields.created_by.name","custom_fields.currency_code","custom_fields.custom_label","custom_fields.custom_label_position","custom_fields.date_value","custom_fields.date_value.date","custom_fields.date_value.date_time","custom_fields.description","custom_fields.display_value","custom_fields.enabled","custom_fields.enum_options","custom_fields.enum_options.color","custom_fields.enum_options.enabled","custom_fields.enum_options.name","custom_fields.enum_value","custom_fields.enum_value.color","custom_fields.enum_value.enabled","custom_fields.enum_value.name","custom_fields.format","custom_fields.has_notifications_enabled","custom_fields.is_formula_field","custom_fields.is_global_to_workspace","custom_fields.is_value_read_only","custom_fields.multi_enum_values","custom_fields.multi_enum_values.color","custom_fields.multi_enum_values.enabled","custom_fields.multi_enum_values.name","custom_fields.name","custom_fields.number_value","custom_fields.people_value","custom_fields.people_value.name","custom_fields.precision","custom_fields.resource_subtype","custom_fields.text_value","custom_fields.type","dependencies","dependents","due_at","due_on","external","external.data","followers","followers.name","hearted","hearts","hearts.user","hearts.user.name","html_notes","is_rendered_as_separator","liked","likes","likes.user","likes.user.name","memberships","memberships.project","memberships.project.name","memberships.section","memberships.section.name","modified_at","name","notes","num_hearts","num_likes","num_subtasks","parent","parent.created_by","parent.name","parent.resource_subtype","permalink_url","projects","projects.name","resource_subtype","start_at","start_on","tags","tags.name","workspace","workspace.name"] # list[str] | This endpoint returns a compact resource, which excludes some properties by default. To include those optional properties, set this query parameter to a comma-separated list of the properties you wish to include. (optional) try: - # Update a task - api_response = api_instance.update_task(body, task_gid, opt_fields=opt_fields) - pprint(api_response) + # Update a task + api_response = api_instance.update_task(body, task_gid, opt_fields=opt_fields) + pprint(api_response) except ApiException as e: - print("Exception when calling TasksApi->update_task: %s\n" % e) + print("Exception when calling TasksApi->update_task: %s\n" % e) diff --git a/docs/TeamMembershipsApi.md b/docs/TeamMembershipsApi.md index 61caac70..ee0bab31 100644 --- a/docs/TeamMembershipsApi.md +++ b/docs/TeamMembershipsApi.md @@ -25,18 +25,19 @@ from pprint import pprint # Configure OAuth2 access token for authorization: oauth2 configuration = asana.Configuration() configuration.access_token = '' +api_client = asana.ApiClient(configuration) # create an instance of the API class -api_instance = asana.TeamMembershipsApi(asana.ApiClient(configuration)) +api_instance = asana.TeamMembershipsApi(api_client) team_membership_gid = '724362' # str | opt_fields = ["is_admin","is_guest","is_limited_access","team","team.name","user","user.name"] # list[str] | This endpoint returns a compact resource, which excludes some properties by default. To include those optional properties, set this query parameter to a comma-separated list of the properties you wish to include. (optional) try: - # Get a team membership - api_response = api_instance.get_team_membership(team_membership_gid, opt_fields=opt_fields) - pprint(api_response) + # Get a team membership + api_response = api_instance.get_team_membership(team_membership_gid, opt_fields=opt_fields) + pprint(api_response) except ApiException as e: - print("Exception when calling TeamMembershipsApi->get_team_membership: %s\n" % e) + print("Exception when calling TeamMembershipsApi->get_team_membership: %s\n" % e) ``` ### Parameters @@ -77,9 +78,10 @@ from pprint import pprint # Configure OAuth2 access token for authorization: oauth2 configuration = asana.Configuration() configuration.access_token = '' +api_client = asana.ApiClient(configuration) # create an instance of the API class -api_instance = asana.TeamMembershipsApi(asana.ApiClient(configuration)) +api_instance = asana.TeamMembershipsApi(api_client) limit = 50 # int | Results per page. The number of objects to return per page. The value must be between 1 and 100. (optional) offset = 'eyJ0eXAiOJiKV1iQLCJhbGciOiJIUzI1NiJ9' # 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.' (optional) team = '159874' # str | Globally unique identifier for the team. (optional) @@ -88,11 +90,11 @@ workspace = '31326' # str | Globally unique identifier for the workspace. This p opt_fields = ["is_admin","is_guest","is_limited_access","offset","path","team","team.name","uri","user","user.name"] # list[str] | This endpoint returns a compact resource, which excludes some properties by default. To include those optional properties, set this query parameter to a comma-separated list of the properties you wish to include. (optional) try: - # Get team memberships - api_response = api_instance.get_team_memberships(limit=limit, offset=offset, team=team, user=user, workspace=workspace, opt_fields=opt_fields) - pprint(api_response) + # Get team memberships + api_response = api_instance.get_team_memberships(limit=limit, offset=offset, team=team, user=user, workspace=workspace, opt_fields=opt_fields) + pprint(api_response) except ApiException as e: - print("Exception when calling TeamMembershipsApi->get_team_memberships: %s\n" % e) + print("Exception when calling TeamMembershipsApi->get_team_memberships: %s\n" % e) ``` ### Parameters @@ -137,20 +139,21 @@ from pprint import pprint # Configure OAuth2 access token for authorization: oauth2 configuration = asana.Configuration() configuration.access_token = '' +api_client = asana.ApiClient(configuration) # create an instance of the API class -api_instance = asana.TeamMembershipsApi(asana.ApiClient(configuration)) +api_instance = asana.TeamMembershipsApi(api_client) team_gid = '159874' # str | Globally unique identifier for the team. limit = 50 # int | Results per page. The number of objects to return per page. The value must be between 1 and 100. (optional) offset = 'eyJ0eXAiOJiKV1iQLCJhbGciOiJIUzI1NiJ9' # 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.' (optional) opt_fields = ["is_admin","is_guest","is_limited_access","offset","path","team","team.name","uri","user","user.name"] # list[str] | This endpoint returns a compact resource, which excludes some properties by default. To include those optional properties, set this query parameter to a comma-separated list of the properties you wish to include. (optional) try: - # Get memberships from a team - api_response = api_instance.get_team_memberships_for_team(team_gid, limit=limit, offset=offset, opt_fields=opt_fields) - pprint(api_response) + # Get memberships from a team + api_response = api_instance.get_team_memberships_for_team(team_gid, limit=limit, offset=offset, opt_fields=opt_fields) + pprint(api_response) except ApiException as e: - print("Exception when calling TeamMembershipsApi->get_team_memberships_for_team: %s\n" % e) + print("Exception when calling TeamMembershipsApi->get_team_memberships_for_team: %s\n" % e) ``` ### Parameters @@ -193,9 +196,10 @@ from pprint import pprint # Configure OAuth2 access token for authorization: oauth2 configuration = asana.Configuration() configuration.access_token = '' +api_client = asana.ApiClient(configuration) # create an instance of the API class -api_instance = asana.TeamMembershipsApi(asana.ApiClient(configuration)) +api_instance = asana.TeamMembershipsApi(api_client) user_gid = 'me' # str | A string identifying a user. This can either be the string \"me\", an email, or the gid of a user. workspace = '31326' # str | Globally unique identifier for the workspace. limit = 50 # int | Results per page. The number of objects to return per page. The value must be between 1 and 100. (optional) @@ -203,11 +207,11 @@ offset = 'eyJ0eXAiOJiKV1iQLCJhbGciOiJIUzI1NiJ9' # str | Offset token. An offset opt_fields = ["is_admin","is_guest","is_limited_access","offset","path","team","team.name","uri","user","user.name"] # list[str] | This endpoint returns a compact resource, which excludes some properties by default. To include those optional properties, set this query parameter to a comma-separated list of the properties you wish to include. (optional) try: - # Get memberships from a user - api_response = api_instance.get_team_memberships_for_user(user_gid, workspace, limit=limit, offset=offset, opt_fields=opt_fields) - pprint(api_response) + # Get memberships from a user + api_response = api_instance.get_team_memberships_for_user(user_gid, workspace, limit=limit, offset=offset, opt_fields=opt_fields) + pprint(api_response) except ApiException as e: - print("Exception when calling TeamMembershipsApi->get_team_memberships_for_user: %s\n" % e) + print("Exception when calling TeamMembershipsApi->get_team_memberships_for_user: %s\n" % e) ``` ### Parameters diff --git a/docs/TeamMembershipsApi.yaml b/docs/TeamMembershipsApi.yaml index 96a3ec77..75ddcbbb 100644 --- a/docs/TeamMembershipsApi.yaml +++ b/docs/TeamMembershipsApi.yaml @@ -7,18 +7,19 @@ TeamMembershipsApi: # Configure OAuth2 access token for authorization: oauth2 configuration = asana.Configuration() configuration.access_token = '' + api_client = asana.ApiClient(configuration) # create an instance of the API class - api_instance = asana.TeamMembershipsApi(asana.ApiClient(configuration)) + api_instance = asana.TeamMembershipsApi(api_client) team_membership_gid = '724362' # str | opt_fields = ["is_admin","is_guest","is_limited_access","team","team.name","user","user.name"] # list[str] | This endpoint returns a compact resource, which excludes some properties by default. To include those optional properties, set this query parameter to a comma-separated list of the properties you wish to include. (optional) try: - # Get a team membership - api_response = api_instance.get_team_membership(team_membership_gid, opt_fields=opt_fields) - pprint(api_response) + # Get a team membership + api_response = api_instance.get_team_membership(team_membership_gid, opt_fields=opt_fields) + pprint(api_response) except ApiException as e: - print("Exception when calling TeamMembershipsApi->get_team_membership: %s\n" % e) + print("Exception when calling TeamMembershipsApi->get_team_membership: %s\n" % e) get_team_memberships: |- import asana from asana.rest import ApiException @@ -27,9 +28,10 @@ TeamMembershipsApi: # Configure OAuth2 access token for authorization: oauth2 configuration = asana.Configuration() configuration.access_token = '' + api_client = asana.ApiClient(configuration) # create an instance of the API class - api_instance = asana.TeamMembershipsApi(asana.ApiClient(configuration)) + api_instance = asana.TeamMembershipsApi(api_client) limit = 50 # int | Results per page. The number of objects to return per page. The value must be between 1 and 100. (optional) offset = 'eyJ0eXAiOJiKV1iQLCJhbGciOiJIUzI1NiJ9' # 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.' (optional) team = '159874' # str | Globally unique identifier for the team. (optional) @@ -38,11 +40,11 @@ TeamMembershipsApi: opt_fields = ["is_admin","is_guest","is_limited_access","offset","path","team","team.name","uri","user","user.name"] # list[str] | This endpoint returns a compact resource, which excludes some properties by default. To include those optional properties, set this query parameter to a comma-separated list of the properties you wish to include. (optional) try: - # Get team memberships - api_response = api_instance.get_team_memberships(limit=limit, offset=offset, team=team, user=user, workspace=workspace, opt_fields=opt_fields) - pprint(api_response) + # Get team memberships + api_response = api_instance.get_team_memberships(limit=limit, offset=offset, team=team, user=user, workspace=workspace, opt_fields=opt_fields) + pprint(api_response) except ApiException as e: - print("Exception when calling TeamMembershipsApi->get_team_memberships: %s\n" % e) + print("Exception when calling TeamMembershipsApi->get_team_memberships: %s\n" % e) get_team_memberships_for_team: |- import asana from asana.rest import ApiException @@ -51,20 +53,21 @@ TeamMembershipsApi: # Configure OAuth2 access token for authorization: oauth2 configuration = asana.Configuration() configuration.access_token = '' + api_client = asana.ApiClient(configuration) # create an instance of the API class - api_instance = asana.TeamMembershipsApi(asana.ApiClient(configuration)) + api_instance = asana.TeamMembershipsApi(api_client) team_gid = '159874' # str | Globally unique identifier for the team. limit = 50 # int | Results per page. The number of objects to return per page. The value must be between 1 and 100. (optional) offset = 'eyJ0eXAiOJiKV1iQLCJhbGciOiJIUzI1NiJ9' # 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.' (optional) opt_fields = ["is_admin","is_guest","is_limited_access","offset","path","team","team.name","uri","user","user.name"] # list[str] | This endpoint returns a compact resource, which excludes some properties by default. To include those optional properties, set this query parameter to a comma-separated list of the properties you wish to include. (optional) try: - # Get memberships from a team - api_response = api_instance.get_team_memberships_for_team(team_gid, limit=limit, offset=offset, opt_fields=opt_fields) - pprint(api_response) + # Get memberships from a team + api_response = api_instance.get_team_memberships_for_team(team_gid, limit=limit, offset=offset, opt_fields=opt_fields) + pprint(api_response) except ApiException as e: - print("Exception when calling TeamMembershipsApi->get_team_memberships_for_team: %s\n" % e) + print("Exception when calling TeamMembershipsApi->get_team_memberships_for_team: %s\n" % e) get_team_memberships_for_user: |- import asana from asana.rest import ApiException @@ -73,9 +76,10 @@ TeamMembershipsApi: # Configure OAuth2 access token for authorization: oauth2 configuration = asana.Configuration() configuration.access_token = '' + api_client = asana.ApiClient(configuration) # create an instance of the API class - api_instance = asana.TeamMembershipsApi(asana.ApiClient(configuration)) + api_instance = asana.TeamMembershipsApi(api_client) user_gid = 'me' # str | A string identifying a user. This can either be the string \"me\", an email, or the gid of a user. workspace = '31326' # str | Globally unique identifier for the workspace. limit = 50 # int | Results per page. The number of objects to return per page. The value must be between 1 and 100. (optional) @@ -83,8 +87,8 @@ TeamMembershipsApi: opt_fields = ["is_admin","is_guest","is_limited_access","offset","path","team","team.name","uri","user","user.name"] # list[str] | This endpoint returns a compact resource, which excludes some properties by default. To include those optional properties, set this query parameter to a comma-separated list of the properties you wish to include. (optional) try: - # Get memberships from a user - api_response = api_instance.get_team_memberships_for_user(user_gid, workspace, limit=limit, offset=offset, opt_fields=opt_fields) - pprint(api_response) + # Get memberships from a user + api_response = api_instance.get_team_memberships_for_user(user_gid, workspace, limit=limit, offset=offset, opt_fields=opt_fields) + pprint(api_response) except ApiException as e: - print("Exception when calling TeamMembershipsApi->get_team_memberships_for_user: %s\n" % e) + print("Exception when calling TeamMembershipsApi->get_team_memberships_for_user: %s\n" % e) diff --git a/docs/TeamsApi.md b/docs/TeamsApi.md index 67efaa55..f90605a2 100644 --- a/docs/TeamsApi.md +++ b/docs/TeamsApi.md @@ -28,19 +28,20 @@ from pprint import pprint # Configure OAuth2 access token for authorization: oauth2 configuration = asana.Configuration() configuration.access_token = '' +api_client = asana.ApiClient(configuration) # create an instance of the API class -api_instance = asana.TeamsApi(asana.ApiClient(configuration)) +api_instance = asana.TeamsApi(api_client) body = asana.TeamGidAddUserBody({"param1": "value1", "param2": "value2",}) # TeamGidAddUserBody | The user to add to the team. team_gid = '159874' # str | Globally unique identifier for the team. opt_fields = ["is_admin","is_guest","is_limited_access","team","team.name","user","user.name"] # list[str] | This endpoint returns a compact resource, which excludes some properties by default. To include those optional properties, set this query parameter to a comma-separated list of the properties you wish to include. (optional) try: - # Add a user to a team - api_response = api_instance.add_user_for_team(body, team_gid, opt_fields=opt_fields) - pprint(api_response) + # Add a user to a team + api_response = api_instance.add_user_for_team(body, team_gid, opt_fields=opt_fields) + pprint(api_response) except ApiException as e: - print("Exception when calling TeamsApi->add_user_for_team: %s\n" % e) + print("Exception when calling TeamsApi->add_user_for_team: %s\n" % e) ``` ### Parameters @@ -82,18 +83,19 @@ from pprint import pprint # Configure OAuth2 access token for authorization: oauth2 configuration = asana.Configuration() configuration.access_token = '' +api_client = asana.ApiClient(configuration) # create an instance of the API class -api_instance = asana.TeamsApi(asana.ApiClient(configuration)) +api_instance = asana.TeamsApi(api_client) body = asana.TeamsBody({"param1": "value1", "param2": "value2",}) # TeamsBody | The team to create. opt_fields = ["description","edit_team_name_or_description_access_level","edit_team_visibility_or_trash_team_access_level","guest_invite_management_access_level","html_description","join_request_management_access_level","member_invite_management_access_level","name","organization","organization.name","permalink_url","team_member_removal_access_level","visibility"] # list[str] | This endpoint returns a compact resource, which excludes some properties by default. To include those optional properties, set this query parameter to a comma-separated list of the properties you wish to include. (optional) try: - # Create a team - api_response = api_instance.create_team(body, opt_fields=opt_fields) - pprint(api_response) + # Create a team + api_response = api_instance.create_team(body, opt_fields=opt_fields) + pprint(api_response) except ApiException as e: - print("Exception when calling TeamsApi->create_team: %s\n" % e) + print("Exception when calling TeamsApi->create_team: %s\n" % e) ``` ### Parameters @@ -134,18 +136,19 @@ from pprint import pprint # Configure OAuth2 access token for authorization: oauth2 configuration = asana.Configuration() configuration.access_token = '' +api_client = asana.ApiClient(configuration) # create an instance of the API class -api_instance = asana.TeamsApi(asana.ApiClient(configuration)) +api_instance = asana.TeamsApi(api_client) team_gid = '159874' # str | Globally unique identifier for the team. opt_fields = ["description","edit_team_name_or_description_access_level","edit_team_visibility_or_trash_team_access_level","guest_invite_management_access_level","html_description","join_request_management_access_level","member_invite_management_access_level","name","organization","organization.name","permalink_url","team_member_removal_access_level","visibility"] # list[str] | This endpoint returns a compact resource, which excludes some properties by default. To include those optional properties, set this query parameter to a comma-separated list of the properties you wish to include. (optional) try: - # Get a team - api_response = api_instance.get_team(team_gid, opt_fields=opt_fields) - pprint(api_response) + # Get a team + api_response = api_instance.get_team(team_gid, opt_fields=opt_fields) + pprint(api_response) except ApiException as e: - print("Exception when calling TeamsApi->get_team: %s\n" % e) + print("Exception when calling TeamsApi->get_team: %s\n" % e) ``` ### Parameters @@ -186,9 +189,10 @@ from pprint import pprint # Configure OAuth2 access token for authorization: oauth2 configuration = asana.Configuration() configuration.access_token = '' +api_client = asana.ApiClient(configuration) # create an instance of the API class -api_instance = asana.TeamsApi(asana.ApiClient(configuration)) +api_instance = asana.TeamsApi(api_client) user_gid = 'me' # str | A string identifying a user. This can either be the string \"me\", an email, or the gid of a user. organization = '1331' # str | The workspace or organization to filter teams on. limit = 50 # int | Results per page. The number of objects to return per page. The value must be between 1 and 100. (optional) @@ -196,11 +200,11 @@ offset = 'eyJ0eXAiOJiKV1iQLCJhbGciOiJIUzI1NiJ9' # str | Offset token. An offset opt_fields = ["description","edit_team_name_or_description_access_level","edit_team_visibility_or_trash_team_access_level","guest_invite_management_access_level","html_description","join_request_management_access_level","member_invite_management_access_level","name","offset","organization","organization.name","path","permalink_url","team_member_removal_access_level","uri","visibility"] # list[str] | This endpoint returns a compact resource, which excludes some properties by default. To include those optional properties, set this query parameter to a comma-separated list of the properties you wish to include. (optional) try: - # Get teams for a user - api_response = api_instance.get_teams_for_user(user_gid, organization, limit=limit, offset=offset, opt_fields=opt_fields) - pprint(api_response) + # Get teams for a user + api_response = api_instance.get_teams_for_user(user_gid, organization, limit=limit, offset=offset, opt_fields=opt_fields) + pprint(api_response) except ApiException as e: - print("Exception when calling TeamsApi->get_teams_for_user: %s\n" % e) + print("Exception when calling TeamsApi->get_teams_for_user: %s\n" % e) ``` ### Parameters @@ -244,20 +248,21 @@ from pprint import pprint # Configure OAuth2 access token for authorization: oauth2 configuration = asana.Configuration() configuration.access_token = '' +api_client = asana.ApiClient(configuration) # create an instance of the API class -api_instance = asana.TeamsApi(asana.ApiClient(configuration)) +api_instance = asana.TeamsApi(api_client) workspace_gid = '12345' # str | Globally unique identifier for the workspace or organization. limit = 50 # int | Results per page. The number of objects to return per page. The value must be between 1 and 100. (optional) offset = 'eyJ0eXAiOJiKV1iQLCJhbGciOiJIUzI1NiJ9' # 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.' (optional) opt_fields = ["description","edit_team_name_or_description_access_level","edit_team_visibility_or_trash_team_access_level","guest_invite_management_access_level","html_description","join_request_management_access_level","member_invite_management_access_level","name","offset","organization","organization.name","path","permalink_url","team_member_removal_access_level","uri","visibility"] # list[str] | This endpoint returns a compact resource, which excludes some properties by default. To include those optional properties, set this query parameter to a comma-separated list of the properties you wish to include. (optional) try: - # Get teams in a workspace - api_response = api_instance.get_teams_for_workspace(workspace_gid, limit=limit, offset=offset, opt_fields=opt_fields) - pprint(api_response) + # Get teams in a workspace + api_response = api_instance.get_teams_for_workspace(workspace_gid, limit=limit, offset=offset, opt_fields=opt_fields) + pprint(api_response) except ApiException as e: - print("Exception when calling TeamsApi->get_teams_for_workspace: %s\n" % e) + print("Exception when calling TeamsApi->get_teams_for_workspace: %s\n" % e) ``` ### Parameters @@ -300,18 +305,19 @@ from pprint import pprint # Configure OAuth2 access token for authorization: oauth2 configuration = asana.Configuration() configuration.access_token = '' +api_client = asana.ApiClient(configuration) # create an instance of the API class -api_instance = asana.TeamsApi(asana.ApiClient(configuration)) +api_instance = asana.TeamsApi(api_client) body = asana.TeamGidRemoveUserBody({"param1": "value1", "param2": "value2",}) # TeamGidRemoveUserBody | The user to remove from the team. team_gid = '159874' # str | Globally unique identifier for the team. try: - # Remove a user from a team - api_response = api_instance.remove_user_for_team(body, team_gid) - pprint(api_response) + # Remove a user from a team + api_response = api_instance.remove_user_for_team(body, team_gid) + pprint(api_response) except ApiException as e: - print("Exception when calling TeamsApi->remove_user_for_team: %s\n" % e) + print("Exception when calling TeamsApi->remove_user_for_team: %s\n" % e) ``` ### Parameters @@ -352,19 +358,20 @@ from pprint import pprint # Configure OAuth2 access token for authorization: oauth2 configuration = asana.Configuration() configuration.access_token = '' +api_client = asana.ApiClient(configuration) # create an instance of the API class -api_instance = asana.TeamsApi(asana.ApiClient(configuration)) +api_instance = asana.TeamsApi(api_client) body = asana.TeamsTeamGidBody({"param1": "value1", "param2": "value2",}) # TeamsTeamGidBody | The team to update. team_gid = '159874' # str | Globally unique identifier for the team. opt_fields = ["description","edit_team_name_or_description_access_level","edit_team_visibility_or_trash_team_access_level","guest_invite_management_access_level","html_description","join_request_management_access_level","member_invite_management_access_level","name","organization","organization.name","permalink_url","team_member_removal_access_level","visibility"] # list[str] | This endpoint returns a compact resource, which excludes some properties by default. To include those optional properties, set this query parameter to a comma-separated list of the properties you wish to include. (optional) try: - # Update a team - api_response = api_instance.update_team(body, team_gid, opt_fields=opt_fields) - pprint(api_response) + # Update a team + api_response = api_instance.update_team(body, team_gid, opt_fields=opt_fields) + pprint(api_response) except ApiException as e: - print("Exception when calling TeamsApi->update_team: %s\n" % e) + print("Exception when calling TeamsApi->update_team: %s\n" % e) ``` ### Parameters diff --git a/docs/TeamsApi.yaml b/docs/TeamsApi.yaml index fcfd1207..24dab33e 100644 --- a/docs/TeamsApi.yaml +++ b/docs/TeamsApi.yaml @@ -7,19 +7,20 @@ TeamsApi: # Configure OAuth2 access token for authorization: oauth2 configuration = asana.Configuration() configuration.access_token = '' + api_client = asana.ApiClient(configuration) # create an instance of the API class - api_instance = asana.TeamsApi(asana.ApiClient(configuration)) + api_instance = asana.TeamsApi(api_client) body = asana.TeamGidAddUserBody({"param1": "value1", "param2": "value2",}) # TeamGidAddUserBody | The user to add to the team. team_gid = '159874' # str | Globally unique identifier for the team. opt_fields = ["is_admin","is_guest","is_limited_access","team","team.name","user","user.name"] # list[str] | This endpoint returns a compact resource, which excludes some properties by default. To include those optional properties, set this query parameter to a comma-separated list of the properties you wish to include. (optional) try: - # Add a user to a team - api_response = api_instance.add_user_for_team(body, team_gid, opt_fields=opt_fields) - pprint(api_response) + # Add a user to a team + api_response = api_instance.add_user_for_team(body, team_gid, opt_fields=opt_fields) + pprint(api_response) except ApiException as e: - print("Exception when calling TeamsApi->add_user_for_team: %s\n" % e) + print("Exception when calling TeamsApi->add_user_for_team: %s\n" % e) create_team: |- import asana from asana.rest import ApiException @@ -28,18 +29,19 @@ TeamsApi: # Configure OAuth2 access token for authorization: oauth2 configuration = asana.Configuration() configuration.access_token = '' + api_client = asana.ApiClient(configuration) # create an instance of the API class - api_instance = asana.TeamsApi(asana.ApiClient(configuration)) + api_instance = asana.TeamsApi(api_client) body = asana.TeamsBody({"param1": "value1", "param2": "value2",}) # TeamsBody | The team to create. opt_fields = ["description","edit_team_name_or_description_access_level","edit_team_visibility_or_trash_team_access_level","guest_invite_management_access_level","html_description","join_request_management_access_level","member_invite_management_access_level","name","organization","organization.name","permalink_url","team_member_removal_access_level","visibility"] # list[str] | This endpoint returns a compact resource, which excludes some properties by default. To include those optional properties, set this query parameter to a comma-separated list of the properties you wish to include. (optional) try: - # Create a team - api_response = api_instance.create_team(body, opt_fields=opt_fields) - pprint(api_response) + # Create a team + api_response = api_instance.create_team(body, opt_fields=opt_fields) + pprint(api_response) except ApiException as e: - print("Exception when calling TeamsApi->create_team: %s\n" % e) + print("Exception when calling TeamsApi->create_team: %s\n" % e) get_team: |- import asana from asana.rest import ApiException @@ -48,18 +50,19 @@ TeamsApi: # Configure OAuth2 access token for authorization: oauth2 configuration = asana.Configuration() configuration.access_token = '' + api_client = asana.ApiClient(configuration) # create an instance of the API class - api_instance = asana.TeamsApi(asana.ApiClient(configuration)) + api_instance = asana.TeamsApi(api_client) team_gid = '159874' # str | Globally unique identifier for the team. opt_fields = ["description","edit_team_name_or_description_access_level","edit_team_visibility_or_trash_team_access_level","guest_invite_management_access_level","html_description","join_request_management_access_level","member_invite_management_access_level","name","organization","organization.name","permalink_url","team_member_removal_access_level","visibility"] # list[str] | This endpoint returns a compact resource, which excludes some properties by default. To include those optional properties, set this query parameter to a comma-separated list of the properties you wish to include. (optional) try: - # Get a team - api_response = api_instance.get_team(team_gid, opt_fields=opt_fields) - pprint(api_response) + # Get a team + api_response = api_instance.get_team(team_gid, opt_fields=opt_fields) + pprint(api_response) except ApiException as e: - print("Exception when calling TeamsApi->get_team: %s\n" % e) + print("Exception when calling TeamsApi->get_team: %s\n" % e) get_teams_for_user: |- import asana from asana.rest import ApiException @@ -68,9 +71,10 @@ TeamsApi: # Configure OAuth2 access token for authorization: oauth2 configuration = asana.Configuration() configuration.access_token = '' + api_client = asana.ApiClient(configuration) # create an instance of the API class - api_instance = asana.TeamsApi(asana.ApiClient(configuration)) + api_instance = asana.TeamsApi(api_client) user_gid = 'me' # str | A string identifying a user. This can either be the string \"me\", an email, or the gid of a user. organization = '1331' # str | The workspace or organization to filter teams on. limit = 50 # int | Results per page. The number of objects to return per page. The value must be between 1 and 100. (optional) @@ -78,11 +82,11 @@ TeamsApi: opt_fields = ["description","edit_team_name_or_description_access_level","edit_team_visibility_or_trash_team_access_level","guest_invite_management_access_level","html_description","join_request_management_access_level","member_invite_management_access_level","name","offset","organization","organization.name","path","permalink_url","team_member_removal_access_level","uri","visibility"] # list[str] | This endpoint returns a compact resource, which excludes some properties by default. To include those optional properties, set this query parameter to a comma-separated list of the properties you wish to include. (optional) try: - # Get teams for a user - api_response = api_instance.get_teams_for_user(user_gid, organization, limit=limit, offset=offset, opt_fields=opt_fields) - pprint(api_response) + # Get teams for a user + api_response = api_instance.get_teams_for_user(user_gid, organization, limit=limit, offset=offset, opt_fields=opt_fields) + pprint(api_response) except ApiException as e: - print("Exception when calling TeamsApi->get_teams_for_user: %s\n" % e) + print("Exception when calling TeamsApi->get_teams_for_user: %s\n" % e) get_teams_for_workspace: |- import asana from asana.rest import ApiException @@ -91,20 +95,21 @@ TeamsApi: # Configure OAuth2 access token for authorization: oauth2 configuration = asana.Configuration() configuration.access_token = '' + api_client = asana.ApiClient(configuration) # create an instance of the API class - api_instance = asana.TeamsApi(asana.ApiClient(configuration)) + api_instance = asana.TeamsApi(api_client) workspace_gid = '12345' # str | Globally unique identifier for the workspace or organization. limit = 50 # int | Results per page. The number of objects to return per page. The value must be between 1 and 100. (optional) offset = 'eyJ0eXAiOJiKV1iQLCJhbGciOiJIUzI1NiJ9' # 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.' (optional) opt_fields = ["description","edit_team_name_or_description_access_level","edit_team_visibility_or_trash_team_access_level","guest_invite_management_access_level","html_description","join_request_management_access_level","member_invite_management_access_level","name","offset","organization","organization.name","path","permalink_url","team_member_removal_access_level","uri","visibility"] # list[str] | This endpoint returns a compact resource, which excludes some properties by default. To include those optional properties, set this query parameter to a comma-separated list of the properties you wish to include. (optional) try: - # Get teams in a workspace - api_response = api_instance.get_teams_for_workspace(workspace_gid, limit=limit, offset=offset, opt_fields=opt_fields) - pprint(api_response) + # Get teams in a workspace + api_response = api_instance.get_teams_for_workspace(workspace_gid, limit=limit, offset=offset, opt_fields=opt_fields) + pprint(api_response) except ApiException as e: - print("Exception when calling TeamsApi->get_teams_for_workspace: %s\n" % e) + print("Exception when calling TeamsApi->get_teams_for_workspace: %s\n" % e) remove_user_for_team: |- import asana from asana.rest import ApiException @@ -113,18 +118,19 @@ TeamsApi: # Configure OAuth2 access token for authorization: oauth2 configuration = asana.Configuration() configuration.access_token = '' + api_client = asana.ApiClient(configuration) # create an instance of the API class - api_instance = asana.TeamsApi(asana.ApiClient(configuration)) + api_instance = asana.TeamsApi(api_client) body = asana.TeamGidRemoveUserBody({"param1": "value1", "param2": "value2",}) # TeamGidRemoveUserBody | The user to remove from the team. team_gid = '159874' # str | Globally unique identifier for the team. try: - # Remove a user from a team - api_response = api_instance.remove_user_for_team(body, team_gid) - pprint(api_response) + # Remove a user from a team + api_response = api_instance.remove_user_for_team(body, team_gid) + pprint(api_response) except ApiException as e: - print("Exception when calling TeamsApi->remove_user_for_team: %s\n" % e) + print("Exception when calling TeamsApi->remove_user_for_team: %s\n" % e) update_team: |- import asana from asana.rest import ApiException @@ -133,16 +139,17 @@ TeamsApi: # Configure OAuth2 access token for authorization: oauth2 configuration = asana.Configuration() configuration.access_token = '' + api_client = asana.ApiClient(configuration) # create an instance of the API class - api_instance = asana.TeamsApi(asana.ApiClient(configuration)) + api_instance = asana.TeamsApi(api_client) body = asana.TeamsTeamGidBody({"param1": "value1", "param2": "value2",}) # TeamsTeamGidBody | The team to update. team_gid = '159874' # str | Globally unique identifier for the team. opt_fields = ["description","edit_team_name_or_description_access_level","edit_team_visibility_or_trash_team_access_level","guest_invite_management_access_level","html_description","join_request_management_access_level","member_invite_management_access_level","name","organization","organization.name","permalink_url","team_member_removal_access_level","visibility"] # list[str] | This endpoint returns a compact resource, which excludes some properties by default. To include those optional properties, set this query parameter to a comma-separated list of the properties you wish to include. (optional) try: - # Update a team - api_response = api_instance.update_team(body, team_gid, opt_fields=opt_fields) - pprint(api_response) + # Update a team + api_response = api_instance.update_team(body, team_gid, opt_fields=opt_fields) + pprint(api_response) except ApiException as e: - print("Exception when calling TeamsApi->update_team: %s\n" % e) + print("Exception when calling TeamsApi->update_team: %s\n" % e) diff --git a/docs/TimePeriodsApi.md b/docs/TimePeriodsApi.md index e7e27ad2..a2962dd1 100644 --- a/docs/TimePeriodsApi.md +++ b/docs/TimePeriodsApi.md @@ -23,18 +23,19 @@ from pprint import pprint # Configure OAuth2 access token for authorization: oauth2 configuration = asana.Configuration() configuration.access_token = '' +api_client = asana.ApiClient(configuration) # create an instance of the API class -api_instance = asana.TimePeriodsApi(asana.ApiClient(configuration)) +api_instance = asana.TimePeriodsApi(api_client) time_period_gid = '917392' # str | Globally unique identifier for the time period. opt_fields = ["display_name","end_on","parent","parent.display_name","parent.end_on","parent.period","parent.start_on","period","start_on"] # list[str] | This endpoint returns a compact resource, which excludes some properties by default. To include those optional properties, set this query parameter to a comma-separated list of the properties you wish to include. (optional) try: - # Get a time period - api_response = api_instance.get_time_period(time_period_gid, opt_fields=opt_fields) - pprint(api_response) + # Get a time period + api_response = api_instance.get_time_period(time_period_gid, opt_fields=opt_fields) + pprint(api_response) except ApiException as e: - print("Exception when calling TimePeriodsApi->get_time_period: %s\n" % e) + print("Exception when calling TimePeriodsApi->get_time_period: %s\n" % e) ``` ### Parameters @@ -75,9 +76,10 @@ from pprint import pprint # Configure OAuth2 access token for authorization: oauth2 configuration = asana.Configuration() configuration.access_token = '' +api_client = asana.ApiClient(configuration) # create an instance of the API class -api_instance = asana.TimePeriodsApi(asana.ApiClient(configuration)) +api_instance = asana.TimePeriodsApi(api_client) workspace = '31326' # str | Globally unique identifier for the workspace. limit = 50 # int | Results per page. The number of objects to return per page. The value must be between 1 and 100. (optional) offset = 'eyJ0eXAiOJiKV1iQLCJhbGciOiJIUzI1NiJ9' # 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.' (optional) @@ -86,11 +88,11 @@ end_on = '2019-09-15' # date | ISO 8601 date string (optional) opt_fields = ["display_name","end_on","offset","parent","parent.display_name","parent.end_on","parent.period","parent.start_on","path","period","start_on","uri"] # list[str] | This endpoint returns a compact resource, which excludes some properties by default. To include those optional properties, set this query parameter to a comma-separated list of the properties you wish to include. (optional) try: - # Get time periods - api_response = api_instance.get_time_periods(workspace, limit=limit, offset=offset, start_on=start_on, end_on=end_on, opt_fields=opt_fields) - pprint(api_response) + # Get time periods + api_response = api_instance.get_time_periods(workspace, limit=limit, offset=offset, start_on=start_on, end_on=end_on, opt_fields=opt_fields) + pprint(api_response) except ApiException as e: - print("Exception when calling TimePeriodsApi->get_time_periods: %s\n" % e) + print("Exception when calling TimePeriodsApi->get_time_periods: %s\n" % e) ``` ### Parameters diff --git a/docs/TimePeriodsApi.yaml b/docs/TimePeriodsApi.yaml index 272c7aa2..daeb7ccd 100644 --- a/docs/TimePeriodsApi.yaml +++ b/docs/TimePeriodsApi.yaml @@ -7,18 +7,19 @@ TimePeriodsApi: # Configure OAuth2 access token for authorization: oauth2 configuration = asana.Configuration() configuration.access_token = '' + api_client = asana.ApiClient(configuration) # create an instance of the API class - api_instance = asana.TimePeriodsApi(asana.ApiClient(configuration)) + api_instance = asana.TimePeriodsApi(api_client) time_period_gid = '917392' # str | Globally unique identifier for the time period. opt_fields = ["display_name","end_on","parent","parent.display_name","parent.end_on","parent.period","parent.start_on","period","start_on"] # list[str] | This endpoint returns a compact resource, which excludes some properties by default. To include those optional properties, set this query parameter to a comma-separated list of the properties you wish to include. (optional) try: - # Get a time period - api_response = api_instance.get_time_period(time_period_gid, opt_fields=opt_fields) - pprint(api_response) + # Get a time period + api_response = api_instance.get_time_period(time_period_gid, opt_fields=opt_fields) + pprint(api_response) except ApiException as e: - print("Exception when calling TimePeriodsApi->get_time_period: %s\n" % e) + print("Exception when calling TimePeriodsApi->get_time_period: %s\n" % e) get_time_periods: |- import asana from asana.rest import ApiException @@ -27,9 +28,10 @@ TimePeriodsApi: # Configure OAuth2 access token for authorization: oauth2 configuration = asana.Configuration() configuration.access_token = '' + api_client = asana.ApiClient(configuration) # create an instance of the API class - api_instance = asana.TimePeriodsApi(asana.ApiClient(configuration)) + api_instance = asana.TimePeriodsApi(api_client) workspace = '31326' # str | Globally unique identifier for the workspace. limit = 50 # int | Results per page. The number of objects to return per page. The value must be between 1 and 100. (optional) offset = 'eyJ0eXAiOJiKV1iQLCJhbGciOiJIUzI1NiJ9' # 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.' (optional) @@ -38,8 +40,8 @@ TimePeriodsApi: opt_fields = ["display_name","end_on","offset","parent","parent.display_name","parent.end_on","parent.period","parent.start_on","path","period","start_on","uri"] # list[str] | This endpoint returns a compact resource, which excludes some properties by default. To include those optional properties, set this query parameter to a comma-separated list of the properties you wish to include. (optional) try: - # Get time periods - api_response = api_instance.get_time_periods(workspace, limit=limit, offset=offset, start_on=start_on, end_on=end_on, opt_fields=opt_fields) - pprint(api_response) + # Get time periods + api_response = api_instance.get_time_periods(workspace, limit=limit, offset=offset, start_on=start_on, end_on=end_on, opt_fields=opt_fields) + pprint(api_response) except ApiException as e: - print("Exception when calling TimePeriodsApi->get_time_periods: %s\n" % e) + print("Exception when calling TimePeriodsApi->get_time_periods: %s\n" % e) diff --git a/docs/TimeTrackingEntriesApi.md b/docs/TimeTrackingEntriesApi.md index 19a5e4e6..2fc1aadc 100644 --- a/docs/TimeTrackingEntriesApi.md +++ b/docs/TimeTrackingEntriesApi.md @@ -26,19 +26,20 @@ from pprint import pprint # Configure OAuth2 access token for authorization: oauth2 configuration = asana.Configuration() configuration.access_token = '' +api_client = asana.ApiClient(configuration) # create an instance of the API class -api_instance = asana.TimeTrackingEntriesApi(asana.ApiClient(configuration)) +api_instance = asana.TimeTrackingEntriesApi(api_client) body = asana.TaskGidTimeTrackingEntriesBody({"param1": "value1", "param2": "value2",}) # TaskGidTimeTrackingEntriesBody | Information about the time tracking entry. task_gid = '321654' # str | The task to operate on. opt_fields = ["created_at","created_by","created_by.name","duration_minutes","entered_on","task","task.created_by","task.name","task.resource_subtype"] # list[str] | This endpoint returns a compact resource, which excludes some properties by default. To include those optional properties, set this query parameter to a comma-separated list of the properties you wish to include. (optional) try: - # Create a time tracking entry - api_response = api_instance.create_time_tracking_entry(body, task_gid, opt_fields=opt_fields) - pprint(api_response) + # Create a time tracking entry + api_response = api_instance.create_time_tracking_entry(body, task_gid, opt_fields=opt_fields) + pprint(api_response) except ApiException as e: - print("Exception when calling TimeTrackingEntriesApi->create_time_tracking_entry: %s\n" % e) + print("Exception when calling TimeTrackingEntriesApi->create_time_tracking_entry: %s\n" % e) ``` ### Parameters @@ -80,17 +81,18 @@ from pprint import pprint # Configure OAuth2 access token for authorization: oauth2 configuration = asana.Configuration() configuration.access_token = '' +api_client = asana.ApiClient(configuration) # create an instance of the API class -api_instance = asana.TimeTrackingEntriesApi(asana.ApiClient(configuration)) +api_instance = asana.TimeTrackingEntriesApi(api_client) time_tracking_entry_gid = '917392' # str | Globally unique identifier for the time tracking entry. try: - # Delete a time tracking entry - api_response = api_instance.delete_time_tracking_entry(time_tracking_entry_gid) - pprint(api_response) + # Delete a time tracking entry + api_response = api_instance.delete_time_tracking_entry(time_tracking_entry_gid) + pprint(api_response) except ApiException as e: - print("Exception when calling TimeTrackingEntriesApi->delete_time_tracking_entry: %s\n" % e) + print("Exception when calling TimeTrackingEntriesApi->delete_time_tracking_entry: %s\n" % e) ``` ### Parameters @@ -130,20 +132,21 @@ from pprint import pprint # Configure OAuth2 access token for authorization: oauth2 configuration = asana.Configuration() configuration.access_token = '' +api_client = asana.ApiClient(configuration) # create an instance of the API class -api_instance = asana.TimeTrackingEntriesApi(asana.ApiClient(configuration)) +api_instance = asana.TimeTrackingEntriesApi(api_client) task_gid = '321654' # str | The task to operate on. limit = 50 # int | Results per page. The number of objects to return per page. The value must be between 1 and 100. (optional) offset = 'eyJ0eXAiOJiKV1iQLCJhbGciOiJIUzI1NiJ9' # 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.' (optional) opt_fields = ["created_by","created_by.name","duration_minutes","entered_on","offset","path","uri"] # list[str] | This endpoint returns a compact resource, which excludes some properties by default. To include those optional properties, set this query parameter to a comma-separated list of the properties you wish to include. (optional) try: - # Get time tracking entries for a task - api_response = api_instance.get_time_tracking_entries_for_task(task_gid, limit=limit, offset=offset, opt_fields=opt_fields) - pprint(api_response) + # Get time tracking entries for a task + api_response = api_instance.get_time_tracking_entries_for_task(task_gid, limit=limit, offset=offset, opt_fields=opt_fields) + pprint(api_response) except ApiException as e: - print("Exception when calling TimeTrackingEntriesApi->get_time_tracking_entries_for_task: %s\n" % e) + print("Exception when calling TimeTrackingEntriesApi->get_time_tracking_entries_for_task: %s\n" % e) ``` ### Parameters @@ -186,18 +189,19 @@ from pprint import pprint # Configure OAuth2 access token for authorization: oauth2 configuration = asana.Configuration() configuration.access_token = '' +api_client = asana.ApiClient(configuration) # create an instance of the API class -api_instance = asana.TimeTrackingEntriesApi(asana.ApiClient(configuration)) +api_instance = asana.TimeTrackingEntriesApi(api_client) time_tracking_entry_gid = '917392' # str | Globally unique identifier for the time tracking entry. opt_fields = ["created_at","created_by","created_by.name","duration_minutes","entered_on","task","task.created_by","task.name","task.resource_subtype"] # list[str] | This endpoint returns a compact resource, which excludes some properties by default. To include those optional properties, set this query parameter to a comma-separated list of the properties you wish to include. (optional) try: - # Get a time tracking entry - api_response = api_instance.get_time_tracking_entry(time_tracking_entry_gid, opt_fields=opt_fields) - pprint(api_response) + # Get a time tracking entry + api_response = api_instance.get_time_tracking_entry(time_tracking_entry_gid, opt_fields=opt_fields) + pprint(api_response) except ApiException as e: - print("Exception when calling TimeTrackingEntriesApi->get_time_tracking_entry: %s\n" % e) + print("Exception when calling TimeTrackingEntriesApi->get_time_tracking_entry: %s\n" % e) ``` ### Parameters @@ -238,19 +242,20 @@ from pprint import pprint # Configure OAuth2 access token for authorization: oauth2 configuration = asana.Configuration() configuration.access_token = '' +api_client = asana.ApiClient(configuration) # create an instance of the API class -api_instance = asana.TimeTrackingEntriesApi(asana.ApiClient(configuration)) +api_instance = asana.TimeTrackingEntriesApi(api_client) body = asana.TimeTrackingEntriesTimeTrackingEntryGidBody({"param1": "value1", "param2": "value2",}) # TimeTrackingEntriesTimeTrackingEntryGidBody | The updated fields for the time tracking entry. time_tracking_entry_gid = '917392' # str | Globally unique identifier for the time tracking entry. opt_fields = ["created_at","created_by","created_by.name","duration_minutes","entered_on","task","task.created_by","task.name","task.resource_subtype"] # list[str] | This endpoint returns a compact resource, which excludes some properties by default. To include those optional properties, set this query parameter to a comma-separated list of the properties you wish to include. (optional) try: - # Update a time tracking entry - api_response = api_instance.update_time_tracking_entry(body, time_tracking_entry_gid, opt_fields=opt_fields) - pprint(api_response) + # Update a time tracking entry + api_response = api_instance.update_time_tracking_entry(body, time_tracking_entry_gid, opt_fields=opt_fields) + pprint(api_response) except ApiException as e: - print("Exception when calling TimeTrackingEntriesApi->update_time_tracking_entry: %s\n" % e) + print("Exception when calling TimeTrackingEntriesApi->update_time_tracking_entry: %s\n" % e) ``` ### Parameters diff --git a/docs/TimeTrackingEntriesApi.yaml b/docs/TimeTrackingEntriesApi.yaml index db028d73..c5180365 100644 --- a/docs/TimeTrackingEntriesApi.yaml +++ b/docs/TimeTrackingEntriesApi.yaml @@ -7,19 +7,20 @@ TimeTrackingEntriesApi: # Configure OAuth2 access token for authorization: oauth2 configuration = asana.Configuration() configuration.access_token = '' + api_client = asana.ApiClient(configuration) # create an instance of the API class - api_instance = asana.TimeTrackingEntriesApi(asana.ApiClient(configuration)) + api_instance = asana.TimeTrackingEntriesApi(api_client) body = asana.TaskGidTimeTrackingEntriesBody({"param1": "value1", "param2": "value2",}) # TaskGidTimeTrackingEntriesBody | Information about the time tracking entry. task_gid = '321654' # str | The task to operate on. opt_fields = ["created_at","created_by","created_by.name","duration_minutes","entered_on","task","task.created_by","task.name","task.resource_subtype"] # list[str] | This endpoint returns a compact resource, which excludes some properties by default. To include those optional properties, set this query parameter to a comma-separated list of the properties you wish to include. (optional) try: - # Create a time tracking entry - api_response = api_instance.create_time_tracking_entry(body, task_gid, opt_fields=opt_fields) - pprint(api_response) + # Create a time tracking entry + api_response = api_instance.create_time_tracking_entry(body, task_gid, opt_fields=opt_fields) + pprint(api_response) except ApiException as e: - print("Exception when calling TimeTrackingEntriesApi->create_time_tracking_entry: %s\n" % e) + print("Exception when calling TimeTrackingEntriesApi->create_time_tracking_entry: %s\n" % e) delete_time_tracking_entry: |- import asana from asana.rest import ApiException @@ -28,17 +29,18 @@ TimeTrackingEntriesApi: # Configure OAuth2 access token for authorization: oauth2 configuration = asana.Configuration() configuration.access_token = '' + api_client = asana.ApiClient(configuration) # create an instance of the API class - api_instance = asana.TimeTrackingEntriesApi(asana.ApiClient(configuration)) + api_instance = asana.TimeTrackingEntriesApi(api_client) time_tracking_entry_gid = '917392' # str | Globally unique identifier for the time tracking entry. try: - # Delete a time tracking entry - api_response = api_instance.delete_time_tracking_entry(time_tracking_entry_gid) - pprint(api_response) + # Delete a time tracking entry + api_response = api_instance.delete_time_tracking_entry(time_tracking_entry_gid) + pprint(api_response) except ApiException as e: - print("Exception when calling TimeTrackingEntriesApi->delete_time_tracking_entry: %s\n" % e) + print("Exception when calling TimeTrackingEntriesApi->delete_time_tracking_entry: %s\n" % e) get_time_tracking_entries_for_task: |- import asana from asana.rest import ApiException @@ -47,20 +49,21 @@ TimeTrackingEntriesApi: # Configure OAuth2 access token for authorization: oauth2 configuration = asana.Configuration() configuration.access_token = '' + api_client = asana.ApiClient(configuration) # create an instance of the API class - api_instance = asana.TimeTrackingEntriesApi(asana.ApiClient(configuration)) + api_instance = asana.TimeTrackingEntriesApi(api_client) task_gid = '321654' # str | The task to operate on. limit = 50 # int | Results per page. The number of objects to return per page. The value must be between 1 and 100. (optional) offset = 'eyJ0eXAiOJiKV1iQLCJhbGciOiJIUzI1NiJ9' # 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.' (optional) opt_fields = ["created_by","created_by.name","duration_minutes","entered_on","offset","path","uri"] # list[str] | This endpoint returns a compact resource, which excludes some properties by default. To include those optional properties, set this query parameter to a comma-separated list of the properties you wish to include. (optional) try: - # Get time tracking entries for a task - api_response = api_instance.get_time_tracking_entries_for_task(task_gid, limit=limit, offset=offset, opt_fields=opt_fields) - pprint(api_response) + # Get time tracking entries for a task + api_response = api_instance.get_time_tracking_entries_for_task(task_gid, limit=limit, offset=offset, opt_fields=opt_fields) + pprint(api_response) except ApiException as e: - print("Exception when calling TimeTrackingEntriesApi->get_time_tracking_entries_for_task: %s\n" % e) + print("Exception when calling TimeTrackingEntriesApi->get_time_tracking_entries_for_task: %s\n" % e) get_time_tracking_entry: |- import asana from asana.rest import ApiException @@ -69,18 +72,19 @@ TimeTrackingEntriesApi: # Configure OAuth2 access token for authorization: oauth2 configuration = asana.Configuration() configuration.access_token = '' + api_client = asana.ApiClient(configuration) # create an instance of the API class - api_instance = asana.TimeTrackingEntriesApi(asana.ApiClient(configuration)) + api_instance = asana.TimeTrackingEntriesApi(api_client) time_tracking_entry_gid = '917392' # str | Globally unique identifier for the time tracking entry. opt_fields = ["created_at","created_by","created_by.name","duration_minutes","entered_on","task","task.created_by","task.name","task.resource_subtype"] # list[str] | This endpoint returns a compact resource, which excludes some properties by default. To include those optional properties, set this query parameter to a comma-separated list of the properties you wish to include. (optional) try: - # Get a time tracking entry - api_response = api_instance.get_time_tracking_entry(time_tracking_entry_gid, opt_fields=opt_fields) - pprint(api_response) + # Get a time tracking entry + api_response = api_instance.get_time_tracking_entry(time_tracking_entry_gid, opt_fields=opt_fields) + pprint(api_response) except ApiException as e: - print("Exception when calling TimeTrackingEntriesApi->get_time_tracking_entry: %s\n" % e) + print("Exception when calling TimeTrackingEntriesApi->get_time_tracking_entry: %s\n" % e) update_time_tracking_entry: |- import asana from asana.rest import ApiException @@ -89,16 +93,17 @@ TimeTrackingEntriesApi: # Configure OAuth2 access token for authorization: oauth2 configuration = asana.Configuration() configuration.access_token = '' + api_client = asana.ApiClient(configuration) # create an instance of the API class - api_instance = asana.TimeTrackingEntriesApi(asana.ApiClient(configuration)) + api_instance = asana.TimeTrackingEntriesApi(api_client) body = asana.TimeTrackingEntriesTimeTrackingEntryGidBody({"param1": "value1", "param2": "value2",}) # TimeTrackingEntriesTimeTrackingEntryGidBody | The updated fields for the time tracking entry. time_tracking_entry_gid = '917392' # str | Globally unique identifier for the time tracking entry. opt_fields = ["created_at","created_by","created_by.name","duration_minutes","entered_on","task","task.created_by","task.name","task.resource_subtype"] # list[str] | This endpoint returns a compact resource, which excludes some properties by default. To include those optional properties, set this query parameter to a comma-separated list of the properties you wish to include. (optional) try: - # Update a time tracking entry - api_response = api_instance.update_time_tracking_entry(body, time_tracking_entry_gid, opt_fields=opt_fields) - pprint(api_response) + # Update a time tracking entry + api_response = api_instance.update_time_tracking_entry(body, time_tracking_entry_gid, opt_fields=opt_fields) + pprint(api_response) except ApiException as e: - print("Exception when calling TimeTrackingEntriesApi->update_time_tracking_entry: %s\n" % e) + print("Exception when calling TimeTrackingEntriesApi->update_time_tracking_entry: %s\n" % e) diff --git a/docs/TypeaheadApi.md b/docs/TypeaheadApi.md index a0f3e8d9..d816ddc4 100644 --- a/docs/TypeaheadApi.md +++ b/docs/TypeaheadApi.md @@ -22,9 +22,10 @@ from pprint import pprint # Configure OAuth2 access token for authorization: oauth2 configuration = asana.Configuration() configuration.access_token = '' +api_client = asana.ApiClient(configuration) # create an instance of the API class -api_instance = asana.TypeaheadApi(asana.ApiClient(configuration)) +api_instance = asana.TypeaheadApi(api_client) workspace_gid = '12345' # str | Globally unique identifier for the workspace or organization. resource_type = 'user' # str | The type of values the typeahead should return. You can choose from one of the following: `custom_field`, `project`, `project_template`, `portfolio`, `tag`, `task`, and `user`. Note that unlike in the names of endpoints, the types listed here are in singular form (e.g. `task`). Using multiple types is not yet supported. (default to user) type = 'user' # str | *Deprecated: new integrations should prefer the resource_type field.* (optional) (default to user) @@ -33,11 +34,11 @@ count = 20 # int | The number of results to return. The default is 20 if this pa opt_fields = ["name"] # list[str] | This endpoint returns a compact resource, which excludes some properties by default. To include those optional properties, set this query parameter to a comma-separated list of the properties you wish to include. (optional) try: - # Get objects via typeahead - api_response = api_instance.typeahead_for_workspace(workspace_gid, resource_type, type=type, query=query, count=count, opt_fields=opt_fields) - pprint(api_response) + # Get objects via typeahead + api_response = api_instance.typeahead_for_workspace(workspace_gid, resource_type, type=type, query=query, count=count, opt_fields=opt_fields) + pprint(api_response) except ApiException as e: - print("Exception when calling TypeaheadApi->typeahead_for_workspace: %s\n" % e) + print("Exception when calling TypeaheadApi->typeahead_for_workspace: %s\n" % e) ``` ### Parameters diff --git a/docs/TypeaheadApi.yaml b/docs/TypeaheadApi.yaml index 673bc427..d158560f 100644 --- a/docs/TypeaheadApi.yaml +++ b/docs/TypeaheadApi.yaml @@ -7,9 +7,10 @@ TypeaheadApi: # Configure OAuth2 access token for authorization: oauth2 configuration = asana.Configuration() configuration.access_token = '' + api_client = asana.ApiClient(configuration) # create an instance of the API class - api_instance = asana.TypeaheadApi(asana.ApiClient(configuration)) + api_instance = asana.TypeaheadApi(api_client) workspace_gid = '12345' # str | Globally unique identifier for the workspace or organization. resource_type = 'user' # str | The type of values the typeahead should return. You can choose from one of the following: `custom_field`, `project`, `project_template`, `portfolio`, `tag`, `task`, and `user`. Note that unlike in the names of endpoints, the types listed here are in singular form (e.g. `task`). Using multiple types is not yet supported. (default to user) type = 'user' # str | *Deprecated: new integrations should prefer the resource_type field.* (optional) (default to user) @@ -18,8 +19,8 @@ TypeaheadApi: opt_fields = ["name"] # list[str] | This endpoint returns a compact resource, which excludes some properties by default. To include those optional properties, set this query parameter to a comma-separated list of the properties you wish to include. (optional) try: - # Get objects via typeahead - api_response = api_instance.typeahead_for_workspace(workspace_gid, resource_type, type=type, query=query, count=count, opt_fields=opt_fields) - pprint(api_response) + # Get objects via typeahead + api_response = api_instance.typeahead_for_workspace(workspace_gid, resource_type, type=type, query=query, count=count, opt_fields=opt_fields) + pprint(api_response) except ApiException as e: - print("Exception when calling TypeaheadApi->typeahead_for_workspace: %s\n" % e) + print("Exception when calling TypeaheadApi->typeahead_for_workspace: %s\n" % e) diff --git a/docs/UserTaskListsApi.md b/docs/UserTaskListsApi.md index d22e82a4..38381d32 100644 --- a/docs/UserTaskListsApi.md +++ b/docs/UserTaskListsApi.md @@ -23,18 +23,19 @@ from pprint import pprint # Configure OAuth2 access token for authorization: oauth2 configuration = asana.Configuration() configuration.access_token = '' +api_client = asana.ApiClient(configuration) # create an instance of the API class -api_instance = asana.UserTaskListsApi(asana.ApiClient(configuration)) +api_instance = asana.UserTaskListsApi(api_client) user_task_list_gid = '12345' # str | Globally unique identifier for the user task list. opt_fields = ["name","owner","workspace"] # list[str] | This endpoint returns a compact resource, which excludes some properties by default. To include those optional properties, set this query parameter to a comma-separated list of the properties you wish to include. (optional) try: - # Get a user task list - api_response = api_instance.get_user_task_list(user_task_list_gid, opt_fields=opt_fields) - pprint(api_response) + # Get a user task list + api_response = api_instance.get_user_task_list(user_task_list_gid, opt_fields=opt_fields) + pprint(api_response) except ApiException as e: - print("Exception when calling UserTaskListsApi->get_user_task_list: %s\n" % e) + print("Exception when calling UserTaskListsApi->get_user_task_list: %s\n" % e) ``` ### Parameters @@ -75,19 +76,20 @@ from pprint import pprint # Configure OAuth2 access token for authorization: oauth2 configuration = asana.Configuration() configuration.access_token = '' +api_client = asana.ApiClient(configuration) # create an instance of the API class -api_instance = asana.UserTaskListsApi(asana.ApiClient(configuration)) +api_instance = asana.UserTaskListsApi(api_client) user_gid = 'me' # str | A string identifying a user. This can either be the string \"me\", an email, or the gid of a user. workspace = '1234' # str | The workspace in which to get the user task list. opt_fields = ["name","owner","workspace"] # list[str] | This endpoint returns a compact resource, which excludes some properties by default. To include those optional properties, set this query parameter to a comma-separated list of the properties you wish to include. (optional) try: - # Get a user's task list - api_response = api_instance.get_user_task_list_for_user(user_gid, workspace, opt_fields=opt_fields) - pprint(api_response) + # Get a user's task list + api_response = api_instance.get_user_task_list_for_user(user_gid, workspace, opt_fields=opt_fields) + pprint(api_response) except ApiException as e: - print("Exception when calling UserTaskListsApi->get_user_task_list_for_user: %s\n" % e) + print("Exception when calling UserTaskListsApi->get_user_task_list_for_user: %s\n" % e) ``` ### Parameters diff --git a/docs/UserTaskListsApi.yaml b/docs/UserTaskListsApi.yaml index 70779ebd..25557436 100644 --- a/docs/UserTaskListsApi.yaml +++ b/docs/UserTaskListsApi.yaml @@ -7,18 +7,19 @@ UserTaskListsApi: # Configure OAuth2 access token for authorization: oauth2 configuration = asana.Configuration() configuration.access_token = '' + api_client = asana.ApiClient(configuration) # create an instance of the API class - api_instance = asana.UserTaskListsApi(asana.ApiClient(configuration)) + api_instance = asana.UserTaskListsApi(api_client) user_task_list_gid = '12345' # str | Globally unique identifier for the user task list. opt_fields = ["name","owner","workspace"] # list[str] | This endpoint returns a compact resource, which excludes some properties by default. To include those optional properties, set this query parameter to a comma-separated list of the properties you wish to include. (optional) try: - # Get a user task list - api_response = api_instance.get_user_task_list(user_task_list_gid, opt_fields=opt_fields) - pprint(api_response) + # Get a user task list + api_response = api_instance.get_user_task_list(user_task_list_gid, opt_fields=opt_fields) + pprint(api_response) except ApiException as e: - print("Exception when calling UserTaskListsApi->get_user_task_list: %s\n" % e) + print("Exception when calling UserTaskListsApi->get_user_task_list: %s\n" % e) get_user_task_list_for_user: |- import asana from asana.rest import ApiException @@ -27,16 +28,17 @@ UserTaskListsApi: # Configure OAuth2 access token for authorization: oauth2 configuration = asana.Configuration() configuration.access_token = '' + api_client = asana.ApiClient(configuration) # create an instance of the API class - api_instance = asana.UserTaskListsApi(asana.ApiClient(configuration)) + api_instance = asana.UserTaskListsApi(api_client) user_gid = 'me' # str | A string identifying a user. This can either be the string \"me\", an email, or the gid of a user. workspace = '1234' # str | The workspace in which to get the user task list. opt_fields = ["name","owner","workspace"] # list[str] | This endpoint returns a compact resource, which excludes some properties by default. To include those optional properties, set this query parameter to a comma-separated list of the properties you wish to include. (optional) try: - # Get a user's task list - api_response = api_instance.get_user_task_list_for_user(user_gid, workspace, opt_fields=opt_fields) - pprint(api_response) + # Get a user's task list + api_response = api_instance.get_user_task_list_for_user(user_gid, workspace, opt_fields=opt_fields) + pprint(api_response) except ApiException as e: - print("Exception when calling UserTaskListsApi->get_user_task_list_for_user: %s\n" % e) + print("Exception when calling UserTaskListsApi->get_user_task_list_for_user: %s\n" % e) diff --git a/docs/UsersApi.md b/docs/UsersApi.md index 3b09c62f..ccd10173 100644 --- a/docs/UsersApi.md +++ b/docs/UsersApi.md @@ -26,9 +26,10 @@ from pprint import pprint # Configure OAuth2 access token for authorization: oauth2 configuration = asana.Configuration() configuration.access_token = '' +api_client = asana.ApiClient(configuration) # create an instance of the API class -api_instance = asana.UsersApi(asana.ApiClient(configuration)) +api_instance = asana.UsersApi(api_client) user_gid = 'me' # str | A string identifying a user. This can either be the string \"me\", an email, or the gid of a user. resource_type = 'project' # str | The resource type of favorites to be returned. (default to project) workspace = '1234' # str | The workspace in which to get favorites. @@ -37,11 +38,11 @@ offset = 'eyJ0eXAiOJiKV1iQLCJhbGciOiJIUzI1NiJ9' # str | Offset token. An offset opt_fields = ["name","offset","path","uri"] # list[str] | This endpoint returns a compact resource, which excludes some properties by default. To include those optional properties, set this query parameter to a comma-separated list of the properties you wish to include. (optional) try: - # Get a user's favorites - api_response = api_instance.get_favorites_for_user(user_gid, resource_type, workspace, limit=limit, offset=offset, opt_fields=opt_fields) - pprint(api_response) + # Get a user's favorites + api_response = api_instance.get_favorites_for_user(user_gid, resource_type, workspace, limit=limit, offset=offset, opt_fields=opt_fields) + pprint(api_response) except ApiException as e: - print("Exception when calling UsersApi->get_favorites_for_user: %s\n" % e) + print("Exception when calling UsersApi->get_favorites_for_user: %s\n" % e) ``` ### Parameters @@ -86,18 +87,19 @@ from pprint import pprint # Configure OAuth2 access token for authorization: oauth2 configuration = asana.Configuration() configuration.access_token = '' +api_client = asana.ApiClient(configuration) # create an instance of the API class -api_instance = asana.UsersApi(asana.ApiClient(configuration)) +api_instance = asana.UsersApi(api_client) user_gid = 'me' # str | A string identifying a user. This can either be the string \"me\", an email, or the gid of a user. opt_fields = ["email","name","photo","photo.image_1024x1024","photo.image_128x128","photo.image_21x21","photo.image_27x27","photo.image_36x36","photo.image_60x60","workspaces","workspaces.name"] # list[str] | This endpoint returns a compact resource, which excludes some properties by default. To include those optional properties, set this query parameter to a comma-separated list of the properties you wish to include. (optional) try: - # Get a user - api_response = api_instance.get_user(user_gid, opt_fields=opt_fields) - pprint(api_response) + # Get a user + api_response = api_instance.get_user(user_gid, opt_fields=opt_fields) + pprint(api_response) except ApiException as e: - print("Exception when calling UsersApi->get_user: %s\n" % e) + print("Exception when calling UsersApi->get_user: %s\n" % e) ``` ### Parameters @@ -138,9 +140,10 @@ from pprint import pprint # Configure OAuth2 access token for authorization: oauth2 configuration = asana.Configuration() configuration.access_token = '' +api_client = asana.ApiClient(configuration) # create an instance of the API class -api_instance = asana.UsersApi(asana.ApiClient(configuration)) +api_instance = asana.UsersApi(api_client) workspace = '1331' # str | The workspace or organization ID to filter users on. (optional) team = '15627' # str | The team ID to filter users on. (optional) limit = 50 # int | Results per page. The number of objects to return per page. The value must be between 1 and 100. (optional) @@ -148,11 +151,11 @@ offset = 'eyJ0eXAiOJiKV1iQLCJhbGciOiJIUzI1NiJ9' # str | Offset token. An offset opt_fields = ["email","name","offset","path","photo","photo.image_1024x1024","photo.image_128x128","photo.image_21x21","photo.image_27x27","photo.image_36x36","photo.image_60x60","uri","workspaces","workspaces.name"] # list[str] | This endpoint returns a compact resource, which excludes some properties by default. To include those optional properties, set this query parameter to a comma-separated list of the properties you wish to include. (optional) try: - # Get multiple users - api_response = api_instance.get_users(workspace=workspace, team=team, limit=limit, offset=offset, opt_fields=opt_fields) - pprint(api_response) + # Get multiple users + api_response = api_instance.get_users(workspace=workspace, team=team, limit=limit, offset=offset, opt_fields=opt_fields) + pprint(api_response) except ApiException as e: - print("Exception when calling UsersApi->get_users: %s\n" % e) + print("Exception when calling UsersApi->get_users: %s\n" % e) ``` ### Parameters @@ -196,19 +199,20 @@ from pprint import pprint # Configure OAuth2 access token for authorization: oauth2 configuration = asana.Configuration() configuration.access_token = '' +api_client = asana.ApiClient(configuration) # create an instance of the API class -api_instance = asana.UsersApi(asana.ApiClient(configuration)) +api_instance = asana.UsersApi(api_client) team_gid = '159874' # str | Globally unique identifier for the team. offset = 'eyJ0eXAiOJiKV1iQLCJhbGciOiJIUzI1NiJ9' # 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.' (optional) opt_fields = ["email","name","photo","photo.image_1024x1024","photo.image_128x128","photo.image_21x21","photo.image_27x27","photo.image_36x36","photo.image_60x60","workspaces","workspaces.name"] # list[str] | This endpoint returns a compact resource, which excludes some properties by default. To include those optional properties, set this query parameter to a comma-separated list of the properties you wish to include. (optional) try: - # Get users in a team - api_response = api_instance.get_users_for_team(team_gid, offset=offset, opt_fields=opt_fields) - pprint(api_response) + # Get users in a team + api_response = api_instance.get_users_for_team(team_gid, offset=offset, opt_fields=opt_fields) + pprint(api_response) except ApiException as e: - print("Exception when calling UsersApi->get_users_for_team: %s\n" % e) + print("Exception when calling UsersApi->get_users_for_team: %s\n" % e) ``` ### Parameters @@ -250,19 +254,20 @@ from pprint import pprint # Configure OAuth2 access token for authorization: oauth2 configuration = asana.Configuration() configuration.access_token = '' +api_client = asana.ApiClient(configuration) # create an instance of the API class -api_instance = asana.UsersApi(asana.ApiClient(configuration)) +api_instance = asana.UsersApi(api_client) workspace_gid = '12345' # str | Globally unique identifier for the workspace or organization. offset = 'eyJ0eXAiOJiKV1iQLCJhbGciOiJIUzI1NiJ9' # 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.' (optional) opt_fields = ["email","name","photo","photo.image_1024x1024","photo.image_128x128","photo.image_21x21","photo.image_27x27","photo.image_36x36","photo.image_60x60","workspaces","workspaces.name"] # list[str] | This endpoint returns a compact resource, which excludes some properties by default. To include those optional properties, set this query parameter to a comma-separated list of the properties you wish to include. (optional) try: - # Get users in a workspace or organization - api_response = api_instance.get_users_for_workspace(workspace_gid, offset=offset, opt_fields=opt_fields) - pprint(api_response) + # Get users in a workspace or organization + api_response = api_instance.get_users_for_workspace(workspace_gid, offset=offset, opt_fields=opt_fields) + pprint(api_response) except ApiException as e: - print("Exception when calling UsersApi->get_users_for_workspace: %s\n" % e) + print("Exception when calling UsersApi->get_users_for_workspace: %s\n" % e) ``` ### Parameters diff --git a/docs/UsersApi.yaml b/docs/UsersApi.yaml index 3741723b..715f26b1 100644 --- a/docs/UsersApi.yaml +++ b/docs/UsersApi.yaml @@ -7,9 +7,10 @@ UsersApi: # Configure OAuth2 access token for authorization: oauth2 configuration = asana.Configuration() configuration.access_token = '' + api_client = asana.ApiClient(configuration) # create an instance of the API class - api_instance = asana.UsersApi(asana.ApiClient(configuration)) + api_instance = asana.UsersApi(api_client) user_gid = 'me' # str | A string identifying a user. This can either be the string \"me\", an email, or the gid of a user. resource_type = 'project' # str | The resource type of favorites to be returned. (default to project) workspace = '1234' # str | The workspace in which to get favorites. @@ -18,11 +19,11 @@ UsersApi: opt_fields = ["name","offset","path","uri"] # list[str] | This endpoint returns a compact resource, which excludes some properties by default. To include those optional properties, set this query parameter to a comma-separated list of the properties you wish to include. (optional) try: - # Get a user's favorites - api_response = api_instance.get_favorites_for_user(user_gid, resource_type, workspace, limit=limit, offset=offset, opt_fields=opt_fields) - pprint(api_response) + # Get a user's favorites + api_response = api_instance.get_favorites_for_user(user_gid, resource_type, workspace, limit=limit, offset=offset, opt_fields=opt_fields) + pprint(api_response) except ApiException as e: - print("Exception when calling UsersApi->get_favorites_for_user: %s\n" % e) + print("Exception when calling UsersApi->get_favorites_for_user: %s\n" % e) get_user: |- import asana from asana.rest import ApiException @@ -31,18 +32,19 @@ UsersApi: # Configure OAuth2 access token for authorization: oauth2 configuration = asana.Configuration() configuration.access_token = '' + api_client = asana.ApiClient(configuration) # create an instance of the API class - api_instance = asana.UsersApi(asana.ApiClient(configuration)) + api_instance = asana.UsersApi(api_client) user_gid = 'me' # str | A string identifying a user. This can either be the string \"me\", an email, or the gid of a user. opt_fields = ["email","name","photo","photo.image_1024x1024","photo.image_128x128","photo.image_21x21","photo.image_27x27","photo.image_36x36","photo.image_60x60","workspaces","workspaces.name"] # list[str] | This endpoint returns a compact resource, which excludes some properties by default. To include those optional properties, set this query parameter to a comma-separated list of the properties you wish to include. (optional) try: - # Get a user - api_response = api_instance.get_user(user_gid, opt_fields=opt_fields) - pprint(api_response) + # Get a user + api_response = api_instance.get_user(user_gid, opt_fields=opt_fields) + pprint(api_response) except ApiException as e: - print("Exception when calling UsersApi->get_user: %s\n" % e) + print("Exception when calling UsersApi->get_user: %s\n" % e) get_users: |- import asana from asana.rest import ApiException @@ -51,9 +53,10 @@ UsersApi: # Configure OAuth2 access token for authorization: oauth2 configuration = asana.Configuration() configuration.access_token = '' + api_client = asana.ApiClient(configuration) # create an instance of the API class - api_instance = asana.UsersApi(asana.ApiClient(configuration)) + api_instance = asana.UsersApi(api_client) workspace = '1331' # str | The workspace or organization ID to filter users on. (optional) team = '15627' # str | The team ID to filter users on. (optional) limit = 50 # int | Results per page. The number of objects to return per page. The value must be between 1 and 100. (optional) @@ -61,11 +64,11 @@ UsersApi: opt_fields = ["email","name","offset","path","photo","photo.image_1024x1024","photo.image_128x128","photo.image_21x21","photo.image_27x27","photo.image_36x36","photo.image_60x60","uri","workspaces","workspaces.name"] # list[str] | This endpoint returns a compact resource, which excludes some properties by default. To include those optional properties, set this query parameter to a comma-separated list of the properties you wish to include. (optional) try: - # Get multiple users - api_response = api_instance.get_users(workspace=workspace, team=team, limit=limit, offset=offset, opt_fields=opt_fields) - pprint(api_response) + # Get multiple users + api_response = api_instance.get_users(workspace=workspace, team=team, limit=limit, offset=offset, opt_fields=opt_fields) + pprint(api_response) except ApiException as e: - print("Exception when calling UsersApi->get_users: %s\n" % e) + print("Exception when calling UsersApi->get_users: %s\n" % e) get_users_for_team: |- import asana from asana.rest import ApiException @@ -74,19 +77,20 @@ UsersApi: # Configure OAuth2 access token for authorization: oauth2 configuration = asana.Configuration() configuration.access_token = '' + api_client = asana.ApiClient(configuration) # create an instance of the API class - api_instance = asana.UsersApi(asana.ApiClient(configuration)) + api_instance = asana.UsersApi(api_client) team_gid = '159874' # str | Globally unique identifier for the team. offset = 'eyJ0eXAiOJiKV1iQLCJhbGciOiJIUzI1NiJ9' # 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.' (optional) opt_fields = ["email","name","photo","photo.image_1024x1024","photo.image_128x128","photo.image_21x21","photo.image_27x27","photo.image_36x36","photo.image_60x60","workspaces","workspaces.name"] # list[str] | This endpoint returns a compact resource, which excludes some properties by default. To include those optional properties, set this query parameter to a comma-separated list of the properties you wish to include. (optional) try: - # Get users in a team - api_response = api_instance.get_users_for_team(team_gid, offset=offset, opt_fields=opt_fields) - pprint(api_response) + # Get users in a team + api_response = api_instance.get_users_for_team(team_gid, offset=offset, opt_fields=opt_fields) + pprint(api_response) except ApiException as e: - print("Exception when calling UsersApi->get_users_for_team: %s\n" % e) + print("Exception when calling UsersApi->get_users_for_team: %s\n" % e) get_users_for_workspace: |- import asana from asana.rest import ApiException @@ -95,16 +99,17 @@ UsersApi: # Configure OAuth2 access token for authorization: oauth2 configuration = asana.Configuration() configuration.access_token = '' + api_client = asana.ApiClient(configuration) # create an instance of the API class - api_instance = asana.UsersApi(asana.ApiClient(configuration)) + api_instance = asana.UsersApi(api_client) workspace_gid = '12345' # str | Globally unique identifier for the workspace or organization. offset = 'eyJ0eXAiOJiKV1iQLCJhbGciOiJIUzI1NiJ9' # 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.' (optional) opt_fields = ["email","name","photo","photo.image_1024x1024","photo.image_128x128","photo.image_21x21","photo.image_27x27","photo.image_36x36","photo.image_60x60","workspaces","workspaces.name"] # list[str] | This endpoint returns a compact resource, which excludes some properties by default. To include those optional properties, set this query parameter to a comma-separated list of the properties you wish to include. (optional) try: - # Get users in a workspace or organization - api_response = api_instance.get_users_for_workspace(workspace_gid, offset=offset, opt_fields=opt_fields) - pprint(api_response) + # Get users in a workspace or organization + api_response = api_instance.get_users_for_workspace(workspace_gid, offset=offset, opt_fields=opt_fields) + pprint(api_response) except ApiException as e: - print("Exception when calling UsersApi->get_users_for_workspace: %s\n" % e) + print("Exception when calling UsersApi->get_users_for_workspace: %s\n" % e) diff --git a/docs/WebhooksApi.md b/docs/WebhooksApi.md index d3695c54..947c2a58 100644 --- a/docs/WebhooksApi.md +++ b/docs/WebhooksApi.md @@ -26,18 +26,19 @@ from pprint import pprint # Configure OAuth2 access token for authorization: oauth2 configuration = asana.Configuration() configuration.access_token = '' +api_client = asana.ApiClient(configuration) # create an instance of the API class -api_instance = asana.WebhooksApi(asana.ApiClient(configuration)) +api_instance = asana.WebhooksApi(api_client) body = asana.WebhooksBody({"param1": "value1", "param2": "value2",}) # WebhooksBody | The webhook workspace and target. opt_fields = ["active","created_at","filters","filters.action","filters.fields","filters.resource_subtype","last_failure_at","last_failure_content","last_success_at","resource","resource.name","target"] # list[str] | This endpoint returns a compact resource, which excludes some properties by default. To include those optional properties, set this query parameter to a comma-separated list of the properties you wish to include. (optional) try: - # Establish a webhook - api_response = api_instance.create_webhook(body, opt_fields=opt_fields) - pprint(api_response) + # Establish a webhook + api_response = api_instance.create_webhook(body, opt_fields=opt_fields) + pprint(api_response) except ApiException as e: - print("Exception when calling WebhooksApi->create_webhook: %s\n" % e) + print("Exception when calling WebhooksApi->create_webhook: %s\n" % e) ``` ### Parameters @@ -78,17 +79,18 @@ from pprint import pprint # Configure OAuth2 access token for authorization: oauth2 configuration = asana.Configuration() configuration.access_token = '' +api_client = asana.ApiClient(configuration) # create an instance of the API class -api_instance = asana.WebhooksApi(asana.ApiClient(configuration)) +api_instance = asana.WebhooksApi(api_client) webhook_gid = '12345' # str | Globally unique identifier for the webhook. try: - # Delete a webhook - api_response = api_instance.delete_webhook(webhook_gid) - pprint(api_response) + # Delete a webhook + api_response = api_instance.delete_webhook(webhook_gid) + pprint(api_response) except ApiException as e: - print("Exception when calling WebhooksApi->delete_webhook: %s\n" % e) + print("Exception when calling WebhooksApi->delete_webhook: %s\n" % e) ``` ### Parameters @@ -128,18 +130,19 @@ from pprint import pprint # Configure OAuth2 access token for authorization: oauth2 configuration = asana.Configuration() configuration.access_token = '' +api_client = asana.ApiClient(configuration) # create an instance of the API class -api_instance = asana.WebhooksApi(asana.ApiClient(configuration)) +api_instance = asana.WebhooksApi(api_client) webhook_gid = '12345' # str | Globally unique identifier for the webhook. opt_fields = ["active","created_at","filters","filters.action","filters.fields","filters.resource_subtype","last_failure_at","last_failure_content","last_success_at","resource","resource.name","target"] # list[str] | This endpoint returns a compact resource, which excludes some properties by default. To include those optional properties, set this query parameter to a comma-separated list of the properties you wish to include. (optional) try: - # Get a webhook - api_response = api_instance.get_webhook(webhook_gid, opt_fields=opt_fields) - pprint(api_response) + # Get a webhook + api_response = api_instance.get_webhook(webhook_gid, opt_fields=opt_fields) + pprint(api_response) except ApiException as e: - print("Exception when calling WebhooksApi->get_webhook: %s\n" % e) + print("Exception when calling WebhooksApi->get_webhook: %s\n" % e) ``` ### Parameters @@ -180,9 +183,10 @@ from pprint import pprint # Configure OAuth2 access token for authorization: oauth2 configuration = asana.Configuration() configuration.access_token = '' +api_client = asana.ApiClient(configuration) # create an instance of the API class -api_instance = asana.WebhooksApi(asana.ApiClient(configuration)) +api_instance = asana.WebhooksApi(api_client) workspace = '1331' # str | The workspace to query for webhooks in. limit = 50 # int | Results per page. The number of objects to return per page. The value must be between 1 and 100. (optional) offset = 'eyJ0eXAiOJiKV1iQLCJhbGciOiJIUzI1NiJ9' # 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.' (optional) @@ -190,11 +194,11 @@ resource = '51648' # str | Only return webhooks for the given resource. (optiona opt_fields = ["active","created_at","filters","filters.action","filters.fields","filters.resource_subtype","last_failure_at","last_failure_content","last_success_at","offset","path","resource","resource.name","target","uri"] # list[str] | This endpoint returns a compact resource, which excludes some properties by default. To include those optional properties, set this query parameter to a comma-separated list of the properties you wish to include. (optional) try: - # Get multiple webhooks - api_response = api_instance.get_webhooks(workspace, limit=limit, offset=offset, resource=resource, opt_fields=opt_fields) - pprint(api_response) + # Get multiple webhooks + api_response = api_instance.get_webhooks(workspace, limit=limit, offset=offset, resource=resource, opt_fields=opt_fields) + pprint(api_response) except ApiException as e: - print("Exception when calling WebhooksApi->get_webhooks: %s\n" % e) + print("Exception when calling WebhooksApi->get_webhooks: %s\n" % e) ``` ### Parameters @@ -238,19 +242,20 @@ from pprint import pprint # Configure OAuth2 access token for authorization: oauth2 configuration = asana.Configuration() configuration.access_token = '' +api_client = asana.ApiClient(configuration) # create an instance of the API class -api_instance = asana.WebhooksApi(asana.ApiClient(configuration)) +api_instance = asana.WebhooksApi(api_client) body = asana.WebhooksWebhookGidBody({"param1": "value1", "param2": "value2",}) # WebhooksWebhookGidBody | The updated filters for the webhook. webhook_gid = '12345' # str | Globally unique identifier for the webhook. opt_fields = ["active","created_at","filters","filters.action","filters.fields","filters.resource_subtype","last_failure_at","last_failure_content","last_success_at","resource","resource.name","target"] # list[str] | This endpoint returns a compact resource, which excludes some properties by default. To include those optional properties, set this query parameter to a comma-separated list of the properties you wish to include. (optional) try: - # Update a webhook - api_response = api_instance.update_webhook(body, webhook_gid, opt_fields=opt_fields) - pprint(api_response) + # Update a webhook + api_response = api_instance.update_webhook(body, webhook_gid, opt_fields=opt_fields) + pprint(api_response) except ApiException as e: - print("Exception when calling WebhooksApi->update_webhook: %s\n" % e) + print("Exception when calling WebhooksApi->update_webhook: %s\n" % e) ``` ### Parameters diff --git a/docs/WebhooksApi.yaml b/docs/WebhooksApi.yaml index 4fd02bb1..9b8fd4ff 100644 --- a/docs/WebhooksApi.yaml +++ b/docs/WebhooksApi.yaml @@ -7,18 +7,19 @@ WebhooksApi: # Configure OAuth2 access token for authorization: oauth2 configuration = asana.Configuration() configuration.access_token = '' + api_client = asana.ApiClient(configuration) # create an instance of the API class - api_instance = asana.WebhooksApi(asana.ApiClient(configuration)) + api_instance = asana.WebhooksApi(api_client) body = asana.WebhooksBody({"param1": "value1", "param2": "value2",}) # WebhooksBody | The webhook workspace and target. opt_fields = ["active","created_at","filters","filters.action","filters.fields","filters.resource_subtype","last_failure_at","last_failure_content","last_success_at","resource","resource.name","target"] # list[str] | This endpoint returns a compact resource, which excludes some properties by default. To include those optional properties, set this query parameter to a comma-separated list of the properties you wish to include. (optional) try: - # Establish a webhook - api_response = api_instance.create_webhook(body, opt_fields=opt_fields) - pprint(api_response) + # Establish a webhook + api_response = api_instance.create_webhook(body, opt_fields=opt_fields) + pprint(api_response) except ApiException as e: - print("Exception when calling WebhooksApi->create_webhook: %s\n" % e) + print("Exception when calling WebhooksApi->create_webhook: %s\n" % e) delete_webhook: |- import asana from asana.rest import ApiException @@ -27,17 +28,18 @@ WebhooksApi: # Configure OAuth2 access token for authorization: oauth2 configuration = asana.Configuration() configuration.access_token = '' + api_client = asana.ApiClient(configuration) # create an instance of the API class - api_instance = asana.WebhooksApi(asana.ApiClient(configuration)) + api_instance = asana.WebhooksApi(api_client) webhook_gid = '12345' # str | Globally unique identifier for the webhook. try: - # Delete a webhook - api_response = api_instance.delete_webhook(webhook_gid) - pprint(api_response) + # Delete a webhook + api_response = api_instance.delete_webhook(webhook_gid) + pprint(api_response) except ApiException as e: - print("Exception when calling WebhooksApi->delete_webhook: %s\n" % e) + print("Exception when calling WebhooksApi->delete_webhook: %s\n" % e) get_webhook: |- import asana from asana.rest import ApiException @@ -46,18 +48,19 @@ WebhooksApi: # Configure OAuth2 access token for authorization: oauth2 configuration = asana.Configuration() configuration.access_token = '' + api_client = asana.ApiClient(configuration) # create an instance of the API class - api_instance = asana.WebhooksApi(asana.ApiClient(configuration)) + api_instance = asana.WebhooksApi(api_client) webhook_gid = '12345' # str | Globally unique identifier for the webhook. opt_fields = ["active","created_at","filters","filters.action","filters.fields","filters.resource_subtype","last_failure_at","last_failure_content","last_success_at","resource","resource.name","target"] # list[str] | This endpoint returns a compact resource, which excludes some properties by default. To include those optional properties, set this query parameter to a comma-separated list of the properties you wish to include. (optional) try: - # Get a webhook - api_response = api_instance.get_webhook(webhook_gid, opt_fields=opt_fields) - pprint(api_response) + # Get a webhook + api_response = api_instance.get_webhook(webhook_gid, opt_fields=opt_fields) + pprint(api_response) except ApiException as e: - print("Exception when calling WebhooksApi->get_webhook: %s\n" % e) + print("Exception when calling WebhooksApi->get_webhook: %s\n" % e) get_webhooks: |- import asana from asana.rest import ApiException @@ -66,9 +69,10 @@ WebhooksApi: # Configure OAuth2 access token for authorization: oauth2 configuration = asana.Configuration() configuration.access_token = '' + api_client = asana.ApiClient(configuration) # create an instance of the API class - api_instance = asana.WebhooksApi(asana.ApiClient(configuration)) + api_instance = asana.WebhooksApi(api_client) workspace = '1331' # str | The workspace to query for webhooks in. limit = 50 # int | Results per page. The number of objects to return per page. The value must be between 1 and 100. (optional) offset = 'eyJ0eXAiOJiKV1iQLCJhbGciOiJIUzI1NiJ9' # 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.' (optional) @@ -76,11 +80,11 @@ WebhooksApi: opt_fields = ["active","created_at","filters","filters.action","filters.fields","filters.resource_subtype","last_failure_at","last_failure_content","last_success_at","offset","path","resource","resource.name","target","uri"] # list[str] | This endpoint returns a compact resource, which excludes some properties by default. To include those optional properties, set this query parameter to a comma-separated list of the properties you wish to include. (optional) try: - # Get multiple webhooks - api_response = api_instance.get_webhooks(workspace, limit=limit, offset=offset, resource=resource, opt_fields=opt_fields) - pprint(api_response) + # Get multiple webhooks + api_response = api_instance.get_webhooks(workspace, limit=limit, offset=offset, resource=resource, opt_fields=opt_fields) + pprint(api_response) except ApiException as e: - print("Exception when calling WebhooksApi->get_webhooks: %s\n" % e) + print("Exception when calling WebhooksApi->get_webhooks: %s\n" % e) update_webhook: |- import asana from asana.rest import ApiException @@ -89,16 +93,17 @@ WebhooksApi: # Configure OAuth2 access token for authorization: oauth2 configuration = asana.Configuration() configuration.access_token = '' + api_client = asana.ApiClient(configuration) # create an instance of the API class - api_instance = asana.WebhooksApi(asana.ApiClient(configuration)) + api_instance = asana.WebhooksApi(api_client) body = asana.WebhooksWebhookGidBody({"param1": "value1", "param2": "value2",}) # WebhooksWebhookGidBody | The updated filters for the webhook. webhook_gid = '12345' # str | Globally unique identifier for the webhook. opt_fields = ["active","created_at","filters","filters.action","filters.fields","filters.resource_subtype","last_failure_at","last_failure_content","last_success_at","resource","resource.name","target"] # list[str] | This endpoint returns a compact resource, which excludes some properties by default. To include those optional properties, set this query parameter to a comma-separated list of the properties you wish to include. (optional) try: - # Update a webhook - api_response = api_instance.update_webhook(body, webhook_gid, opt_fields=opt_fields) - pprint(api_response) + # Update a webhook + api_response = api_instance.update_webhook(body, webhook_gid, opt_fields=opt_fields) + pprint(api_response) except ApiException as e: - print("Exception when calling WebhooksApi->update_webhook: %s\n" % e) + print("Exception when calling WebhooksApi->update_webhook: %s\n" % e) diff --git a/docs/WorkspaceMembershipsApi.md b/docs/WorkspaceMembershipsApi.md index eaa2b916..5c198601 100644 --- a/docs/WorkspaceMembershipsApi.md +++ b/docs/WorkspaceMembershipsApi.md @@ -24,18 +24,19 @@ from pprint import pprint # Configure OAuth2 access token for authorization: oauth2 configuration = asana.Configuration() configuration.access_token = '' +api_client = asana.ApiClient(configuration) # create an instance of the API class -api_instance = asana.WorkspaceMembershipsApi(asana.ApiClient(configuration)) +api_instance = asana.WorkspaceMembershipsApi(api_client) workspace_membership_gid = '12345' # str | opt_fields = ["created_at","is_active","is_admin","is_guest","user","user.name","user_task_list","user_task_list.name","user_task_list.owner","user_task_list.workspace","vacation_dates","vacation_dates.end_on","vacation_dates.start_on","workspace","workspace.name"] # list[str] | This endpoint returns a compact resource, which excludes some properties by default. To include those optional properties, set this query parameter to a comma-separated list of the properties you wish to include. (optional) try: - # Get a workspace membership - api_response = api_instance.get_workspace_membership(workspace_membership_gid, opt_fields=opt_fields) - pprint(api_response) + # Get a workspace membership + api_response = api_instance.get_workspace_membership(workspace_membership_gid, opt_fields=opt_fields) + pprint(api_response) except ApiException as e: - print("Exception when calling WorkspaceMembershipsApi->get_workspace_membership: %s\n" % e) + print("Exception when calling WorkspaceMembershipsApi->get_workspace_membership: %s\n" % e) ``` ### Parameters @@ -76,20 +77,21 @@ from pprint import pprint # Configure OAuth2 access token for authorization: oauth2 configuration = asana.Configuration() configuration.access_token = '' +api_client = asana.ApiClient(configuration) # create an instance of the API class -api_instance = asana.WorkspaceMembershipsApi(asana.ApiClient(configuration)) +api_instance = asana.WorkspaceMembershipsApi(api_client) user_gid = 'me' # str | A string identifying a user. This can either be the string \"me\", an email, or the gid of a user. limit = 50 # int | Results per page. The number of objects to return per page. The value must be between 1 and 100. (optional) offset = 'eyJ0eXAiOJiKV1iQLCJhbGciOiJIUzI1NiJ9' # 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.' (optional) opt_fields = ["created_at","is_active","is_admin","is_guest","offset","path","uri","user","user.name","user_task_list","user_task_list.name","user_task_list.owner","user_task_list.workspace","vacation_dates","vacation_dates.end_on","vacation_dates.start_on","workspace","workspace.name"] # list[str] | This endpoint returns a compact resource, which excludes some properties by default. To include those optional properties, set this query parameter to a comma-separated list of the properties you wish to include. (optional) try: - # Get workspace memberships for a user - api_response = api_instance.get_workspace_memberships_for_user(user_gid, limit=limit, offset=offset, opt_fields=opt_fields) - pprint(api_response) + # Get workspace memberships for a user + api_response = api_instance.get_workspace_memberships_for_user(user_gid, limit=limit, offset=offset, opt_fields=opt_fields) + pprint(api_response) except ApiException as e: - print("Exception when calling WorkspaceMembershipsApi->get_workspace_memberships_for_user: %s\n" % e) + print("Exception when calling WorkspaceMembershipsApi->get_workspace_memberships_for_user: %s\n" % e) ``` ### Parameters @@ -132,9 +134,10 @@ from pprint import pprint # Configure OAuth2 access token for authorization: oauth2 configuration = asana.Configuration() configuration.access_token = '' +api_client = asana.ApiClient(configuration) # create an instance of the API class -api_instance = asana.WorkspaceMembershipsApi(asana.ApiClient(configuration)) +api_instance = asana.WorkspaceMembershipsApi(api_client) workspace_gid = '12345' # str | Globally unique identifier for the workspace or organization. user = 'me' # str | A string identifying a user. This can either be the string \"me\", an email, or the gid of a user. (optional) limit = 50 # int | Results per page. The number of objects to return per page. The value must be between 1 and 100. (optional) @@ -142,11 +145,11 @@ offset = 'eyJ0eXAiOJiKV1iQLCJhbGciOiJIUzI1NiJ9' # str | Offset token. An offset opt_fields = ["created_at","is_active","is_admin","is_guest","offset","path","uri","user","user.name","user_task_list","user_task_list.name","user_task_list.owner","user_task_list.workspace","vacation_dates","vacation_dates.end_on","vacation_dates.start_on","workspace","workspace.name"] # list[str] | This endpoint returns a compact resource, which excludes some properties by default. To include those optional properties, set this query parameter to a comma-separated list of the properties you wish to include. (optional) try: - # Get the workspace memberships for a workspace - api_response = api_instance.get_workspace_memberships_for_workspace(workspace_gid, user=user, limit=limit, offset=offset, opt_fields=opt_fields) - pprint(api_response) + # Get the workspace memberships for a workspace + api_response = api_instance.get_workspace_memberships_for_workspace(workspace_gid, user=user, limit=limit, offset=offset, opt_fields=opt_fields) + pprint(api_response) except ApiException as e: - print("Exception when calling WorkspaceMembershipsApi->get_workspace_memberships_for_workspace: %s\n" % e) + print("Exception when calling WorkspaceMembershipsApi->get_workspace_memberships_for_workspace: %s\n" % e) ``` ### Parameters diff --git a/docs/WorkspaceMembershipsApi.yaml b/docs/WorkspaceMembershipsApi.yaml index dbfb0e33..22ac165b 100644 --- a/docs/WorkspaceMembershipsApi.yaml +++ b/docs/WorkspaceMembershipsApi.yaml @@ -7,18 +7,19 @@ WorkspaceMembershipsApi: # Configure OAuth2 access token for authorization: oauth2 configuration = asana.Configuration() configuration.access_token = '' + api_client = asana.ApiClient(configuration) # create an instance of the API class - api_instance = asana.WorkspaceMembershipsApi(asana.ApiClient(configuration)) + api_instance = asana.WorkspaceMembershipsApi(api_client) workspace_membership_gid = '12345' # str | opt_fields = ["created_at","is_active","is_admin","is_guest","user","user.name","user_task_list","user_task_list.name","user_task_list.owner","user_task_list.workspace","vacation_dates","vacation_dates.end_on","vacation_dates.start_on","workspace","workspace.name"] # list[str] | This endpoint returns a compact resource, which excludes some properties by default. To include those optional properties, set this query parameter to a comma-separated list of the properties you wish to include. (optional) try: - # Get a workspace membership - api_response = api_instance.get_workspace_membership(workspace_membership_gid, opt_fields=opt_fields) - pprint(api_response) + # Get a workspace membership + api_response = api_instance.get_workspace_membership(workspace_membership_gid, opt_fields=opt_fields) + pprint(api_response) except ApiException as e: - print("Exception when calling WorkspaceMembershipsApi->get_workspace_membership: %s\n" % e) + print("Exception when calling WorkspaceMembershipsApi->get_workspace_membership: %s\n" % e) get_workspace_memberships_for_user: |- import asana from asana.rest import ApiException @@ -27,20 +28,21 @@ WorkspaceMembershipsApi: # Configure OAuth2 access token for authorization: oauth2 configuration = asana.Configuration() configuration.access_token = '' + api_client = asana.ApiClient(configuration) # create an instance of the API class - api_instance = asana.WorkspaceMembershipsApi(asana.ApiClient(configuration)) + api_instance = asana.WorkspaceMembershipsApi(api_client) user_gid = 'me' # str | A string identifying a user. This can either be the string \"me\", an email, or the gid of a user. limit = 50 # int | Results per page. The number of objects to return per page. The value must be between 1 and 100. (optional) offset = 'eyJ0eXAiOJiKV1iQLCJhbGciOiJIUzI1NiJ9' # 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.' (optional) opt_fields = ["created_at","is_active","is_admin","is_guest","offset","path","uri","user","user.name","user_task_list","user_task_list.name","user_task_list.owner","user_task_list.workspace","vacation_dates","vacation_dates.end_on","vacation_dates.start_on","workspace","workspace.name"] # list[str] | This endpoint returns a compact resource, which excludes some properties by default. To include those optional properties, set this query parameter to a comma-separated list of the properties you wish to include. (optional) try: - # Get workspace memberships for a user - api_response = api_instance.get_workspace_memberships_for_user(user_gid, limit=limit, offset=offset, opt_fields=opt_fields) - pprint(api_response) + # Get workspace memberships for a user + api_response = api_instance.get_workspace_memberships_for_user(user_gid, limit=limit, offset=offset, opt_fields=opt_fields) + pprint(api_response) except ApiException as e: - print("Exception when calling WorkspaceMembershipsApi->get_workspace_memberships_for_user: %s\n" % e) + print("Exception when calling WorkspaceMembershipsApi->get_workspace_memberships_for_user: %s\n" % e) get_workspace_memberships_for_workspace: |- import asana from asana.rest import ApiException @@ -49,9 +51,10 @@ WorkspaceMembershipsApi: # Configure OAuth2 access token for authorization: oauth2 configuration = asana.Configuration() configuration.access_token = '' + api_client = asana.ApiClient(configuration) # create an instance of the API class - api_instance = asana.WorkspaceMembershipsApi(asana.ApiClient(configuration)) + api_instance = asana.WorkspaceMembershipsApi(api_client) workspace_gid = '12345' # str | Globally unique identifier for the workspace or organization. user = 'me' # str | A string identifying a user. This can either be the string \"me\", an email, or the gid of a user. (optional) limit = 50 # int | Results per page. The number of objects to return per page. The value must be between 1 and 100. (optional) @@ -59,8 +62,8 @@ WorkspaceMembershipsApi: opt_fields = ["created_at","is_active","is_admin","is_guest","offset","path","uri","user","user.name","user_task_list","user_task_list.name","user_task_list.owner","user_task_list.workspace","vacation_dates","vacation_dates.end_on","vacation_dates.start_on","workspace","workspace.name"] # list[str] | This endpoint returns a compact resource, which excludes some properties by default. To include those optional properties, set this query parameter to a comma-separated list of the properties you wish to include. (optional) try: - # Get the workspace memberships for a workspace - api_response = api_instance.get_workspace_memberships_for_workspace(workspace_gid, user=user, limit=limit, offset=offset, opt_fields=opt_fields) - pprint(api_response) + # Get the workspace memberships for a workspace + api_response = api_instance.get_workspace_memberships_for_workspace(workspace_gid, user=user, limit=limit, offset=offset, opt_fields=opt_fields) + pprint(api_response) except ApiException as e: - print("Exception when calling WorkspaceMembershipsApi->get_workspace_memberships_for_workspace: %s\n" % e) + print("Exception when calling WorkspaceMembershipsApi->get_workspace_memberships_for_workspace: %s\n" % e) diff --git a/docs/WorkspacesApi.md b/docs/WorkspacesApi.md index 3a16a27e..7eaf913d 100644 --- a/docs/WorkspacesApi.md +++ b/docs/WorkspacesApi.md @@ -26,19 +26,20 @@ from pprint import pprint # Configure OAuth2 access token for authorization: oauth2 configuration = asana.Configuration() configuration.access_token = '' +api_client = asana.ApiClient(configuration) # create an instance of the API class -api_instance = asana.WorkspacesApi(asana.ApiClient(configuration)) +api_instance = asana.WorkspacesApi(api_client) body = asana.WorkspaceGidAddUserBody({"param1": "value1", "param2": "value2",}) # WorkspaceGidAddUserBody | The user to add to the workspace. workspace_gid = '12345' # str | Globally unique identifier for the workspace or organization. opt_fields = ["email","name","photo","photo.image_1024x1024","photo.image_128x128","photo.image_21x21","photo.image_27x27","photo.image_36x36","photo.image_60x60"] # list[str] | This endpoint returns a compact resource, which excludes some properties by default. To include those optional properties, set this query parameter to a comma-separated list of the properties you wish to include. (optional) try: - # Add a user to a workspace or organization - api_response = api_instance.add_user_for_workspace(body, workspace_gid, opt_fields=opt_fields) - pprint(api_response) + # Add a user to a workspace or organization + api_response = api_instance.add_user_for_workspace(body, workspace_gid, opt_fields=opt_fields) + pprint(api_response) except ApiException as e: - print("Exception when calling WorkspacesApi->add_user_for_workspace: %s\n" % e) + print("Exception when calling WorkspacesApi->add_user_for_workspace: %s\n" % e) ``` ### Parameters @@ -80,18 +81,19 @@ from pprint import pprint # Configure OAuth2 access token for authorization: oauth2 configuration = asana.Configuration() configuration.access_token = '' +api_client = asana.ApiClient(configuration) # create an instance of the API class -api_instance = asana.WorkspacesApi(asana.ApiClient(configuration)) +api_instance = asana.WorkspacesApi(api_client) workspace_gid = '12345' # str | Globally unique identifier for the workspace or organization. opt_fields = ["email_domains","is_organization","name"] # list[str] | This endpoint returns a compact resource, which excludes some properties by default. To include those optional properties, set this query parameter to a comma-separated list of the properties you wish to include. (optional) try: - # Get a workspace - api_response = api_instance.get_workspace(workspace_gid, opt_fields=opt_fields) - pprint(api_response) + # Get a workspace + api_response = api_instance.get_workspace(workspace_gid, opt_fields=opt_fields) + pprint(api_response) except ApiException as e: - print("Exception when calling WorkspacesApi->get_workspace: %s\n" % e) + print("Exception when calling WorkspacesApi->get_workspace: %s\n" % e) ``` ### Parameters @@ -132,19 +134,20 @@ from pprint import pprint # Configure OAuth2 access token for authorization: oauth2 configuration = asana.Configuration() configuration.access_token = '' +api_client = asana.ApiClient(configuration) # create an instance of the API class -api_instance = asana.WorkspacesApi(asana.ApiClient(configuration)) +api_instance = asana.WorkspacesApi(api_client) limit = 50 # int | Results per page. The number of objects to return per page. The value must be between 1 and 100. (optional) offset = 'eyJ0eXAiOJiKV1iQLCJhbGciOiJIUzI1NiJ9' # 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.' (optional) opt_fields = ["email_domains","is_organization","name","offset","path","uri"] # list[str] | This endpoint returns a compact resource, which excludes some properties by default. To include those optional properties, set this query parameter to a comma-separated list of the properties you wish to include. (optional) try: - # Get multiple workspaces - api_response = api_instance.get_workspaces(limit=limit, offset=offset, opt_fields=opt_fields) - pprint(api_response) + # Get multiple workspaces + api_response = api_instance.get_workspaces(limit=limit, offset=offset, opt_fields=opt_fields) + pprint(api_response) except ApiException as e: - print("Exception when calling WorkspacesApi->get_workspaces: %s\n" % e) + print("Exception when calling WorkspacesApi->get_workspaces: %s\n" % e) ``` ### Parameters @@ -186,18 +189,19 @@ from pprint import pprint # Configure OAuth2 access token for authorization: oauth2 configuration = asana.Configuration() configuration.access_token = '' +api_client = asana.ApiClient(configuration) # create an instance of the API class -api_instance = asana.WorkspacesApi(asana.ApiClient(configuration)) +api_instance = asana.WorkspacesApi(api_client) body = asana.WorkspaceGidRemoveUserBody({"param1": "value1", "param2": "value2",}) # WorkspaceGidRemoveUserBody | The user to remove from the workspace. workspace_gid = '12345' # str | Globally unique identifier for the workspace or organization. try: - # Remove a user from a workspace or organization - api_response = api_instance.remove_user_for_workspace(body, workspace_gid) - pprint(api_response) + # Remove a user from a workspace or organization + api_response = api_instance.remove_user_for_workspace(body, workspace_gid) + pprint(api_response) except ApiException as e: - print("Exception when calling WorkspacesApi->remove_user_for_workspace: %s\n" % e) + print("Exception when calling WorkspacesApi->remove_user_for_workspace: %s\n" % e) ``` ### Parameters @@ -238,19 +242,20 @@ from pprint import pprint # Configure OAuth2 access token for authorization: oauth2 configuration = asana.Configuration() configuration.access_token = '' +api_client = asana.ApiClient(configuration) # create an instance of the API class -api_instance = asana.WorkspacesApi(asana.ApiClient(configuration)) +api_instance = asana.WorkspacesApi(api_client) body = asana.WorkspacesWorkspaceGidBody({"param1": "value1", "param2": "value2",}) # WorkspacesWorkspaceGidBody | The workspace object with all updated properties. workspace_gid = '12345' # str | Globally unique identifier for the workspace or organization. opt_fields = ["email_domains","is_organization","name"] # list[str] | This endpoint returns a compact resource, which excludes some properties by default. To include those optional properties, set this query parameter to a comma-separated list of the properties you wish to include. (optional) try: - # Update a workspace - api_response = api_instance.update_workspace(body, workspace_gid, opt_fields=opt_fields) - pprint(api_response) + # Update a workspace + api_response = api_instance.update_workspace(body, workspace_gid, opt_fields=opt_fields) + pprint(api_response) except ApiException as e: - print("Exception when calling WorkspacesApi->update_workspace: %s\n" % e) + print("Exception when calling WorkspacesApi->update_workspace: %s\n" % e) ``` ### Parameters diff --git a/docs/WorkspacesApi.yaml b/docs/WorkspacesApi.yaml index 76dbd2ea..458a7a5f 100644 --- a/docs/WorkspacesApi.yaml +++ b/docs/WorkspacesApi.yaml @@ -7,19 +7,20 @@ WorkspacesApi: # Configure OAuth2 access token for authorization: oauth2 configuration = asana.Configuration() configuration.access_token = '' + api_client = asana.ApiClient(configuration) # create an instance of the API class - api_instance = asana.WorkspacesApi(asana.ApiClient(configuration)) + api_instance = asana.WorkspacesApi(api_client) body = asana.WorkspaceGidAddUserBody({"param1": "value1", "param2": "value2",}) # WorkspaceGidAddUserBody | The user to add to the workspace. workspace_gid = '12345' # str | Globally unique identifier for the workspace or organization. opt_fields = ["email","name","photo","photo.image_1024x1024","photo.image_128x128","photo.image_21x21","photo.image_27x27","photo.image_36x36","photo.image_60x60"] # list[str] | This endpoint returns a compact resource, which excludes some properties by default. To include those optional properties, set this query parameter to a comma-separated list of the properties you wish to include. (optional) try: - # Add a user to a workspace or organization - api_response = api_instance.add_user_for_workspace(body, workspace_gid, opt_fields=opt_fields) - pprint(api_response) + # Add a user to a workspace or organization + api_response = api_instance.add_user_for_workspace(body, workspace_gid, opt_fields=opt_fields) + pprint(api_response) except ApiException as e: - print("Exception when calling WorkspacesApi->add_user_for_workspace: %s\n" % e) + print("Exception when calling WorkspacesApi->add_user_for_workspace: %s\n" % e) get_workspace: |- import asana from asana.rest import ApiException @@ -28,18 +29,19 @@ WorkspacesApi: # Configure OAuth2 access token for authorization: oauth2 configuration = asana.Configuration() configuration.access_token = '' + api_client = asana.ApiClient(configuration) # create an instance of the API class - api_instance = asana.WorkspacesApi(asana.ApiClient(configuration)) + api_instance = asana.WorkspacesApi(api_client) workspace_gid = '12345' # str | Globally unique identifier for the workspace or organization. opt_fields = ["email_domains","is_organization","name"] # list[str] | This endpoint returns a compact resource, which excludes some properties by default. To include those optional properties, set this query parameter to a comma-separated list of the properties you wish to include. (optional) try: - # Get a workspace - api_response = api_instance.get_workspace(workspace_gid, opt_fields=opt_fields) - pprint(api_response) + # Get a workspace + api_response = api_instance.get_workspace(workspace_gid, opt_fields=opt_fields) + pprint(api_response) except ApiException as e: - print("Exception when calling WorkspacesApi->get_workspace: %s\n" % e) + print("Exception when calling WorkspacesApi->get_workspace: %s\n" % e) get_workspaces: |- import asana from asana.rest import ApiException @@ -48,19 +50,20 @@ WorkspacesApi: # Configure OAuth2 access token for authorization: oauth2 configuration = asana.Configuration() configuration.access_token = '' + api_client = asana.ApiClient(configuration) # create an instance of the API class - api_instance = asana.WorkspacesApi(asana.ApiClient(configuration)) + api_instance = asana.WorkspacesApi(api_client) limit = 50 # int | Results per page. The number of objects to return per page. The value must be between 1 and 100. (optional) offset = 'eyJ0eXAiOJiKV1iQLCJhbGciOiJIUzI1NiJ9' # 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.' (optional) opt_fields = ["email_domains","is_organization","name","offset","path","uri"] # list[str] | This endpoint returns a compact resource, which excludes some properties by default. To include those optional properties, set this query parameter to a comma-separated list of the properties you wish to include. (optional) try: - # Get multiple workspaces - api_response = api_instance.get_workspaces(limit=limit, offset=offset, opt_fields=opt_fields) - pprint(api_response) + # Get multiple workspaces + api_response = api_instance.get_workspaces(limit=limit, offset=offset, opt_fields=opt_fields) + pprint(api_response) except ApiException as e: - print("Exception when calling WorkspacesApi->get_workspaces: %s\n" % e) + print("Exception when calling WorkspacesApi->get_workspaces: %s\n" % e) remove_user_for_workspace: |- import asana from asana.rest import ApiException @@ -69,18 +72,19 @@ WorkspacesApi: # Configure OAuth2 access token for authorization: oauth2 configuration = asana.Configuration() configuration.access_token = '' + api_client = asana.ApiClient(configuration) # create an instance of the API class - api_instance = asana.WorkspacesApi(asana.ApiClient(configuration)) + api_instance = asana.WorkspacesApi(api_client) body = asana.WorkspaceGidRemoveUserBody({"param1": "value1", "param2": "value2",}) # WorkspaceGidRemoveUserBody | The user to remove from the workspace. workspace_gid = '12345' # str | Globally unique identifier for the workspace or organization. try: - # Remove a user from a workspace or organization - api_response = api_instance.remove_user_for_workspace(body, workspace_gid) - pprint(api_response) + # Remove a user from a workspace or organization + api_response = api_instance.remove_user_for_workspace(body, workspace_gid) + pprint(api_response) except ApiException as e: - print("Exception when calling WorkspacesApi->remove_user_for_workspace: %s\n" % e) + print("Exception when calling WorkspacesApi->remove_user_for_workspace: %s\n" % e) update_workspace: |- import asana from asana.rest import ApiException @@ -89,16 +93,17 @@ WorkspacesApi: # Configure OAuth2 access token for authorization: oauth2 configuration = asana.Configuration() configuration.access_token = '' + api_client = asana.ApiClient(configuration) # create an instance of the API class - api_instance = asana.WorkspacesApi(asana.ApiClient(configuration)) + api_instance = asana.WorkspacesApi(api_client) body = asana.WorkspacesWorkspaceGidBody({"param1": "value1", "param2": "value2",}) # WorkspacesWorkspaceGidBody | The workspace object with all updated properties. workspace_gid = '12345' # str | Globally unique identifier for the workspace or organization. opt_fields = ["email_domains","is_organization","name"] # list[str] | This endpoint returns a compact resource, which excludes some properties by default. To include those optional properties, set this query parameter to a comma-separated list of the properties you wish to include. (optional) try: - # Update a workspace - api_response = api_instance.update_workspace(body, workspace_gid, opt_fields=opt_fields) - pprint(api_response) + # Update a workspace + api_response = api_instance.update_workspace(body, workspace_gid, opt_fields=opt_fields) + pprint(api_response) except ApiException as e: - print("Exception when calling WorkspacesApi->update_workspace: %s\n" % e) + print("Exception when calling WorkspacesApi->update_workspace: %s\n" % e) diff --git a/setup.py b/setup.py index f6e1b23c..3f18a4d2 100644 --- a/setup.py +++ b/setup.py @@ -14,7 +14,7 @@ from setuptools import setup, find_packages # noqa: H301 NAME = "asana" -VERSION = "4.0.4" +VERSION = "4.0.5" with open(os.path.join(os.path.dirname(__file__), 'README.md')) as readme: LONG_DESCRIPTION = readme.read() # To install the library, run the following