8000 fix: add version to path params in python · Santhasangar/twilio-python@16e9fc3 · GitHub
[go: up one dir, main page]

Skip to content

Commit 16e9fc3

Browse files
author
Bilal Boussayoud
committed
fix: add version to path params in python
1 parent 4ac3fd5 commit 16e9fc3

File tree

2 files changed

+20
-20
lines changed

2 files changed

+20
-20
lines changed

tests/integration/events/v1/schema/test_version.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -58,15 +58,15 @@ def test_read_results_response(self):
5858
"schema_versions": [
5959
{
6060
"id": "Messaging.MessageStatus",
61-
"schema_version": 1,
61+
"version": 1,
6262
"public": true,
6363
"date_created": "2015-07-30T20:00:00Z",
6464
"url": "https://events.twilio.com/v1/Schemas/Messaging.MessageStatus/Versions/1",
6565
"raw": "https://events-schemas.twilio.com/Messaging.MessageStatus/1"
6666
},
6767
{
6868
"id": "Messaging.MessageStatus",
69-
"schema_version": 2,
69+
"version": 2,
7070
"public": true,
7171
"date_created": "2015-07-30T20:00:00Z",
7272
"url": "https://events.twilio.com/v1/Schemas/Messaging.MessageStatus/Versions/2",
@@ -109,7 +109,7 @@ def test_fetch_response(self):
109109
'''
110110
{
111111
"id": "Messaging.MessageStatus",
112-
"schema_version": 1,
112+
"version": 1,
113113
"public": true,
114114
"date_created": "2015-07-30T20:00:00Z",
115115
"url": "https://events.twilio.com/v1/Schemas/Messaging.MessageStatus/Versions/1",

twilio/rest/events/v1/schema/version.py

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -111,27 +111,27 @@ def get_page(self, target_url):
111111

112112
return SchemaVersionPage(self._version, response, self._solution)
113113

114-
def get(self, schema_version):
114+
def get(self, path_version):
115115
"""
116116
Constructs a SchemaVersionContext
117117
118-
:param schema_version: The version of the schema
118+
:param path_version: The version of the schema
119119
120120
:returns: twilio.rest.events.v1.schema.version.SchemaVersionContext
121121
:rtype: twilio.rest.events.v1.schema.version.SchemaVersionContext
122122
"""
123-
return SchemaVersionContext(self._version, id=self._solution['id'], schema_version=schema_version, )
123+
return SchemaVersionContext(self._version, id=self._solution['id'], path_version=path_version, )
124124

125-
def __call__(self, schema_version):
125+
def __call__(self, path_version):
126126
"""
127127
Constructs a SchemaVersionContext
128128
129-
:param schema_version: The version of the schema
129+
:param path_version: The version of the schema
130130
131131
:returns: twilio.rest.events.v1.schema.version.SchemaVersionContext
132132
:rtype: twilio.rest.events.v1.schema.version.SchemaVersionContext
133133
"""
134-
return SchemaVersionContext(self._version, id=self._solution['id'], schema_version=schema_version, )
134+
return SchemaVersionContext(self._version, id=self._solution['id'], path_version=path_version, )
135135

136136
def __repr__(self):
137137
"""
@@ -188,22 +188,22 @@ class SchemaVersionContext(InstanceContext):
188188
""" PLEASE NOTE that this class contains beta products that are subject to
189189
change. Use them with caution. """
190190

191-
def __init__(self, version, id, schema_version):
191+
def __init__(self, version, id, path_version):
192192
"""
193193
Initialize the SchemaVersionContext
194194
195195
:param Version version: Version that contains the resource
196196
:param id: The unique identifier of the schema.
197-
:param schema_version: The version of the schema
197+
:param path_version: The version of the schema
198198
199199
:returns: twilio.rest.events.v1.schema.version.SchemaVersionContext
200200
:rtype: twilio.rest.events.v1.schema.version.SchemaVersionContext
201201
"""
202202
super(SchemaVersionContext, self).__init__(version)
203203

204204
# Path Solution
205-
self._solution = {'id': id, 'schema_version': schema_version, }
206-
self._uri = '/Schemas/{id}/Versions/{schema_version}'.format(**self._solution)
205+
self._solution = {'id': id, 'path_version': path_version, }
206+
self._uri = '/Schemas/{id}/Versions/{path_version}'.format(**self._solution)
207207

208208
def fetch(self):
209209
"""
@@ -218,7 +218,7 @@ def fetch(self):
218218
self._version,
219219
payload,
220220
id=self._solution['id'],
221-
schema_version=self._solution['schema_version'],
221+
path_version=self._solution['path_version'],
222222
)
223223

224224
def __repr__(self):
@@ -236,7 +236,7 @@ class SchemaVersionInstance(InstanceResource):
236236
""" PLEASE NOTE that this class contains beta products that are subject to
237237
change. Use them with caution. """
238238

239-
def __init__(self, version, payload, id, schema_version=None):
239+
def __init__(self, version, payload, id, path_version=None):
240240
"""
241241
Initialize the SchemaVersionInstance
242242
@@ -248,15 +248,15 @@ def __init__(self, version, payload, id, schema_version=None):
248248
# Marshaled Properties
249249
self._properties = {
250250
'id': payload.get('id'),
251-
'schema_version': deserialize.integer(payload.get('schema_version')),
251+
'version': deserialize.integer(payload.get('version')),
252252
'date_created': deserialize.iso8601_datetime(payload.get('date_created')),
253253
'url': payload.get('url'),
254254
'raw': payload.get('raw'),
255255
}
256256

257257
# Context
258258
self._context = None
259-
self._solution = {'id': id, 'schema_version': schema_version or self._properties['schema_version'], }
259+
self._solution = {'id': id, 'path_version': path_version or self._properties['version'], }
260260

261261
@property
262262
def _proxy(self):
@@ -271,7 +271,7 @@ def _proxy(self):
271271
self._context = SchemaVersionContext(
272272
self._version,
273273
id=self._solution['id'],
274-
schema_version=self._solution['schema_version'],
274+
path_version=self._solution['path_version'],
275275
)
276276
return self._context
277277

@@ -284,12 +284,12 @@ def id(self):
284284
return self._properties['id']
285285

286286
@property
287-
def schema_version(self):
287+
def version(self):
288288
"""
289289
:returns: The version of this schema.
290290
:rtype: unicode
291291
"""
292-
return self._properties['schema_version']
292+
return self._properties['version']
293293

294294
@property
295295
def date_created(self):

0 commit comments

Comments
 (0)
0