-
Notifications
You must be signed in to change notification settings - Fork 117
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
13 changed files
with
149 additions
and
89 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
46 changes: 46 additions & 0 deletions
46
src/main/java/com/meilisearch/sdk/enums/OperationType.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
package com.meilisearch.sdk.enums; | ||
|
||
import com.fasterxml.jackson.annotation.JsonValue; | ||
import com.google.gson.annotations.SerializedName; | ||
|
||
/** | ||
* Enum for Operation Type | ||
* | ||
* @see <a href="https://www.meilisearch.com/docs/reference/api/tasks#type">API specification</a> | ||
*/ | ||
public enum OperationType { | ||
@SerializedName("indexCreation") | ||
INDEX_CREATION("indexCreation"), | ||
@SerializedName("indexUpdate") | ||
INDEX_UPDATE("indexUpdate"), | ||
@SerializedName("indexDeletion") | ||
INDEX_DELETE("indexDeletion"), | ||
@SerializedName("indexSwap") | ||
INDEX_SWAP("indexSwap"), | ||
@SerializedName("documentAdditionOrUpdate") | ||
DOCUMENT_UPSERT("documentAdditionOrUpdate"), | ||
@SerializedName("documentDeletion") | ||
DOCUMENT_DELETE("documentDeletion"), | ||
@SerializedName("settingsUpdate") | ||
SETTINGS_UPDATE("settingsUpdate"), | ||
@SerializedName("dumpCreation") | ||
DUMP_CREATE("dumpCreation"), | ||
@SerializedName("taskCancelation") | ||
TASK_CANCEL("taskCancelation"), | ||
@SerializedName("taskDeletion") | ||
TASK_DELETE("taskDeletion"), | ||
@SerializedName("snapshotCreation") | ||
SNAPSHOT_CREATE("snapshotCreation"); | ||
|
||
public final String operationType; | ||
|
||
OperationType(String operationType) { | ||
this.operationType = operationType; | ||
} | ||
|
||
@JsonValue | ||
@Override | ||
public String toString() { | ||
return this.operationType; | ||
} | ||
} |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
8 changes: 7 additions & 1 deletion
8
...m/meilisearch/sdk/model/BatchesQuery.java → ...rch/sdk/model/batch/req/BatchesQuery.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
21 changes: 21 additions & 0 deletions
21
src/main/java/com/meilisearch/sdk/model/batch/res/Batch.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
package com.meilisearch.sdk.model.batch.res; | ||
|
||
import com.meilisearch.sdk.model.TaskDetails; | ||
import lombok.Data; | ||
|
||
/** | ||
* Data structure of the batch object response | ||
* | ||
* @see <a href="https://www.meilisearch.com/docs/reference/api/batches#batch-object">API | ||
* specification</a> | ||
*/ | ||
@Data | ||
public class Batch { | ||
private int uid = 0; | ||
private TaskDetails details; | ||
private BatchProgress progress; | ||
private StatDetails stats; | ||
private String startedAt; | ||
private String finishedAt; | ||
private String duration; | ||
} |
10 changes: 10 additions & 0 deletions
10
src/main/java/com/meilisearch/sdk/model/batch/res/BatchProgress.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
package com.meilisearch.sdk.model.batch.res; | ||
|
||
import java.util.List; | ||
import lombok.Data; | ||
|
||
@Data | ||
class BatchProgress { | ||
private List<StepDetails> steps; | ||
private int percentage; | ||
} |
14 changes: 14 additions & 0 deletions
14
src/main/java/com/meilisearch/sdk/model/batch/res/StatDetails.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
package com.meilisearch.sdk.model.batch.res; | ||
|
||
import com.meilisearch.sdk.enums.OperationType; | ||
import com.meilisearch.sdk.model.TaskStatus; | ||
import java.util.Map; | ||
import lombok.Data; | ||
|
||
@Data | ||
public class StatDetails { | ||
private int totalNbTasks; | ||
private Map<TaskStatus, Integer> status; | ||
private Map<OperationType, Integer> types; | ||
private Map<String, Integer> indexUids; | ||
} |
10 changes: 10 additions & 0 deletions
10
src/main/java/com/meilisearch/sdk/model/batch/res/StepDetails.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
package com.meilisearch.sdk.model.batch.res; | ||
|
||
import lombok.Data; | ||
|
||
@Data | ||
class StepDetails { | ||
private String currentStep; | ||
private int finished; | ||
private int total; | ||
} |
35 changes: 0 additions & 35 deletions
35
src/main/java/com/meilisearch/sdk/model/batch_dto/Batch.java
This file was deleted.
Oops, something went wrong.
12 changes: 0 additions & 12 deletions
12
src/main/java/com/meilisearch/sdk/model/batch_dto/StatDetails.java
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters