Skip to content

Commit 24f6c10

Browse files
Updated Python SDK: v5.2.2
1 parent 3b27ae6 commit 24f6c10

34 files changed

+1591
-326
lines changed

README.md

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

asana/__init__.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
from __future__ import absolute_import
1616

1717
# import apis into sdk package
18+
from asana.api.access_requests_api import AccessRequestsApi
1819
from asana.api.allocations_api import AllocationsApi
1920
from asana.api.attachments_api import AttachmentsApi
2021
from asana.api.audit_log_api_api import AuditLogAPIApi
@@ -36,6 +37,7 @@
3637
from asana.api.project_statuses_api import ProjectStatusesApi
3738
from asana.api.project_templates_api import ProjectTemplatesApi
3839
from asana.api.projects_api import ProjectsApi
40+
from asana.api.reactions_api import ReactionsApi
3941
from asana.api.rules_api import RulesApi
4042
from asana.api.sections_api import SectionsApi
4143
from asana.api.status_updates_api import StatusUpdatesApi

asana/api/__init__.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
# flake8: noqa
44

55
# import apis into api package
6+
from asana.api.access_requests_api import AccessRequestsApi
67
from asana.api.allocations_api import AllocationsApi
78
from asana.api.attachments_api import AttachmentsApi
89
from asana.api.audit_log_api_api import AuditLogAPIApi
@@ -24,6 +25,7 @@
2425
from asana.api.project_statuses_api import ProjectStatusesApi
2526
from asana.api.project_templates_api import ProjectTemplatesApi
2627
from asana.api.projects_api import ProjectsApi
28+
from asana.api.reactions_api import ReactionsApi
2729
from asana.api.rules_api import RulesApi
2830
from asana.api.sections_api import SectionsApi
2931
from asana.api.status_updates_api import StatusUpdatesApi

asana/api/access_requests_api.py

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

asana/api/exports_api.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ def __init__(self, api_client=None):
3535
def create_graph_export(self, body, **kwargs): # noqa: E501
3636
"""Initiate a graph export # noqa: E501
3737
38-
Initiates a graph export job for a given parent object (team, portfolio, or project). The export will be processed asynchronously. Once initiated, use the [jobs](/reference/getjob) endpoint to monitor progress. **Export Caching:** When exporting more than 1,000 tasks, the results are cached for 4 hours. Any new export requests made within this 4-hour window will return the same cached results rather than generating a fresh export. # noqa: E501
38+
Initiates a graph export job for a given parent object (goal, team, portfolio, or project). The export will be processed asynchronously. Once initiated, use the [jobs](/reference/getjob) endpoint to monitor progress. **Export Caching:** When exporting more than 1,000 tasks, the results are cached for 4 hours. Any new export requests made within this 4-hour window will return the same cached results rather than generating a fresh export. # noqa: E501
3939
This method makes a synchronous HTTP request by default. To make an
4040
asynchronous HTTP request, please pass async_req=True
4141
>>> thread = api.create_graph_export(body, async_req=True)
@@ -57,7 +57,7 @@ def create_graph_export(self, body, **kwargs): # noqa: E501
5757
def create_graph_export_with_http_info(self, body, **kwargs): # noqa: E501
5858
"""Initiate a graph export # noqa: E501
5959
60-
Initiates a graph export job for a given parent object (team, portfolio, or project). The export will be processed asynchronously. Once initiated, use the [jobs](/reference/getjob) endpoint to monitor progress. **Export Caching:** When exporting more than 1,000 tasks, the results are cached for 4 hours. Any new export requests made within this 4-hour window will return the same cached results rather than generating a fresh export. # noqa: E501
60+
Initiates a graph export job for a given parent object (goal, team, portfolio, or project). The export will be processed asynchronously. Once initiated, use the [jobs](/reference/getjob) endpoint to monitor progress. **Export Caching:** When exporting more than 1,000 tasks, the results are cached for 4 hours. Any new export requests made within this 4-hour window will return the same cached results rather than generating a fresh export. # noqa: E501
6161
This method makes a synchronous HTTP request by default. To make an
6262
asynchronous HTTP request, please pass async_req=True
6363
>>> thread = api.create_graph_export_with_http_info(body, async_req=True)

asana/api/reactions_api.py

