Skip to content

Commit ee447f9

Browse files
Auth endpoint updated
1 parent 00456f2 commit ee447f9

38 files changed

+81
-48
lines changed

.DS_Store

6 KB
Binary file not shown.

setup.py

100644100755
Lines changed: 29 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -1,37 +1,29 @@
1-
# coding: utf-8
2-
3-
"""
4-
Telstra Messaging API
5-
6-
The Telstra SMS Messaging API allows your applications to send and receive SMS text messages from Australia's leading network operator. It also allows your application to track the delivery status of both sent and received SMS messages.
7-
"""
8-
9-
10-
import sys
11-
from setuptools import setup, find_packages
12-
13-
NAME = "Telstra"
14-
VERSION = "1.0.0"
15-
# To install the library, run the following
16-
#
17-
# python setup.py install
18-
#
19-
# prerequisite: setuptools
20-
# http://pypi.python.org/pypi/setuptools
21-
22-
REQUIRES = ["cachecontrol", "jsonpickle", "requests", "python-dateutil"]
23-
24-
setup(
25-
name=NAME,
26-
version=VERSION,
27-
description="Telstra Messaging API",
28-
author_email="",
29-
url="https://github.com/telstra/MessagingAPI-SDK-python",
30-
keywords=["Telstra Messaging SDK - Python Library"],
31-
install_requires=REQUIRES,
32-
packages=find_packages(),
33-
include_package_data=True,
34-
long_description="""\
35-
The Telstra SMS Messaging API allows your applications to send and receive SMS text messages from Australia's leading network operator. It also allows your application to track the delivery status of both sent and received SMS messages.
36-
"""
37-
)
1+
from setuptools import setup, find_packages
2+
3+
# Try to convert markdown README to rst format for PyPI.
4+
try:
5+
import pypandoc
6+
long_description = pypandoc.convert('README.md', 'rst')
7+
except(IOError, ImportError):
8+
long_description = open('README.md').read()
9+
10+
setup(
11+
name='telstramessagingapi',
12+
version='2.2.3',
13+
description=' The Telstra SMS Messaging API allows your applications to send and receive SMS text messages from Australia's leading network operator. It also allows your application to track the delivery status of both sent and received SMS messages. ',
14+
long_description=long_description,
15+
author='APIMatic SDK Generator',
16+
author_email='support@apimatic.io',
17+
url='https://apimatic.io/',
18+
packages=find_packages(),
19+
install_requires=[
20+
'requests>=2.9.1, <3.0',
21+
'jsonpickle>=0.7.1, <1.0',
22+
'cachecontrol>=0.11.7, <1.0',
23+
'python-dateutil>=2.5.3, <3.0'
24+
],
25+
tests_require=[
26+
'nose>=1.3.7'
27+
],
28+
test_suite = 'nose.collector'
29+
)

telstramessagingapi/__init__.pyc

-351 Bytes
Binary file not shown.

telstramessagingapi/api_helper.py

Lines changed: 17 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
"""
88

99
import re
10+
import sys
1011
import datetime
1112
import calendar
1213
import email.utils as eut
@@ -117,14 +118,22 @@ def serialize_array(key, array, formatting="indexed"):
117118
"""
118119
tuples = []
119120

120-
if formatting is "unindexed":
121-
tuples += [("{0}[]".format(key), element) for element in array]
122-
elif formatting is "indexed":
123-
tuples += [("{0}[{1}]".format(key, index), element) for index, element in enumerate(array)]
124-
elif formatting is "plain":
125-
tuples += [(key, element) for element in array]
121+
if sys.version_info[0] < 3:
122+
serializable_types = (str, int, long, float, bool, datetime.date, APIHelper.CustomDate)
123+
else:
124+
serializable_types = (str, int, float, bool, datetime.date, APIHelper.CustomDate)
125+
126+
if isinstance(array[0], serializable_types):
127+
if formatting is "unindexed":
128+
tuples += [("{0}[]".format(key), element) for element in array]
129+
elif formatting is "indexed":
130+
tuples += [("{0}[{1}]".format(key, index), element) for index, element in enumerate(array)]
131+
elif formatting is "plain":
132+
tuples += [(key, element) for element in array]
133+
else:
134+
raise ValueError("Invalid format provided.")
126135
else:
127-
raise ValueError("Invalid format provided.")
136+
tuples += [("{0}[{1}]".format(key, index), element) for index, element in enumerate(array)]
128137

129138
return tuples
130139

@@ -187,7 +196,7 @@ def append_url_with_query_parameters(url,
187196

188197
for key, value in parameters.items():
189198
seperator = '&' if '?' in url else '?'
190-
if not value is None:
199+
if value is not None:
191200
if isinstance(value, list):
192201
value = [element for element in value if element]
193202
if array_serialization is "csv":
@@ -254,7 +263,6 @@ def form_encode_parameters(form_parameters,
254263

255264
return encoded
256265

257-
258266
@staticmethod
259267
def form_encode(obj,
260268
instance_name,

telstramessagingapi/api_helper.pyc

-14.5 KB
Binary file not shown.

telstramessagingapi/configuration.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ class Server(object):
5050
environments = {
5151
Environment.PRODUCTION: {
5252
Server.DEFAULT: 'https://tapi.telstra.com/v2',
53-
Server.ACCESS_TOKEN_SERVER: 'https://sapi.telstra.com/v1/oauth',
53+
Server.ACCESS_TOKEN_SERVER: 'https://tapi.telstra.com/v1/oauth',
5454
},
5555
}
5656

-2.2 KB
Binary file not shown.
-320 Bytes
Binary file not shown.
-3.81 KB
Binary file not shown.
-13.2 KB
Binary file not shown.

0 commit comments

Comments
 (0)