Assets/Watson/Scripts/Services/VisualRecognition/VisualRecognition.cs
/// <summary>
/// Deletes the classifier by classifierID.
/// </summary>
/// <returns><c>true</c>, if classifier was deleted, <c>false</c> otherwise.</returns>
/// <param name="classifierId">Classifier identifier.</param>
/// <param name="callback">Callback.</param>
Deletes the classifier by classifierID.
Deletes the classifier by classifierID .
public bool DeleteClassifier(OnDeleteClassifier 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!");
            Log.Debug("VisualRecognition", "Attempting to delete classifier {0}", classifierId);
            RESTConnector connector = RESTConnector.GetConnector(SERVICE_ID, SERVICE_CLASSIFIERS + "/" + classifierId);
            if(connector == null)
                return false;
            DeleteClassifierReq req = new DeleteClassifierReq();
            req.Callback = callback;
            req.Data = customData;
            req.Timeout = REQUEST_TIMEOUT;
            req.Parameters["api_key"] = mp_ApiKey;
            req.Parameters["version"] = VisualRecognitionVersion.Version;
            req.OnResponse = OnDeleteClassifierResp;
            req.Delete = true;
            return connector.Send(req);
        }
public bool DeleteClassifier ( OnDeleteClassifier 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 ( " " ) ; Log . Debug ( " " , " " , classifierId ) ; RESTConnector connector = RESTConnector . GetConnector ( SERVICE_ID , SERVICE_CLASSIFIERS + " " + classifierId ) ; if ( connector == null ) return false ; DeleteClassifierReq req = new DeleteClassifierReq ( ) ; req . Callback = callback ; req . Data = customData ; req . Timeout = REQUEST_TIMEOUT ; req . Parameters [ " " ] = mp_ApiKey ; req . Parameters [ " " ] = VisualRecognitionVersion . Version ; req . OnResponse = OnDeleteClassifierResp ; req . Delete = true ; return connector . Send ( req ) ; }
Deletes the classifier by classifierID.
Deletes the classifier by classifierID .
None
callback
OnDeleteClassifier
None
classifierId
string
None
customData
string