Lines changed: 183 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,183 @@
1+
# coding: utf-8
2+
3+
"""
4+
Asana
5+
6+
This is the interface for interacting with the [Asana Platform](https://developers.asana.com). Our API reference is generated from our [OpenAPI spec] (https://raw.githubusercontent.com/Asana/openapi/master/defs/asana_oas.yaml). # noqa: E501
7+
8+
OpenAPI spec version: 1.0
9+
10+
Generated by: https://github.com/swagger-api/swagger-codegen.git
11+
"""
12+
13+
from __future__ import absolute_import
14+
15+
import re # noqa: F401
16+
17+
# python 2 and python 3 compatibility library
18+
import six
19+
from asana.api_client import ApiClient
20+
from asana.pagination.event_iterator import EventIterator
21+
from asana.pagination.page_iterator import PageIterator
22+
23+
class ReactionsApi(object):
24+
"""NOTE: This class is auto generated by the swagger code generator program.
25+
26+
Do not edit the class manually.
27+
Ref: https://github.com/swagger-api/swagger-codegen
28+
"""
29+
30+
def __init__(self, api_client=None):
31+
if api_client is None:
32+
api_client = ApiClient()
33+
self.api_client = api_client
34+
35+
def get_reactions_on_object(self, target, emoji_base, opts, **kwargs): # noqa: E501
36+
"""Get reactions with an emoji base on an object. # noqa: E501
37+
38+
Returns the reactions with a specified emoji base character on the object. # 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_reactions_on_object(target, emoji_base, async_req=True)
42+
>>> result = thread.get()
43+
44+
:param async_req bool
45+
:param str target: Globally unique identifier for object to fetch reactions from. Must be a GID for a status update or story. (required)
46+
:param str emoji_base: Only return reactions with this emoji base character. (required)
47+
:param int limit: Results per page. The number of objects to return per page. The value must be between 1 and 100.
48+
: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.*
49+
:return: ReactionCompactArray
50+
If the method is called asynchronously,
51+
returns the request thread.
52+
"""
53+
kwargs['_return_http_data_only'] = kwargs.get("_return_http_data_only", True)
54+
if kwargs.get('async_req'):
55+
return self.get_reactions_on_object_with_http_info(target, emoji_base, opts, **kwargs) # noqa: E501
56+
else:
57+
(data) = self.get_reactions_on_object_with_http_info(target, emoji_base, opts, **kwargs) # noqa: E501
58+
return data
59+
60+
def get_reactions_on_object_with_http_info(self, target, emoji_base, opts, **kwargs): # noqa: E501
61+
"""Get reactions with an emoji base on an object. # noqa: E501
62+
63+
Returns the reactions with a specified emoji base character on the object. # noqa: E501
64+
This method makes a synchronous HTTP request by default. To make an
65+
asynchronous HTTP request, please pass async_req=True
66+
>>> thread = api.get_reactions_on_object_with_http_info(target, emoji_base, async_req=True)
67+
>>> result = thread.get()
68+
69+
:param async_req bool
70+
:param str target: Globally unique identifier for object to fetch reactions from. Must be a GID for a status update or story. (required)
71+
:param str emoji_base: Only return reactions with this emoji base character. (required)
72+
:param int limit: Results per page. The number of objects to return per page. The value must be between 1 and 100.
73+
: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.*
74+
:return: ReactionCompactArray
75+
If the method is called asynchronously,
76+
returns the request thread.
77+
"""
78+
all_params = []
79+
all_params.append('async_req')
80+
all_params.append('header_params')
81+
all_params.append('_return_http_data_only')
82+
all_params.append('_preload_content')
83+
all_params.append('_request_timeout')
84+
all_params.append('full_payload')
85+
all_params.append('item_limit')
86+
87+
params = locals()
88+
for key, val in six.iteritems(params['kwargs']):
89+
if key not in all_params:
90+
raise TypeError(
91+
"Got an unexpected keyword argument '%s'"
92+
" to method get_reactions_on_object" % key
93+
)
94+
params[key] = val
95+
del params['kwargs']
96+
# verify the required parameter 'target' is set
97+
if (target is None):
98+
raise ValueError("Missing the required parameter `target` when calling `get_reactions_on_object`") # noqa: E501
99+
# verify the required parameter 'emoji_base' is set
100+
if (emoji_base is None):
101+
raise ValueError("Missing the required parameter `emoji_base` when calling `get_reactions_on_object`") # noqa: E501
102+
103+
collection_formats = {}
104+
105+
path_params = {}
106+
107+
query_params = {}
108+
query_params = opts
109+
query_params['target'] = target
110+
query_params['emoji_base'] = emoji_base
111+
112+
113+
header_params = kwargs.get("header_params", {})
114+
115+
form_params = []
116+
local_var_files = {}
117+
118+
body_params = None
119+
120+
# HTTP header `Accept`
121+
header_params['Accept'] = self.api_client.select_header_accept(
122+
['application/json; charset=UTF-8']) # noqa: E501
123+
124+
# Authentication setting
125+
auth_settings = ['personalAccessToken'] # noqa: E501
126+
127+
# hard checking for True boolean value because user can provide full_payload or async_req with any data type
128+
if kwargs.get("full_payload", False) is True or kwargs.get('async_req', False) is True:
129+
return self.api_client.call_api(
130+
'/reactions', 'GET',
131+
path_params,
132+
query_params,
133+
header_params,
134+
body=body_params,
135+
post_params=form_params,
136+
files=local_var_files,
137+
response_type=object, # noqa: E501
138+
auth_settings=auth_settings,
139+
async_req=params.get('async_req'),
140+
_return_http_data_only=params.get('_return_http_data_only'),
141+
_preload_content=params.get('_preload_content', True),
142+
_request_timeout=params.get('_request_timeout'),
143+
collection_formats=collection_formats
144+
)
145+
elif self.api_client.configuration.return_page_iterator:
146+
query_params["limit"] = query_params.get("limit", self.api_client.configuration.page_limit)
147+
return PageIterator(
148+
self.api_client,
149+
{
150+
"resource_path": '/reactions',
151+
"method": 'GET',
152+
"path_params": path_params,
153+
"query_params": query_params,
154+
"header_params": header_params,
155+
"body": body_params,
156+
"post_params": form_params,
157+
"files": local_var_files,
158+
"response_type": object,
159+
"auth_settings": auth_settings,
160+
"async_req": params.get('async_req'),
161+
"_return_http_data_only": params.get('_return_http_data_only'),
162+
"_preload_content": params.get('_preload_content', True),
163+
"_request_timeout": params.get('_request_timeout'),
164+
"collection_formats": collection_formats
165+
},
166+
**kwargs
167+
).items()
168+
else:
169+
return self.api_client.call_api(
170+
'/reactions', 'GET',
171+
path_params,
172+
query_params,
173+
header_params,
174+
body=body_params,
175+
post_params=form_params,
176+
files=local_var_files,
177+
response_type=object, # noqa: E501
178+
auth_settings=auth_settings,
179+
async_req=params.get('async_req'),
180+
_return_http_data_only=params.get('_return_http_data_only'),
181+
_preload_content=params.get('_preload_content', True),
182+
_request_timeout=params.get('_request_timeout'),
183+
collection_formats=collection_formats)

