1313import io .weaviate .client6 .v1 .internal .rest .Endpoint ;
1414import io .weaviate .client6 .v1 .internal .rest .SimpleEndpoint ;
1515
16- public record CreateExportRequest (ExportCreate body , String backend ) {
16+ public record CreateExportRequest (ExportCreate config , String backend ) {
1717
1818 public static Endpoint <CreateExportRequest , Export > _ENDPOINT = new SimpleEndpoint <>(
1919 request -> "POST" ,
2020 request -> "/export/" + request .backend ,
2121 request -> Collections .emptyMap (),
22- request -> JSON .serialize (request .body ),
22+ request -> JSON .serialize (request .config ),
2323 (statusCode , response ) -> JSON .deserialize (response , Export .class ));
2424
2525 public static record ExportCreate (
@@ -28,12 +28,13 @@ public static record ExportCreate(
2828 @ SerializedName ("include" ) List <String > includeCollections ,
2929 @ SerializedName ("exclude" ) List <String > excludeCollections ) {
3030
31- public static ExportCreate of (String exportId ) {
32- return of (exportId , ObjectBuilder .identity ());
31+ public static ExportCreate of (String exportId , FileFormat fileFormat ) {
32+ return of (exportId , fileFormat , ObjectBuilder .identity ());
3333 }
3434
35- public static ExportCreate of (String exportId , Function <Builder , ObjectBuilder <ExportCreate >> fn ) {
36- return fn .apply (new Builder (exportId )).build ();
35+ public static ExportCreate of (String exportId , FileFormat fileFormat ,
36+ Function <Builder , ObjectBuilder <ExportCreate >> fn ) {
37+ return fn .apply (new Builder (exportId , fileFormat )).build ();
3738 }
3839
3940 public ExportCreate (Builder builder ) {
@@ -46,13 +47,14 @@ public ExportCreate(Builder builder) {
4647
4748 public static class Builder implements ObjectBuilder <ExportCreate > {
4849 private final String exportId ;
50+ private FileFormat fileFormat ;
4951
50- private FileFormat fileFormat = FileFormat .PARQUET ;
5152 private final List <String > includeCollections = new ArrayList <>();
5253 private final List <String > excludeCollections = new ArrayList <>();
5354
54- public Builder (String exportId ) {
55+ public Builder (String exportId , FileFormat fileFormat ) {
5556 this .exportId = exportId ;
57+ this .fileFormat = fileFormat ;
5658 }
5759
5860 /** Collection that should be included in the export. */
@@ -77,12 +79,6 @@ public Builder excludeCollections(List<String> excludeCollections) {
7779 return this ;
7880 }
7981
80- /** Export file format. */
81- public Builder fileFormat (FileFormat fileFormat ) {
82- this .fileFormat = fileFormat ;
83- return this ;
84- }
85-
8682 @ Override
8783 public ExportCreate build () {
8884 return new ExportCreate (this );
0 commit comments