8000 Issue 341: Update return values for TwiML code. by jmctwilio · Pull Request #355 · twilio/twilio-python · GitHub
[go: up one dir, main page]

Skip to content

Issue 341: Update return values for TwiML code. #355

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

< 8000 /details>
Merged
merged 2 commits into from
Jun 16, 2017

Conversation

jmctwilio
Copy link
Contributor

@@ -7,7 +7,7 @@ class MessagingResponse(TwiML):
"""
def __init__(self):
"""
Create a new <Response>
Create a new <MessagingResponse>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

str(MessagingResponse()) returns <Response>, but I'm not sure if we want to be general or specific.

Copy link
Contributor Author
@jmctwilio jmctwilio Jun 14, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Here's what I'm seeing:

In [2]: vr = VoiceResponse()

In [3]: type(vr)
Out[3]: twilio.twiml.voice_response.VoiceResponse

In [4]: str(vr)
Out[4]: '<?xml version="1.0" encoding="UTF-8"?><Response />'

In [5]: from twilio.twiml.messaging_response import MessagingResponse
In [6]: mr = MessagingResponse()

In [7]: str(mr)
Out[7]: '<?xml version="1.0" encoding="UTF-8"?><Response />'

In [8]: type(mr)
Out[8]: twilio.twiml.messaging_response.MessagingResponse

I suppose it creates a <Response> tag. It's a good question as to whether we should be specific there in the documentation or not. I wonder what the future holds for TwiML.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes you are correct, I was omitting the XML header since it's common to both classes.

@@ -30,7 +30,7 @@ def message(self,
:param action: action URL
:param status_callback: callback URL
:param kwargs: other attributes
:return: <Message> element
:return: <MessagingResponse> element
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

self.append returns the parent element, in this case MessagingResponse or a <Response> element.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As above, I'm sure. I'll change them to <Response> pending some more info.

@@ -49,7 +49,7 @@ def redirect(self, url, method=None, **kwargs):
:param url: URL to redirect to
:param method: HTTP method
:param kwargs: other attributes
:return: <Redirect> element
:return: <MessagingResponse> element
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should be <Response>.

@dougblack dougblack merged commit 3d32449 into master Jun 16, 2017
@ilanbiala ilanbiala deleted the issue-341_update_twiml_documentation_return_values branch June 18, 2017 01:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants
0