Assets/Watson/Scripts/Services/VisualRecognition/VisualRecognition.cs
/// <summary>
/// Gets a classifier by classifierId.
/// </summary>
/// <returns><c>true</c>, if classifier was gotten, <c>false</c> otherwise.</returns>
/// <param name="classifierId">Classifier identifier.</param>
/// <param name="callback">Callback.</param>
Gets a classifier by classifierId.
Gets a classifier by classifierId .
public bool GetClassifier(OnGetClassifier callback, string classifierId, string customData = default(string))
        {
            if (string.IsNullOrEmpty(classifierId))
                throw new ArgumentNullException("classifierId");
            if (callback == null)
                throw new ArgumentNullException("callback");
            if(string.IsNullOrEmpty(mp_ApiKey))
                mp_ApiKey = Config.Instance.GetAPIKey(SERVICE_ID);
            if(string.IsNullOrEmpty(mp_ApiKey))
                throw new WatsonException("No API Key was found!");
            RESTConnector connector = RESTConnector.GetConnector(SERVICE_ID, SERVICE_CLASSIFIERS + "/" + classifierId);
            if (connector == null)
                return false;
            GetClassifierReq req = new GetClassifierReq();
            req.Callback = callback;
            req.Parameters["api_key"] = mp_ApiKey;
            req.Parameters["version"] = VisualRecognitionVersion.Version;
            req.OnResponse = OnGetClassifierResp;
            return connector.Send(req);
        }
public bool GetClassifier ( OnGetClassifier callback , string classifierId , string customData = default ( string ) ) { if ( string . IsNullOrEmpty ( classifierId ) ) throw new ArgumentNullException ( " " ) ; if ( callback == null ) throw new ArgumentNullException ( " " ) ; if ( string . IsNullOrEmpty ( mp_ApiKey ) ) mp_ApiKey = Config . Instance . GetAPIKey ( SERVICE_ID ) ; if ( string . IsNullOrEmpty ( mp_ApiKey ) ) throw new WatsonException ( " " ) ; RESTConnector connector = RESTConnector . GetConnector ( SERVICE_ID , SERVICE_CLASSIFIERS + " " + classifierId ) ; if ( connector == null ) return false ; GetClassifierReq req = new GetClassifierReq ( ) ; req . Callback = callback ; req . Parameters [ " " ] = mp_ApiKey ; req . Parameters [ " " ] = VisualRecognitionVersion . Version ; req . OnResponse = OnGetClassifierResp ; return connector . Send ( req ) ; }
Gets a classifier by classifierId.
Gets a classifier by classifierId .
None
callback
OnGetClassifier
None
classifierId
string
None
customData
string