Assets/Watson/Scripts/Services/VisualRecognition/VisualRecognition.cs
/// <summary>
/// Retrieve information about a specific collection. Only user-created collections can be specified.
/// </summary>
/// <param name="callback">The callback.</param>
/// <param name="collectionID">The requested collection identifier.</param>
/// <param name="customData">Custom data.</param>
/// <returns>Returns true if succeess, false if failure.</returns>
Retrieve information about a specific collection. Only user-created collections can be specified.
Retrieve information about a specific collection . Only user - created collections can be specified .
public bool GetCollection(OnGetCollection callback, string collectionID, string customData = default(string))
        {
            if (callback == null)
                throw new ArgumentNullException("callback");
            if (string.IsNullOrEmpty(collectionID))
                throw new ArgumentNullException(collectionID);
            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, string.Format(SERVICE_COLLECTION, collectionID));
            if (connector == null)
                return false;
            GetCollectionReq req = new GetCollectionReq();
            req.Callback = callback;
            req.Data = customData;
            req.CollectionID = collectionID;
            req.Parameters["api_key"] = mp_ApiKey;
            req.Parameters["version"] = VisualRecognitionVersion.Version;
            req.Timeout = 20.0f * 60.0f;
            req.OnResponse = OnGetCollectionResp;
            return connector.Send(req);
        }
public bool GetCollection ( OnGetCollection callback , string collectionID , string customData = default ( string ) ) { if ( callback == null ) throw new ArgumentNullException ( " " ) ; if ( string . IsNullOrEmpty ( collectionID ) ) throw new ArgumentNullException ( collectionID ) ; 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 , string . Format ( SERVICE_COLLECTION , collectionID ) ) ; if ( connector == null ) return false ; GetCollectionReq req = new GetCollectionReq ( ) ; req . Callback = callback ; req . Data = customData ; req . CollectionID = collectionID ; req . Parameters [ " " ] = mp_ApiKey ; req . Parameters [ " " ] = VisualRecognitionVersion . Version ; req . Timeout = 20.0f * 60.0f ; req . OnResponse = OnGetCollectionResp ; return connector . Send ( req ) ; }
Retrieve information about a specific collection.
Retrieve information about a specific collection .
Returns true if succeess, false if failure.
Returns true if succeess false if failure .
callback
OnGetCollection
None
collectionID
string
The requested collection identifier.
The requested collection identifier .
customData
string
None