Skip to content

Commit

Permalink
Merge pull request #215 from pturegano/example_urllib3Update
Browse files Browse the repository at this point in the history
Example urllib3 update
  • Loading branch information
qitia authored Jul 10, 2023
2 parents 7d9e3fa + 6f22c1e commit 373a586
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 8 deletions.
3 changes: 1 addition & 2 deletions examples/v13/customer_signup.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,7 @@ def main(authorization_data):
try:
output_status_message("-----\nGetUser:")
get_user_response=customer_service.GetUser(
UserId=None,
IncludeLinkedAccountIds=True
UserId=None
)
user = get_user_response.User
customer_roles=get_user_response.CustomerRoles
Expand Down
10 changes: 6 additions & 4 deletions examples/v13/geographical_locations.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
import urllib2
import urllib3 as urllib
from urllib.error import URLError
from urllib.request import urlopen, Request

from auth_helper import *
from campaignmanagement_example_helper import *
Expand Down Expand Up @@ -29,14 +31,14 @@ def main(authorization_data):
output_status_message("FileUrlExpiryTimeUtc: {0}".format(get_geo_locations_file_url_response.FileUrlExpiryTimeUtc))
output_status_message("LastModifiedTimeUtc: {0}".format(get_geo_locations_file_url_response.LastModifiedTimeUtc))

request=urllib2.Request(get_geo_locations_file_url_response.FileUrl)
response=urllib2.urlopen(request)
request=Request(get_geo_locations_file_url_response.FileUrl)
response=urlopen(request)

if response.getcode() == 200:
download_file(response)
output_status_message("Downloaded the geographical locations to {0}.".format(LOCAL_FILE))

except urllib2.URLError as ex:
except URLError as ex:
if hasattr(ex, 'code'):
output_status_message("Error code: {0}".format(ex.code))
elif hasattr(ex, 'reason'):
Expand Down
3 changes: 1 addition & 2 deletions examples/v13/invite_user.py
Original file line number Diff line number Diff line change
Expand Up @@ -101,8 +101,7 @@ def main(authorization_data):
for info in users_info['UserInfo']:
output_status_message("-----\nGetUser:")
get_user_response=customer_service.GetUser(
UserId=info.Id,
IncludeLinkedAccountIds=True)
UserId=info.Id)
user = get_user_response.User
customer_roles=get_user_response.CustomerRoles
output_status_message("User:")
Expand Down

0 comments on commit 373a586

Please sign in to comment.