Skip to content

Commit f38865f

Browse files
jv-asanaactions-user
authored andcommitted
Updated Python SDK: v4.0.7
1 parent c40cedd commit f38865f

12 files changed

+37
-40
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
Python client library for Asana
44

55
- API version: 1.0
6-
- Package version: 4.0.6
6+
- Package version: 4.0.7
77

88
## Requirements.
99

asana/api_client.py

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
"""
1111
from __future__ import absolute_import
1212

13+
import logging
1314
import datetime
1415
import json
1516
import mimetypes
@@ -68,28 +69,32 @@ def __init__(self, configuration=None, header_name=None, header_value=None,
6869
configuration = Configuration()
6970
self.configuration = configuration
7071

71-
self.pool = ThreadPool()
72+
try:
73+
self.pool = ThreadPool()
74+
except OSError:
75+
logging.warning('Looks like your system does not support ThreadPool but it will try without it if you do not use async requests')
7276
self.rest_client = rest.RESTClientObject(configuration)
7377
self.default_headers = {}
7478
if header_name is not None:
7579
self.default_headers[header_name] = header_value
7680
self.cookie = cookie
7781
# Set default User-Agent.
78-
self.user_agent = 'Swagger-Codegen/4.0.6/python'
82+
self.user_agent = 'Swagger-Codegen/4.0.7/python'
7983
# Add custom header
8084
self.default_headers['X-Asana-Client-Lib'] = urlencode(
8185
{
8286
'language': 'Python',
83-
'version': '4.0.6',
87+
'version': '4.0.7',
8488
'language_version': platform.python_version(),
8589
'os': platform.system(),
8690
'os_version': platform.release()
8791
}
8892
)
8993

9094
def __del__(self):
91-
self.pool.close()
92-
self.pool.join()
95+
if hasattr(self, "pool"):
96+
self.pool.close()
97+
self.pool.join()
9398

9499
@property
95100
def user_agent(self):

asana/configuration.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -249,5 +249,5 @@ def to_debug_report(self):
249249
"OS: {env}\n"\
250250
"Python Version: {pyversion}\n"\
251251
"Version of the API: 1.0\n"\
252-
"SDK Package Version: 4.0.6".\
252+
"SDK Package Version: 4.0.7".\
253253
format(env=sys.platform, pyversion=sys.version)

asana/models/project_base_current_status.py

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -72,10 +72,12 @@ def __init__(self, gid=None, resource_type=None, title=None, text=None, html_tex
7272
self.resource_type = resource_type
7373
if title is not None:
7474
self.title = title
75-
self.text = text
75+
if text is not None:
76+
self.text = text
7677
if html_text is not None:
7778
self.html_text = html_text
78-
self.color = color
79+
if color is not None:
80+
self.color = color
7981
if author is not None:
8082
self.author = author
8183
if created_at is not None:
@@ -174,8 +176,6 @@ def text(self, text):
174176
:param text: The text of this ProjectBaseCurrentStatus. # noqa: E501
175177
:type: str
176178
"""
177-
if text is None:
178-
raise ValueError("Invalid value for `text`, must not be `None`") # noqa: E501
179179

180180
self._text = text
181181

@@ -222,8 +222,6 @@ def color(self, color):
222222
:param color: The color of this ProjectBaseCurrentStatus. # noqa: E501
223223
:type: str
224224
"""
225-
if color is None:
226-
raise ValueError("Invalid value for `color`, must not be `None`") # noqa: E501
227225
allowed_values = ["green", "yellow", "red", "blue"] # noqa: E501
228226
if color not in allowed_values:
229227
raise ValueError(

asana/models/project_status_base.py

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -60,10 +60,12 @@ def __init__(self, gid=None, resource_type=None, title=None, text=None, html_tex
6060
self.resource_type = resource_type
6161
if title is not None:
6262
self.title = title
63-
self.text = text
63+
if text is not None:
64+
self.text = text
6465
if html_text is not None:
6566
self.html_text = html_text
66-
self.color = color
67+
if color is not None:
68+
self.color = color
6769

6870
@property
6971
def gid(self):
@@ -154,8 +156,6 @@ def text(self, text):
154156
:param text: The text of this ProjectStatusBase. # noqa: E501
155157
:type: str
156158
"""
157-
if text is None:
158-
raise ValueError("Invalid value for `text`, must not be `None`") # noqa: E501
159159

160160
self._text = text
161161

