com.ibm.watson.developer_cloud.http.RequestBuilder.delete()方法的使用及代码示例

x33g5p2x  于2022-01-29 转载在 其他  
字(14.0k)|赞(0)|评价(0)|浏览(101)

本文整理了Java中com.ibm.watson.developer_cloud.http.RequestBuilder.delete方法的一些代码示例,展示了RequestBuilder.delete的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。RequestBuilder.delete方法的具体详情如下:
包路径:com.ibm.watson.developer_cloud.http.RequestBuilder
类名称:RequestBuilder
方法名:delete

RequestBuilder.delete介绍

[英]The DELETE method requests that the origin server delete the resource identified by the Request-URI.
[中]DELETE方法请求源服务器删除由请求URI标识的资源。

代码示例

代码示例来源:origin: com.ibm.watson.developer_cloud/retrieve-and-rank

/**
 * Deletes a ranker.
 *
 * @param rankerID the ranker id
 * @return the service call
 */
public ServiceCall<Void> deleteRanker(final String rankerID) {
 Validator.isTrue((rankerID != null) && !rankerID.isEmpty(), "rankerId cannot be null or empty");
 final Request request = RequestBuilder.delete(String.format(PATH_RANKER, rankerID)).build();
 return createServiceCall(request, ResponseConverterUtils.getVoid());
}

代码示例来源:origin: com.ibm.watson.developer_cloud/retrieve-and-rank

@Override
public ServiceCall<Void> deleteSolrCluster(String solrClusterId) {
 Validator.isTrue((solrClusterId != null) && !solrClusterId.isEmpty(), "solrClusterId cannot be null or empty");
 final Request request = RequestBuilder.delete(String.format(PATH_GET_SOLR_CLUSTER, solrClusterId)).build();
 return createServiceCall(request, ResponseConverterUtils.getVoid());
}

代码示例来源:origin: com.ibm.watson.developer_cloud/dialog

/**
 * Deletes a dialog.
 *
 * @param dialogId The dialog identifier
 * @return the service call
 * @see DialogService
 */
public ServiceCall<Void> deleteDialog(final String dialogId) {
 Validator.isTrue((dialogId != null) && !dialogId.isEmpty(), "dialogId cannot be null or empty");
 final Request request = RequestBuilder.delete(String.format(PATH_DIALOG, dialogId)).build();
 return createServiceCall(request, ResponseConverterUtils.getVoid());
}

代码示例来源:origin: watson-developer-cloud/java-sdk

/**
 * Test illegal argument exception.
 */
@Test(expected = IllegalArgumentException.class)
public void testIllegalArgumentException() {
 RequestBuilder.delete(null);
}

代码示例来源:origin: com.ibm.watson.developer_cloud/retrieve-and-rank

@Override
public ServiceCall<Void> deleteSolrClusterConfiguration(String solrClusterId, String configName) {
 final String configPath = createConfigPath(solrClusterId, configName);
 final Request request = RequestBuilder.delete(configPath).build();
 return createServiceCall(request, ResponseConverterUtils.getVoid());
}

代码示例来源:origin: watson-developer-cloud/java-sdk

/**
 * Test delete.
 */
@Test
public void testDelete() {
 final Request request = RequestBuilder.delete(HttpUrl.parse(urlWithQuery)).build();
 assertEquals("DELETE", request.method());
 assertEquals(urlWithQuery, request.url().toString());
}

代码示例来源:origin: watson-developer-cloud/java-sdk

/**
 * Delete classifier.
 *
 * @param deleteClassifierOptions the {@link DeleteClassifierOptions} containing the options for the call
 * @return a {@link ServiceCall} with a response type of Void
 */
public ServiceCall<Void> deleteClassifier(DeleteClassifierOptions deleteClassifierOptions) {
 Validator.notNull(deleteClassifierOptions, "deleteClassifierOptions cannot be null");
 String[] pathSegments = { "v1/classifiers" };
 String[] pathParameters = { deleteClassifierOptions.classifierId() };
 RequestBuilder builder = RequestBuilder.delete(RequestBuilder.constructHttpUrl(getEndPoint(), pathSegments,
   pathParameters));
 return createServiceCall(builder.build(), ResponseConverterUtils.getVoid());
}

代码示例来源:origin: watson-developer-cloud/java-sdk

