Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Example urllib3 update #215

Merged
merged 3 commits into from
Jul 10, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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