Skip to content

Commit 8f9cd23

Browse files
1.0.2 SDK release
1 parent 2c68f59 commit 8f9cd23

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

42 files changed

+1941
-276
lines changed

README.md

Lines changed: 16 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
11
# Telstra_Messaging
22
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.
33

4+
45
- API version: 2.2.4
5-
- Package version: 1.0.1
6+
- Package version: 1.0.2
67

78
## Requirements.
89

@@ -13,9 +14,9 @@ Python 2.7 and 3.4+
1314

1415

1516
```sh
16-
pip install git+https://github.com/Telstra/Messaging-SDK-python.git
17+
pip install git+https://github.com/Telstra/MessagingAPI-SDK-python.git
1718
```
18-
(you may need to run `pip` with root permission: `sudo pip install git+https://github.com/Telstra/Messaging-SDK-python.git`)
19+
(you may need to run `pip` with root permission: `sudo pip install git+https://github.com/Telstra/MessagingAPI-SDK-python.git`)
1920

2021
```python
2122
import Telstra_Messaging
@@ -44,18 +45,19 @@ import Telstra_Messaging
4445
from Telstra_Messaging.rest import ApiException
4546
from pprint import pprint
4647

48+
# Configure OAuth2 access token for authorization: auth
49+
Telstra_Messaging.configuration.access_token = 'YOUR_ACCESS_TOKEN'
4750
# create an instance of the API class
48-
api_instance = Telstra_Messaging.AuthenticationApi()
49-
client_id = 'client_id_example' # str |
50-
client_secret = 'client_secret_example' # str |
51-
grant_type = 'client_credentials' # str | (default to client_credentials)
51+
api_instance = Telstra_Messaging.MessagingApi()
52+
messageid = 'messageid_example' # str | Unique identifier of a message - it is the value returned from a previous POST call to https://api.telstra.com/v2/messages/mms
5253

5354
try:
54-
# Generate authentication token
55-
api_response = api_instance.auth_token(client_id, client_secret, grant_type)
55+
# Get MMS Status
56+
api_response = api_instance.get_mms_status(messageid)
5657
pprint(api_response)
5758
except ApiException as e:
58-
print("Exception when calling AuthenticationApi->auth_token: %s\n" % e)
59+
print("Exception when calling MessagingApi->get_mms_status: %s\n" % e)
60+
5961
```
6062

6163
## Documentation for API Endpoints
@@ -77,8 +79,10 @@ Class | Method | HTTP request | Description
7779

7880
## Documentation For Models
7981

82+
- [DeleteNumberRequest](docs/DeleteNumberRequest.md)
8083
- [ErrorError](docs/ErrorError.md)
8184
- [ErrorErrorError](docs/ErrorErrorError.md)
85+
- [GetSubscriptionResponse](docs/GetSubscriptionResponse.md)
8286
- [InboundPollResponse](docs/InboundPollResponse.md)
8387
- [MMSContent](docs/MMSContent.md)
8488
- [Message](docs/Message.md)
@@ -94,14 +98,14 @@ Class | Method | HTTP request | Description
9498
- [Status](docs/Status.md)
9599

96100

97-
## Documentation For Authorization
101+
## Documentation For Authorisation
98102

99103

100104
## auth
101105

102106
- **Type**: OAuth
103107
- **Flow**: application
104-
- **Authorization URL**:
108+
- **Authorisation URL**:
105109
- **Scopes**:
106110
- **NSMS**: NSMS
107111

Telstra_Messaging/__init__.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,10 @@
2424
from Telstra_Messaging.api_client import ApiClient
2525
from Telstra_Messaging.configuration import Configuration
2626
# import models into sdk package
27+
from Telstra_Messaging.models.delete_number_request import DeleteNumberRequest
2728
from Telstra_Messaging.models.error_error import ErrorError
2829
from Telstra_Messaging.models.error_error_error import ErrorErrorError
30+
from Telstra_Messaging.models.get_subscription_response import GetSubscriptionResponse
2931
from Telstra_Messaging.models.inbound_poll_response import InboundPollResponse
3032
from Telstra_Messaging.models.mms_content import MMSContent
3133
from Telstra_Messaging.models.message import Message

Telstra_Messaging/api/auth_api.py