/**
 * Delete environment.
 *
 * @param deleteEnvironmentOptions the {@link DeleteEnvironmentOptions} containing the options for the call
 * @return a {@link ServiceCall} with a response type of Void
 */
public ServiceCall<Void> deleteEnvironment(DeleteEnvironmentOptions deleteEnvironmentOptions) {
 Validator.notNull(deleteEnvironmentOptions, "deleteEnvironmentOptions cannot be null");
 String[] pathSegments = { "v1/environments" };
 String[] pathParameters = { deleteEnvironmentOptions.environmentId() };
 RequestBuilder builder = RequestBuilder.delete(RequestBuilder.constructHttpUrl(getEndPoint(), pathSegments,
   pathParameters));
 builder.query(VERSION, versionDate);
 return createServiceCall(builder.build(), ResponseConverterUtils.getVoid());
}

代码示例来源:origin: watson-developer-cloud/java-sdk

/**
 * Delete a classifier.
 *
 * @param deleteClassifierOptions the {@link DeleteClassifierOptions} containing the options for the call
 * @return a {@link ServiceCall} with a response type of Void
 */
public ServiceCall<Void> deleteClassifier(DeleteClassifierOptions deleteClassifierOptions) {
 Validator.notNull(deleteClassifierOptions, "deleteClassifierOptions cannot be null");
 String[] pathSegments = { "v3/classifiers" };
 String[] pathParameters = { deleteClassifierOptions.classifierId() };
 RequestBuilder builder = RequestBuilder.delete(RequestBuilder.constructHttpUrl(getEndPoint(), pathSegments,
   pathParameters));
 builder.query(VERSION, versionDate);
 return createServiceCall(builder.build(), ResponseConverterUtils.getVoid());
}

代码示例来源:origin: watson-developer-cloud/java-sdk

/**
 * Delete model.
 *
 * Deletes a custom translation model.
 *
 * @param deleteModelOptions the {@link DeleteModelOptions} containing the options for the call
 * @return a {@link ServiceCall} with a response type of Void
 */
public ServiceCall<Void> deleteModel(DeleteModelOptions deleteModelOptions) {
 Validator.notNull(deleteModelOptions, "deleteModelOptions cannot be null");
 String[] pathSegments = { "v3/models" };
 String[] pathParameters = { deleteModelOptions.modelId() };
 RequestBuilder builder = RequestBuilder.delete(RequestBuilder.constructHttpUrl(getEndPoint(), pathSegments,
   pathParameters));
 builder.query(VERSION, versionDate);
 return createServiceCall(builder.build(), ResponseConverterUtils.getVoid());
}

代码示例来源:origin: watson-developer-cloud/java-sdk

/**
 * Delete model.
 *
 * Deletes a custom model.
 *
 * @param deleteModelOptions the {@link DeleteModelOptions} containing the options for the call
 * @return a {@link ServiceCall} with a response type of Void
 */
public ServiceCall<Void> deleteModel(DeleteModelOptions deleteModelOptions) {
 Validator.notNull(deleteModelOptions, "deleteModelOptions cannot be null");
 String[] pathSegments = { "v1/models" };
 String[] pathParameters = { deleteModelOptions.modelId() };
 RequestBuilder builder = RequestBuilder.delete(RequestBuilder.constructHttpUrl(getEndPoint(), pathSegments,
   pathParameters));
 builder.query(VERSION, versionDate);
 return createServiceCall(builder.build(), ResponseConverterUtils.getVoid());
}

代码示例来源:origin: watson-developer-cloud/java-sdk

/**
 * Delete workspace.
 *
 * Delete a workspace from the service instance.
 *
 * This operation is limited to 30 requests per 30 minutes. For more information, see **Rate limiting**.
 *
 * @param deleteWorkspaceOptions the {@link DeleteWorkspaceOptions} containing the options for the call
 * @return a {@link ServiceCall} with a response type of Void
 */
public ServiceCall<Void> deleteWorkspace(DeleteWorkspaceOptions deleteWorkspaceOptions) {
 Validator.notNull(deleteWorkspaceOptions, "deleteWorkspaceOptions cannot be null");
 String[] pathSegments = { "v1/workspaces" };
 String[] pathParameters = { deleteWorkspaceOptions.workspaceId() };
 RequestBuilder builder = RequestBuilder.delete(RequestBuilder.constructHttpUrl(getEndPoint(), pathSegments,
   pathParameters));
 builder.query(VERSION, versionDate);
 return createServiceCall(builder.build(), ResponseConverterUtils.getVoid());
}

