Skip to content

Commit 2e75f6e

Browse files
committed
[Librarian] Regenerated @ e1fdbad79f0a5b5c68afaf6798362f18827b32d1
1 parent d881810 commit 2e75f6e

File tree

68 files changed

+1776
-1694
lines changed

Some content is hidden

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

68 files changed

+1776
-1694
lines changed

CHANGES.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,18 @@ twilio-python Changelog
33

44
Here you can see the full list of changes between each twilio-python release.
55

6+
[2019-10-02] Version 6.31.1
7+
---------------------------
8+
**Library**
9+
- [PR #477](https://github.com/twilio/twilio-python/pull/477): added validation of signature without stripping port number. Thanks to [@eshanholtz](https://github.com/eshanholtz)!
10+
11+
**Conversations**
12+
- Add media to Conversations Message resource
13+
14+
**Supersim**
15+
- Add List endpoint to Sims resource for Super Sim Pilot
16+
17+
618
[2019-09-18] Version 6.31.0
719
----------------------------
820
**Numbers**

CONTRIBUTING.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ even better than it is today! Here are the guidelines we'd like you to follow:
1111
- [Submission Guidelines](#submit)
1212
- [Coding Rules](#rules)
1313

14+
1415
## <a name="coc"></a> Code of Conduct
1516

1617
Help us keep `twilio-python` open and inclusive. Please be kind to and considerate
@@ -154,6 +155,7 @@ you are working:
154155
* All features or bug fixes **must be tested** by one or more tests.
155156
* All classes and methods **must be documented**.
156157
158+
157159
[docs-link]: https://www.twilio.com/docs/libraries/python
158160
[issue-link]: https://github.com/twilio/twilio-python/issues/new
159161
[github]: https://github.com/twilio/twilio-python

tests/integration/conversations/v1/conversation/test_message.py

Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,39 @@ def test_create_response(self):
3535
"account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
3636
"conversation_sid": "CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
3737
"body": "Hello",
38+
"media": null,
39+
"author": "message author",
40+
"attributes": "{ \\"importance\\": \\"high\\" }",
41+
"date_created": "2015-12-16T22:18:37Z",
42+
"date_updated": "2015-12-16T22:18:38Z",
43+
"index": 0,
44+
"url": "https://conversations.twilio.com/v1/Conversations/CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Messages/IMaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
45+
}
46+
'''
47+
))
48+
49+
actual = self.client.conversations.v1.conversations(sid="CHXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX") \
50+
.messages.create()
51+
52+
self.assertIsNotNone(actual)
53+
54+
def test_create_with_media_response(self):
55+
self.holodeck.mock(Response(
56+
201,
57+
'''
58+
{
59+
"sid": "IMaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
60+
"account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
61+
"conversation_sid": "CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
62+
"body": null,
63+
"media": [
64+
{
65+
"sid": "MEaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
66+
"size": 42056,
67+
"content_type": "image/jpeg",
68+
"filename": "car.jpg"
69+
}
70+
],
3871
"author": "message author",
3972
"attributes": "{ \\"importance\\": \\"high\\" }",
4073
"date_created": "2015-12-16T22:18:37Z",
@@ -71,6 +104,7 @@ def test_update_response(self):
71104
"account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
72105
"conversation_sid": "CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
73106
"body": "Hello",
107+
"media": null,
74108
"author": "message author",
75109
"attributes": "{ \\"importance\\": \\"high\\" }",
76110
"date_created": "2015-12-16T22:18:37Z",
@@ -130,6 +164,7 @@ def test_fetch_response(self):
130164
"account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
131165
"conversation_sid": "CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
132166
"body": "Welcome!",
167+
"media": null,
133168
"author": "system",
134169
"attributes": "{ \\"importance\\": \\"high\\" }",
135170
"date_created": "2016-03-24T20:37:57Z",
@@ -177,6 +212,7 @@ def test_read_full_response(self):
177212
"account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
178213
"conversation_sid": "CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
179214
"body": "I like pie.",
215+
"media": null,
180216
"author": "pie_preferrer",
181217
"attributes": "{ \\"importance\\": \\"high\\" }",
182218
"date_created": "2016-03-24T20:37:57Z",
@@ -189,6 +225,27 @@ def test_read_full_response(self):
189225
"account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
190226
"conversation_sid": "CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
191227
"body": "Cake is my favorite!",
228+
"media": null,
229+
"author": "cake_lover",
230+
"attributes": "{ \\"importance\\": \\"high\\" }",
231+
"date_created": "2016-03-24T20:38:21Z",
232+
"date_updated": "2016-03-24T20:38:21Z",
233+
"index": 0,
234+
"url": "https://conversations.twilio.com/v1/Conversations/CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Messages/IMaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
235+
},
236+
{
237+
"sid": "IMaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
238+
"account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
239+
"conversation_sid": "CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
240+
"body": null,
241+
"media": [
242+
{
243+
"sid": "MEaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
244+
"size": 42056,
245+
"content_type": "image/jpeg",
246+
"filename": "car.jpg"
247+
}
248+
],
192249
"author": "cake_lover",
193250
"attributes": "{ \\"importance\\": \\"high\\" }",
194251
"date_created": "2016-03-24T20:38:21Z",

twilio/rest/api/v2010/account/call/__init__.py

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -144,12 +144,12 @@ def stream(self, to=values.unset, from_=values.unset,
144144
:param unicode from_: Phone number or Client identifier to filter `from` on
145145
:param unicode parent_call_sid: Parent call SID to filter on
146146
:param CallInstance.Status status: The status of the resources to read
147-
:param datetime start_time_before: Only include calls that started on or after this date
148-
:param datetime start_time: Only include calls that started on or after this date
149-
:param datetime start_time_after: Only include calls that started on or after this date
150-
:param datetime end_time_before: Only include usage that occurred on or before this date
151-
:param datetime end_time: Only include usage that occurred on or before this date
152-
:param datetime end_time_after: Only include usage that occurred on or before this date
147+
:param datetime start_time_before: Only include calls that started on this date
148+
:param datetime start_time: Only include calls that started on this date
149+
:param datetime start_time_after: Only include calls that started on this date
150+
:param datetime end_time_before: Only include calls that ended on this date
151+
:param datetime end_time: Only include calls that ended on this date
152+
:param datetime end_time_after: Only include calls that ended on this date
153153
:param int limit: Upper limit for the number of records to return. stream()
154154
guarantees to never return more than limit. Default is no limit
155155
:param int page_size: Number of records to fetch per request, when not set will use
@@ -193,12 +193,12 @@ def list(self, to=values.unset, from_=values.unset,
193193
:param unicode from_: Phone number or Client identifier to filter `from` on
194194
:param unicode parent_call_sid: Parent call SID to filter on
195195
:param CallInstance.Status status: The status of the resources to read
196-
:param datetime start_time_before: Only include calls that started on or after this date
197-
:param datetime start_time: Only include calls that started on or after this date
198-
:param datetime start_time_after: Only include calls that started on or after this date
199-
:param datetime end_time_before: Only include usage that occurred on or before this date
200-
:param datetime end_time: Only include usage that occurred on or before this date
201-
:param datetime end_time_after: Only include usage that occurred on or before this date
196+
:param datetime start_time_before: Only include calls that started on this date
197+
:param datetime start_time: Only include calls that started on this date
198+
:param datetime start_time_after: Only include calls that started on this date
199+
:param datetime end_time_before: Only include calls that ended on this date
200+
:param datetime end_time: Only include calls that ended on this date
201+
:param datetime end_time_after: Only include calls that ended on this date
202202
:param int limit: Upper limit for the number of records to return. list() guarantees
203203
never to return more than limit. Default is no limit
204204
:param int page_size: Number of records to fetch per request, when not set will use
@@ -239,12 +239,12 @@ def page(self, to=values.unset, from_=values.unset,
239239
:param unicode from_: Phone number or Client identifier to filter `from` on
240240
:param unicode parent_call_sid: Parent call SID to filter on
241241
:param CallInstance.Status status: The status of the resources to read
242-
:param datetime start_time_before: Only include calls that started on or after this date
243-
:param datetime start_time: Only include calls that started on or after this date
244-
:param datetime start_time_after: Only include calls that started on or after this date
245-
:param datetime end_time_before: Only include usage that occurred on or before this date
246-
:param datetime end_time: Only include usage that occurred on or before this date
247-
:param datetime end_time_after: Only include usage that occurred on or before this date
242+
:param datetime start_time_before: Only include calls that started on this date
243+
:param datetime start_time: Only include calls that started on this date
244+
:param datetime start_time_after: Only include calls that started on this date
245+
:param datetime end_time_before: Only include calls that ended on this date
246+
:param datetime end_time: Only include calls that ended on this date
247+
:param datetime end_time_after: Only include calls that ended on this date
248248
:param str page_token: PageToken provided by the API
249249
:param int page_number: Page Number, this value is simply for client state
250250
:param int page_size: Number of records to return, defaults to 50

twilio/rest/api/v2010/account/message/media.py

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -43,9 +43,9 @@ def stream(self, date_created_before=values.unset, date_created=values.unset,
4343
is reached.
4444
The results are returned as a generator, so this operation is memory efficient.
4545
46-
:param datetime date_created_before: The `YYYY-MM-DD` value of the resources to read
47-
:param datetime date_created: The `YYYY-MM-DD` value of the resources to read
48-
:param datetime date_created_after: The `YYYY-MM-DD` value of the resources to read
46+
:param datetime date_created_before: Only include media that was created on this date
47+
:param datetime date_created: Only include media that was created on this date
48+
:param datetime date_created_after: Only include media that was created on this date
4949
:param int limit: Upper limit for the number of records to return. stream()
5050
guarantees to never return more than limit. Default is no limit
5151
:param int page_size: Number of records to fetch per request, when not set will use
@@ -74,9 +74,9 @@ def list(self, date_created_before=values.unset, date_created=values.unset,
7474
Unlike stream(), this operation is eager and will load `limit` records into
7575
memory before returning.
7676
77-
:param datetime date_created_before: The `YYYY-MM-DD` value of the resources to read
78-
:param datetime date_created: The `YYYY-MM-DD` value of the resources to read
79-
:param datetime date_created_after: The `YYYY-MM-DD` value of the resources to read
77+
:param datetime date_created_before: Only include media that was created on this date
78+
:param datetime date_created: Only include media that was created on this date
79+
:param datetime date_created_after: Only include media that was created on this date
8080
:param int limit: Upper limit for the number of records to return. list() guarantees
8181
never to return more than limit. Default is no limit
8282
:param int page_size: Number of records to fetch per request, when not set will use
@@ -102,9 +102,9 @@ def page(self, date_created_before=values.unset, date_created=values.unset,
102102
Retrieve a single page of MediaInstance records from the API.
103103
Request is executed immediately
104104
105-
:param datetime date_created_before: The `YYYY-MM-DD` value of the resources to read
106-
:param datetime date_created: The `YYYY-MM-DD` value of the resources to read
107-
:param datetime date_created_after: The `YYYY-MM-DD` value of the resources to read
105+
:param datetime date_created_before: Only include media that was created on this date
106+
:param datetime date_created: Only include media that was created on this date
107+
:param datetime date_created_after: Only include media that was created on this date
108108
:param str page_token: PageToken provided by the API
109109
:param int page_number: Page Number, this value is simply for client state
110110
:param int page_size: Number of records to return, defaults to 50

twilio/rest/api/v2010/account/recording/__init__.py

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -45,9 +45,9 @@ def stream(self, date_created_before=values.unset, date_created=values.unset,
4545
is reached.
4646
The results are returned as a generator, so this operation is memory efficient.
4747
48-
:param datetime date_created_before: The `YYYY-MM-DD` value of the resources to read
49-
:param datetime date_created: The `YYYY-MM-DD` value of the resources to read
50-
:param datetime date_created_after: The `YYYY-MM-DD` value of the resources to read
48+
:param datetime date_created_before: Only include recordings that were created on this date
49+
:param datetime date_created: Only include recordings that were created on this date
50+
:param datetime date_created_after: Only include recordings that were created on this date
5151
:param unicode call_sid: The Call SID of the resources to read
5252
:param unicode conference_sid: Read by unique Conference SID for the recording
5353
:param int limit: Upper limit for the number of records to return. stream()
@@ -81,9 +81,9 @@ def list(self, date_created_before=values.unset, date_created=values.unset,
8181
Unlike stream(), this operation is eager and will load `limit` records into
8282
memory before returning.
8383
84-
:param datetime date_created_before: The `YYYY-MM-DD` value of the resources to read
85-
:param datetime date_created: The `YYYY-MM-DD` value of the resources to read
86-
:param datetime date_created_after: The `YYYY-MM-DD` value of the resources to read
84+
:param datetime date_created_before: Only include recordings that were created on this date
85+
:param datetime date_created: Only include recordings that were created on this date
86+
:param datetime date_created_after: Only include recordings that were created on this date
8787
:param unicode call_sid: The Call SID of the resources to read
8888
:param unicode conference_sid: Read by unique Conference SID for the recording
8989
:param int limit: Upper limit for the number of records to return. list() guarantees
@@ -114,9 +114,9 @@ def page(self, date_created_before=values.unset, date_created=values.unset,
114114
Retrieve a single page of RecordingInstance records from the API.
115115
Request is executed immediately
116116
117-
:param datetime date_created_before: The `YYYY-MM-DD` value of the resources to read
118-
:param datetime date_created: The `YYYY-MM-DD` value of the resources to read
119-
:param datetime date_created_after: The `YYYY-MM-DD` value of the resources to read
117+
:param datetime date_created_before: Only include recordings that were created on this date
118+
:param datetime date_created: Only include recordings that were created on this date
119+
:param datetime date_created_after: Only include recordings that were created on this date
120120
:param unicode call_sid: The Call SID of the resources to read
121121
:param unicode conference_sid: Read by unique Conference SID for the recording
122122
:param str page_token: PageToken provided by the API

twilio/rest/conversations/v1/conversation/message.py

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ def __init__(self, version, conversation_sid):
3737

3838
def create(self, author=values.unset, body=values.unset,
3939
date_created=values.unset, date_updated=values.unset,
40-
attributes=values.unset):
40+
attributes=values.unset, media_sid=values.unset):
4141
"""
4242
Create a new MessageInstance
4343
@@ -46,6 +46,7 @@ def create(self, author=values.unset, body=values.unset,
4646
:param datetime date_created: The date that this resource was created.
4747
:param datetime date_updated: The date that this resource was last updated.
4848
:param unicode attributes: A string metadata field you can use to store any data you wish.
49+
:param unicode media_sid: The Media Sid to be attached to the new Message.
4950
5051
:returns: Newly created MessageInstance
5152
:rtype: twilio.rest.conversations.v1.conversation.message.MessageInstance
@@ -56,6 +57,7 @@ def create(self, author=values.unset, body=values.unset,
5657
'DateCreated': serialize.iso8601_datetime(date_created),
5758
'DateUpdated': serialize.iso8601_datetime(date_updated),
5859
'Attributes': attributes,
60+
'MediaSid': media_sid,
5961
})
6062

6163
payload = self._version.create(
@@ -344,6 +346,7 @@ def __init__(self, version, payload, conversation_sid, sid=None):
344346
'index': deserialize.integer(payload['index']),
345347
'author': payload['author'],
346348
'body': payload['body'],
349+
'media': payload['media'],
347350
'attributes': payload['attributes'],
348351
'date_created': deserialize.iso8601_datetime(payload['date_created']),
349352
'date_updated': deserialize.iso8601_datetime(payload['date_updated']),
@@ -419,6 +422,14 @@ def body(self):
419422
"""
420423
return self._properties['body']
421424

425+
@property
426+
def media(self):
427+
"""
428+
:returns: An array of objects that describe the Message's media if attached, otherwise, null.
429+
:rtype: dict
430+
"""
431+
return self._properties['media']
432+
422433
@property
423434
def attributes(self):
424435
"""

twilio/rest/fax/v1/fax/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -163,7 +163,7 @@ def create(self, to, media_url, quality=values.unset,
163163
Create a new FaxInstance
164164
165165
:param unicode to: The phone number to receive the fax
166-
:param unicode media_url: The Twilio-hosted URL of the PDF that contains the fax
166+
:param unicode media_url: The URL of the PDF that contains the fax
167167
:param FaxInstance.Quality quality: The quality of this fax
168168
:param unicode status_callback: The URL we should call to send status information to your application
169169
:param unicode from_: The number the fax was sent from

0 commit comments

Comments
 (0)