public FindClassifierReq(VisualRecognition service, string classifierName, OnFindClassifier callback) { if (callback == null) { throw new ArgumentNullException("callback"); } if (string.IsNullOrEmpty(classifierName)) { throw new WatsonException("classifierName required"); } if (string.IsNullOrEmpty(mp_ApiKey)) { mp_ApiKey = Config.Instance.GetAPIKey(SERVICE_ID); } if (string.IsNullOrEmpty(mp_ApiKey)) { throw new WatsonException("FindClassifier - VISUAL_RECOGNITION_API_KEY needs to be defined in config.json"); } Service = service; ClassifierName = classifierName; Callback = callback; Service.GetClassifiers(OnGetClassifiers); }
public FindClassifierReq(NaturalLanguageClassifier service, string classifierName, OnFindClassifier callback) { if (service == null) { throw new ArgumentNullException("service"); } if (string.IsNullOrEmpty(classifierName)) { throw new ArgumentNullException("classifierName"); } if (callback == null) { throw new ArgumentNullException("callback"); } Service = service; ClassifierName = classifierName; Callback = callback; Service.GetClassifiers(GetClassifiers); }
/// <summary> /// Finds a classifier by classifier name. /// </summary> /// <param name="classifierName">Classifier name.</param> /// <param name="callback">Callback.</param> public void FindClassifier(string classifierName, OnFindClassifier callback) { new FindClassifierReq(this, classifierName, callback); }