watson_developer_cloud.watson_service module¶
-
exception
WatsonApiException
(code, message, info=None, httpResponse=None)[source]¶ Bases:
watson_developer_cloud.watson_service.WatsonException
Custom exception class for errors returned from Watson APIs.
Parameters:
-
exception
WatsonInvalidArgument
[source]¶ Bases:
watson_developer_cloud.watson_service.WatsonException
-
datetime_to_string
(datetime)[source]¶ Serializes a datetime to a string. :param datetime: datetime value :return: string. containing iso8601 format date string
-
string_to_datetime
(string)[source]¶ Deserializes string to datetime. :param string: string containing datetime in iso8601 format :return: datetime.
-
get_error_message
(response)[source]¶ Gets the error message from a JSON response. :return: the error message :rtype: string
-
class
DetailedResponse
(response=None, headers=None, status_code=None)[source]¶ Bases:
object
Custom class for detailed response returned from Watson APIs.
Parameters:
-
class
WatsonService
(vcap_services_name, url, username=None, password=None, use_vcap_services=True, api_key=None, iam_apikey=None, iam_access_token=None, iam_url=None)[source]¶ Bases:
object