asana/api/team_memberships_api.py

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ def __init__(self, api_client=None):
3535
def get_team_membership(self, team_membership_gid, opts, **kwargs): # noqa: E501
3636
"""Get a team membership # noqa: E501
3737
38-
Returns the complete team membership record for a single team membership. # noqa: E501
38+
<b>Required scope: </b><code>team_memberships:read</code> Returns the complete team membership record for a single team membership. # noqa: E501
3939
This method makes a synchronous HTTP request by default. To make an
4040
asynchronous HTTP request, please pass async_req=True
4141
>>> thread = api.get_team_membership(team_membership_gid, async_req=True)
@@ -58,7 +58,7 @@ def get_team_membership(self, team_membership_gid, opts, **kwargs): # noqa: E50
5858
def get_team_membership_with_http_info(self, team_membership_gid, opts, **kwargs): # noqa: E501
5959
"""Get a team membership # noqa: E501
6060
61-
Returns the complete team membership record for a single team membership. # noqa: E501
61+
<b>Required scope: </b><code>team_memberships:read</code> Returns the complete team membership record for a single team membership. # noqa: E501
6262
This method makes a synchronous HTTP request by default. To make an
6363
asynchronous HTTP request, please pass async_req=True
6464
>>> thread = api.get_team_membership_with_http_info(team_membership_gid, async_req=True)
@@ -174,7 +174,7 @@ def get_team_membership_with_http_info(self, team_membership_gid, opts, **kwargs
174174
def get_team_memberships(self, opts, **kwargs): # noqa: E501
175175
"""Get team memberships # noqa: E501
176176
177-
Returns compact team membership records. # noqa: E501
177+
<b>Required scope: </b><code>team_memberships:read</code> Returns compact team membership records. # noqa: E501
178178
This method makes a synchronous HTTP request by default. To make an
179179
asynchronous HTTP request, please pass async_req=True
180180
>>> thread = api.get_team_memberships(async_req=True)
@@ -201,7 +201,7 @@ def get_team_memberships(self, opts, **kwargs): # noqa: E501
201201
def get_team_memberships_with_http_info(self, opts, **kwargs): # noqa: E501
202202
"""Get team memberships # noqa: E501
203203
204-
Returns compact team membership records. # noqa: E501
204+
<b>Required scope: </b><code>team_memberships:read</code> Returns compact team membership records. # noqa: E501
205205
This method makes a synchronous HTTP request by default. To make an
206206
asynchronous HTTP request, please pass async_req=True
207207
>>> thread = api.get_team_memberships_with_http_info(async_req=True)
@@ -320,7 +320,7 @@ def get_team_memberships_with_http_info(self, opts, **kwargs): # noqa: E501
320320
def get_team_memberships_for_team(self, team_gid, opts, **kwargs): # noqa: E501
321321
"""Get memberships from a team # noqa: E501
322322
323-
Returns the compact team memberships for the team. # noqa: E501
323+
<b>Required scope: </b><code>team_memberships:read</code> Returns the compact team memberships for the team. # noqa: E501
324324
This method makes a synchronous HTTP request by default. To make an
325325
asynchronous HTTP request, please pass async_req=True
326326
>>> thread = api.get_team_memberships_for_team(team_gid, async_req=True)
@@ -345,7 +345,7 @@ def get_team_memberships_for_team(self, team_gid, opts, **kwargs): # noqa: E501
345345
def get_team_memberships_for_team_with_http_info(self, team_gid, opts, **kwargs): # noqa: E501
346346
"""Get memberships from a team # noqa: E501
347347
348-
Returns the compact team memberships for the team. # noqa: E501
348+
<b>Required scope: </b><code>team_memberships:read</code> Returns the compact team memberships for the team. # noqa: E501
349349
This method makes a synchronous HTTP request by default. To make an
350350
asynchronous HTTP request, please pass async_req=True
351351
>>> thread = api.get_team_memberships_for_team_with_http_info(team_gid, async_req=True)
@@ -466,7 +466,7 @@ def get_team_memberships_for_team_with_http_info(self, team_gid, opts, **kwargs)
466466
def get_team_memberships_for_user(self, user_gid, workspace, opts, **kwargs): # noqa: E501
467467
"""Get memberships from a user # noqa: E501
468468
469-
Returns the compact team membership records for the user. # noqa: E501
469+
<b>Required scope: </b><code>team_memberships:read</code> Returns the compact team membership records for the user. # noqa: E501
470470
This method makes a synchronous HTTP request by default. To make an
471471
asynchronous HTTP request, please pass async_req=True
472472
>>> thread = api.get_team_memberships_for_user(user_gid, workspace, async_req=True)
@@ -492,7 +492,7 @@ def get_team_memberships_for_user(self, user_gid, workspace, opts, **kwargs): #
492492
def get_team_memberships_for_user_with_http_info(self, user_gid, workspace, opts, **kwargs): # noqa: E501
493493
"""Get memberships from a user # noqa: E501
494494
495-
Returns the compact team membership records for the user. # noqa: E501
495+
<b>Required scope: </b><code>team_memberships:read</code> Returns the compact team membership records for the user. # noqa: E501
496496
This method makes a synchronous HTTP request by default. To make an
497497
asynchronous HTTP request, please pass async_req=True
498498
>>> thread = api.get_team_memberships_for_user_with_http_info(user_gid, workspace, async_req=True)

asana/api_client.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -78,12 +78,12 @@ def __init__(self, configuration=None, header_name=None, header_value=None,
7878
self.default_headers[header_name] = header_value
7979
self.cookie = cookie
8080
# Set default User-Agent.
81-
self.user_agent = 'Swagger-Codegen/5.2.1/python'
81+
self.user_agent = 'Swagger-Codegen/5.2.2/python'
8282
# Add custom header
8383
self.default_headers['X-Asana-Client-Lib'] = urlencode(
8484
{
8585
'language': 'Python',
86-
'version': '5.2.1',
86+
'version': '5.2.2',
8787
'language_version': platform.python_version(),
8888
'os': platform.system(),
8989
'os_version': platform.release()

asana/configuration.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -266,5 +266,5 @@ def to_debug_report(self):
266266
"OS: {env}\n"\
267267
"Python Version: {pyversion}\n"\
268268
"Version of the API: 1.0\n"\
269-
"SDK Package Version: 5.2.1".\
269+
"SDK Package Version: 5.2.2".\
270270
format(env=sys.platform, pyversion=sys.version)

0 commit comments

Comments
 (0)