Assets/Watson/Scripts/Services/VisualRecognition/VisualRecognition.cs
/// <summary>
/// Deletes an image from a collection.
/// </summary>
/// <param name="callback">The OnDeleteCollection callback.</param>
/// <param name="collectionID">The collection identifier holding the image to delete.</param>
/// <param name="imageID">The identifier of the image to delete.</param>
/// <param name="customData">Optional custom data.</param>
/// <returns>Returns true if succeess, false if failure.</returns>
Deletes an image from a collection.
Deletes an image from a collection .
public bool DeleteCollectionImage(OnDeleteCollectionImage callback, string collectionID, string imageID, string customData = null)
        {
            if (callback == null)
                throw new ArgumentNullException("callback");
            if (string.IsNullOrEmpty(collectionID))
                throw new ArgumentNullException("collectionID");
            if (string.IsNullOrEmpty(imageID))
                throw new ArgumentNullException("imageID");
            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_IMAGE, collectionID, imageID));
            if (connector == null)
                return false;
            DeleteCollectionImageReq req = new DeleteCollectionImageReq();
            req.Callback = callback;
            req.CollectionID = collectionID;
            req.ImageID = imageID;
            req.Data = customData;
            req.Parameters["api_key"] = mp_ApiKey;
            req.Parameters["version"] = VisualRecognitionVersion.Version;
            req.Delete = true;
            req.Timeout = 20.0f * 60.0f;
            req.OnResponse = OnDeleteCollectionImageResp;
            return connector.Send(req);
        }
public bool DeleteCollectionImage ( OnDeleteCollectionImage callback , string collectionID , string imageID , string customData = null ) { if ( callback == null ) throw new ArgumentNullException ( " " ) ; if ( string . IsNullOrEmpty ( collectionID ) ) throw new ArgumentNullException ( " " ) ; if ( string . IsNullOrEmpty ( imageID ) ) 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 , string . Format ( SERVICE_COLLECTION_IMAGE , collectionID , imageID ) ) ; if ( connector == null ) return false ; DeleteCollectionImageReq req = new DeleteCollectionImageReq ( ) ; req . Callback = callback ; req . CollectionID = collectionID ; req . ImageID = imageID ; req . Data = customData ; req . Parameters [ " " ] = mp_ApiKey ; req . Parameters [ " " ] = VisualRecognitionVersion . Version ; req . Delete = true ; req . Timeout = 20.0f * 60.0f ; req . OnResponse = OnDeleteCollectionImageResp ; return connector . Send ( req ) ; }
Deletes an image from a collection.
Deletes an image from a collection .
Returns true if succeess, false if failure.
Returns true if succeess false if failure .
callback
OnDeleteCollectionImage
The OnDeleteCollection callback.
The OnDeleteCollection callback .
collectionID
string
The collection identifier holding the image to delete.
The collection identifier holding the image to delete .
imageID
string
The identifier of the image to delete.
The identifier of the image to delete .
customData
string
Optional custom data.
Optional custom data .