Skip to content

Commit 3b27ae6

Browse files
Updated Python SDK: v5.2.1
1 parent ef8250c commit 3b27ae6

37 files changed

+982
-314
lines changed

README.md

Lines changed: 199 additions & 196 deletions
Large diffs are not rendered by default.

asana/api/attachments_api.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -214,7 +214,7 @@ def create_attachment_for_object_with_http_info(self, opts, **kwargs): # noqa:
214214
def delete_attachment(self, attachment_gid, **kwargs): # noqa: E501
215215
"""Delete an attachment # noqa: E501
216216
217-
Deletes a specific, existing attachment. Returns an empty data record. # noqa: E501
217+
<b>Required scope: </b><code>attachments:delete</code> Deletes a specific, existing attachment. Returns an empty data record. # noqa: E501
218218
This method makes a synchronous HTTP request by default. To make an
219219
asynchronous HTTP request, please pass async_req=True
220220
>>> thread = api.delete_attachment(attachment_gid, async_req=True)
@@ -236,7 +236,7 @@ def delete_attachment(self, attachment_gid, **kwargs): # noqa: E501
236236
def delete_attachment_with_http_info(self, attachment_gid, **kwargs): # noqa: E501
237237
"""Delete an attachment # noqa: E501
238238
239-
Deletes a specific, existing attachment. Returns an empty data record. # noqa: E501
239+
<b>Required scope: </b><code>attachments:delete</code> Deletes a specific, existing attachment. Returns an empty data record. # noqa: E501
240240
This method makes a synchronous HTTP request by default. To make an
241241
asynchronous HTTP request, please pass async_req=True
242242
>>> thread = api.delete_attachment_with_http_info(attachment_gid, async_req=True)

asana/api/custom_fields_api.py

Lines changed: 14 additions & 14 deletions
Large diffs are not rendered by default.

asana/api/custom_types_api.py

Lines changed: 139 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,145 @@ def __init__(self, api_client=None):
3232
api_client = ApiClient()
3333
self.api_client = api_client
3434

