Skip to content

Commit dcf814a

Browse files
author
Silver Kuusk
committed
Sync Python: Remove Json serialization from examples
1 parent edfd357 commit dcf814a

File tree

6 files changed

+12
-23
lines changed

6 files changed

+12
-23
lines changed

sync/rest/documents/create-document/create-document.6.x.py

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,18 @@
11
# Download the Python helper library from twilio.com/docs/python/install
22
from twilio.rest import Client
3-
import json
43
from datetime import datetime
54

65
# Your Account Sid and Auth Token from twilio.com/user/account
76
account_sid = "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"
87
auth_token = "your_auth_token"
98
client = Client(account_sid, auth_token)
109

11-
data = json.dumps({
10+
data = {
1211
'date_updated': str(datetime.now()),
1312
'movie_title': "On The Line",
1413
'show_times': ["12:30:00Z", "14:45:00Z", "15:30:00Z", "17:45:00Z"],
1514
'starring': ["Lance Bass", "Joey Fatone"],
16-
'genre': "Romance"
17-
})
15+
'genre': "Romance"}
1816

1917
document = client.sync \
2018
.services("ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX") \

sync/rest/documents/update-document/update-document.6.x.py

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,18 @@
11
# Download the Python helper library from twilio.com/docs/python/install
22
from twilio.rest import Client
3-
import json
43
from datetime import datetime
54

65
# Your Account Sid and Auth Token from twilio.com/user/account
76
account_sid = "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"
87
auth_token = "your_auth_token"
98
client = Client(account_sid, auth_token)
109

11-
new_data = json.dumps({
10+
new_data = {
1211
'date_updated': str(datetime.now()),
1312
'movie_title': "On The Line",
1413
'show_times': None,
1514
'starring': ["Lance Bass", "Joey Fatone"],
16-
'genre': "Romance"
17-
})
15+
'genre': "Romance"}
1816

1917
document = client.sync \
2018
.services("ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX") \

sync/rest/lists/create-list-item/create-list-item.6.x.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,16 @@
11
# Download the Python helper library from twilio.com/docs/python/install
22
from twilio.rest import Client
3-
import json
43

54
# Your Account Sid and Auth Token from twilio.com/user/account
65
account_sid = "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"
76
auth_token = "your_auth_token"
87
client = Client(account_sid, auth_token)
98

10-
data = json.dumps({
9+
data = {
1110
'number': "001",
1211
'name': "Bulbasaur",
1312
'attack': 49
14-
})
13+
}
1514

1615
list_item = client.sync \
1716
.services("ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX") \

sync/rest/lists/update-list-item/update-list-item.6.x.py

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,15 @@
11
# Download the Python helper library from twilio.com/docs/python/install
22
from twilio.rest import Client
3-
import json
43

54
# Your Account Sid and Auth Token from twilio.com/user/account
65
account_sid = "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"
76
auth_token = "your_auth_token"
87
client = Client(account_sid, auth_token)
98

10-
data = json.dumps({
9+
data = {
1110
'number': "001",
1211
'name': "Bulbasaur",
13-
'attack': 50
14-
})
12+
'attack': 50}
1513

1614
list_item = client.sync \
1715
.services("ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX") \

sync/rest/maps/create-map-item/create-map-item.6.x.py

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,15 @@
11
# Download the Python helper library from twilio.com/docs/python/install
22
from twilio.rest import Client
3-
import json
43

54
# Your Account Sid and Auth Token from twilio.com/user/account
65
account_sid = "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"
76
auth_token = "your_auth_token"
87
client = Client(account_sid, auth_token)
98

10-
data = json.dumps({
9+
data = {
1110
'name': "Stephen Curry",
1211
'level': 30,
13-
'username': "spicy_curry"
14-
})
12+
'username': "spicy_curry"}
1513

1614
map_item = client.sync \
1715
.services("ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX") \

sync/rest/maps/update-map-item/update-map-item.6.x.py

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,15 @@
11
# Download the Python helper library from twilio.com/docs/python/install
22
from twilio.rest import Client
3-
import json
43

54
# Your Account Sid and Auth Token from twilio.com/user/account
65
account_sid = "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"
76
auth_token = "your_auth_token"
87
client = Client(account_sid, auth_token)
98

10-
data = json.dumps({
9+
data = {
1110
'name': "Stephen Curry",
1211
'level': 31,
13-
'username': "spicy_curry"
14-
})
12+
'username': "spicy_curry"}
1513

1614
map_item = client.sync \
1715
.services("ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX") \

0 commit comments

Comments
 (0)