8000 spelling fixes and code sample fixes for documentation · MC6/twilio-python@259f028 · GitHub
[go: up one dir, main page]

Skip to content

Commit 259f028

Browse files
committed
spelling fixes and code sample fixes for documentation
1 parent 4a2ab7e commit 259f028

File tree

2 files changed

+36
-16
lines changed

2 files changed

+36
-16
lines changed

docs/usage/token-generation.rst

Lines changed: 18 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,16 +4,26 @@
44
Generate Capability Tokens
55
===========================
66

7-
`Twilio Client <http://www.twilio.com/api/client>`_ allows you to make and recieve connections in the browser. You can place a call to a phone on the PSTN network, all without leaving your browser. See the `Twilio Client Quickstart <http:/www.twilio.com/docs/quickstart/client>`_ to get up and running with Twilio Client.
7+
`Twilio Client <http://www.twilio.com/api/client>`_ allows you to make and
8+
recieve connections in the browser. You can place a call to a phone on the PSTN
9+
network, all without leaving your browser. See the `Twilio Client Quickstart
10+
<http:/www.twilio.com/docs/quickstart/client>`_ to get up and running with
11+
Twilio Client.
812

9-
Capability tokens are used by `Twilio Client <http://www.twilio.com/api/client>`_ to provide connection security and authorization. The `Capability Token documentation <http://www.twilio.con/docs/tokens>`_ explains indepth the purpose and features of these tokens.
13+
Capability tokens are used by `Twilio Client
14+
<http://www.twilio.com/api/client>`_ to provide connection
15+
security and authorization. The `Capability Token documentation
16+
<http://www.twilio.con/docs/tokens>`_ explains indepth the purpose and features
17+
of these tokens.
1018

11-
:class:`TwilioCapability` is responsible for the creation of these capability tokens. You'll need your Twilio AccountSid and AuthToken.
19+
:class:`TwilioCapability` is responsible for the creation of these capability
20+
tokens. You'll need your Twilio AccountSid and AuthToken.
1221

1322
.. code-block:: python
1423
1524
from twilio.util import TwilioCapability
1625
26+
# Find these values at twilio.com/user/account
1727
account_sid = "AC123123"
1828
auth_token = "secret"
1929
@@ -37,7 +47,7 @@ To make an outgoing connection from a `Twilio Client <http://www.twilio.com/api/
3747

3848
.. code-block:: python
3949
40-
application_sid = "AP123123" # Twilio Application Sid
50+
application_sid = "APabe7650f654fc34655fc81ae71caa3ff" # Twilio Application Sid
4151
capability.allow_client_outgoing(application_sid)
4252
4353
Generate a Token
@@ -47,10 +57,12 @@ Generate a Token
4757
4858
token = capability.generate()
4959
50-
By default, this token will expire in one hour. If you'd like to change the token expiration, :meth:`generate` takes an optional :attr:`expires` argument.
60+
By default, this token will expire in one hour. If you'd like to change the
61+
token expiration, :meth:`generate` takes an optional :attr:`expires` argument.
5162

5263
.. code-block:: python
5364
5465
token = capability.generate(expires=600)
5566
56-
This token will now expire in 10 minutes. If you haven't guessed already, :attr:`expires` is expressed in seconds.
67+
This token will now expire in 10 minutes. If you haven't guessed already,
68+
:attr:`expires` is expressed in seconds.

twilio/rest/resources.py

Lines changed: 18 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -133,7 +133,7 @@ def make_request(method, url,
133133
url = '%s&%s' % (url, enc_params)
134134
else:
135135
url = '%s?%s' % (url, enc_params)
136-
136+
137137
resp, content = http.request(url, method, headers=headers, body=data)
138138

139139
# Format httplib2 reqeusts as reqeusts objects
@@ -269,7 +269,16 @@ def get_instance(self, sid):
269269

270270
def get_instances(self, params=None, page=None, page_size=None):
271271
"""
272-
Query the list resource for a list of InstanceResources
272+
Query the list resource for a list of InstanceResources.
273+
274+
Raises a TwilioRestException if requesting a page of results that does
275+
not exist.
276+
277+
:param dict params: List of URL parameters to be included in request
278+
:param int page: The page of results to retrieve (most recent at 0)
279+
:param int page_size: The number of results to be returned.
280+
281+
:returns: -- the list of resources
273282
"""
274283
params = params or {}
275284

@@ -290,7 +299,7 @@ def create_instance(self, body):
290299
"""
291300
Create an InstanceResource via a POST to the List Resource
292301
293-
:param dict body: Dictoionary of POST data
302+
:param dict body: Dictionary of POST data
294303
"""
295304
resp, instance = self.request("POST", self.uri, data=body)
296305

@@ -350,7 +359,6 @@ def load_instance(self, data):
350359
instance.load_subresources()
351360
return instance
352361

353-
354362
class AvailablePhoneNumber(InstanceResource):
355363
""" An available phone number resource """
356364

@@ -729,7 +737,7 @@ def list(self, phone_number=None, friendly_name=None, **kwargs):
729737
"PhoneNumber": phone_number,
730738
"FrienldyName": friendly_name,
731739
})
732-
return self.get_instances(params=params, **kwargs)
740+
return self.get_instances(params=params, **kwargs)
733741

734742
def update(self, sid, friendly_name=None):
735743
"""
@@ -782,7 +790,7 @@ def load(self, entries):
782790

783791
# Only check if entries has a uri
784792
if "account_sid" in entries:
785-
793+
786794
# Parse the parent's uri to get the scheme and base
787795
uri = re.sub(r'AC(.*)', entries["account_sid"],
788796
self.parent.base_uri)
@@ -912,7 +920,7 @@ def transfer(self, sid, account_sid):
912920
Transfer the phone number with sid from the current account to another
913921
identified by account_sid
914922
"""
915-
return self.update(sid, account_sid=account_sid)
923+
return self.update(sid, account_sid=account_sid)
916924

917925
def update(self, sid, api_version=None, voice_url=None, voice_method=None,
918926
voice_fallback_url=None, voice_fallback_method=None,
@@ -968,7 +976,7 @@ def update(self, voice_url=None, voice_method=None, sms_url=None,
968976
"""
969977
Update your Twilio Sandbox
970978
"""
971-
data = transform_params({
979+
body = transform_params({
972980
"VoiceUrl": voice_url,
973981
"VoiceMethod": voice_method,
974982
"SmsUrl": sms_url,
@@ -1028,9 +1036,9 @@ def list(self, to=None, from_=None, before=None, after=None, **kwargs):
10281036
paging informtion see :class:`ListResource`.
10291037
10301038
:param to: Only show SMS messages to this phone number.
1031-
:param from_: Onlye show SMS message from this phone number.
1039+
:param from_: Only show SMS messages from this phone number.
10321040
:param date after: Only list recordings logged after this datetime
1033-
:param date before: Only list recordings logger before this datetime
1041+
:param date before: Only list recordings logged before this datetime
10341042
"""
10351043
params = transform_params({
10361044
"To": to,

0 commit comments

Comments
 (0)
0