@@ -202,8 +202,6 @@ def color(self, color):
202202
:param color: The color of this ProjectStatusBase. # noqa: E501
203203
:type: str
204204
"""
205-
if color is None:
206-
raise ValueError("Invalid value for `color`, must not be `None`") # noqa: E501
207205
allowed_values = ["green", "yellow", "red", "blue"] # noqa: E501
208206
if color not in allowed_values:
209207
raise ValueError(

asana/models/project_status_request.py

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -60,10 +60,12 @@ def __init__(self, gid=None, resource_type=None, title=None, text=None, html_tex
6060
self.resource_type = resource_type
6161
if title is not None:
6262
self.title = title
63-
self.text = text
63+
if text is not None:
64+
self.text = text
6465
if html_text is not None:
6566
self.html_text = html_text
66-
self.color = color
67+
if color is not None:
68+
self.color = color
6769

6870
@property
6971
def gid(self):
@@ -154,8 +156,6 @@ def text(self, text):
154156
:param text: The text of this ProjectStatusRequest. # noqa: E501
155157
:type: str
156158
"""
157-
if text is None:
158-
raise ValueError("Invalid value for `text`, must not be `None`") # noqa: E501
159159

160160
self._text = text
161161

@@ -202,8 +202,6 @@ def color(self, color):
202202
:param color: The color of this ProjectStatusRequest. # noqa: E501
203203
:type: str
204204
"""
205-
if color is None:
206-
raise ValueError("Invalid value for `color`, must not be `None`") # noqa: E501
207205
allowed_values = ["green", "yellow", "red", "blue"] # noqa: E501
208206
if color not in allowed_values:
209207
raise ValueError(

asana/models/project_status_response.py

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -72,10 +72,12 @@ def __init__(self, gid=None, resource_type=None, title=None, text=None, html_tex
7272
self.resource_type = resource_type
7373
if title is not None:
7474
self.title = title
75-
self.text = text
75+
if text is not None:
76+
self.text = text
7677
if html_text is not None:
7778
self.html_text = html_text
78-
self.color = color
79+
if color is not None:
80+
self.color = color
7981
if author is not None:
8082
self.author = author
8183
if created_at is not None:
@@ -174,8 +176,6 @@ def text(self, text):
174176
:param text: The text of this ProjectStatusResponse. # noqa: E501
175177
:type: str
176178
"""
177-
if text is None:
178-
raise ValueError("Invalid value for `text`, must not be `None`") # noqa: E501
179179

180180
self._text = text
181181

@@ -222,8 +222,6 @@ def color(self, color):
222222
:param color: The color of this ProjectStatusResponse. # noqa: E501
223223
:type: str
224224
"""
225-
if color is None:
226-
raise ValueError("Invalid value for `color`, must not be `None`") # noqa: E501
227225
allowed_values = ["green", "yellow", "red", "blue"] # noqa: E501
228226
if color not in allowed_values:
229227
raise ValueError(

docs/ProjectBaseCurrentStatus.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,9 @@ Name | Type | Description | Notes
66
**gid** | **str** | Globally unique identifier of the resource, as a string. | [optional]
77
**resource_type** | **str** | The base type of this resource. | [optional]
88
**title** | **str** | The title of the project status update. | [optional]
9-
**text** | **str** | The text content of the status update. |
9+
**text** | **str** | The text content of the status update. | [optional]
1010
**html_text** | **str** | [Opt In](/docs/inputoutput-options). The text content of the status update with formatting as HTML. | [optional]
11-
**color** | **str** | The color associated with the status update. |
11+
**color** | **str** | The color associated with the status update. | [optional]
1212
**author** | [**CustomFieldResponsePeopleValue**](CustomFieldResponsePeopleValue.md) | | [optional]
1313
**created_at** | **datetime** | The time at which this resource was created. | [optional]
1414
**created_by** | [**CustomFieldResponsePeopleValue**](CustomFieldResponsePeopleValue.md) | | [optional]

docs/ProjectStatusBase.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,9 @@ Name | Type | Description | Notes
66
**gid** | **str** | Globally unique identifier of the resource, as a string. | [optional]
77
**resource_type** | **str** | The base type of this resource. | [optional]
88
**title** | **str** | The title of the project status update. | [optional]
9-
**text** | **str** | The text content of the status update. |
9+
**text** | **str** | The text content of the status update. | [optional]
1010
**html_text** | **str** | [Opt In](/docs/inputoutput-options). The text content of the status update with formatting as HTML. | [optional]
11-
**color** | **str** | The color associated with the status update. |
11+
**color** | **str** | The color associated with the status update. | [optional]
1212

1313
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
1414

docs/ProjectStatusRequest.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,9 @@ Name | Type | Description | Notes
66
**gid** | **str** | Globally unique identifier of the resource, as a string. | [optional]
77
**resource_type** | **str** | The base type of this resource. | [optional]
88
**title** | **str** | The title of the project status update. | [optional]
9-
**text** | **str** | The text content of the status update. |
9+
**text** | **str** | The text content of the status update. | [optional]
1010
**html_text** | **str** | [Opt In](/docs/inputoutput-options). The text content of the status update with formatting as HTML. | [optional]
11-
**color** | **str** | The color associated with the status update. |
11+
**color** | **str** | The color associated with the status update. | [optional]
1212

1313
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
1414

0 commit comments

Comments
 (0)