Skip to content

Commit

Permalink
Updated Python SDK
Browse files Browse the repository at this point in the history
  • Loading branch information
jv-asana authored and actions-user committed Aug 4, 2023
1 parent 6a23ba3 commit 5ca1994
Show file tree
Hide file tree
Showing 41 changed files with 523 additions and 88 deletions.
3 changes: 2 additions & 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.3
- Package version: 4.0.4

## Requirements.

Expand Down Expand Up @@ -417,6 +417,7 @@ Class | Method | HTTP request | Description
- [AttachmentResponseArray](docs/AttachmentResponseArray.md)
- [AttachmentResponseData](docs/AttachmentResponseData.md)
- [AttachmentResponseParent](docs/AttachmentResponseParent.md)
- [AttachmentResponseParentCreatedBy](docs/AttachmentResponseParentCreatedBy.md)
- [AuditLogEvent](docs/AuditLogEvent.md)
- [AuditLogEventActor](docs/AuditLogEventActor.md)
- [AuditLogEventArray](docs/AuditLogEventArray.md)
Expand Down
1 change: 1 addition & 0 deletions asana/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,7 @@
from asana.models.attachment_response_array import AttachmentResponseArray
from asana.models.attachment_response_data import AttachmentResponseData
from asana.models.attachment_response_parent import AttachmentResponseParent
from asana.models.attachment_response_parent_created_by import AttachmentResponseParentCreatedBy
from asana.models.audit_log_event import AuditLogEvent
from asana.models.audit_log_event_actor import AuditLogEventActor
from asana.models.audit_log_event_array import AuditLogEventArray
Expand Down
4 changes: 2 additions & 2 deletions asana/api_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -75,12 +75,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.3/python'
self.user_agent = 'Swagger-Codegen/4.0.4/python'
# Add custom header
self.default_headers['X-Asana-Client-Lib'] = urlencode(
{
'language': 'Python',
'version': '4.0.3',
'version': '4.0.4',
'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.3".\
"SDK Package Version: 4.0.4".\
format(env=sys.platform, pyversion=sys.version)
1 change: 1 addition & 0 deletions asana/models/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@
from asana.models.attachment_response_array import AttachmentResponseArray
from asana.models.attachment_response_data import AttachmentResponseData
from asana.models.attachment_response_parent import AttachmentResponseParent
from asana.models.attachment_response_parent_created_by import AttachmentResponseParentCreatedBy
from asana.models.audit_log_event import AuditLogEvent
from asana.models.audit_log_event_actor import AuditLogEventActor
from asana.models.audit_log_event_array import AuditLogEventArray
Expand Down
32 changes: 29 additions & 3 deletions asana/models/attachment_response_parent.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,22 +31,25 @@ class AttachmentResponseParent(object):
'gid': 'str',
'resource_type': 'str',
'name': 'str',
'resource_subtype': 'str'
'resource_subtype': 'str',
'created_by': 'AttachmentResponseParentCreatedBy'
}

attribute_map = {
'gid': 'gid',
'resource_type': 'resource_type',
'name': 'name',
'resource_subtype': 'resource_subtype'
'resource_subtype': 'resource_subtype',
'created_by': 'created_by'
}

def __init__(self, gid=None, resource_type=None, name=None, resource_subtype=None): # noqa: E501
def __init__(self, gid=None, resource_type=None, name=None, resource_subtype=None, created_by=None): # noqa: E501
"""AttachmentResponseParent - a model defined in Swagger""" # noqa: E501
self._gid = None
self._resource_type = None
self._name = None
self._resource_subtype = None
self._created_by = None
self.discriminator = None
if gid is not None:
self.gid = gid
Expand All @@ -56,6 +59,8 @@ def __init__(self, gid=None, resource_type=None, name=None, resource_subtype=Non
self.name = name
if resource_subtype is not None:
self.resource_subtype = resource_subtype
if created_by is not None:
self.created_by = created_by

@property
def gid(self):
Expand Down Expand Up @@ -149,6 +154,27 @@ def resource_subtype(self, resource_subtype):

self._resource_subtype = resource_subtype

@property
def created_by(self):
"""Gets the created_by of this AttachmentResponseParent. # noqa: E501
:return: The created_by of this AttachmentResponseParent. # noqa: E501
:rtype: AttachmentResponseParentCreatedBy
"""
return self._created_by

@created_by.setter
def created_by(self, created_by):
"""Sets the created_by of this AttachmentResponseParent.
:param created_by: The created_by of this AttachmentResponseParent. # noqa: E501
:type: AttachmentResponseParentCreatedBy
"""

self._created_by = created_by

def to_dict(self):
"""Returns the model properties as a dict"""
result = {}
Expand Down
140 changes: 140 additions & 0 deletions asana/models/attachment_response_parent_created_by.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,140 @@
# coding: utf-8

"""
Asana
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
OpenAPI spec version: 1.0
Generated by: https://github.com/swagger-api/swagger-codegen.git
"""

import pprint
import re # noqa: F401

import six

class AttachmentResponseParentCreatedBy(object):
"""NOTE: This class is auto generated by the swagger code generator program.
Do not edit the class manually.
"""
"""
Attributes:
swagger_types (dict): The key is attribute name
and the value is attribute type.
attribute_map (dict): The key is attribute name
and the value is json key in definition.
"""
swagger_types = {
'gid': 'str',
'resource_type': 'str'
}

attribute_map = {
'gid': 'gid',
'resource_type': 'resource_type'
}

def __init__(self, gid=None, resource_type=None): # noqa: E501
"""AttachmentResponseParentCreatedBy - a model defined in Swagger""" # noqa: E501
self._gid = None
self._resource_type = None
self.discriminator = None
if gid is not None:
self.gid = gid
if resource_type is not None:
self.resource_type = resource_type

@property
def gid(self):
"""Gets the gid of this AttachmentResponseParentCreatedBy. # noqa: E501
Globally unique identifier of the resource. # noqa: E501
:return: The gid of this AttachmentResponseParentCreatedBy. # noqa: E501
:rtype: str
"""
return self._gid

@gid.setter
def gid(self, gid):
"""Sets the gid of this AttachmentResponseParentCreatedBy.
Globally unique identifier of the resource. # noqa: E501
:param gid: The gid of this AttachmentResponseParentCreatedBy. # noqa: E501
:type: str
"""

self._gid = gid

@property
def resource_type(self):
"""Gets the resource_type of this AttachmentResponseParentCreatedBy. # noqa: E501
The type of resource. # noqa: E501
:return: The resource_type of this AttachmentResponseParentCreatedBy. # noqa: E501
:rtype: str
"""
return self._resource_type

@resource_type.setter
def resource_type(self, resource_type):
"""Sets the resource_type of this AttachmentResponseParentCreatedBy.
The type of resource. # noqa: E501
:param resource_type: The resource_type of this AttachmentResponseParentCreatedBy. # noqa: E501
:type: str
"""

self._resource_type = resource_type

def to_dict(self):
"""Returns the model properties as a dict"""
result = {}

for attr, _ in six.iteritems(self.swagger_types):
value = getattr(self, attr)
if isinstance(value, list):
result[attr] = list(map(
lambda x: x.to_dict() if hasattr(x, "to_dict") else x,
value
))
elif hasattr(value, "to_dict"):
result[attr] = value.to_dict()
elif isinstance(value, dict):
result[attr] = dict(map(
lambda item: (item[0], item[1].to_dict())
if hasattr(item[1], "to_dict") else item,
value.items()
))
else:
result[attr] = value
if issubclass(AttachmentResponseParentCreatedBy, dict):
for key, value in self.items():
result[key] = value

return result

def to_str(self):
"""Returns the string representation of the model"""
return pprint.pformat(self.to_dict())

def __repr__(self):
"""For `print` and `pprint`"""
return self.to_str()

def __eq__(self, other):
"""Returns true if both objects are equal"""
if not isinstance(other, AttachmentResponseParentCreatedBy):
return False

return self.__dict__ == other.__dict__

def __ne__(self, other):
"""Returns true if both objects are not equal"""
return not self == other
32 changes: 29 additions & 3 deletions asana/models/job_base_new_task.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,22 +31,25 @@ class JobBaseNewTask(object):
'gid': 'str',
'resource_type': 'str',
'name': 'str',
'resource_subtype': 'str'
'resource_subtype': 'str',
'created_by': 'AttachmentResponseParentCreatedBy'
}

attribute_map = {
'gid': 'gid',
'resource_type': 'resource_type',
'name': 'name',
'resource_subtype': 'resource_subtype'
'resource_subtype': 'resource_subtype',
'created_by': 'created_by'
}

def __init__(self, gid=None, resource_type=None, name=None, resource_subtype=None): # noqa: E501
def __init__(self, gid=None, resource_type=None, name=None, resource_subtype=None, created_by=None): # noqa: E501
"""JobBaseNewTask - a model defined in Swagger""" # noqa: E501
self._gid = None
self._resource_type = None
self._name = None
self._resource_subtype = None
self._created_by = None
self.discriminator = None
if gid is not None:
self.gid = gid
Expand All @@ -56,6 +59,8 @@ def __init__(self, gid=None, resource_type=None, name=None, resource_subtype=Non
self.name = name
if resource_subtype is not None:
self.resource_subtype = resource_subtype
if created_by is not None:
self.created_by = created_by

@property
def gid(self):
Expand Down Expand Up @@ -155,6 +160,27 @@ def resource_subtype(self, resource_subtype):

self._resource_subtype = resource_subtype

@property
def created_by(self):
"""Gets the created_by of this JobBaseNewTask. # noqa: E501
:return: The created_by of this JobBaseNewTask. # noqa: E501
:rtype: AttachmentResponseParentCreatedBy
"""
return self._created_by

@created_by.setter
def created_by(self, created_by):
"""Sets the created_by of this JobBaseNewTask.
:param created_by: The created_by of this JobBaseNewTask. # noqa: E501
:type: AttachmentResponseParentCreatedBy
"""

self._created_by = created_by

def to_dict(self):
"""Returns the model properties as a dict"""
result = {}
Expand Down
32 changes: 29 additions & 3 deletions asana/models/story_response_target.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,22 +31,25 @@ class StoryResponseTarget(object):
'gid': 'str',
'resource_type': 'str',
'name': 'str',
'resource_subtype': 'str'
'resource_subtype': 'str',
'created_by': 'AttachmentResponseParentCreatedBy'
}

attribute_map = {
'gid': 'gid',
'resource_type': 'resource_type',
'name': 'name',
'resource_subtype': 'resource_subtype'
'resource_subtype': 'resource_subtype',
'created_by': 'created_by'
}

def __init__(self, gid=None, resource_type=None, name=None, resource_subtype=None): # noqa: E501
def __init__(self, gid=None, resource_type=None, name=None, resource_subtype=None, created_by=None): # noqa: E501
"""StoryResponseTarget - a model defined in Swagger""" # noqa: E501
self._gid = None
self._resource_type = None
self._name = None
self._resource_subtype = None
self._created_by = None
self.discriminator = None
if gid is not None:
self.gid = gid
Expand All @@ -56,6 +59,8 @@ def __init__(self, gid=None, resource_type=None, name=None, resource_subtype=Non
self.name = name
if resource_subtype is not None:
self.resource_subtype = resource_subtype
if created_by is not None:
self.created_by = created_by

@property
def gid(self):
Expand Down Expand Up @@ -155,6 +160,27 @@ def resource_subtype(self, resource_subtype):

self._resource_subtype = resource_subtype

@property
def created_by(self):
"""Gets the created_by of this StoryResponseTarget. # noqa: E501
:return: The created_by of this StoryResponseTarget. # noqa: E501
:rtype: AttachmentResponseParentCreatedBy
"""
return self._created_by

@created_by.setter
def created_by(self, created_by):
"""Sets the created_by of this StoryResponseTarget.
:param created_by: The created_by of this StoryResponseTarget. # noqa: E501
:type: AttachmentResponseParentCreatedBy
"""

self._created_by = created_by

def to_dict(self):
"""Returns the model properties as a dict"""
result = {}
Expand Down
Loading

0 comments on commit 5ca1994

Please sign in to comment.