35+
def get_custom_type(self, custom_type_gid, opts, **kwargs): # noqa: E501
36+
"""Get a custom type # noqa: E501
37+
38+
Returns the complete custom type record for a single custom type. # noqa: E501
39+
This method makes a synchronous HTTP request by default. To make an
40+
asynchronous HTTP request, please pass async_req=True
41+
>>> thread = api.get_custom_type(custom_type_gid, async_req=True)
42+
>>> result = thread.get()
43+
44+
:param async_req bool
45+
:param str custom_type_gid: Globally unique identifier for the custom type. (required)
46+
:param list[str] opt_fields: This endpoint returns a resource which excludes some properties by default. To include those optional properties, set this query parameter to a comma-separated list of the properties you wish to include.
47+
:return: CustomTypeResponseData
48+
If the method is called asynchronously,
49+
returns the request thread.
50+
"""
51+
kwargs['_return_http_data_only'] = kwargs.get("_return_http_data_only", True)
52+
if kwargs.get('async_req'):
53+
return self.get_custom_type_with_http_info(custom_type_gid, opts, **kwargs) # noqa: E501
54+
else:
55+
(data) = self.get_custom_type_with_http_info(custom_type_gid, opts, **kwargs) # noqa: E501
56+
return data
57+
58+
def get_custom_type_with_http_info(self, custom_type_gid, opts, **kwargs): # noqa: E501
59+
"""Get a custom type # noqa: E501
60+
61+
Returns the complete custom type record for a single custom type. # noqa: E501
62+
This method makes a synchronous HTTP request by default. To make an
63+
asynchronous HTTP request, please pass async_req=True
64+
>>> thread = api.get_custom_type_with_http_info(custom_type_gid, async_req=True)
65+
>>> result = thread.get()
66+
67+
:param async_req bool
68+
:param str custom_type_gid: Globally unique identifier for the custom type. (required)
69+
:param list[str] opt_fields: This endpoint returns a resource which excludes some properties by default. To include those optional properties, set this query parameter to a comma-separated list of the properties you wish to include.
70+
:return: CustomTypeResponseData
71+
If the method is called asynchronously,
72+
returns the request thread.
73+
"""
74+
all_params = []
75+
all_params.append('async_req')
76+
all_params.append('header_params')
77+
all_params.append('_return_http_data_only')
78+
all_params.append('_preload_content')
79+
all_params.append('_request_timeout')
80+
all_params.append('full_payload')
81+
all_params.append('item_limit')
82+
83+
params = locals()
84+
for key, val in six.iteritems(params['kwargs']):
85+
if key not in all_params:
86+
raise TypeError(
87+
"Got an unexpected keyword argument '%s'"
88+
" to method get_custom_type" % key
89+
)
90+
params[key] = val
91+
del params['kwargs']
92+
# verify the required parameter 'custom_type_gid' is set
93+
if (custom_type_gid is None):
94+
raise ValueError("Missing the required parameter `custom_type_gid` when calling `get_custom_type`") # noqa: E501
95+
96+
collection_formats = {}
97+
98+
path_params = {}
99+
path_params['custom_type_gid'] = custom_type_gid # noqa: E501
100+
101+
query_params = {}
102+
query_params = opts
103+
104+
105+
header_params = kwargs.get("header_params", {})
106+
107+
form_params = []
108+
local_var_files = {}
109+
110+
body_params = None
111+
112+
# HTTP header `Accept`
113+
header_params['Accept'] = self.api_client.select_header_accept(
114+
['application/json; charset=UTF-8']) # noqa: E501
115+
116+
# Authentication setting
117+
auth_settings = ['personalAccessToken'] # noqa: E501
118+
119+
# hard checking for True boolean value because user can provide full_payload or async_req with any data type
120+
if kwargs.get("full_payload", False) is True or kwargs.get('async_req', False) is True:
121+
return self.api_client.call_api(
122+
'/custom_types/{custom_type_gid}', 'GET',
123+
path_params,
124+
query_params,
125+
header_params,
126+
body=body_params,
127+
post_params=form_params,
128+
files=local_var_files,
129+
response_type=object, # noqa: E501
130+
auth_settings=auth_settings,
131+
async_req=params.get('async_req'),
132+
_return_http_data_only=params.get('_return_http_data_only'),
133+
_preload_content=params.get('_preload_content', True),
134+
_request_timeout=params.get('_request_timeout'),
135+
collection_formats=collection_formats
136+
)
137+
elif self.api_client.configuration.return_page_iterator:
138+
(data) = self.api_client.call_api(
139+
'/custom_types/{custom_type_gid}', 'GET',
140+
path_params,
141+
query_params,
142+
header_params,
143+
body=body_params,
144+
post_params=form_params,
145+
files=local_var_files,
146+
response_type=object, # noqa: E501
147+
auth_settings=auth_settings,
148+
async_req=params.get('async_req'),
149+
_return_http_data_only=params.get('_return_http_data_only'),
150+
_preload_content=params.get('_preload_content', True),
151+
_request_timeout=params.get('_request_timeout'),
152+
collection_formats=collection_formats
153+
)
154+
if params.get('_return_http_data_only') == False:
155+
return data
156+
return data["data"] if data else data
157+
else:
158+
return self.api_client.call_api(
159+
'/custom_types/{custom_type_gid}', 'GET',
160+
path_params,
161+
query_params,
162+
header_params,
163+
body=body_params,
164+
post_params=form_params,
165+
files=local_var_files,
166+
response_type=object, # noqa: E501
167+
auth_settings=auth_settings,
168+
async_req=params.get('async_req'),
169+
_return_http_data_only=params.get('_return_http_data_only'),
170+
_preload_content=params.get('_preload_content', True),
171+
_request_timeout=params.get('_request_timeout'),
172+
collection_formats=collection_formats)
173+
35174
def get_custom_types(self, project, opts, **kwargs): # noqa: E501
36175
"""Get all custom types associated with an object # noqa: E501
37176

0 commit comments

Comments
 (0)