Watson Developer Cloud Unity SDK  1.0.0
The Unity SDK uses the Watson Developer Cloud services, a collection of REST APIs and SDKs that use cognitive computing to solve complex problems.
IBM.Watson.DeveloperCloud.Utilities.Credentials Class Reference

Helper class for holding a user and password or authorization token, used by both the WSCOnnector and RESTConnector. More...

Public Member Functions

 Credentials (string url=null)
 Constructor that takes the URL. Used for token authentication. More...
 
 Credentials (string username, string password, string url=null)
 Constructor that takes the user name and password. More...
 
 Credentials (string apiKey, string url=null)
 Constructor that takes an authentication token created by the user or an ApiKey. If providing an ApiKey set useApiKey to true. More...
 
string CreateAuthorization ()
 Create basic authentication header data for REST requests. More...
 
bool HasCredentials ()
 Do we have credentials? More...
 
bool HasAuthorizationToken ()
 Do we have an authentication token? More...
 
bool HasApiKey ()
 Do we have an ApiKey? More...
 

Properties

string Username [get, set]
 The user name. More...
 
string Password [get, set]
 The password. More...
 
string ApiKey [get, set]
 The Api Key. More...
 
string AuthenticationToken [get, set]
 The autheentication token More...
 
string Url [get, set]
 The service endpoint. More...
 

Detailed Description

Helper class for holding a user and password or authorization token, used by both the WSCOnnector and RESTConnector.

Constructor & Destructor Documentation

IBM.Watson.DeveloperCloud.Utilities.Credentials.Credentials ( string  url = null)
inline

Constructor that takes the URL. Used for token authentication.

IBM.Watson.DeveloperCloud.Utilities.Credentials.Credentials ( string  username,
string  password,
string  url = null 
)
inline

Constructor that takes the user name and password.

Parameters
usernameThe string containing the user name.
passwordA string containing the password.
urlThe service endpoint.
IBM.Watson.DeveloperCloud.Utilities.Credentials.Credentials ( string  apiKey,
string  url = null 
)
inline

Constructor that takes an authentication token created by the user or an ApiKey. If providing an ApiKey set useApiKey to true.

Parameters
urlThe service endpoint.

Member Function Documentation

string IBM.Watson.DeveloperCloud.Utilities.Credentials.CreateAuthorization ( )
inline

Create basic authentication header data for REST requests.

Returns
The authentication data base64 encoded.
bool IBM.Watson.DeveloperCloud.Utilities.Credentials.HasApiKey ( )
inline

Do we have an ApiKey?

Returns
True if the class has a Authentication Token
bool IBM.Watson.DeveloperCloud.Utilities.Credentials.HasAuthorizationToken ( )
inline

Do we have an authentication token?

Returns
True if the class has a Authentication Token
bool IBM.Watson.DeveloperCloud.Utilities.Credentials.HasCredentials ( )
inline

Do we have credentials?

Returns
true if the class has a username and password.

Property Documentation

string IBM.Watson.DeveloperCloud.Utilities.Credentials.ApiKey
getset

The Api Key.

string IBM.Watson.DeveloperCloud.Utilities.Credentials.AuthenticationToken
getset

The autheentication token

string IBM.Watson.DeveloperCloud.Utilities.Credentials.Password
getset

The password.

string IBM.Watson.DeveloperCloud.Utilities.Credentials.Url
getset

The service endpoint.

string IBM.Watson.DeveloperCloud.Utilities.Credentials.Username
getset

The user name.


The documentation for this class was generated from the following file: