Skip to content

Commit

Permalink
Updated Python SDK: v4.0.10
Browse files Browse the repository at this point in the history
  • Loading branch information
jv-asana authored and actions-user committed Aug 30, 2023
1 parent eb428c4 commit f53d023
Show file tree
Hide file tree
Showing 13 changed files with 37 additions and 29 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
Python client library for Asana

- API version: 1.0
- Package version: 4.0.9
- Package version: 4.0.10

## Requirements.

Expand Down
18 changes: 7 additions & 11 deletions asana/api/tasks_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -2725,11 +2725,15 @@ def search_tasks_for_workspace_with_http_info(self, workspace_gid, **kwargs): #
all_params.append('_request_timeout')

params = locals()
matchSnakeCase = '^custom_fields_(.*?)_.*$'
custom_fields_query_param_keys = []
for key, val in six.iteritems(params['kwargs']):
# Do not throw an error if the user provides custom field query parameters
if re.match('^custom_fields_(.*?)_value$', key) or re.match('^custom_fields.(.*?).value$', key):
params[key] = val
if (re.match(matchSnakeCase, key)):
custom_field_gid = re.search(matchSnakeCase, key).group(1)
custom_field_query_param_key = key.replace(f'custom_fields_{custom_field_gid}_', f'custom_fields.{custom_field_gid}.')
params[custom_field_query_param_key] = val
custom_fields_query_param_keys.append(custom_field_query_param_key)
continue
if key not in all_params:
raise TypeError(
Expand Down Expand Up @@ -2860,15 +2864,7 @@ def search_tasks_for_workspace_with_http_info(self, workspace_gid, **kwargs): #

# Checks if the user provided custom field query parameters and adds it to the request
for key in custom_fields_query_param_keys:
# If user provided in format: custom_fields.<CUSTOM_FIELD_GID>.value
if re.match('^custom_fields.(.*?).value$', key):
query_params.append((key, params[key])) # noqa: E501
# If user provided in format: custom_fields_<CUSTOM_FIELD_GID>_value
elif re.match('^custom_fields_(.*?)_value$', key):
removed_prefix = key.replace('custom_fields_', '')
custom_fields_gid = removed_prefix.replace('_value', '')
custom_fields_query_param_name = f'custom_fields.{custom_fields_gid}.value'
query_params.append((custom_fields_query_param_name, params[key])) # noqa: E501
query_params.append((key, params[key])) # noqa: E501

header_params = kwargs.get("header_params", {})

Expand Down
4 changes: 2 additions & 2 deletions asana/api_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -79,12 +79,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.9/python'
self.user_agent = 'Swagger-Codegen/4.0.10/python'
# Add custom header
self.default_headers['X-Asana-Client-Lib'] = urlencode(
{
'language': 'Python',
'version': '4.0.9',
'version': '4.0.10',
'language_version': platform.python_version(),
'os': platform.system(),
'os_version': platform.release()
Expand Down
2 changes: 1 addition & 1 deletion asana/configuration.py
Original file line number Diff line number Diff line change
Expand Up @@ -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.9".\
"SDK Package Version: 4.0.10".\
format(env=sys.platform, pyversion=sys.version)
4 changes: 2 additions & 2 deletions asana/models/project_request.py
Original file line number Diff line number Diff line change
Expand Up @@ -680,7 +680,7 @@ def minimum_access_level_for_sharing(self, minimum_access_level_for_sharing):
def custom_fields(self):
"""Gets the custom_fields of this ProjectRequest. # noqa: E501
An object where each key is a Custom Field GID and each value is an enum GID, string, number, or object. # noqa: E501
An object where each key is the GID of a custom field and its corresponding value is either an enum GID, string, number, or object (depending on the custom field type). See the [custom fields guide](/docs/custom-fields-guide) for details on creating and updating custom field values. # noqa: E501
:return: The custom_fields of this ProjectRequest. # noqa: E501
:rtype: dict(str, str)
Expand All @@ -691,7 +691,7 @@ def custom_fields(self):
def custom_fields(self, custom_fields):
"""Sets the custom_fields of this ProjectRequest.
An object where each key is a Custom Field GID and each value is an enum GID, string, number, or object. # noqa: E501
An object where each key is the GID of a custom field and its corresponding value is either an enum GID, string, number, or object (depending on the custom field type). See the [custom fields guide](/docs/custom-fields-guide) for details on creating and updating custom field values. # noqa: E501
:param custom_fields: The custom_fields of this ProjectRequest. # noqa: E501
:type: dict(str, str)
Expand Down
4 changes: 2 additions & 2 deletions asana/models/project_update_request.py
Original file line number Diff line number Diff line change
Expand Up @@ -675,7 +675,7 @@ def minimum_access_level_for_sharing(self, minimum_access_level_for_sharing):
def custom_fields(self):
"""Gets the custom_fields of this ProjectUpdateRequest. # noqa: E501
An object where each key is a Custom Field GID and each value is an enum GID, string, number, or object. # noqa: E501
An object where each key is the GID of a custom field and its corresponding value is either an enum GID, string, number, or object (depending on the custom field type). See the [custom fields guide](/docs/custom-fields-guide) for details on creating and updating custom field values. # noqa: E501
:return: The custom_fields of this ProjectUpdateRequest. # noqa: E501
:rtype: dict(str, str)
Expand All @@ -686,7 +686,7 @@ def custom_fields(self):
def custom_fields(self, custom_fields):
"""Sets the custom_fields of this ProjectUpdateRequest.
An object where each key is a Custom Field GID and each value is an enum GID, string, number, or object. # noqa: E501
An object where each key is the GID of a custom field and its corresponding value is either an enum GID, string, number, or object (depending on the custom field type). See the [custom fields guide](/docs/custom-fields-guide) for details on creating and updating custom field values. # noqa: E501
:param custom_fields: The custom_fields of this ProjectUpdateRequest. # noqa: E501
:type: dict(str, str)
Expand Down
4 changes: 2 additions & 2 deletions asana/models/task_request.py
Original file line number Diff line number Diff line change
Expand Up @@ -1007,7 +1007,7 @@ def assignee_section(self, assignee_section):
def custom_fields(self):
"""Gets the custom_fields of this TaskRequest. # noqa: E501
An object where each key is a Custom Field GID and each value is an enum GID, string, number, object, or array. # noqa: E501
An object where each key is the GID of a custom field and its corresponding value is either an enum GID, string, number, object, or array (depending on the custom field type). See the [custom fields guide](/docs/custom-fields-guide) for details on creating and updating custom field values. # noqa: E501
:return: The custom_fields of this TaskRequest. # noqa: E501
:rtype: dict(str, str)
Expand All @@ -1018,7 +1018,7 @@ def custom_fields(self):
def custom_fields(self, custom_fields):
"""Sets the custom_fields of this TaskRequest.
An object where each key is a Custom Field GID and each value is an enum GID, string, number, object, or array. # noqa: E501
An object where each key is the GID of a custom field and its corresponding value is either an enum GID, string, number, object, or array (depending on the custom field type). See the [custom fields guide](/docs/custom-fields-guide) for details on creating and updating custom field values. # noqa: E501
:param custom_fields: The custom_fields of this TaskRequest. # noqa: E501
:type: dict(str, str)
Expand Down
2 changes: 1 addition & 1 deletion docs/ProjectRequest.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ Name | Type | Description | Notes
**default_access_level** | **str** | The default access for users or teams who join or are added as members to the project. | [optional]
**minimum_access_level_for_customization** | **str** | The minimum access level needed for project members to modify this project&#x27;s workflow and appearance. | [optional]
**minimum_access_level_for_sharing** | **str** | The minimum access level needed for project members to share the project and manage project memberships. | [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]
**custom_fields** | **dict(str, str)** | An object where each key is the GID of a custom field and its corresponding value is either an enum GID, string, number, or object (depending on the custom field type). See the [custom fields guide](/docs/custom-fields-guide) for details on creating and updating custom field values. | [optional]
**followers** | **str** | *Create-only*. Comma separated string of users. Followers are a subset of members who have opted in to receive \&quot;tasks added\&quot; 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]
Expand Down
2 changes: 1 addition & 1 deletion docs/ProjectUpdateRequest.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ Name | Type | Description | Notes
**default_access_level** | **str** | The default access for users or teams who join or are added as members to the project. | [optional]
**minimum_access_level_for_customization** | **str** | The minimum access level needed for project members to modify this project&#x27;s workflow and appearance. | [optional]
**minimum_access_level_for_sharing** | **str** | The minimum access level needed for project members to share the project and manage project memberships. | [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]
**custom_fields** | **dict(str, str)** | An object where each key is the GID of a custom field and its corresponding value is either an enum GID, string, number, or object (depending on the custom field type). See the [custom fields guide](/docs/custom-fields-guide) for details on creating and updating custom field values. | [optional]
**followers** | **str** | *Create-only*. Comma separated string of users. Followers are a subset of members who have opted in to receive \&quot;tasks added\&quot; 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]
Expand Down
2 changes: 1 addition & 1 deletion docs/TaskRequest.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ Name | Type | Description | Notes
**actual_time_minutes** | **float** | This value represents the sum of all the Time Tracking entries in the Actual Time field on a given Task. It is represented as a nullable long value. | [optional]
**assignee** | **str** | Gid of a user. | [optional]
**assignee_section** | **str** | The *assignee section* is a subdivision of a project that groups tasks together in the assignee&#x27;s \&quot;My Tasks\&quot; list. It can either be a header above a list of tasks in a list view or a column in a board view of \&quot;My Tasks.\&quot; The &#x60;assignee_section&#x60; property will be returned in the response only if the request was sent by the user who is the assignee of the task. Note that you can only write to &#x60;assignee_section&#x60; with the gid of an existing section visible in the user&#x27;s \&quot;My Tasks\&quot; list. | [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, object, or array. | [optional]
**custom_fields** | **dict(str, str)** | An object where each key is the GID of a custom field and its corresponding value is either an enum GID, string, number, object, or array (depending on the custom field type). See the [custom fields guide](/docs/custom-fields-guide) for details on creating and updating custom field values. | [optional]
**followers** | **list[str]** | *Create-Only* An array of strings identifying users. These can either be the string \&quot;me\&quot;, an email, or the gid of a user. In order to change followers on an existing task use &#x60;addFollowers&#x60; and &#x60;removeFollowers&#x60;. | [optional]
**parent** | **str** | Gid of a task. | [optional]
**projects** | **list[str]** | *Create-Only* Array of project gids. In order to change projects on an existing task use &#x60;addProject&#x60; and &#x60;removeProject&#x60;. | [optional]
Expand Down
Loading

0 comments on commit f53d023

Please sign in to comment.