Lines changed: 141 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,141 @@
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. # noqa: E501
7+
8+
OpenAPI spec version: 2.2.4
9+
10+
Generated by: https://github.com/swagger-api/swagger-codegen.git
11+
"""
12+
13+
14+
from __future__ import absolute_import
15+
16+
import re # noqa: F401
17+
18+
# python 2 and python 3 compatibility library
19+
import six
20+
21+
from Telstra_Messaging.api_client import ApiClient
22+
23+
24+
class AuthApi(object):
25+
"""NOTE: This class is auto generated by the swagger code generator program.
26+
27+
Do not edit the class manually.
28+
Ref: https://github.com/swagger-api/swagger-codegen
29+
"""
30+
31+
def __init__(self, api_client=None):
32+
if api_client is None:
33+
api_client = ApiClient()
34+
self.api_client = api_client
35+
36+
def oauth_token_post(self, o_auth_client_id, o_auth_client_secret, **kwargs): # noqa: E501
37+
"""AuthGeneratetokenPost # noqa: E501
38+
39+
generate auth token # noqa: E501
40+
This method makes a synchronous HTTP request by default. To make an
41+
asynchronous HTTP request, please pass async=True
42+
>>> thread = api.oauth_token_post(o_auth_client_id, o_auth_client_secret, async=True)
43+
>>> result = thread.get()
44+
45+
:param async bool
46+
:param str o_auth_client_id: (required)
47+
:param str o_auth_client_secret: (required)
48+
:return: AuthgeneratetokenpostResponse
49+
If the method is called asynchronously,
50+
returns the request thread.
51+
"""
52+
kwargs['_return_http_data_only'] = True
53+
if kwargs.get('async'):
54+
return self.oauth_token_post_with_http_info(o_auth_client_id, o_auth_client_secret, **kwargs) # noqa: E501
55+
else:
56+
(data) = self.oauth_token_post_with_http_info(o_auth_client_id, o_auth_client_secret, **kwargs) # noqa: E501
57+
return data
58+
59+
def oauth_token_post_with_http_info(self, o_auth_client_id, o_auth_client_secret, **kwargs): # noqa: E501
60+
"""AuthGeneratetokenPost # noqa: E501
61+
62+
generate auth token # noqa: E501
63+
This method makes a synchronous HTTP request by default. To make an
64+
asynchronous HTTP request, please pass async=True
65+
>>> thread = api.oauth_token_post_with_http_info(o_auth_client_id, o_auth_client_secret, async=True)
66+
>>> result = thread.get()
67+
68+
:param async bool
69+
:param str o_auth_client_id: (required)
70+
:param str o_auth_client_secret: (required)
71+
:return: AuthgeneratetokenpostResponse
72+
If the method is called asynchronously,
73+
returns the request thread.
74+
"""
75+
76+
all_params = ['o_auth_client_id', 'o_auth_client_secret'] # noqa: E501
77+
all_params.append('async')
78+
all_params.append('_return_http_data_only')
79+
all_params.append('_preload_content')
80+
all_params.append('_request_timeout')
81+
82+
params = locals()
83+
for key, val in six.iteritems(params['kwargs']):
84+
if key not in all_params:
85+
raise TypeError(
86+
"Got an unexpected keyword argument '%s'"
87+
" to method oauth_token_post" % key
88+
)
89+
params[key] = val
90+
del params['kwargs']
91+
# verify the required parameter 'o_auth_client_id' is set
92+
if ('o_auth_client_id' not in params or
93+
params['o_auth_client_id'] is None):
94+
raise ValueError("Missing the required parameter `o_auth_client_id` when calling `oauth_token_post`") # noqa: E501
95+
# verify the required parameter 'o_auth_client_secret' is set
96+
if ('o_auth_client_secret' not in params or
97+
params['o_auth_client_secret'] is None):
98+
raise ValueError("Missing the required parameter `o_auth_client_secret` when calling `oauth_token_post`") # noqa: E501
99+
100+
collection_formats = {}
101+
102+
path_params = {}
103+
104+
query_params = []
105+
106+
header_params = {}
107+
108+
form_params = []
109+
local_var_files = {}
110+
if 'o_auth_client_id' in params:
111+
form_params.append(('oAuthClientId', params['o_auth_client_id'])) # noqa: E501
112+
if 'o_auth_client_secret' in params:
113+
form_params.append(('oAuthClientSecret', params['o_auth_client_secret'])) # noqa: E501
114+
115+
body_params = None
116+
# HTTP header `Accept`
117+
header_params['Accept'] = self.api_client.select_header_accept(
118+
['application/json']) # noqa: E501
119+
120+
# HTTP header `Content-Type`
121+
header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501
122+
['application/x-www-form-urlencoded']) # noqa: E501
123+
124+
# Authentication setting
125+
auth_settings = [] # noqa: E501
126+
127+
return self.api_client.call_api(
128+
'/oauth/token', 'POST',
129+
path_params,
130+
query_params,
131+
header_params,
132+
body=body_params,
133+
post_params=form_params,
134+
files=local_var_files,
135+
response_type='AuthgeneratetokenpostResponse', # noqa: E501
136+
auth_settings=auth_settings,
137+
async=params.get('async'),
138+
_return_http_data_only=params.get('_return_http_data_only'),
139+
_preload_content=params.get('_preload_content', True),
140+
_request_timeout=params.get('_request_timeout'),
141+
collection_formats=collection_formats)

Telstra_Messaging/api/messaging_api.py

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ def get_mms_status(self, messageid, **kwargs): # noqa: E501
4444
4545
:param async bool
4646
:param str messageid: Unique identifier of a message - it is the value returned from a previous POST call to https://api.telstra.com/v2/messages/mms (required)
47-
:return: OutboundPollResponse
47+
:return: list[OutboundPollResponse]
4848
If the method is called asynchronously,
4949
returns the request thread.
5050
"""
@@ -66,7 +66,7 @@ def get_mms_status_with_http_info(self, messageid, **kwargs): # noqa: E501
6666
6767
:param async bool
6868
:param str messageid: Unique identifier of a message - it is the value returned from a previous POST call to https://api.telstra.com/v2/messages/mms (required)
69-
:return: OutboundPollResponse
69+
:return: list[OutboundPollResponse]
7070
If the method is called asynchronously,
7171
returns the request thread.
7272
"""
@@ -124,7 +124,7 @@ def get_mms_status_with_http_info(self, messageid, **kwargs): # noqa: E501
124124
body=body_params,
125125
post_params=form_params,
126126
files=local_var_files,
127-
response_type='OutboundPollResponse', # noqa: E501
127+
response_type='list[OutboundPollResponse]', # noqa: E501
128128
auth_settings=auth_settings,
129129
async=params.get('async'),
130130
_return_http_data_only=params.get('_return_http_data_only'),
@@ -143,7 +143,7 @@ def get_sms_status(self, message_id, **kwargs): # noqa: E501
143143
144144
:param async bool
145145
:param str message_id: Unique identifier of a message - it is the value returned from a previous POST call to https://api.telstra.com/v2/messages/sms (required)
146-
:return: OutboundPollResponse
146+
:return: list[OutboundPollResponse]
147147
If the method is called asynchronously,
148148
returns the request thread.
149149
"""
@@ -165,7 +165,7 @@ def get_sms_status_with_http_info(self, message_id, **kwargs): # noqa: E501
165165
166166
:param async bool
167167
:param str message_id: Unique identifier of a message - it is the value returned from a previous POST call to https://api.telstra.com/v2/messages/sms (required)
168-
:return: OutboundPollResponse
168+
:return: list[OutboundPollResponse]
169169
If the method is called asynchronously,
170170
returns the request thread.
171171
"""
@@ -223,7 +223,7 @@ def get_sms_status_with_http_info(self, message_id, **kwargs): # noqa: E501
223223
body=body_params,
224224
post_params=form_params,
225225
files=local_var_files,
226-
response_type='OutboundPollResponse', # noqa: E501
226+
response_type='list[OutboundPollResponse]', # noqa: E501
227227
auth_settings=auth_settings,
228228
async=params.get('async'),
229229
_return_http_data_only=params.get('_return_http_data_only'),
@@ -241,7 +241,7 @@ def retrieve_sms_responses(self, **kwargs): # noqa: E501
241241
>>> result = thread.get()
242242
243243
:param async bool
244-
:return: list[InboundPollResponse]
244+
:return: InboundPollResponse
245245
If the method is called asynchronously,
246246
returns the request thread.
247247
"""
@@ -262,7 +262,7 @@ def retrieve_sms_responses_with_http_info(self, **kwargs): # noqa: E501
262262
>>> result = thread.get()
263263
264264
:param async bool
265-
:return: list[InboundPollResponse]
265+
:return: InboundPollResponse
266266
If the method is called asynchronously,
267267
returns the request thread.
268268
"""
@@ -314,7 +314,7 @@ def retrieve_sms_responses_with_http_info(self, **kwargs): # noqa: E501
314314
body=body_params,
315315
post_params=form_params,
316316
files=local_var_files,
317-
response_type='list[InboundPollResponse]', # noqa: E501
317+
response_type='InboundPollResponse', # noqa: E501
318318
auth_settings=auth_settings,
319319
async=params.get('async'),
320320
_return_http_data_only=params.get('_return_http_data_only'),
@@ -333,7 +333,7 @@ def send_mms(self, body, **kwargs): # noqa: E501
333333
334334
:param async bool
335335
:param SendMmsRequest body: A JSON or XML payload containing the recipient's phone number and MMS message.The recipient number should be in the format '04xxxxxxxx' where x is a digit (required)
336-
:return: object
336+
:return: MessageSentResponse
337337
If the method is called asynchronously,
338338
returns the request thread.
339339
"""
@@ -355,7 +355,7 @@ def send_mms_with_http_info(self, body, **kwargs): # noqa: E501
355355
356356
:param async bool
357357
:param SendMmsRequest body: A JSON or XML payload containing the recipient's phone number and MMS message.The recipient number should be in the format '04xxxxxxxx' where x is a digit (required)
358-
:return: object
358+
:return: MessageSentResponse
359359
If the method is called asynchronously,
360360
returns the request thread.
361361
"""
@@ -413,7 +413,7 @@ def send_mms_with_http_info(self, body, **kwargs): # noqa: E501
413413
body=body_params,
414414
post_params=form_params,
415415
files=local_var_files,
416-
response_type='object', # noqa: E501
416+
response_type='MessageSentResponse', # noqa: E501
417417
auth_settings=auth_settings,
418418
async=params.get('async'),
419419
_return_http_data_only=params.get('_return_http_data_only'),

0 commit comments

Comments
 (0)