@@ -107,40 +107,42 @@ You supply either an IAM service **API key** or an **access token**:
107107
108108``` python
109109# In the constructor, letting the SDK manage the IAM token
110- discovery = DiscoveryV1(version = ' 2017-10-16' ,
110+ discovery = DiscoveryV1(version = ' 2018-08-01' ,
111+ url = ' <url_as_per_region>' ,
111112 iam_apikey = ' <iam_apikey>' ,
112113 iam_url = ' <iam_url>' ) # optional - the default value is https://iam.bluemix.net/identity/token
113114```
114115
115116``` python
116117# after instantiation, letting the SDK manage the IAM token
117- discovery = DiscoveryV1(version = ' 2017-10-16 ' )
118+ discovery = DiscoveryV1(version = ' 2018-08-01 ' , url = ' <url_as_per_region> ' )
118119discovery.set_iam_apikey(' <iam_apikey>' )
119120```
120121
121122#### Supplying the access token
122123``` python
123124# in the constructor, assuming control of managing IAM token
124- discovery = DiscoveryV1(version = ' 2017-10-16' ,
125+ discovery = DiscoveryV1(version = ' 2018-08-01' ,
126+ url = ' <url_as_per_region>' ,
125127 iam_access_token = ' <iam_access_token>' )
126128```
127129
128130``` python
129131# after instantiation, assuming control of managing IAM token
130- discovery = DiscoveryV1(version = ' 2017-10-16 ' )
132+ discovery = DiscoveryV1(version = ' 2018-08-01 ' , url = ' <url_as_per_region> ' )
131133discovery.set_iam_access_token(' <access_token>' )
132134```
133135
134136### Username and password
135137``` python
136138from watson_developer_cloud import DiscoveryV1
137139# In the constructor
138- discovery = DiscoveryV1(version = ' 2017-10-16 ' , username = ' <username>' , password = ' <password>' )
140+ discovery = DiscoveryV1(version = ' 2018-08-01 ' , url = ' <url_as_per_region> ' , username = ' <username>' , password = ' <password>' )
139141```
140142
141143``` python
142144# After instantiation
143- discovery = DiscoveryV1(version = ' 2017-10-16 ' )
145+ discovery = DiscoveryV1(version = ' 2018-08-01 ' , url = ' <url_as_per_region> ' )
144146discovery.set_username_and_password(' <username>' , ' <password>' )
145147```
146148
@@ -151,12 +153,12 @@ discovery.set_username_and_password('<username>', '<password>')
151153``` python
152154from watson_developer_cloud import VisualRecognitionV3
153155# In the constructor
154- visual_recognition = VisualRecognitionV3(version = ' 2018-05-22 ' , api_key = ' <api_key>' )
156+ visual_recognition = VisualRecognitionV3(version = ' 2018-03-19 ' , url = ' <url_as_per_region> ' , api_key = ' <api_key>' )
155157```
156158
157159``` python
158160# After instantiation
159- visual_recognition = VisualRecognitionV3(version = ' 2018-05-22 ' )
161+ visual_recognition = VisualRecognitionV3(version = ' 2018-03-19 ' )
160162visual_recognition.set_api_key(' <api_key>' )
161163```
162164
@@ -175,7 +177,8 @@ from watson_developer_cloud import AssistantV1
175177assistant = AssistantV1(
176178 username = ' xxx' ,
177179 password = ' yyy' ,
178- version = ' 2017-04-21' )
180+ url = ' <url_as_per_region>' ,
181+ version = ' 2018-07-10' )
179182
180183response = assistant.list_workspaces(headers = {' Custom-Header' : ' custom_value' })
181184print (response.get_result())
@@ -196,7 +199,8 @@ from watson_developer_cloud import AssistantV1
196199assistant = AssistantV1(
197200 username = ' xxx' ,
198201 password = ' yyy' ,
199- version = ' 2017-04-21' )
202+ url = ' <url_as_per_region>' ,
203+ version = ' 2018-07-10' )
200204
201205assistant.set_http_config({' timeout' : 100 })
202206response = assistant.message(workspace_id = workspace_id, input = {
@@ -226,7 +230,8 @@ from watson_developer_cloud import AssistantV1
226230assistant = AssistantV1(
227231 username = ' xxx' ,
228232 password = ' yyy' ,
229- version = ' 2017-04-21' )
233+ url = ' <url_as_per_region>' ,
234+ version = ' 2018-07-10' )
230235
231236response = assistant.list_workspaces(headers = {' Custom-Header' : ' custom_value' }).get_result()
232237```
@@ -239,7 +244,8 @@ from watson_developer_cloud import AssistantV1
239244assistant = AssistantV1(
240245 username = ' xxx' ,
241246 password = ' yyy' ,
242- version = ' 2017-04-21' )
247+ url = ' <url_as_per_region>' ,
248+ version = ' 2018-07-10' )
243249
244250assistant.set_detailed_response(True )
245251response = assistant.list_workspaces(headers = {' Custom-Header' : ' custom_value' }).get_result()
0 commit comments