Skip to content

Commit 7c19372

Browse files
committed
Updated according to PR comments.
1 parent 744e290 commit 7c19372

5 files changed

Lines changed: 33 additions & 12 deletions

File tree

examples/clients/clients.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,8 @@
1010
# GET /clients/stats #
1111

1212
params = {'aggregated_by': 'day',
13-
'start_date': '2016-01-01', 'end_date': '2016-04-01'}
13+
'start_date': '2016-01-01',
14+
'end_date': '2016-04-01'}
1415
response = sg.client.clients.stats.get(query_params=params)
1516
print(response.status_code)
1617
print(response.body)
@@ -21,7 +22,8 @@
2122
# GET /clients/{client_type}/stats #
2223

2324
params = {'aggregated_by': 'day',
24-
'start_date': '2016-01-01', 'end_date': '2016-04-01'}
25+
'start_date': '2016-01-01',
26+
'end_date': '2016-04-01'}
2527
client_type = "test_url_param"
2628
response = sg.client.clients._(client_type).stats.get(query_params=params)
2729
print(response.status_code)

examples/contactdb/contactdb.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,8 @@
9393
params = {'list_id': 1}
9494
list_id = "test_url_param"
9595
response = sg.client.contactdb.lists._(list_id).patch(
96-
request_body=data, query_params=params)
96+
request_body=data,
97+
query_params=params)
9798
print(response.status_code)
9899
print(response.body)
99100
print(response.headers)
@@ -362,7 +363,8 @@
362363
params = {'segment_id': 'test_string'}
363364
segment_id = "test_url_param"
364365
response = sg.client.contactdb.segments._(segment_id).patch(
365-
request_body=data, query_params=params)
366+
request_body=data,
367+
query_params=params)
366368
print(response.status_code)
367369
print(response.body)
368370
print(response.headers)

examples/devices/devices.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,9 @@
1010
# GET /devices/stats #
1111

1212
params = {'aggregated_by': 'day', 'limit': 1,
13-
'start_date': '2016-01-01', 'end_date': '2016-04-01', 'offset': 1}
13+
'start_date': '2016-01-01',
14+
'end_date': '2016-04-01',
15+
'offset': 1}
1416
response = sg.client.devices.stats.get(query_params=params)
1517
print(response.status_code)
1618
print(response.body)

examples/geo/geo.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,12 @@
99
# Retrieve email statistics by country and state/province. #
1010
# GET /geo/stats #
1111

12-
params = {'end_date': '2016-04-01', 'country': 'US', 'aggregated_by': 'day',
13-
'limit': 1, 'offset': 1, 'start_date': '2016-01-01'}
12+
params = {'end_date': '2016-04-01',
13+
'country': 'US',
14+
'aggregated_by': 'day',
15+
'limit': 1,
16+
'offset': 1,
17+
'start_date': '2016-01-01'}
1418
response = sg.client.geo.stats.get(query_params=params)
1519
print(response.status_code)
1620
print(response.body)

examples/helpers/mail/mail_example.py

Lines changed: 16 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,9 @@ def build_kitchen_sink():
109109
mail_settings.bcc_settings = BCCSettings(True, Email("test@example.com"))
110110
mail_settings.bypass_list_management = BypassListManagement(True)
111111
mail_settings.footer_settings = FooterSettings(
112-
True, "Footer Text", "<html><body>Footer Text</body></html>")
112+
True,
113+
"Footer Text",
114+
"<html><body>Footer Text</body></html>")
113115
mail_settings.sandbox_mode = SandBoxMode(True)
114116
mail_settings.spam_check = SpamCheck(
115117
True, 1, "https://spamcatcher.sendgrid.com")
@@ -118,11 +120,20 @@ def build_kitchen_sink():
118120
tracking_settings = TrackingSettings()
119121
tracking_settings.click_tracking = ClickTracking(True, True)
120122
tracking_settings.open_tracking = OpenTracking(
121-
True, "Optional tag to replace with the open image in the body of the message")
122-
tracking_settings.subscription_tracking = SubscriptionTracking(True, "text to insert into the text/plain portion of the message",
123-
"<html><body>html to insert into the text/html portion of the message</body></html>", "Optional tag to replace with the open image in the body of the message")
123+
True,
124+
"Optional tag to replace with the open image in the body of the message")
125+
tracking_settings.subscription_tracking = SubscriptionTracking(
126+
True,
127+
"text to insert into the text/plain portion of the message",
128+
"<html><body>html to insert into the text/html portion of the message</body></html>",
129+
"Optional tag to replace with the open image in the body of the message")
124130
tracking_settings.ganalytics = Ganalytics(
125-
True, "some source", "some medium", "some term", "some_content", "some_campaign")
131+
True,
132+
"some source",
133+
"some medium",
134+
"some term",
135+
"some_content",
136+
"some_campaign")
126137
mail.tracking_settings = tracking_settings
127138

128139
mail.reply_to = Email("test@example.com")

0 commit comments

Comments
 (0)