Skip to content

Commit

Permalink
[Librarian] Regenerated @ e1fdbad79f0a5b5c68afaf6798362f18827b32d1
Browse files Browse the repository at this point in the history
  • Loading branch information
twilio-ci committed Oct 2, 2019
1 parent d881810 commit 2e75f6e
Show file tree
Hide file tree
Showing 68 changed files with 1,776 additions and 1,694 deletions.
12 changes: 12 additions & 0 deletions CHANGES.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,18 @@ twilio-python Changelog

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

[2019-10-02] Version 6.31.1
---------------------------
**Library**
- [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)!

**Conversations**
- Add media to Conversations Message resource

**Supersim**
- Add List endpoint to Sims resource for Super Sim Pilot


[2019-09-18] Version 6.31.0
----------------------------
**Numbers**
Expand Down
2 changes: 2 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ even better than it is today! Here are the guidelines we'd like you to follow:
- [Submission Guidelines](#submit)
- [Coding Rules](#rules)


## <a name="coc"></a> Code of Conduct

Help us keep `twilio-python` open and inclusive. Please be kind to and considerate
Expand Down Expand Up @@ -154,6 +155,7 @@ you are working:
* All features or bug fixes **must be tested** by one or more tests.
* All classes and methods **must be documented**.
[docs-link]: https://www.twilio.com/docs/libraries/python
[issue-link]: https://github.com/twilio/twilio-python/issues/new
[github]: https://github.com/twilio/twilio-python
57 changes: 57 additions & 0 deletions tests/integration/conversations/v1/conversation/test_message.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,39 @@ def test_create_response(self):
"account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
"conversation_sid": "CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
"body": "Hello",
"media": null,
"author": "message author",
"attributes": "{ \\"importance\\": \\"high\\" }",
"date_created": "2015-12-16T22:18:37Z",
"date_updated": "2015-12-16T22:18:38Z",
"index": 0,
"url": "https://conversations.twilio.com/v1/Conversations/CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Messages/IMaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
}
'''
))

actual = self.client.conversations.v1.conversations(sid="CHXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX") \
.messages.create()

self.assertIsNotNone(actual)

def test_create_with_media_response(self):
self.holodeck.mock(Response(
201,
'''
{
"sid": "IMaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
"account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
"conversation_sid": "CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
"body": null,
"media": [
{
"sid": "MEaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
"size": 42056,
"content_type": "image/jpeg",
"filename": "car.jpg"
}
],
"author": "message author",
"attributes": "{ \\"importance\\": \\"high\\" }",
"date_created": "2015-12-16T22:18:37Z",
Expand Down Expand Up @@ -71,6 +104,7 @@ def test_update_response(self):
"account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
"conversation_sid": "CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
"body": "Hello",
"media": null,
"author": "message author",
"attributes": "{ \\"importance\\": \\"high\\" }",
"date_created": "2015-12-16T22:18:37Z",
Expand Down Expand Up @@ -130,6 +164,7 @@ def test_fetch_response(self):
"account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
"conversation_sid": "CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
"body": "Welcome!",
"media": null,
"author": "system",
"attributes": "{ \\"importance\\": \\"high\\" }",
"date_created": "2016-03-24T20:37:57Z",
Expand Down Expand Up @@ -177,6 +212,7 @@ def test_read_full_response(self):
"account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
"conversation_sid": "CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
"body": "I like pie.",
"media": null,
"author": "pie_preferrer",
"attributes": "{ \\"importance\\": \\"high\\" }",
"date_created": "2016-03-24T20:37:57Z",
Expand All @@ -189,6 +225,27 @@ def test_read_full_response(self):
"account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
"conversation_sid": "CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
"body": "Cake is my favorite!",
"media": null,
"author": "cake_lover",
"attributes": "{ \\"importance\\": \\"high\\" }",
"date_created": "2016-03-24T20:38:21Z",
"date_updated": "2016-03-24T20:38:21Z",
"index": 0,
"url": "https://conversations.twilio.com/v1/Conversations/CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Messages/IMaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
},
{
"sid": "IMaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
"account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
"conversation_sid": "CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
"body": null,
"media": [
{
"sid": "MEaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
"size": 42056,
"content_type": "image/jpeg",
"filename": "car.jpg"
}
],
"author": "cake_lover",
"attributes": "{ \\"importance\\": \\"high\\" }",
"date_created": "2016-03-24T20:38:21Z",
Expand Down
36 changes: 18 additions & 18 deletions twilio/rest/api/v2010/account/call/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -144,12 +144,12 @@ def stream(self, to=values.unset, from_=values.unset,
:param unicode from_: Phone number or Client identifier to filter `from` on
:param unicode parent_call_sid: Parent call SID to filter on
:param CallInstance.Status status: The status of the resources to read
:param datetime start_time_before: Only include calls that started on or after this date
:param datetime start_time: Only include calls that started on or after this date
:param datetime start_time_after: Only include calls that started on or after this date
:param datetime end_time_before: Only include usage that occurred on or before this date
:param datetime end_time: Only include usage that occurred on or before this date
:param datetime end_time_after: Only include usage that occurred on or before this date
:param datetime start_time_before: Only include calls that started on this date
:param datetime start_time: Only include calls that started on this date
:param datetime start_time_after: Only include calls that started on this date
:param datetime end_time_before: Only include calls that ended on this date
:param datetime end_time: Only include calls that ended on this date
:param datetime end_time_after: Only include calls that ended on this date
:param int limit: Upper limit for the number of records to return. stream()
guarantees to never return more than limit. Default is no limit
:param int page_size: Number of records to fetch per request, when not set will use
Expand Down Expand Up @@ -193,12 +193,12 @@ def list(self, to=values.unset, from_=values.unset,
:param unicode from_: Phone number or Client identifier to filter `from` on
:param unicode parent_call_sid: Parent call SID to filter on
:param CallInstance.Status status: The status of the resources to read
:param datetime start_time_before: Only include calls that started on or after this date
:param datetime start_time: Only include calls that started on or after this date
:param datetime start_time_after: Only include calls that started on or after this date
:param datetime end_time_before: Only include usage that occurred on or before this date
:param datetime end_time: Only include usage that occurred on or before this date
:param datetime end_time_after: Only include usage that occurred on or before this date
:param datetime start_time_before: Only include calls that started on this date
:param datetime start_time: Only include calls that started on this date
:param datetime start_time_after: Only include calls that started on this date
:param datetime end_time_before: Only include calls that ended on this date
:param datetime end_time: Only include calls that ended on this date
:param datetime end_time_after: Only include calls that ended on this date
:param int limit: Upper limit for the number of records to return. list() guarantees
never to return more than limit. Default is no limit
:param int page_size: Number of records to fetch per request, when not set will use
Expand Down Expand Up @@ -239,12 +239,12 @@ def page(self, to=values.unset, from_=values.unset,
:param unicode from_: Phone number or Client identifier to filter `from` on
:param unicode parent_call_sid: Parent call SID to filter on
:param CallInstance.Status status: The status of the resources to read
:param datetime start_time_before: Only include calls that started on or after this date
:param datetime start_time: Only include calls that started on or after this date
:param datetime start_time_after: Only include calls that started on or after this date
:param datetime end_time_before: Only include usage that occurred on or before this date
:param datetime end_time: Only include usage that occurred on or before this date
:param datetime end_time_after: Only include usage that occurred on or before this date
:param datetime start_time_before: Only include calls that started on this date
:param datetime start_time: Only include calls that started on this date
:param datetime start_time_after: Only include calls that started on this date
:param datetime end_time_before: Only include calls that ended on this date
:param datetime end_time: Only include calls that ended on this date
:param datetime end_time_after: Only include calls that ended on this date
:param str page_token: PageToken provided by the API
:param int page_number: Page Number, this value is simply for client state
:param int page_size: Number of records to return, defaults to 50
Expand Down
18 changes: 9 additions & 9 deletions twilio/rest/api/v2010/account/message/media.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,9 +43,9 @@ def stream(self, date_created_before=values.unset, date_created=values.unset,
is reached.
The results are returned as a generator, so this operation is memory efficient.
:param datetime date_created_before: The `YYYY-MM-DD` value of the resources to read
:param datetime date_created: The `YYYY-MM-DD` value of the resources to read
:param datetime date_created_after: The `YYYY-MM-DD` value of the resources to read
:param datetime date_created_before: Only include media that was created on this date
:param datetime date_created: Only include media that was created on this date
:param datetime date_created_after: Only include media that was created on this date
:param int limit: Upper limit for the number of records to return. stream()
guarantees to never return more than limit. Default is no limit
:param int page_size: Number of records to fetch per request, when not set will use
Expand Down Expand Up @@ -74,9 +74,9 @@ def list(self, date_created_before=values.unset, date_created=values.unset,
Unlike stream(), this operation is eager and will load `limit` records into
memory before returning.
:param datetime date_created_before: The `YYYY-MM-DD` value of the resources to read
:param datetime date_created: The `YYYY-MM-DD` value of the resources to read
:param datetime date_created_after: The `YYYY-MM-DD` value of the resources to read
:param datetime date_created_before: Only include media that was created on this date
:param datetime date_created: Only include media that was created on this date
:param datetime date_created_after: Only include media that was created on this date
:param int limit: Upper limit for the number of records to return. list() guarantees
never to return more than limit. Default is no limit
:param int page_size: Number of records to fetch per request, when not set will use
Expand All @@ -102,9 +102,9 @@ def page(self, date_created_before=values.unset, date_created=values.unset,
Retrieve a single page of MediaInstance records from the API.
Request is executed immediately
:param datetime date_created_before: The `YYYY-MM-DD` value of the resources to read
:param datetime date_created: The `YYYY-MM-DD` value of the resources to read
:param datetime date_created_after: The `YYYY-MM-DD` value of the resources to read
:param datetime date_created_before: Only include media that was created on this date
:param datetime date_created: Only include media that was created on this date
:param datetime date_created_after: Only include media that was created on this date
:param str page_token: PageToken provided by the API
:param int page_number: Page Number, this value is simply for client state
:param int page_size: Number of records to return, defaults to 50
Expand Down
18 changes: 9 additions & 9 deletions twilio/rest/api/v2010/account/recording/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,9 +45,9 @@ def stream(self, date_created_before=values.unset, date_created=values.unset,
is reached.
The results are returned as a generator, so this operation is memory efficient.
:param datetime date_created_before: The `YYYY-MM-DD` value of the resources to read
:param datetime date_created: The `YYYY-MM-DD` value of the resources to read
:param datetime date_created_after: The `YYYY-MM-DD` value of the resources to read
:param datetime date_created_before: Only include recordings that were created on this date
:param datetime date_created: Only include recordings that were created on this date
:param datetime date_created_after: Only include recordings that were created on this date
:param unicode call_sid: The Call SID of the resources to read
:param unicode conference_sid: Read by unique Conference SID for the recording
:param int limit: Upper limit for the number of records to return. stream()
Expand Down Expand Up @@ -81,9 +81,9 @@ def list(self, date_created_before=values.unset, date_created=values.unset,
Unlike stream(), this operation is eager and will load `limit` records into
memory before returning.
:param datetime date_created_before: The `YYYY-MM-DD` value of the resources to read
:param datetime date_created: The `YYYY-MM-DD` value of the resources to read
:param datetime date_created_after: The `YYYY-MM-DD` value of the resources to read
:param datetime date_created_before: Only include recordings that were created on this date
:param datetime date_created: Only include recordings that were created on this date
:param datetime date_created_after: Only include recordings that were created on this date
:param unicode call_sid: The Call SID of the resources to read
:param unicode conference_sid: Read by unique Conference SID for the recording
:param int limit: Upper limit for the number of records to return. list() guarantees
Expand Down Expand Up @@ -114,9 +114,9 @@ def page(self, date_created_before=values.unset, date_created=values.unset,
Retrieve a single page of RecordingInstance records from the API.
Request is executed immediately
:param datetime date_created_before: The `YYYY-MM-DD` value of the resources to read
:param datetime date_created: The `YYYY-MM-DD` value of the resources to read
:param datetime date_created_after: The `YYYY-MM-DD` value of the resources to read
:param datetime date_created_before: Only include recordings that were created on this date
:param datetime date_created: Only include recordings that were created on this date
:param datetime date_created_after: Only include recordings that were created on this date
:param unicode call_sid: The Call SID of the resources to read
:param unicode conference_sid: Read by unique Conference SID for the recording
:param str page_token: PageToken provided by the API
Expand Down
13 changes: 12 additions & 1 deletion twilio/rest/conversations/v1/conversation/message.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ def __init__(self, version, conversation_sid):

def create(self, author=values.unset, body=values.unset,
date_created=values.unset, date_updated=values.unset,
attributes=values.unset):
attributes=values.unset, media_sid=values.unset):
"""
Create a new MessageInstance
Expand All @@ -46,6 +46,7 @@ def create(self, author=values.unset, body=values.unset,
:param datetime date_created: The date that this resource was created.
:param datetime date_updated: The date that this resource was last updated.
:param unicode attributes: A string metadata field you can use to store any data you wish.
:param unicode media_sid: The Media Sid to be attached to the new Message.
:returns: Newly created MessageInstance
:rtype: twilio.rest.conversations.v1.conversation.message.MessageInstance
Expand All @@ -56,6 +57,7 @@ def create(self, author=values.unset, body=values.unset,
'DateCreated': serialize.iso8601_datetime(date_created),
'DateUpdated': serialize.iso8601_datetime(date_updated),
'Attributes': attributes,
'MediaSid': media_sid,
})

payload = self._version.create(
Expand Down Expand Up @@ -344,6 +346,7 @@ def __init__(self, version, payload, conversation_sid, sid=None):
'index': deserialize.integer(payload['index']),
'author': payload['author'],
'body': payload['body'],
'media': payload['media'],
'attributes': payload['attributes'],
'date_created': deserialize.iso8601_datetime(payload['date_created']),
'date_updated': deserialize.iso8601_datetime(payload['date_updated']),
Expand Down Expand Up @@ -419,6 +422,14 @@ def body(self):
"""
return self._properties['body']

@property
def media(self):
"""
:returns: An array of objects that describe the Message's media if attached, otherwise, null.
:rtype: dict
"""
return self._properties['media']

@property
def attributes(self):
"""
Expand Down
2 changes: 1 addition & 1 deletion twilio/rest/fax/v1/fax/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,7 @@ def create(self, to, media_url, quality=values.unset,
Create a new FaxInstance
:param unicode to: The phone number to receive the fax
:param unicode media_url: The Twilio-hosted URL of the PDF that contains the fax
:param unicode media_url: The URL of the PDF that contains the fax
:param FaxInstance.Quality quality: The quality of this fax
:param unicode status_callback: The URL we should call to send status information to your application
:param unicode from_: The number the fax was sent from
Expand Down
Loading

0 comments on commit 2e75f6e

Please sign in to comment.