@@ -27,8 +27,15 @@ def transform_params(p):
27
27
"""
28
28
Transform parameters, throwing away any None values
29
29
and convert False and True values to strings
30
+
31
+ Ex:
32
+ {"record": true, "date_created": "2012-01-02"}
33
+
34
+ becomes:
35
+ {"Record": "true", "DateCreated": "2012-01-02"}
30
36
"""
31
- p = [(format_name (d ), convert_boolean (p [d ])) for d in p if p [d ] is not None ]
37
+ p = [(format_name (d ),
38
+ convert_boolean (p [d ])) for d in p if p [d ] is not None ]
32
39
return dict (p )
33
40
34
41
@@ -60,7 +67,10 @@ def convert_boolean(boolean):
60
67
61
68
def convert_case (s ):
62
69
"""
63
- Given a string in snake case, conver to CamelCase
70
+ Given a string in snake case, convert to CamelCase
71
+
72
+ Ex:
73
+ date_created -> DateCreated
64
74
"""
65
75
return '' .join ([a .title () for a in s .split ("_" ) if a ])
66
76
@@ -496,7 +506,7 @@ class Notifications(ListResource):
496
506
def list (self , before = None , after = None , ** kwargs ):
497
507
"""
498
508
Returns a page of :class:`Notification` resources as a list.
499
- For paging informtion see :class:`ListResource`.
509
+ For paging information see :class:`ListResource`.
500
510
501
511
**NOTE**: Due to the potentially voluminous amount of data in a
502
512
notification, the full HTTP request and response data is only returned
@@ -523,15 +533,15 @@ class ConnectApp(InstanceResource):
523
533
524
534
525
535
class ConnectApps (ListResource ):
526
- """ A list of Call resources """
536
+ """ A list of Connect App resources """
527
537
528
538
name = "ConnectApps"
529
539
instance = ConnectApp
530
540
key = "connect_apps"
531
541
532
542
def list (self , ** kwargs ):
533
543
"""
534
- Returns a page of :class:`Call ` resources as a list. For paging
544
+ Returns a page of :class:`ConnectApp ` resources as a list. For paging
535
545
informtion see :class:`ListResource`
536
546
"""
537
547
return self .get_instances (kwargs )
@@ -554,7 +564,7 @@ def load(self, entries):
554
564
555
565
556
566
class AuthorizedConnectApps (ConnectApps ):
557
- """ A list of Call resources """
567
+ """ A list of Authorized Connect App resources """
558
568
559
569
name = "AuthorizedConnectApps"
560
570
instance = AuthorizedConnectApp
@@ -621,7 +631,7 @@ def list(self, from_=None, ended_after=None,
621
631
:param date before: Only list calls started before this datetime
622
632
"""
623
633
kwargs ["from" ] = from_
624
- kwargs ["StartTime<" ] = started_before
634
+ kwargs ["StartTime<" ] = started_before
625
635
kwargs ["StartTime>" ] = started_after
626
636
kwargs ["StartTime" ] = parse_date (started )
627
637
kwargs ["EndTime<" ] = ended_before
@@ -736,7 +746,7 @@ def update(self, sid, **kwargs):
736
746
737
747
def validate (self , phone_number , ** kwargs ):
738
748
"""
739
- Begin the validation procress for the given number.
749
+ Begin the validation process for the given number.
740
750
741
751
Returns a dictionary with the following keys
742
752
@@ -994,8 +1004,8 @@ def list(self, **kwargs):
994
1004
"""
995
1005
return self .get_instances (kwargs )
996
1006
997
- def update (self , sid , url = None , method = None ,
998
- fallback_url = None , fallback_method = None ):
1007
+ def update (self , sid , url = None , method = None , fallback_url = None ,
1008
+ fallback_method = None , ** kwargs ):
999
1009
"""
1000
1010
Update a specific :class:`ShortCode`, by specifying the sid.
1001
1011
@@ -1200,7 +1210,7 @@ def create(self, **kwargs):
1200
1210
"""
1201
1211
return self .create_instance (kwargs )
1202
1212
1203
- def update (self , sid , ** kwargs ):
1213
+ def update (self , sid , ** kwargs ):
1204
1214
"""
1205
1215
Update an :class:`Application` with the given parameters.
1206
1216
0 commit comments