
clarifai2.api.request.model.DeleteModelVersionRequest Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of core Show documentation
Show all versions of core Show documentation
Clarifai Java API Client
The newest version!
package clarifai2.api.request.model;
import clarifai2.internal.grpc.api.ModelVersionOuterClass;
import clarifai2.api.BaseClarifaiClient;
import clarifai2.api.request.ClarifaiRequest;
import clarifai2.dto.model.ModelVersion;
import com.google.common.util.concurrent.ListenableFuture;
import org.jetbrains.annotations.NotNull;
import java.util.Collections;
import java.util.List;
// The returned object here should be JsonNull since the response does not actually return any ModelVersions.
// But changing this would break client code.
public final class DeleteModelVersionRequest extends ClarifaiRequest.Builder> {
@NotNull private final String modelID;
@NotNull private final String versionID;
public DeleteModelVersionRequest(
@NotNull BaseClarifaiClient client,
@NotNull String modelID,
@NotNull String versionID
) {
super(client);
this.modelID = modelID;
this.versionID = versionID;
}
@NotNull @Override protected String method() {
return "DELETE";
}
@NotNull @Override protected String subUrl() {
return String.format("v2/models/%s/versions/%s", modelID, versionID);
}
@NotNull @Override protected DeserializedRequest> request() {
return new DeserializedRequest>() {
@NotNull @Override public ListenableFuture httpRequestGrpc() {
return stub().deleteModelVersion(ModelVersionOuterClass.DeleteModelVersionRequest.newBuilder().build());
}
@NotNull @Override public List unmarshalerGrpc(Object returnedObject) {
return Collections.emptyList();
}
};
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy