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 CheckServiceStatus(VisualRecognition service, ServiceStatus callback) { m_Service = service; m_Callback = callback; if (!m_Service.GetClassifiers(OnCheckServices)) { OnFailure("Failed to get classifiers!"); } }