代码示例来源:origin: watson-developer-cloud/java-sdk

/**
 * Delete a collection.
 *
 * @param deleteCollectionOptions the {@link DeleteCollectionOptions} containing the options for the call
 * @return a {@link ServiceCall} with a response type of Void
 */
public ServiceCall<Void> deleteCollection(DeleteCollectionOptions deleteCollectionOptions) {
 Validator.notNull(deleteCollectionOptions, "deleteCollectionOptions cannot be null");
 String[] pathSegments = { "v1/environments", "collections" };
 String[] pathParameters = { deleteCollectionOptions.environmentId(), deleteCollectionOptions.collectionId() };
 RequestBuilder builder = RequestBuilder.delete(RequestBuilder.constructHttpUrl(getEndPoint(), pathSegments,
   pathParameters));
 builder.query(VERSION, versionDate);
 return createServiceCall(builder.build(), ResponseConverterUtils.getVoid());
}

代码示例来源:origin: watson-developer-cloud/java-sdk

/**
 * Delete Gateway.
 *
 * Delete the specified gateway configuration.
 *
 * @param deleteGatewayOptions the {@link DeleteGatewayOptions} containing the options for the call
 * @return a {@link ServiceCall} with a response type of Void
 */
public ServiceCall<Void> deleteGateway(DeleteGatewayOptions deleteGatewayOptions) {
 Validator.notNull(deleteGatewayOptions, "deleteGatewayOptions cannot be null");
 String[] pathSegments = { "v1/environments", "gateways" };
 String[] pathParameters = { deleteGatewayOptions.environmentId(), deleteGatewayOptions.gatewayId() };
 RequestBuilder builder = RequestBuilder.delete(RequestBuilder.constructHttpUrl(getEndPoint(), pathSegments,
   pathParameters));
 builder.query(VERSION, versionDate);
 return createServiceCall(builder.build(), ResponseConverterUtils.getVoid());
}

代码示例来源:origin: watson-developer-cloud/java-sdk

/**
 * Delete session.
 *
 * Deletes a session explicitly before it times out.
 *
 * @param deleteSessionOptions the {@link DeleteSessionOptions} containing the options for the call
 * @return a {@link ServiceCall} with a response type of Void
 */
public ServiceCall<Void> deleteSession(DeleteSessionOptions deleteSessionOptions) {
 Validator.notNull(deleteSessionOptions, "deleteSessionOptions cannot be null");
 String[] pathSegments = { "v2/assistants", "sessions" };
 String[] pathParameters = { deleteSessionOptions.assistantId(), deleteSessionOptions.sessionId() };
 RequestBuilder builder = RequestBuilder.delete(RequestBuilder.constructHttpUrl(getEndPoint(), pathSegments,
   pathParameters));
 builder.query(VERSION, versionDate);
 return createServiceCall(builder.build(), ResponseConverterUtils.getVoid());
}

代码示例来源:origin: watson-developer-cloud/java-sdk

/**
 * Delete entity.
 *
 * Delete an entity from a workspace.
 *
 * This operation is limited to 1000 requests per 30 minutes. For more information, see **Rate limiting**.
 *
 * @param deleteEntityOptions the {@link DeleteEntityOptions} containing the options for the call
 * @return a {@link ServiceCall} with a response type of Void
 */
public ServiceCall<Void> deleteEntity(DeleteEntityOptions deleteEntityOptions) {
 Validator.notNull(deleteEntityOptions, "deleteEntityOptions cannot be null");
 String[] pathSegments = { "v1/workspaces", "entities" };
 String[] pathParameters = { deleteEntityOptions.workspaceId(), deleteEntityOptions.entity() };
 RequestBuilder builder = RequestBuilder.delete(RequestBuilder.constructHttpUrl(getEndPoint(), pathSegments,
   pathParameters));
 builder.query(VERSION, versionDate);
 return createServiceCall(builder.build(), ResponseConverterUtils.getVoid());
}

代码示例来源:origin: watson-developer-cloud/java-sdk

