deleteRecommendRule method
Future<DeletedAtResponse>
deleteRecommendRule({
- required String indexName,
- required RecommendModels model,
- required String objectID,
- RequestOptions? requestOptions,
Deletes a Recommend rule from a recommendation scenario.
Required API Key ACLs:
- editSettings
Parameters:
indexName
Name of the index on which to perform the operation.model
Recommend model.objectID
Unique record identifier.requestOptions
additional request configuration.
Implementation
Future<DeletedAtResponse> deleteRecommendRule({
required String indexName,
required RecommendModels model,
required String objectID,
RequestOptions? requestOptions,
}) async {
assert(
indexName.isNotEmpty,
'Parameter `indexName` is required when calling `deleteRecommendRule`.',
);
assert(
objectID.isNotEmpty,
'Parameter `objectID` is required when calling `deleteRecommendRule`.',
);
final request = ApiRequest(
method: RequestMethod.delete,
path: r'/1/indexes/{indexName}/{model}/recommend/rules/{objectID}'
.replaceAll(
'{' r'indexName' '}', Uri.encodeComponent(indexName.toString()))
.replaceAll('{' r'model' '}', Uri.encodeComponent(model.toString()))
.replaceAll(
'{' r'objectID' '}', Uri.encodeComponent(objectID.toString())),
);
final response = await _retryStrategy.execute(
request: request,
options: requestOptions,
);
return deserialize<DeletedAtResponse, DeletedAtResponse>(
response,
'DeletedAtResponse',
growable: true,
);
}