Skip to content

Commit

Permalink
Updated Python SDK: v5.0.4
Browse files Browse the repository at this point in the history
  • Loading branch information
asana-publish-client-libraries[bot] committed Mar 14, 2024
1 parent 2e42bfa commit 500f82d
Show file tree
Hide file tree
Showing 63 changed files with 909 additions and 491 deletions.
3 changes: 0 additions & 3 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,3 @@ target/

.travis.yml
git_push.sh

# dot-env
.env
2 changes: 1 addition & 1 deletion .swagger-codegen/VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
3.0.46
3.0.54
377 changes: 187 additions & 190 deletions README.md

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions asana/api/events_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ def get_events(self, resource, opts, **kwargs): # noqa: E501
>>> 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 resource: A resource ID to subscribe to. The resource can be a task, project, or goal. (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
Expand All @@ -66,7 +66,7 @@ def get_events_with_http_info(self, resource, opts, **kwargs): # noqa: E501
>>> 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 resource: A resource ID to subscribe to. The resource can be a task, project, or goal. (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
Expand Down
53 changes: 28 additions & 25 deletions asana/api/memberships_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,15 +35,15 @@ def __init__(self, api_client=None):
def create_membership(self, opts, **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
Creates a new membership in a `goal` or `project`. `Teams` or `users` can be a member of `goals` or `projects`. 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 dict body: The updated fields for the membership.
:return: MembershipResponseData
:return: MembershipResponseArray
If the method is called asynchronously,
returns the request thread.
"""
Expand All @@ -57,15 +57,15 @@ def create_membership(self, opts, **kwargs): # noqa: E501
def create_membership_with_http_info(self, opts, **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
Creates a new membership in a `goal` or `project`. `Teams` or `users` can be a member of `goals` or `projects`. 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 dict body: The updated fields for the membership.
:return: MembershipResponseData
:return: MembershipResponseArray
If the method is called asynchronously,
returns the request thread.
"""
Expand Down Expand Up @@ -133,25 +133,28 @@ def create_membership_with_http_info(self, opts, **kwargs): # noqa: E501
collection_formats=collection_formats
)
elif self.api_client.configuration.return_page_iterator:
(data) = 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=object, # noqa: E501
auth_settings=auth_settings,
async_req=params.get('async_req'),
_return_http_data_only=params.get('_return_http_data_only'),
_preload_content=params.get('_preload_content', True),
_request_timeout=params.get('_request_timeout'),
collection_formats=collection_formats
)
if params.get('_return_http_data_only') == False:
return data
return data["data"] if data else data
query_params["limit"] = query_params.get("limit", self.api_client.configuration.page_limit)
return PageIterator(
self.api_client,
{
"resource_path": '/memberships',
"method": 'POST',
"path_params": path_params,
"query_params": query_params,
"header_params": header_params,
"body": body_params,
"post_params": form_params,
"files": local_var_files,
"response_type": object,
"auth_settings": auth_settings,
"async_req": params.get('async_req'),
"_return_http_data_only": params.get('_return_http_data_only'),
"_preload_content": params.get('_preload_content', True),
"_request_timeout": params.get('_request_timeout'),
"collection_formats": collection_formats
},
**kwargs
).items()
else:
return self.api_client.call_api(
'/memberships', 'POST',
Expand All @@ -172,7 +175,7 @@ def create_membership_with_http_info(self, opts, **kwargs): # noqa: E501
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
A specific, existing membership for a `goal` or `project` 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)
Expand All @@ -194,7 +197,7 @@ def delete_membership(self, membership_gid, **kwargs): # noqa: E501
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
A specific, existing membership for a `goal` or `project` 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)
Expand Down
136 changes: 136 additions & 0 deletions asana/api/task_templates_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,142 @@ def __init__(self, api_client=None):
api_client = ApiClient()
self.api_client = api_client

def delete_task_template(self, task_template_gid, **kwargs): # noqa: E501
"""Delete a task template # noqa: E501
A specific, existing task template can be deleted by making a DELETE request on the URL for that task 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_task_template(task_template_gid, async_req=True)
>>> result = thread.get()
:param async_req bool
:param str task_template_gid: Globally unique identifier for the task 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_task_template_with_http_info(task_template_gid, **kwargs) # noqa: E501
else:
(data) = self.delete_task_template_with_http_info(task_template_gid, **kwargs) # noqa: E501
return data

def delete_task_template_with_http_info(self, task_template_gid, **kwargs): # noqa: E501
"""Delete a task template # noqa: E501
A specific, existing task template can be deleted by making a DELETE request on the URL for that task 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_task_template_with_http_info(task_template_gid, async_req=True)
>>> result = thread.get()
:param async_req bool
:param str task_template_gid: Globally unique identifier for the task template. (required)
:return: EmptyResponseData
If the method is called asynchronously,
returns the request thread.
"""
all_params = []
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')
all_params.append('full_payload')
all_params.append('item_limit')

params = locals()
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_template" % key
)
params[key] = val
del params['kwargs']
# verify the required parameter 'task_template_gid' is set
if (task_template_gid is None):
raise ValueError("Missing the required parameter `task_template_gid` when calling `delete_task_template`") # noqa: E501

collection_formats = {}

path_params = {}
path_params['task_template_gid'] = task_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 = ['personalAccessToken'] # noqa: E501

# hard checking for True boolean value because user can provide full_payload or async_req with any data type
if kwargs.get("full_payload", False) is True or kwargs.get('async_req', False) is True:
return self.api_client.call_api(
'/task_templates/{task_template_gid}', 'DELETE',
path_params,
query_params,
header_params,
body=body_params,
post_params=form_params,
files=local_var_files,
response_type=object, # noqa: E501
auth_settings=auth_settings,
async_req=params.get('async_req'),
_return_http_data_only=params.get('_return_http_data_only'),
_preload_content=params.get('_preload_content', True),
_request_timeout=params.get('_request_timeout'),
collection_formats=collection_formats
)
elif self.api_client.configuration.return_page_iterator:
(data) = self.api_client.call_api(
'/task_templates/{task_template_gid}', 'DELETE',
path_params,
query_params,
header_params,
body=body_params,
post_params=form_params,
files=local_var_files,
response_type=object, # noqa: E501
auth_settings=auth_settings,
async_req=params.get('async_req'),
_return_http_data_only=params.get('_return_http_data_only'),
_preload_content=params.get('_preload_content', True),
_request_timeout=params.get('_request_timeout'),
collection_formats=collection_formats
)
if params.get('_return_http_data_only') == False:
return data
return data["data"] if data else data
else:
return self.api_client.call_api(
'/task_templates/{task_template_gid}', 'DELETE',
path_params,
query_params,
header_params,
body=body_params,
post_params=form_params,
files=local_var_files,
response_type=object, # noqa: E501
auth_settings=auth_settings,
async_req=params.get('async_req'),
_return_http_data_only=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_template(self, task_template_gid, opts, **kwargs): # noqa: E501
"""Get a task template # noqa: E501
Expand Down
Loading

0 comments on commit 500f82d

Please sign in to comment.