/**
 * Delete dialog node.
 *
 * Delete a dialog node from a workspace.
 *
 * This operation is limited to 500 requests per 30 minutes. For more information, see **Rate limiting**.
 *
 * @param deleteDialogNodeOptions the {@link DeleteDialogNodeOptions} containing the options for the call
 * @return a {@link ServiceCall} with a response type of Void
 */
public ServiceCall<Void> deleteDialogNode(DeleteDialogNodeOptions deleteDialogNodeOptions) {
 Validator.notNull(deleteDialogNodeOptions, "deleteDialogNodeOptions cannot be null");
 String[] pathSegments = { "v1/workspaces", "dialog_nodes" };
 String[] pathParameters = { deleteDialogNodeOptions.workspaceId(), deleteDialogNodeOptions.dialogNode() };
 RequestBuilder builder = RequestBuilder.delete(RequestBuilder.constructHttpUrl(getEndPoint(), pathSegments,
   pathParameters));
 builder.query(VERSION, versionDate);
 return createServiceCall(builder.build(), ResponseConverterUtils.getVoid());
}

代码示例来源:origin: watson-developer-cloud/java-sdk

/**
 * Delete credentials.
 *
 * Deletes a set of stored credentials from your Discovery instance.
 *
 * @param deleteCredentialsOptions the {@link DeleteCredentialsOptions} containing the options for the call
 * @return a {@link ServiceCall} with a response type of Void
 */
public ServiceCall<Void> deleteCredentials(DeleteCredentialsOptions deleteCredentialsOptions) {
 Validator.notNull(deleteCredentialsOptions, "deleteCredentialsOptions cannot be null");
 String[] pathSegments = { "v1/environments", "credentials" };
 String[] pathParameters = { deleteCredentialsOptions.environmentId(), deleteCredentialsOptions.credentialId() };
 RequestBuilder builder = RequestBuilder.delete(RequestBuilder.constructHttpUrl(getEndPoint(), pathSegments,
   pathParameters));
 builder.query(VERSION, versionDate);
 return createServiceCall(builder.build(), ResponseConverterUtils.getVoid());
}

代码示例来源:origin: watson-developer-cloud/java-sdk

/**
 * Delete a training data query.
 *
 * Removes the training data query and all associated examples from the training data set.
 *
 * @param deleteTrainingDataOptions the {@link DeleteTrainingDataOptions} containing the options for the call
 * @return a {@link ServiceCall} with a response type of Void
 */
public ServiceCall<Void> deleteTrainingData(DeleteTrainingDataOptions deleteTrainingDataOptions) {
 Validator.notNull(deleteTrainingDataOptions, "deleteTrainingDataOptions cannot be null");
 String[] pathSegments = { "v1/environments", "collections", "training_data" };
 String[] pathParameters = { deleteTrainingDataOptions.environmentId(), deleteTrainingDataOptions.collectionId(),
   deleteTrainingDataOptions.queryId() };
 RequestBuilder builder = RequestBuilder.delete(RequestBuilder.constructHttpUrl(getEndPoint(), pathSegments,
   pathParameters));
 builder.query(VERSION, versionDate);
 return createServiceCall(builder.build(), ResponseConverterUtils.getVoid());
}

代码示例来源:origin: watson-developer-cloud/java-sdk

/**
 * Deletes a specified feedback entry.
 *
 * @param deleteFeedbackOptions the {@link DeleteFeedbackOptions} containing the options for the call
 * @return a {@link ServiceCall} with a response type of Void
 */
public ServiceCall<Void> deleteFeedback(DeleteFeedbackOptions deleteFeedbackOptions) {
 Validator.notNull(deleteFeedbackOptions, "deleteFeedbackOptions cannot be null");
 String[] pathSegments = { "v1/feedback" };
 String[] pathParameters = { deleteFeedbackOptions.feedbackId() };
 RequestBuilder builder = RequestBuilder.delete(RequestBuilder.constructHttpUrl(getEndPoint(), pathSegments,
   pathParameters));
 builder.query(VERSION, versionDate);
 if (deleteFeedbackOptions.modelId() != null) {
  builder.query("model_id", deleteFeedbackOptions.modelId());
 }
 return createServiceCall(builder.build(), ResponseConverterUtils.getVoid());
}

相关文章