diff --git a/.code-samples.meilisearch.yaml b/.code-samples.meilisearch.yaml index 89722e24..1ddae719 100644 --- a/.code-samples.meilisearch.yaml +++ b/.code-samples.meilisearch.yaml @@ -791,7 +791,7 @@ get_all_tasks_filtering_1: |- client.Index("movies").GetTasks(nil); // OR client.GetTasks(&TasksQuery{ - IndexUID: []string{"movies"}, + IndexUIDs: []string{"movies"}, }); get_all_tasks_filtering_2: |- client.GetTasks(&meilisearch.TasksQuery{ diff --git a/README.md b/README.md index 3dc5bb04..5be251f3 100644 --- a/README.md +++ b/README.md @@ -230,7 +230,7 @@ searchRes, err := index.Search("wonder", ## 🤖 Compatibility with Meilisearch -This package only guarantees the compatibility with the [version v0.29.0 of Meilisearch](https://github.com/meilisearch/meilisearch/releases/tag/v0.29.0). +This package only guarantees the compatibility with the [version v0.30.0 of Meilisearch](https://github.com/meilisearch/meilisearch/releases/tag/v0.30.0). ## 💡 Learn more diff --git a/client.go b/client.go index 8cc61532..3ca5f9d7 100644 --- a/client.go +++ b/client.go @@ -54,6 +54,9 @@ type ClientInterface interface { IsHealthy() bool GetTask(taskUID int64) (resp *Task, err error) GetTasks(param *TasksQuery) (resp *TaskResult, err error) + CancelTasks(param *CancelTasksQuery) (resp *TaskInfo, err error) + DeleteTasks(param *DeleteTasksQuery) (resp *TaskInfo, err error) + SwapIndexes(param []SwapIndexesParams) (resp *TaskInfo, err error) WaitForTask(taskUID int64, options ...WaitParams) (*Task, error) GenerateTenantToken(APIKeyUID string, searchRules map[string]interface{}, options *TenantTokenOptions) (resp string, err error) } @@ -277,21 +280,87 @@ func (c *Client) GetTasks(param *TasksQuery) (resp *TaskResult, err error) { functionName: "GetTasks", } if param != nil { - if param.Limit != 0 { - req.withQueryParams["limit"] = strconv.FormatInt(param.Limit, 10) - } - if param.From != 0 { - req.withQueryParams["from"] = strconv.FormatInt(param.From, 10) - } - if len(param.Status) != 0 { - req.withQueryParams["status"] = strings.Join(param.Status, ",") - } - if len(param.Type) != 0 { - req.withQueryParams["type"] = strings.Join(param.Type, ",") + encodeTasksQuery(param, &req) + } + if err := c.executeRequest(req); err != nil { + return nil, err + } + return resp, nil +} + +func (c *Client) CancelTasks(param *CancelTasksQuery) (resp *TaskInfo, err error) { + resp = &TaskInfo{} + req := internalRequest{ + endpoint: "/tasks/cancel", + method: http.MethodPost, + withRequest: nil, + withResponse: &resp, + withQueryParams: map[string]string{}, + acceptedStatusCodes: []int{http.StatusOK}, + functionName: "CancelTasks", + } + if param != nil { + paramToSend := &TasksQuery{ + UIDS: param.UIDS, + IndexUIDS: param.IndexUIDS, + Statuses: param.Statuses, + Types: param.Types, + BeforeEnqueuedAt: param.BeforeEnqueuedAt, + AfterEnqueuedAt: param.AfterEnqueuedAt, + BeforeStartedAt: param.BeforeStartedAt, + AfterStartedAt: param.AfterStartedAt, } - if len(param.IndexUID) != 0 { - req.withQueryParams["indexUid"] = strings.Join(param.IndexUID, ",") + encodeTasksQuery(paramToSend, &req) + } + if err := c.executeRequest(req); err != nil { + return nil, err + } + return resp, nil +} + +func (c *Client) DeleteTasks(param *DeleteTasksQuery) (resp *TaskInfo, err error) { + resp = &TaskInfo{} + req := internalRequest{ + endpoint: "/tasks", + method: http.MethodDelete, + withRequest: nil, + withResponse: &resp, + withQueryParams: map[string]string{}, + acceptedStatusCodes: []int{http.StatusOK}, + functionName: "DeleteTasks", + } + if param != nil { + paramToSend := &TasksQuery{ + UIDS: param.UIDS, + IndexUIDS: param.IndexUIDS, + Statuses: param.Statuses, + Types: param.Types, + CanceledBy: param.CanceledBy, + BeforeEnqueuedAt: param.BeforeEnqueuedAt, + AfterEnqueuedAt: param.AfterEnqueuedAt, + BeforeStartedAt: param.BeforeStartedAt, + AfterStartedAt: param.AfterStartedAt, + BeforeFinishedAt: param.BeforeFinishedAt, + AfterFinishedAt: param.AfterFinishedAt, } + encodeTasksQuery(paramToSend, &req) + } + if err := c.executeRequest(req); err != nil { + return nil, err + } + return resp, nil +} + +func (c *Client) SwapIndexes(param []SwapIndexesParams) (resp *TaskInfo, err error) { + resp = &TaskInfo{} + req := internalRequest{ + endpoint: "/swap-indexes", + method: http.MethodPost, + contentType: contentTypeJSON, + withRequest: param, + withResponse: &resp, + acceptedStatusCodes: []int{http.StatusAccepted}, + functionName: "SwapIndexes", } if err := c.executeRequest(req); err != nil { return nil, err @@ -390,9 +459,7 @@ func convertKeyToParsedKey(key Key) (resp KeyParsed) { // Convert time.Time to *string to feat the exact ISO-8601 // format of Meilisearch if !key.ExpiresAt.IsZero() { - const Format = "2006-01-02T15:04:05" - timeParsedToString := key.ExpiresAt.Format(Format) - resp.ExpiresAt = &timeParsedToString + resp.ExpiresAt = formatDate(key.ExpiresAt, true) } return resp } @@ -401,3 +468,51 @@ func IsValidUUID(uuid string) bool { r := regexp.MustCompile("^[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-4[a-fA-F0-9]{3}-[8|9|aA|bB][a-fA-F0-9]{3}-[a-fA-F0-9]{12}$") return r.MatchString(uuid) } + +func encodeTasksQuery(param *TasksQuery, req *internalRequest) { + if param.Limit != 0 { + req.withQueryParams["limit"] = strconv.FormatInt(param.Limit, 10) + } + if param.From != 0 { + req.withQueryParams["from"] = strconv.FormatInt(param.From, 10) + } + if len(param.Statuses) != 0 { + req.withQueryParams["statuses"] = strings.Join(param.Statuses, ",") + } + if len(param.Types) != 0 { + req.withQueryParams["types"] = strings.Join(param.Types, ",") + } + if len(param.IndexUIDS) != 0 { + req.withQueryParams["indexUids"] = strings.Join(param.IndexUIDS, ",") + } + if len(param.UIDS) != 0 { + req.withQueryParams["uids"] = strings.Trim(strings.Join(strings.Fields(fmt.Sprint(param.UIDS)), ","), "[]") + } + if len(param.CanceledBy) != 0 { + req.withQueryParams["canceledBy"] = strings.Trim(strings.Join(strings.Fields(fmt.Sprint(param.CanceledBy)), ","), "[]") + } + if !param.BeforeEnqueuedAt.IsZero() { + req.withQueryParams["beforeEnqueuedAt"] = *formatDate(param.BeforeEnqueuedAt, false) + } + if !param.AfterEnqueuedAt.IsZero() { + req.withQueryParams["afterEnqueuedAt"] = *formatDate(param.AfterEnqueuedAt, false) + } + if !param.BeforeStartedAt.IsZero() { + req.withQueryParams["beforeStartedAt"] = *formatDate(param.BeforeStartedAt, false) + } + if !param.AfterStartedAt.IsZero() { + req.withQueryParams["afterStartedAt"] = *formatDate(param.AfterStartedAt, false) + } + if !param.BeforeFinishedAt.IsZero() { + req.withQueryParams["beforeFinishedAt"] = *formatDate(param.BeforeFinishedAt, false) + } + if !param.AfterFinishedAt.IsZero() { + req.withQueryParams["afterFinishedAt"] = *formatDate(param.AfterFinishedAt, false) + } +} + +func formatDate(date time.Time, key bool) *string { + const format = "2006-01-02T15:04:05Z" + timeParsedToString := date.Format(format) + return &timeParsedToString +} diff --git a/client_test.go b/client_test.go index 5323e084..57228cf4 100644 --- a/client_test.go +++ b/client_test.go @@ -2,6 +2,8 @@ package meilisearch import ( "context" + "strings" + "sync" "testing" "time" @@ -655,8 +657,8 @@ func TestClient_GetTask(t *testing.T) { require.GreaterOrEqual(t, gotResp.UID, tt.args.taskUID) require.Equal(t, tt.args.UID, gotResp.IndexUID) require.Equal(t, TaskStatusSucceeded, gotResp.Status) - require.Equal(t, len(tt.args.document), gotResp.Details.ReceivedDocuments) - require.Equal(t, len(tt.args.document), gotResp.Details.IndexedDocuments) + require.Equal(t, int64(len(tt.args.document)), gotResp.Details.ReceivedDocuments) + require.Equal(t, int64(len(tt.args.document)), gotResp.Details.IndexedDocuments) // Make sure that timestamps are also retrieved require.NotZero(t, gotResp.EnqueuedAt) @@ -747,9 +749,51 @@ func TestClient_GetTasks(t *testing.T) { {ID: "123", Name: "Pride and Prejudice"}, }, query: &TasksQuery{ - Limit: 1, - From: 0, - IndexUID: []string{"indexUID"}, + Limit: 1, + From: 0, + IndexUIDS: []string{"indexUID"}, + }, + }, + }, + { + name: "TestGetTasksWithUidFilter", + args: args{ + UID: "indexUID", + client: defaultClient, + document: []docTest{ + {ID: "123", Name: "Pride and Prejudice"}, + }, + query: &TasksQuery{ + Limit: 1, + UIDS: []int64{1}, + }, + }, + }, + { + name: "TestGetTasksWithDateFilter", + args: args{ + UID: "indexUID", + client: defaultClient, + document: []docTest{ + {ID: "123", Name: "Pride and Prejudice"}, + }, + query: &TasksQuery{ + Limit: 1, + BeforeEnqueuedAt: time.Now(), + }, + }, + }, + { + name: "TestGetTasksWithCanceledByFilter", + args: args{ + UID: "indexUID", + client: defaultClient, + document: []docTest{ + {ID: "123", Name: "Pride and Prejudice"}, + }, + query: &TasksQuery{ + Limit: 1, + CanceledBy: []int64{1}, }, }, }, @@ -785,6 +829,324 @@ func TestClient_GetTasks(t *testing.T) { } } +func TestClient_CancelTasks(t *testing.T) { + type args struct { + UID string + client *Client + query *CancelTasksQuery + } + tests := []struct { + name string + args args + want string + }{ + { + name: "TestCancelTasksWithNoFilters", + args: args{ + UID: "indexUID", + client: defaultClient, + query: nil, + }, + want: "", + }, + { + name: "TestCancelTasksWithStatutes", + args: args{ + UID: "indexUID", + client: defaultClient, + query: &CancelTasksQuery{ + Statuses: []string{"succeeded"}, + }, + }, + want: "?statuses=succeeded", + }, + { + name: "TestCancelTasksWithIndexUidFilter", + args: args{ + UID: "indexUID", + client: defaultClient, + query: &CancelTasksQuery{ + IndexUIDS: []string{"0"}, + }, + }, + want: "?indexUids=0", + }, + { + name: "TestCancelTasksWithMultipleIndexUidsFilter", + args: args{ + UID: "indexUID", + client: defaultClient, + query: &CancelTasksQuery{ + IndexUIDS: []string{"0", "1"}, + }, + }, + want: "?indexUids=0%2C1", + }, + { + name: "TestCancelTasksWithUidFilter", + args: args{ + UID: "indexUID", + client: defaultClient, + query: &CancelTasksQuery{ + UIDS: []int64{0}, + }, + }, + want: "?uids=0", + }, + { + name: "TestCancelTasksWithMultipleUidsFilter", + args: args{ + UID: "indexUID", + client: defaultClient, + query: &CancelTasksQuery{ + UIDS: []int64{0, 1}, + }, + }, + want: "?uids=0%2C1", + }, + { + name: "TestCancelTasksWithDateFilter", + args: args{ + UID: "indexUID", + client: defaultClient, + query: &CancelTasksQuery{ + BeforeEnqueuedAt: time.Now(), + }, + }, + want: strings.NewReplacer(":", "%3A").Replace("?beforeEnqueuedAt=" + time.Now().Format("2006-01-02T15:04:05Z")), + }, + { + name: "TestCancelTasksWithParameters", + args: args{ + UID: "indexUID", + client: defaultClient, + query: &CancelTasksQuery{ + Statuses: []string{"enqueued"}, + IndexUIDS: []string{"indexUID"}, + UIDS: []int64{1}, + AfterEnqueuedAt: time.Now(), + }, + }, + want: "?afterEnqueuedAt=" + strings.NewReplacer(":", "%3A").Replace(time.Now().Format("2006-01-02T15:04:05Z")) + "&indexUids=indexUID&statuses=enqueued&uids=1", + }, + } + for _, tt := range tests { + t.Run(tt.name, func(t *testing.T) { + c := tt.args.client + t.Cleanup(cleanup(c)) + + gotResp, err := c.CancelTasks(tt.args.query) + if tt.args.query == nil { + require.Error(t, err) + require.Equal(t, "missing_task_filters", + err.(*Error).MeilisearchApiError.Code) + } else { + require.NoError(t, err) + + _, err = c.WaitForTask(gotResp.TaskUID) + require.NoError(t, err) + + gotTask, err := c.GetTask(gotResp.TaskUID) + require.NoError(t, err) + + require.NotNil(t, gotResp.Status) + require.NotNil(t, gotResp.Type) + require.NotNil(t, gotResp.TaskUID) + require.NotNil(t, gotResp.EnqueuedAt) + require.Equal(t, "", gotResp.IndexUID) + require.Equal(t, "taskCancelation", gotResp.Type) + require.Equal(t, tt.want, gotTask.Details.OriginalFilter) + } + }) + } +} + +func TestClient_DeleteTasks(t *testing.T) { + type args struct { + UID string + client *Client + query *DeleteTasksQuery + } + tests := []struct { + name string + args args + want string + }{ + { + name: "TestBasicDeleteTasks", + args: args{ + UID: "indexUID", + client: defaultClient, + query: &DeleteTasksQuery{ + Statuses: []string{"enqueued"}, + }, + }, + want: "?statuses=enqueued", + }, + { + name: "TestDeleteTasksWithUidFilter", + args: args{ + UID: "indexUID", + client: defaultClient, + query: &DeleteTasksQuery{ + UIDS: []int64{1}, + }, + }, + want: "?uids=1", + }, + { + name: "TestDeleteTasksWithMultipleUidsFilter", + args: args{ + UID: "indexUID", + client: defaultClient, + query: &DeleteTasksQuery{ + UIDS: []int64{0, 1}, + }, + }, + want: "?uids=0%2C1", + }, + { + name: "TestDeleteTasksWithIndexUidFilter", + args: args{ + UID: "indexUID", + client: defaultClient, + query: &DeleteTasksQuery{ + IndexUIDS: []string{"0"}, + }, + }, + want: "?indexUids=0", + }, + { + name: "TestDeleteTasksWithMultipleIndexUidsFilter", + args: args{ + UID: "indexUID", + client: defaultClient, + query: &DeleteTasksQuery{ + IndexUIDS: []string{"0", "1"}, + }, + }, + want: "?indexUids=0%2C1", + }, + { + name: "TestDeleteTasksWithDateFilter", + args: args{ + UID: "indexUID", + client: defaultClient, + query: &DeleteTasksQuery{ + BeforeEnqueuedAt: time.Now(), + }, + }, + want: strings.NewReplacer(":", "%3A").Replace("?beforeEnqueuedAt=" + time.Now().Format("2006-01-02T15:04:05Z")), + }, + { + name: "TestDeleteTasksWithCanceledByFilter", + args: args{ + UID: "indexUID", + client: defaultClient, + query: &DeleteTasksQuery{ + CanceledBy: []int64{1}, + }, + }, + want: "?canceledBy=1", + }, + { + name: "TestDeleteTasksWithParameters", + args: args{ + UID: "indexUID", + client: defaultClient, + query: &DeleteTasksQuery{ + Statuses: []string{"enqueued"}, + IndexUIDS: []string{"indexUID"}, + UIDS: []int64{1}, + AfterEnqueuedAt: time.Now(), + }, + }, + want: "?afterEnqueuedAt=" + strings.NewReplacer(":", "%3A").Replace(time.Now().Format("2006-01-02T15:04:05Z")) + "&indexUids=indexUID&statuses=enqueued&uids=1", + }, + } + for _, tt := range tests { + t.Run(tt.name, func(t *testing.T) { + c := tt.args.client + t.Cleanup(cleanup(c)) + + gotResp, err := c.DeleteTasks(tt.args.query) + require.NoError(t, err) + + _, err = c.WaitForTask(gotResp.TaskUID) + require.NoError(t, err) + + gotTask, err := c.GetTask(gotResp.TaskUID) + require.NoError(t, err) + + require.NotNil(t, gotResp.Status) + require.NotNil(t, gotResp.Type) + require.NotNil(t, gotResp.TaskUID) + require.NotNil(t, gotResp.EnqueuedAt) + require.Equal(t, "", gotResp.IndexUID) + require.Equal(t, "taskDeletion", gotResp.Type) + require.NotNil(t, gotTask.Details.OriginalFilter) + require.Equal(t, tt.want, gotTask.Details.OriginalFilter) + }) + } +} + +func TestClient_SwapIndexes(t *testing.T) { + type args struct { + UID string + client *Client + query []SwapIndexesParams + } + tests := []struct { + name string + args args + }{ + { + name: "TestBasicSwapIndexes", + args: args{ + UID: "indexUID", + client: defaultClient, + query: []SwapIndexesParams{ + {Indexes: []string{"IndexA", "IndexB"}}, + }, + }, + }, + { + name: "TestSwapIndexesWithMultipleIndexes", + args: args{ + UID: "indexUID", + client: defaultClient, + query: []SwapIndexesParams{ + {Indexes: []string{"IndexA", "IndexB"}}, + {Indexes: []string{"Index1", "Index2"}}, + }, + }, + }, + } + for _, tt := range tests { + t.Run(tt.name, func(t *testing.T) { + c := tt.args.client + t.Cleanup(cleanup(c)) + + gotResp, err := c.SwapIndexes(tt.args.query) + require.NoError(t, err) + + _, err = c.WaitForTask(gotResp.TaskUID) + require.NoError(t, err) + + gotTask, err := c.GetTask(gotResp.TaskUID) + require.NoError(t, err) + + require.NotNil(t, gotResp.Status) + require.NotNil(t, gotResp.Type) + require.NotNil(t, gotResp.TaskUID) + require.NotNil(t, gotResp.EnqueuedAt) + require.Equal(t, "", gotResp.IndexUID) + require.Equal(t, "indexSwap", gotResp.Type) + require.Equal(t, tt.args.query, gotTask.Details.Swaps) + }) + } +} + func TestClient_DefaultWaitForTask(t *testing.T) { type args struct { UID string @@ -979,7 +1341,7 @@ func TestClient_ConnectionCloseByServer(t *testing.T) { func TestClient_GenerateTenantToken(t *testing.T) { type args struct { - IndexUID string + IndexUIDS string client *Client APIKeyUID string searchRules map[string]interface{} @@ -995,7 +1357,7 @@ func TestClient_GenerateTenantToken(t *testing.T) { { name: "TestDefaultGenerateTenantToken", args: args{ - IndexUID: "TestDefaultGenerateTenantToken", + IndexUIDS: "TestDefaultGenerateTenantToken", client: privateClient, APIKeyUID: GetPrivateUIDKey(), searchRules: map[string]interface{}{ @@ -1010,7 +1372,7 @@ func TestClient_GenerateTenantToken(t *testing.T) { { name: "TestGenerateTenantTokenWithApiKey", args: args{ - IndexUID: "TestGenerateTenantTokenWithApiKey", + IndexUIDS: "TestGenerateTenantTokenWithApiKey", client: defaultClient, APIKeyUID: GetPrivateUIDKey(), searchRules: map[string]interface{}{ @@ -1027,7 +1389,7 @@ func TestClient_GenerateTenantToken(t *testing.T) { { name: "TestGenerateTenantTokenWithOnlyExpiresAt", args: args{ - IndexUID: "TestGenerateTenantTokenWithOnlyExpiresAt", + IndexUIDS: "TestGenerateTenantTokenWithOnlyExpiresAt", client: privateClient, APIKeyUID: GetPrivateUIDKey(), searchRules: map[string]interface{}{ @@ -1044,7 +1406,7 @@ func TestClient_GenerateTenantToken(t *testing.T) { { name: "TestGenerateTenantTokenWithApiKeyAndExpiresAt", args: args{ - IndexUID: "TestGenerateTenantTokenWithApiKeyAndExpiresAt", + IndexUIDS: "TestGenerateTenantTokenWithApiKeyAndExpiresAt", client: defaultClient, APIKeyUID: GetPrivateUIDKey(), searchRules: map[string]interface{}{ @@ -1062,7 +1424,7 @@ func TestClient_GenerateTenantToken(t *testing.T) { { name: "TestGenerateTenantTokenWithFilters", args: args{ - IndexUID: "indexUID", + IndexUIDS: "indexUID", client: privateClient, APIKeyUID: GetPrivateUIDKey(), searchRules: map[string]interface{}{ @@ -1081,7 +1443,7 @@ func TestClient_GenerateTenantToken(t *testing.T) { { name: "TestGenerateTenantTokenWithFilterOnOneINdex", args: args{ - IndexUID: "indexUID", + IndexUIDS: "indexUID", client: privateClient, APIKeyUID: GetPrivateUIDKey(), searchRules: map[string]interface{}{ @@ -1100,7 +1462,7 @@ func TestClient_GenerateTenantToken(t *testing.T) { { name: "TestGenerateTenantTokenWithoutSearchRules", args: args{ - IndexUID: "TestGenerateTenantTokenWithoutSearchRules", + IndexUIDS: "TestGenerateTenantTokenWithoutSearchRules", client: privateClient, APIKeyUID: GetPrivateUIDKey(), searchRules: nil, @@ -1113,7 +1475,7 @@ func TestClient_GenerateTenantToken(t *testing.T) { { name: "TestGenerateTenantTokenWithoutApiKey", args: args{ - IndexUID: "TestGenerateTenantTokenWithoutApiKey", + IndexUIDS: "TestGenerateTenantTokenWithoutApiKey", client: NewClient(ClientConfig{ Host: getenv("MEILISEARCH_URL", "http://localhost:7700"), APIKey: "", @@ -1131,7 +1493,7 @@ func TestClient_GenerateTenantToken(t *testing.T) { { name: "TestGenerateTenantTokenWithBadExpiresAt", args: args{ - IndexUID: "TestGenerateTenantTokenWithBadExpiresAt", + IndexUIDS: "TestGenerateTenantTokenWithBadExpiresAt", client: defaultClient, APIKeyUID: GetPrivateUIDKey(), searchRules: map[string]interface{}{ @@ -1148,7 +1510,7 @@ func TestClient_GenerateTenantToken(t *testing.T) { { name: "TestGenerateTenantTokenWithBadAPIKeyUID", args: args{ - IndexUID: "TestGenerateTenantTokenWithBadAPIKeyUID", + IndexUIDS: "TestGenerateTenantTokenWithBadAPIKeyUID", client: defaultClient, APIKeyUID: GetPrivateUIDKey() + "1234", searchRules: map[string]interface{}{ @@ -1163,7 +1525,7 @@ func TestClient_GenerateTenantToken(t *testing.T) { { name: "TestGenerateTenantTokenWithEmptyAPIKeyUID", args: args{ - IndexUID: "TestGenerateTenantTokenWithEmptyAPIKeyUID", + IndexUIDS: "TestGenerateTenantTokenWithEmptyAPIKeyUID", client: defaultClient, APIKeyUID: "", searchRules: map[string]interface{}{ @@ -1189,11 +1551,11 @@ func TestClient_GenerateTenantToken(t *testing.T) { require.NoError(t, err) if tt.wantFilter { - gotTask, err := c.Index(tt.args.IndexUID).UpdateFilterableAttributes(&tt.args.filter) + gotTask, err := c.Index(tt.args.IndexUIDS).UpdateFilterableAttributes(&tt.args.filter) require.NoError(t, err, "UpdateFilterableAttributes() in TestGenerateTenantToken error should be nil") - testWaitForTask(t, c.Index(tt.args.IndexUID), gotTask) + testWaitForTask(t, c.Index(tt.args.IndexUIDS), gotTask) } else { - _, err := SetUpEmptyIndex(&IndexConfig{Uid: tt.args.IndexUID}) + _, err := SetUpEmptyIndex(&IndexConfig{Uid: tt.args.IndexUIDS}) require.NoError(t, err, "CreateIndex() in TestGenerateTenantToken error should be nil") } @@ -1202,7 +1564,7 @@ func TestClient_GenerateTenantToken(t *testing.T) { APIKey: token, }) - _, err = client.Index(tt.args.IndexUID).Search("", &SearchRequest{}) + _, err = client.Index(tt.args.IndexUIDS).Search("", &SearchRequest{}) require.NoError(t, err) } diff --git a/index.go b/index.go index e3663097..a64c450f 100644 --- a/index.go +++ b/index.go @@ -183,17 +183,17 @@ func (i Index) GetTasks(param *TasksQuery) (resp *TaskResult, err error) { if param.From != 0 { req.withQueryParams["from"] = strconv.FormatInt(param.From, 10) } - if len(param.Status) != 0 { - req.withQueryParams["status"] = strings.Join(param.Status, ",") + if len(param.Statuses) != 0 { + req.withQueryParams["statuses"] = strings.Join(param.Statuses, ",") } - if len(param.Type) != 0 { - req.withQueryParams["type"] = strings.Join(param.Type, ",") + if len(param.Types) != 0 { + req.withQueryParams["types"] = strings.Join(param.Types, ",") } - if len(param.IndexUID) != 0 { - param.IndexUID = append(param.IndexUID, i.UID) - req.withQueryParams["indexUid"] = strings.Join(param.IndexUID, ",") + if len(param.IndexUIDS) != 0 { + param.IndexUIDS = append(param.IndexUIDS, i.UID) + req.withQueryParams["indexUids"] = strings.Join(param.IndexUIDS, ",") } else { - req.withQueryParams["indexUid"] = i.UID + req.withQueryParams["indexUids"] = i.UID } } if err := i.client.executeRequest(req); err != nil { diff --git a/index_search.go b/index_search.go index dea86bbd..7e562f2f 100644 --- a/index_search.go +++ b/index_search.go @@ -85,6 +85,12 @@ func searchPostRequestParams(query string, request *SearchRequest) map[string]in if request.CropLength != 0 { params["cropLength"] = request.CropLength } + if request.HitsPerPage != 0 { + params["hitsPerPage"] = request.HitsPerPage + } + if request.Page != 0 { + params["page"] = request.Page + } if request.CropMarker != "" { params["cropMarker"] = request.CropMarker } diff --git a/index_search_test.go b/index_search_test.go index 0985b83c..d7ca2f9f 100644 --- a/index_search_test.go +++ b/index_search_test.go @@ -851,6 +851,7 @@ func TestIndex_SearchWithFilters(t *testing.T) { require.Equal(t, tt.want.Hits[len].(map[string]interface{})["title"], got.Hits[len].(map[string]interface{})["title"]) require.Equal(t, tt.want.Hits[len].(map[string]interface{})["book_id"], got.Hits[len].(map[string]interface{})["book_id"]) } + require.Equal(t, tt.args.query, got.Query) require.Equal(t, tt.want.EstimatedTotalHits, got.EstimatedTotalHits) require.Equal(t, tt.want.Offset, got.Offset) require.Equal(t, tt.want.Limit, got.Limit) @@ -1267,3 +1268,135 @@ func TestIndex_SearchOnNestedFileds(t *testing.T) { }) } } + +func TestIndex_SearchWithPagination(t *testing.T) { + type args struct { + UID string + PrimaryKey string + client *Client + query string + request SearchRequest + } + tests := []struct { + name string + args args + want *SearchResponse + }{ + { + name: "TestIndexBasicSearchWithHitsPerPage", + args: args{ + UID: "indexUID", + client: defaultClient, + query: "and", + request: SearchRequest{ + HitsPerPage: 10, + }, + }, + want: &SearchResponse{ + Hits: []interface{}{ + map[string]interface{}{ + "book_id": float64(123), "title": "Pride and Prejudice", + }, + map[string]interface{}{ + "book_id": float64(730), "title": "War and Peace", + }, + map[string]interface{}{ + "book_id": float64(1032), "title": "Crime and Punishment", + }, + map[string]interface{}{ + "book_id": float64(4), "title": "Harry Potter and the Half-Blood Prince", + }, + }, + HitsPerPage: 10, + Page: 1, + TotalHits: 4, + TotalPages: 1, + }, + }, + { + name: "TestIndexBasicSearchWithPage", + args: args{ + UID: "indexUID", + client: defaultClient, + query: "and", + request: SearchRequest{ + Page: 1, + }, + }, + want: &SearchResponse{ + Hits: []interface{}{ + map[string]interface{}{ + "book_id": float64(123), "title": "Pride and Prejudice", + }, + map[string]interface{}{ + "book_id": float64(730), "title": "War and Peace", + }, + map[string]interface{}{ + "book_id": float64(1032), "title": "Crime and Punishment", + }, + map[string]interface{}{ + "book_id": float64(4), "title": "Harry Potter and the Half-Blood Prince", + }, + }, + HitsPerPage: 20, + Page: 1, + TotalHits: 4, + TotalPages: 1, + }, + }, + { + name: "TestIndexBasicSearchWithPageAndHitsPerPage", + args: args{ + UID: "indexUID", + client: defaultClient, + query: "and", + request: SearchRequest{ + HitsPerPage: 10, + Page: 1, + }, + }, + want: &SearchResponse{ + Hits: []interface{}{ + map[string]interface{}{ + "book_id": float64(123), "title": "Pride and Prejudice", + }, + map[string]interface{}{ + "book_id": float64(730), "title": "War and Peace", + }, + map[string]interface{}{ + "book_id": float64(1032), "title": "Crime and Punishment", + }, + map[string]interface{}{ + "book_id": float64(4), "title": "Harry Potter and the Half-Blood Prince", + }, + }, + HitsPerPage: 10, + Page: 1, + TotalHits: 4, + TotalPages: 1, + }, + }, + } + for _, tt := range tests { + t.Run(tt.name, func(t *testing.T) { + SetUpIndexForFaceting() + c := tt.args.client + i := c.Index(tt.args.UID) + t.Cleanup(cleanup(c)) + + got, err := i.Search(tt.args.query, &tt.args.request) + require.NoError(t, err) + require.Equal(t, len(tt.want.Hits), len(got.Hits)) + + for len := range got.Hits { + require.Equal(t, tt.want.Hits[len].(map[string]interface{})["title"], got.Hits[len].(map[string]interface{})["title"]) + require.Equal(t, tt.want.Hits[len].(map[string]interface{})["book_id"], got.Hits[len].(map[string]interface{})["book_id"]) + } + require.Equal(t, tt.args.query, got.Query) + require.Equal(t, tt.want.HitsPerPage, got.HitsPerPage) + require.Equal(t, tt.want.Page, got.Page) + require.Equal(t, tt.want.TotalHits, got.TotalHits) + require.Equal(t, tt.want.TotalPages, got.TotalPages) + }) + } +} diff --git a/main_test.go b/main_test.go index e8c7cec7..c7dc028d 100644 --- a/main_test.go +++ b/main_test.go @@ -275,14 +275,14 @@ func TestMain(m *testing.M) { } func Test_deleteAllIndexes(t *testing.T) { - indexUIDs := []string{ + indexUIDS := []string{ "Test_deleteAllIndexes", "Test_deleteAllIndexes2", "Test_deleteAllIndexes3", } _, _ = deleteAllIndexes(defaultClient) - for _, uid := range indexUIDs { + for _, uid := range indexUIDS { task, err := defaultClient.CreateIndex(&IndexConfig{ Uid: uid, }) @@ -297,7 +297,7 @@ func Test_deleteAllIndexes(t *testing.T) { _, _ = deleteAllIndexes(defaultClient) - for _, uid := range indexUIDs { + for _, uid := range indexUIDS { resp, err := defaultClient.GetIndex(uid) if resp != nil { t.Fatal(resp) diff --git a/types.go b/types.go index a28cdf5b..8c22a3da 100644 --- a/types.go +++ b/types.go @@ -35,8 +35,8 @@ type IndexesResults struct { } type IndexesQuery struct { - Limit int64 `json:"limit,omitempty"` - Offset int64 `json:"offset,omitempty"` + Limit int64 + Offset int64 } // Settings is the type that represents the settings in Meilisearch @@ -130,38 +130,70 @@ type Task struct { StartedAt time.Time `json:"startedAt,omitempty"` FinishedAt time.Time `json:"finishedAt,omitempty"` Details Details `json:"details,omitempty"` + CanceledBy int64 `json:"canceledBy,omitempty"` } // TaskInfo indicates information regarding a task returned by an asynchronous method // // Documentation: https://docs.meilisearch.com/reference/api/tasks.html#tasks type TaskInfo struct { - Status TaskStatus `json:"status"` - TaskUID int64 `json:"taskUid,omitempty"` - IndexUID string `json:"indexUid"` - Type string `json:"type"` - Error meilisearchApiError `json:"error,omitempty"` - Duration string `json:"duration,omitempty"` - EnqueuedAt time.Time `json:"enqueuedAt"` - StartedAt time.Time `json:"startedAt,omitempty"` - FinishedAt time.Time `json:"finishedAt,omitempty"` - Details Details `json:"details,omitempty"` + Status TaskStatus `json:"status"` + TaskUID int64 `json:"taskUid"` + IndexUID string `json:"indexUid"` + Type string `json:"type"` + EnqueuedAt time.Time `json:"enqueuedAt"` } -// TasksQuery is the request body for list documents method +// TasksQuery is a list of filter available to send as query parameters type TasksQuery struct { - Limit int64 `json:"limit,omitempty"` - From int64 `json:"from,omitempty"` - IndexUID []string `json:"indexUid,omitempty"` - Status []string `json:"status,omitempty"` - Type []string `json:"type,omitempty"` + UIDS []int64 + Limit int64 + From int64 + IndexUIDS []string + Statuses []string + Types []string + CanceledBy []int64 + BeforeEnqueuedAt time.Time + AfterEnqueuedAt time.Time + BeforeStartedAt time.Time + AfterStartedAt time.Time + BeforeFinishedAt time.Time + AfterFinishedAt time.Time +} + +// CancelTasksQuery is a list of filter available to send as query parameters +type CancelTasksQuery struct { + UIDS []int64 + IndexUIDS []string + Statuses []string + Types []string + BeforeEnqueuedAt time.Time + AfterEnqueuedAt time.Time + BeforeStartedAt time.Time + AfterStartedAt time.Time +} + +// DeleteTasksQuery is a list of filter available to send as query parameters +type DeleteTasksQuery struct { + UIDS []int64 + IndexUIDS []string + Statuses []string + Types []string + CanceledBy []int64 + BeforeEnqueuedAt time.Time + AfterEnqueuedAt time.Time + BeforeStartedAt time.Time + AfterStartedAt time.Time + BeforeFinishedAt time.Time + AfterFinishedAt time.Time } type Details struct { - ReceivedDocuments int `json:"receivedDocuments,omitempty"` - IndexedDocuments int `json:"indexedDocuments,omitempty"` - DeletedDocuments int `json:"deletedDocuments,omitempty"` + ReceivedDocuments int64 `json:"receivedDocuments,omitempty"` + IndexedDocuments int64 `json:"indexedDocuments,omitempty"` + DeletedDocuments int64 `json:"deletedDocuments,omitempty"` PrimaryKey string `json:"primaryKey,omitempty"` + ProvidedIds int64 `json:"providedIds,omitempty"` RankingRules []string `json:"rankingRules,omitempty"` DistinctAttribute *string `json:"distinctAttribute,omitempty"` SearchableAttributes []string `json:"searchableAttributes,omitempty"` @@ -170,6 +202,14 @@ type Details struct { Synonyms map[string][]string `json:"synonyms,omitempty"` FilterableAttributes []string `json:"filterableAttributes,omitempty"` SortableAttributes []string `json:"sortableAttributes,omitempty"` + TypoTolerance *TypoTolerance `json:"typoTolerance,omitempty"` + Pagination *Pagination `json:"pagination,omitempty"` + Faceting *Faceting `json:"faceting,omitempty"` + MatchedTasks int64 `json:"matchedTasks,omitempty"` + CanceledTasks int64 `json:"canceledTasks,omitempty"` + DeletedTasks int64 `json:"deletedTasks,omitempty"` + OriginalFilter string `json:"originalFilter,omitempty"` + Swaps []SwapIndexesParams `json:"swaps,omitempty"` } // Return of multiple tasks is wrap in a TaskResult @@ -222,8 +262,8 @@ type KeysResults struct { } type KeysQuery struct { - Limit int64 `json:"limit,omitempty"` - Offset int64 `json:"offset,omitempty"` + Limit int64 + Offset int64 } // Information to create a tenant token @@ -273,17 +313,23 @@ type SearchRequest struct { Facets []string PlaceholderSearch bool Sort []string + HitsPerPage int64 + Page int64 } // SearchResponse is the response body for search method type SearchResponse struct { Hits []interface{} `json:"hits"` - EstimatedTotalHits int64 `json:"estimatedTotalHits"` - Offset int64 `json:"offset"` - Limit int64 `json:"limit"` + EstimatedTotalHits int64 `json:"estimatedTotalHits,omitempty"` + Offset int64 `json:"offset,omitempty"` + Limit int64 `json:"limit,omitempty"` ProcessingTimeMs int64 `json:"processingTimeMs"` Query string `json:"query"` FacetDistribution interface{} `json:"facetDistribution,omitempty"` + TotalHits int64 `json:"totalHits,omitempty"` + HitsPerPage int64 `json:"hitsPerPage,omitempty"` + Page int64 `json:"page,omitempty"` + TotalPages int64 `json:"totalPages,omitempty"` } // DocumentQuery is the request body get one documents method @@ -305,6 +351,10 @@ type DocumentsResult struct { Total int64 `json:"total"` } +type SwapIndexesParams struct { + Indexes []string `json:"indexes"` +} + // RawType is an alias for raw byte[] type RawType []byte diff --git a/types_easyjson.go b/types_easyjson.go index 99aa443b..56bd424e 100644 --- a/types_easyjson.go +++ b/types_easyjson.go @@ -587,79 +587,149 @@ func easyjson6601e8cdDecodeGithubComMeilisearchMeilisearchGo5(in *jlexer.Lexer, continue } switch key { - case "limit": - out.Limit = int64(in.Int64()) - case "from": - out.From = int64(in.Int64()) - case "indexUid": + case "UIDS": if in.IsNull() { in.Skip() - out.IndexUID = nil + out.UIDS = nil } else { in.Delim('[') - if out.IndexUID == nil { + if out.UIDS == nil { if !in.IsDelim(']') { - out.IndexUID = make([]string, 0, 4) + out.UIDS = make([]int64, 0, 8) } else { - out.IndexUID = []string{} + out.UIDS = []int64{} } } else { - out.IndexUID = (out.IndexUID)[:0] + out.UIDS = (out.UIDS)[:0] } for !in.IsDelim(']') { - var v7 string - v7 = string(in.String()) - out.IndexUID = append(out.IndexUID, v7) + var v7 int64 + v7 = int64(in.Int64()) + out.UIDS = append(out.UIDS, v7) in.WantComma() } in.Delim(']') } - case "status": + case "Limit": + out.Limit = int64(in.Int64()) + case "From": + out.From = int64(in.Int64()) + case "IndexUIDS": if in.IsNull() { in.Skip() - out.Status = nil + out.IndexUIDS = nil } else { in.Delim('[') - if out.Status == nil { + if out.IndexUIDS == nil { if !in.IsDelim(']') { - out.Status = make([]string, 0, 4) + out.IndexUIDS = make([]string, 0, 4) } else { - out.Status = []string{} + out.IndexUIDS = []string{} } } else { - out.Status = (out.Status)[:0] + out.IndexUIDS = (out.IndexUIDS)[:0] } for !in.IsDelim(']') { var v8 string v8 = string(in.String()) - out.Status = append(out.Status, v8) + out.IndexUIDS = append(out.IndexUIDS, v8) in.WantComma() } in.Delim(']') } - case "type": + case "Statuses": if in.IsNull() { in.Skip() - out.Type = nil + out.Statuses = nil } else { in.Delim('[') - if out.Type == nil { + if out.Statuses == nil { if !in.IsDelim(']') { - out.Type = make([]string, 0, 4) + out.Statuses = make([]string, 0, 4) } else { - out.Type = []string{} + out.Statuses = []string{} } } else { - out.Type = (out.Type)[:0] + out.Statuses = (out.Statuses)[:0] } for !in.IsDelim(']') { var v9 string v9 = string(in.String()) - out.Type = append(out.Type, v9) + out.Statuses = append(out.Statuses, v9) + in.WantComma() + } + in.Delim(']') + } + case "Types": + if in.IsNull() { + in.Skip() + out.Types = nil + } else { + in.Delim('[') + if out.Types == nil { + if !in.IsDelim(']') { + out.Types = make([]string, 0, 4) + } else { + out.Types = []string{} + } + } else { + out.Types = (out.Types)[:0] + } + for !in.IsDelim(']') { + var v10 string + v10 = string(in.String()) + out.Types = append(out.Types, v10) + in.WantComma() + } + in.Delim(']') + } + case "CanceledBy": + if in.IsNull() { + in.Skip() + out.CanceledBy = nil + } else { + in.Delim('[') + if out.CanceledBy == nil { + if !in.IsDelim(']') { + out.CanceledBy = make([]int64, 0, 8) + } else { + out.CanceledBy = []int64{} + } + } else { + out.CanceledBy = (out.CanceledBy)[:0] + } + for !in.IsDelim(']') { + var v11 int64 + v11 = int64(in.Int64()) + out.CanceledBy = append(out.CanceledBy, v11) in.WantComma() } in.Delim(']') } + case "BeforeEnqueuedAt": + if data := in.Raw(); in.Ok() { + in.AddError((out.BeforeEnqueuedAt).UnmarshalJSON(data)) + } + case "AfterEnqueuedAt": + if data := in.Raw(); in.Ok() { + in.AddError((out.AfterEnqueuedAt).UnmarshalJSON(data)) + } + case "BeforeStartedAt": + if data := in.Raw(); in.Ok() { + in.AddError((out.BeforeStartedAt).UnmarshalJSON(data)) + } + case "AfterStartedAt": + if data := in.Raw(); in.Ok() { + in.AddError((out.AfterStartedAt).UnmarshalJSON(data)) + } + case "BeforeFinishedAt": + if data := in.Raw(); in.Ok() { + in.AddError((out.BeforeFinishedAt).UnmarshalJSON(data)) + } + case "AfterFinishedAt": + if data := in.Raw(); in.Ok() { + in.AddError((out.AfterFinishedAt).UnmarshalJSON(data)) + } default: in.SkipRecursive() } @@ -674,79 +744,126 @@ func easyjson6601e8cdEncodeGithubComMeilisearchMeilisearchGo5(out *jwriter.Write out.RawByte('{') first := true _ = first - if in.Limit != 0 { - const prefix string = ",\"limit\":" - first = false + { + const prefix string = ",\"UIDS\":" out.RawString(prefix[1:]) - out.Int64(int64(in.Limit)) - } - if in.From != 0 { - const prefix string = ",\"from\":" - if first { - first = false - out.RawString(prefix[1:]) + if in.UIDS == nil && (out.Flags&jwriter.NilSliceAsEmpty) == 0 { + out.RawString("null") } else { - out.RawString(prefix) + out.RawByte('[') + for v12, v13 := range in.UIDS { + if v12 > 0 { + out.RawByte(',') + } + out.Int64(int64(v13)) + } + out.RawByte(']') } + } + { + const prefix string = ",\"Limit\":" + out.RawString(prefix) + out.Int64(int64(in.Limit)) + } + { + const prefix string = ",\"From\":" + out.RawString(prefix) out.Int64(int64(in.From)) } - if len(in.IndexUID) != 0 { - const prefix string = ",\"indexUid\":" - if first { - first = false - out.RawString(prefix[1:]) + { + const prefix string = ",\"IndexUIDS\":" + out.RawString(prefix) + if in.IndexUIDS == nil && (out.Flags&jwriter.NilSliceAsEmpty) == 0 { + out.RawString("null") } else { - out.RawString(prefix) - } - { out.RawByte('[') - for v10, v11 := range in.IndexUID { - if v10 > 0 { + for v14, v15 := range in.IndexUIDS { + if v14 > 0 { out.RawByte(',') } - out.String(string(v11)) + out.String(string(v15)) } out.RawByte(']') } } - if len(in.Status) != 0 { - const prefix string = ",\"status\":" - if first { - first = false - out.RawString(prefix[1:]) + { + const prefix string = ",\"Statuses\":" + out.RawString(prefix) + if in.Statuses == nil && (out.Flags&jwriter.NilSliceAsEmpty) == 0 { + out.RawString("null") } else { - out.RawString(prefix) - } - { out.RawByte('[') - for v12, v13 := range in.Status { - if v12 > 0 { + for v16, v17 := range in.Statuses { + if v16 > 0 { out.RawByte(',') } - out.String(string(v13)) + out.String(string(v17)) } out.RawByte(']') } } - if len(in.Type) != 0 { - const prefix string = ",\"type\":" - if first { - first = false - out.RawString(prefix[1:]) + { + const prefix string = ",\"Types\":" + out.RawString(prefix) + if in.Types == nil && (out.Flags&jwriter.NilSliceAsEmpty) == 0 { + out.RawString("null") } else { - out.RawString(prefix) + out.RawByte('[') + for v18, v19 := range in.Types { + if v18 > 0 { + out.RawByte(',') + } + out.String(string(v19)) + } + out.RawByte(']') } - { + } + { + const prefix string = ",\"CanceledBy\":" + out.RawString(prefix) + if in.CanceledBy == nil && (out.Flags&jwriter.NilSliceAsEmpty) == 0 { + out.RawString("null") + } else { out.RawByte('[') - for v14, v15 := range in.Type { - if v14 > 0 { + for v20, v21 := range in.CanceledBy { + if v20 > 0 { out.RawByte(',') } - out.String(string(v15)) + out.Int64(int64(v21)) } out.RawByte(']') } } + { + const prefix string = ",\"BeforeEnqueuedAt\":" + out.RawString(prefix) + out.Raw((in.BeforeEnqueuedAt).MarshalJSON()) + } + { + const prefix string = ",\"AfterEnqueuedAt\":" + out.RawString(prefix) + out.Raw((in.AfterEnqueuedAt).MarshalJSON()) + } + { + const prefix string = ",\"BeforeStartedAt\":" + out.RawString(prefix) + out.Raw((in.BeforeStartedAt).MarshalJSON()) + } + { + const prefix string = ",\"AfterStartedAt\":" + out.RawString(prefix) + out.Raw((in.AfterStartedAt).MarshalJSON()) + } + { + const prefix string = ",\"BeforeFinishedAt\":" + out.RawString(prefix) + out.Raw((in.BeforeFinishedAt).MarshalJSON()) + } + { + const prefix string = ",\"AfterFinishedAt\":" + out.RawString(prefix) + out.Raw((in.AfterFinishedAt).MarshalJSON()) + } out.RawByte('}') } @@ -808,9 +925,9 @@ func easyjson6601e8cdDecodeGithubComMeilisearchMeilisearchGo6(in *jlexer.Lexer, out.Results = (out.Results)[:0] } for !in.IsDelim(']') { - var v16 Task - (v16).UnmarshalEasyJSON(in) - out.Results = append(out.Results, v16) + var v22 Task + (v22).UnmarshalEasyJSON(in) + out.Results = append(out.Results, v22) in.WantComma() } in.Delim(']') @@ -842,11 +959,11 @@ func easyjson6601e8cdEncodeGithubComMeilisearchMeilisearchGo6(out *jwriter.Write out.RawString("null") } else { out.RawByte('[') - for v17, v18 := range in.Results { - if v17 > 0 { + for v23, v24 := range in.Results { + if v23 > 0 { out.RawByte(',') } - (v18).MarshalEasyJSON(out) + (v24).MarshalEasyJSON(out) } out.RawByte(']') } @@ -919,24 +1036,10 @@ func easyjson6601e8cdDecodeGithubComMeilisearchMeilisearchGo7(in *jlexer.Lexer, out.IndexUID = string(in.String()) case "type": out.Type = string(in.String()) - case "error": - easyjson6601e8cdDecodeGithubComMeilisearchMeilisearchGo8(in, &out.Error) - case "duration": - out.Duration = string(in.String()) case "enqueuedAt": if data := in.Raw(); in.Ok() { in.AddError((out.EnqueuedAt).UnmarshalJSON(data)) } - case "startedAt": - if data := in.Raw(); in.Ok() { - in.AddError((out.StartedAt).UnmarshalJSON(data)) - } - case "finishedAt": - if data := in.Raw(); in.Ok() { - in.AddError((out.FinishedAt).UnmarshalJSON(data)) - } - case "details": - (out.Details).UnmarshalEasyJSON(in) default: in.SkipRecursive() } @@ -956,7 +1059,7 @@ func easyjson6601e8cdEncodeGithubComMeilisearchMeilisearchGo7(out *jwriter.Write out.RawString(prefix[1:]) out.String(string(in.Status)) } - if in.TaskUID != 0 { + { const prefix string = ",\"taskUid\":" out.RawString(prefix) out.Int64(int64(in.TaskUID)) @@ -971,36 +1074,11 @@ func easyjson6601e8cdEncodeGithubComMeilisearchMeilisearchGo7(out *jwriter.Write out.RawString(prefix) out.String(string(in.Type)) } - if true { - const prefix string = ",\"error\":" - out.RawString(prefix) - easyjson6601e8cdEncodeGithubComMeilisearchMeilisearchGo8(out, in.Error) - } - if in.Duration != "" { - const prefix string = ",\"duration\":" - out.RawString(prefix) - out.String(string(in.Duration)) - } { const prefix string = ",\"enqueuedAt\":" out.RawString(prefix) out.Raw((in.EnqueuedAt).MarshalJSON()) } - if true { - const prefix string = ",\"startedAt\":" - out.RawString(prefix) - out.Raw((in.StartedAt).MarshalJSON()) - } - if true { - const prefix string = ",\"finishedAt\":" - out.RawString(prefix) - out.Raw((in.FinishedAt).MarshalJSON()) - } - if true { - const prefix string = ",\"details\":" - out.RawString(prefix) - (in.Details).MarshalEasyJSON(out) - } out.RawByte('}') } @@ -1027,70 +1105,7 @@ func (v *TaskInfo) UnmarshalJSON(data []byte) error { func (v *TaskInfo) UnmarshalEasyJSON(l *jlexer.Lexer) { easyjson6601e8cdDecodeGithubComMeilisearchMeilisearchGo7(l, v) } -func easyjson6601e8cdDecodeGithubComMeilisearchMeilisearchGo8(in *jlexer.Lexer, out *meilisearchApiError) { - isTopLevel := in.IsStart() - if in.IsNull() { - if isTopLevel { - in.Consumed() - } - in.Skip() - return - } - in.Delim('{') - for !in.IsDelim('}') { - key := in.UnsafeFieldName(false) - in.WantColon() - if in.IsNull() { - in.Skip() - in.WantComma() - continue - } - switch key { - case "message": - out.Message = string(in.String()) - case "code": - out.Code = string(in.String()) - case "type": - out.Type = string(in.String()) - case "link": - out.Link = string(in.String()) - default: - in.SkipRecursive() - } - in.WantComma() - } - in.Delim('}') - if isTopLevel { - in.Consumed() - } -} -func easyjson6601e8cdEncodeGithubComMeilisearchMeilisearchGo8(out *jwriter.Writer, in meilisearchApiError) { - out.RawByte('{') - first := true - _ = first - { - const prefix string = ",\"message\":" - out.RawString(prefix[1:]) - out.String(string(in.Message)) - } - { - const prefix string = ",\"code\":" - out.RawString(prefix) - out.String(string(in.Code)) - } - { - const prefix string = ",\"type\":" - out.RawString(prefix) - out.String(string(in.Type)) - } - { - const prefix string = ",\"link\":" - out.RawString(prefix) - out.String(string(in.Link)) - } - out.RawByte('}') -} -func easyjson6601e8cdDecodeGithubComMeilisearchMeilisearchGo9(in *jlexer.Lexer, out *Task) { +func easyjson6601e8cdDecodeGithubComMeilisearchMeilisearchGo8(in *jlexer.Lexer, out *Task) { isTopLevel := in.IsStart() if in.IsNull() { if isTopLevel { @@ -1120,7 +1135,7 @@ func easyjson6601e8cdDecodeGithubComMeilisearchMeilisearchGo9(in *jlexer.Lexer, case "type": out.Type = string(in.String()) case "error": - easyjson6601e8cdDecodeGithubComMeilisearchMeilisearchGo8(in, &out.Error) + easyjson6601e8cdDecodeGithubComMeilisearchMeilisearchGo9(in, &out.Error) case "duration": out.Duration = string(in.String()) case "enqueuedAt": @@ -1137,6 +1152,8 @@ func easyjson6601e8cdDecodeGithubComMeilisearchMeilisearchGo9(in *jlexer.Lexer, } case "details": (out.Details).UnmarshalEasyJSON(in) + case "canceledBy": + out.CanceledBy = int64(in.Int64()) default: in.SkipRecursive() } @@ -1147,7 +1164,7 @@ func easyjson6601e8cdDecodeGithubComMeilisearchMeilisearchGo9(in *jlexer.Lexer, in.Consumed() } } -func easyjson6601e8cdEncodeGithubComMeilisearchMeilisearchGo9(out *jwriter.Writer, in Task) { +func easyjson6601e8cdEncodeGithubComMeilisearchMeilisearchGo8(out *jwriter.Writer, in Task) { out.RawByte('{') first := true _ = first @@ -1179,7 +1196,7 @@ func easyjson6601e8cdEncodeGithubComMeilisearchMeilisearchGo9(out *jwriter.Write if true { const prefix string = ",\"error\":" out.RawString(prefix) - easyjson6601e8cdEncodeGithubComMeilisearchMeilisearchGo8(out, in.Error) + easyjson6601e8cdEncodeGithubComMeilisearchMeilisearchGo9(out, in.Error) } if in.Duration != "" { const prefix string = ",\"duration\":" @@ -1206,33 +1223,38 @@ func easyjson6601e8cdEncodeGithubComMeilisearchMeilisearchGo9(out *jwriter.Write out.RawString(prefix) (in.Details).MarshalEasyJSON(out) } + if in.CanceledBy != 0 { + const prefix string = ",\"canceledBy\":" + out.RawString(prefix) + out.Int64(int64(in.CanceledBy)) + } out.RawByte('}') } // MarshalJSON supports json.Marshaler interface func (v Task) MarshalJSON() ([]byte, error) { w := jwriter.Writer{} - easyjson6601e8cdEncodeGithubComMeilisearchMeilisearchGo9(&w, v) + easyjson6601e8cdEncodeGithubComMeilisearchMeilisearchGo8(&w, v) return w.Buffer.BuildBytes(), w.Error } // MarshalEasyJSON supports easyjson.Marshaler interface func (v Task) MarshalEasyJSON(w *jwriter.Writer) { - easyjson6601e8cdEncodeGithubComMeilisearchMeilisearchGo9(w, v) + easyjson6601e8cdEncodeGithubComMeilisearchMeilisearchGo8(w, v) } // UnmarshalJSON supports json.Unmarshaler interface func (v *Task) UnmarshalJSON(data []byte) error { r := jlexer.Lexer{Data: data} - easyjson6601e8cdDecodeGithubComMeilisearchMeilisearchGo9(&r, v) + easyjson6601e8cdDecodeGithubComMeilisearchMeilisearchGo8(&r, v) return r.Error() } // UnmarshalEasyJSON supports easyjson.Unmarshaler interface func (v *Task) UnmarshalEasyJSON(l *jlexer.Lexer) { - easyjson6601e8cdDecodeGithubComMeilisearchMeilisearchGo9(l, v) + easyjson6601e8cdDecodeGithubComMeilisearchMeilisearchGo8(l, v) } -func easyjson6601e8cdDecodeGithubComMeilisearchMeilisearchGo10(in *jlexer.Lexer, out *StatsIndex) { +func easyjson6601e8cdDecodeGithubComMeilisearchMeilisearchGo9(in *jlexer.Lexer, out *meilisearchApiError) { isTopLevel := in.IsStart() if in.IsNull() { if isTopLevel { @@ -1251,25 +1273,186 @@ func easyjson6601e8cdDecodeGithubComMeilisearchMeilisearchGo10(in *jlexer.Lexer, continue } switch key { - case "numberOfDocuments": - out.NumberOfDocuments = int64(in.Int64()) - case "isIndexing": - out.IsIndexing = bool(in.Bool()) - case "fieldDistribution": - if in.IsNull() { - in.Skip() - } else { - in.Delim('{') - out.FieldDistribution = make(map[string]int64) - for !in.IsDelim('}') { - key := string(in.String()) - in.WantColon() - var v19 int64 - v19 = int64(in.Int64()) - (out.FieldDistribution)[key] = v19 - in.WantComma() - } - in.Delim('}') + case "message": + out.Message = string(in.String()) + case "code": + out.Code = string(in.String()) + case "type": + out.Type = string(in.String()) + case "link": + out.Link = string(in.String()) + default: + in.SkipRecursive() + } + in.WantComma() + } + in.Delim('}') + if isTopLevel { + in.Consumed() + } +} +func easyjson6601e8cdEncodeGithubComMeilisearchMeilisearchGo9(out *jwriter.Writer, in meilisearchApiError) { + out.RawByte('{') + first := true + _ = first + { + const prefix string = ",\"message\":" + out.RawString(prefix[1:]) + out.String(string(in.Message)) + } + { + const prefix string = ",\"code\":" + out.RawString(prefix) + out.String(string(in.Code)) + } + { + const prefix string = ",\"type\":" + out.RawString(prefix) + out.String(string(in.Type)) + } + { + const prefix string = ",\"link\":" + out.RawString(prefix) + out.String(string(in.Link)) + } + out.RawByte('}') +} +func easyjson6601e8cdDecodeGithubComMeilisearchMeilisearchGo10(in *jlexer.Lexer, out *SwapIndexesParams) { + isTopLevel := in.IsStart() + if in.IsNull() { + if isTopLevel { + in.Consumed() + } + in.Skip() + return + } + in.Delim('{') + for !in.IsDelim('}') { + key := in.UnsafeFieldName(false) + in.WantColon() + if in.IsNull() { + in.Skip() + in.WantComma() + continue + } + switch key { + case "indexes": + if in.IsNull() { + in.Skip() + out.Indexes = nil + } else { + in.Delim('[') + if out.Indexes == nil { + if !in.IsDelim(']') { + out.Indexes = make([]string, 0, 4) + } else { + out.Indexes = []string{} + } + } else { + out.Indexes = (out.Indexes)[:0] + } + for !in.IsDelim(']') { + var v25 string + v25 = string(in.String()) + out.Indexes = append(out.Indexes, v25) + in.WantComma() + } + in.Delim(']') + } + default: + in.SkipRecursive() + } + in.WantComma() + } + in.Delim('}') + if isTopLevel { + in.Consumed() + } +} +func easyjson6601e8cdEncodeGithubComMeilisearchMeilisearchGo10(out *jwriter.Writer, in SwapIndexesParams) { + out.RawByte('{') + first := true + _ = first + { + const prefix string = ",\"indexes\":" + out.RawString(prefix[1:]) + if in.Indexes == nil && (out.Flags&jwriter.NilSliceAsEmpty) == 0 { + out.RawString("null") + } else { + out.RawByte('[') + for v26, v27 := range in.Indexes { + if v26 > 0 { + out.RawByte(',') + } + out.String(string(v27)) + } + out.RawByte(']') + } + } + out.RawByte('}') +} + +// MarshalJSON supports json.Marshaler interface +func (v SwapIndexesParams) MarshalJSON() ([]byte, error) { + w := jwriter.Writer{} + easyjson6601e8cdEncodeGithubComMeilisearchMeilisearchGo10(&w, v) + return w.Buffer.BuildBytes(), w.Error +} + +// MarshalEasyJSON supports easyjson.Marshaler interface +func (v SwapIndexesParams) MarshalEasyJSON(w *jwriter.Writer) { + easyjson6601e8cdEncodeGithubComMeilisearchMeilisearchGo10(w, v) +} + +// UnmarshalJSON supports json.Unmarshaler interface +func (v *SwapIndexesParams) UnmarshalJSON(data []byte) error { + r := jlexer.Lexer{Data: data} + easyjson6601e8cdDecodeGithubComMeilisearchMeilisearchGo10(&r, v) + return r.Error() +} + +// UnmarshalEasyJSON supports easyjson.Unmarshaler interface +func (v *SwapIndexesParams) UnmarshalEasyJSON(l *jlexer.Lexer) { + easyjson6601e8cdDecodeGithubComMeilisearchMeilisearchGo10(l, v) +} +func easyjson6601e8cdDecodeGithubComMeilisearchMeilisearchGo11(in *jlexer.Lexer, out *StatsIndex) { + isTopLevel := in.IsStart() + if in.IsNull() { + if isTopLevel { + in.Consumed() + } + in.Skip() + return + } + in.Delim('{') + for !in.IsDelim('}') { + key := in.UnsafeFieldName(false) + in.WantColon() + if in.IsNull() { + in.Skip() + in.WantComma() + continue + } + switch key { + case "numberOfDocuments": + out.NumberOfDocuments = int64(in.Int64()) + case "isIndexing": + out.IsIndexing = bool(in.Bool()) + case "fieldDistribution": + if in.IsNull() { + in.Skip() + } else { + in.Delim('{') + out.FieldDistribution = make(map[string]int64) + for !in.IsDelim('}') { + key := string(in.String()) + in.WantColon() + var v28 int64 + v28 = int64(in.Int64()) + (out.FieldDistribution)[key] = v28 + in.WantComma() + } + in.Delim('}') } default: in.SkipRecursive() @@ -1281,7 +1464,7 @@ func easyjson6601e8cdDecodeGithubComMeilisearchMeilisearchGo10(in *jlexer.Lexer, in.Consumed() } } -func easyjson6601e8cdEncodeGithubComMeilisearchMeilisearchGo10(out *jwriter.Writer, in StatsIndex) { +func easyjson6601e8cdEncodeGithubComMeilisearchMeilisearchGo11(out *jwriter.Writer, in StatsIndex) { out.RawByte('{') first := true _ = first @@ -1302,16 +1485,16 @@ func easyjson6601e8cdEncodeGithubComMeilisearchMeilisearchGo10(out *jwriter.Writ out.RawString(`null`) } else { out.RawByte('{') - v20First := true - for v20Name, v20Value := range in.FieldDistribution { - if v20First { - v20First = false + v29First := true + for v29Name, v29Value := range in.FieldDistribution { + if v29First { + v29First = false } else { out.RawByte(',') } - out.String(string(v20Name)) + out.String(string(v29Name)) out.RawByte(':') - out.Int64(int64(v20Value)) + out.Int64(int64(v29Value)) } out.RawByte('}') } @@ -1322,27 +1505,27 @@ func easyjson6601e8cdEncodeGithubComMeilisearchMeilisearchGo10(out *jwriter.Writ // MarshalJSON supports json.Marshaler interface func (v StatsIndex) MarshalJSON() ([]byte, error) { w := jwriter.Writer{} - easyjson6601e8cdEncodeGithubComMeilisearchMeilisearchGo10(&w, v) + easyjson6601e8cdEncodeGithubComMeilisearchMeilisearchGo11(&w, v) return w.Buffer.BuildBytes(), w.Error } // MarshalEasyJSON supports easyjson.Marshaler interface func (v StatsIndex) MarshalEasyJSON(w *jwriter.Writer) { - easyjson6601e8cdEncodeGithubComMeilisearchMeilisearchGo10(w, v) + easyjson6601e8cdEncodeGithubComMeilisearchMeilisearchGo11(w, v) } // UnmarshalJSON supports json.Unmarshaler interface func (v *StatsIndex) UnmarshalJSON(data []byte) error { r := jlexer.Lexer{Data: data} - easyjson6601e8cdDecodeGithubComMeilisearchMeilisearchGo10(&r, v) + easyjson6601e8cdDecodeGithubComMeilisearchMeilisearchGo11(&r, v) return r.Error() } // UnmarshalEasyJSON supports easyjson.Unmarshaler interface func (v *StatsIndex) UnmarshalEasyJSON(l *jlexer.Lexer) { - easyjson6601e8cdDecodeGithubComMeilisearchMeilisearchGo10(l, v) + easyjson6601e8cdDecodeGithubComMeilisearchMeilisearchGo11(l, v) } -func easyjson6601e8cdDecodeGithubComMeilisearchMeilisearchGo11(in *jlexer.Lexer, out *Stats) { +func easyjson6601e8cdDecodeGithubComMeilisearchMeilisearchGo12(in *jlexer.Lexer, out *Stats) { isTopLevel := in.IsStart() if in.IsNull() { if isTopLevel { @@ -1376,9 +1559,9 @@ func easyjson6601e8cdDecodeGithubComMeilisearchMeilisearchGo11(in *jlexer.Lexer, for !in.IsDelim('}') { key := string(in.String()) in.WantColon() - var v21 StatsIndex - (v21).UnmarshalEasyJSON(in) - (out.Indexes)[key] = v21 + var v30 StatsIndex + (v30).UnmarshalEasyJSON(in) + (out.Indexes)[key] = v30 in.WantComma() } in.Delim('}') @@ -1393,7 +1576,7 @@ func easyjson6601e8cdDecodeGithubComMeilisearchMeilisearchGo11(in *jlexer.Lexer, in.Consumed() } } -func easyjson6601e8cdEncodeGithubComMeilisearchMeilisearchGo11(out *jwriter.Writer, in Stats) { +func easyjson6601e8cdEncodeGithubComMeilisearchMeilisearchGo12(out *jwriter.Writer, in Stats) { out.RawByte('{') first := true _ = first @@ -1414,16 +1597,16 @@ func easyjson6601e8cdEncodeGithubComMeilisearchMeilisearchGo11(out *jwriter.Writ out.RawString(`null`) } else { out.RawByte('{') - v22First := true - for v22Name, v22Value := range in.Indexes { - if v22First { - v22First = false + v31First := true + for v31Name, v31Value := range in.Indexes { + if v31First { + v31First = false } else { out.RawByte(',') } - out.String(string(v22Name)) + out.String(string(v31Name)) out.RawByte(':') - (v22Value).MarshalEasyJSON(out) + (v31Value).MarshalEasyJSON(out) } out.RawByte('}') } @@ -1434,27 +1617,27 @@ func easyjson6601e8cdEncodeGithubComMeilisearchMeilisearchGo11(out *jwriter.Writ // MarshalJSON supports json.Marshaler interface func (v Stats) MarshalJSON() ([]byte, error) { w := jwriter.Writer{} - easyjson6601e8cdEncodeGithubComMeilisearchMeilisearchGo11(&w, v) + easyjson6601e8cdEncodeGithubComMeilisearchMeilisearchGo12(&w, v) return w.Buffer.BuildBytes(), w.Error } // MarshalEasyJSON supports easyjson.Marshaler interface func (v Stats) MarshalEasyJSON(w *jwriter.Writer) { - easyjson6601e8cdEncodeGithubComMeilisearchMeilisearchGo11(w, v) + easyjson6601e8cdEncodeGithubComMeilisearchMeilisearchGo12(w, v) } // UnmarshalJSON supports json.Unmarshaler interface func (v *Stats) UnmarshalJSON(data []byte) error { r := jlexer.Lexer{Data: data} - easyjson6601e8cdDecodeGithubComMeilisearchMeilisearchGo11(&r, v) + easyjson6601e8cdDecodeGithubComMeilisearchMeilisearchGo12(&r, v) return r.Error() } // UnmarshalEasyJSON supports easyjson.Unmarshaler interface func (v *Stats) UnmarshalEasyJSON(l *jlexer.Lexer) { - easyjson6601e8cdDecodeGithubComMeilisearchMeilisearchGo11(l, v) + easyjson6601e8cdDecodeGithubComMeilisearchMeilisearchGo12(l, v) } -func easyjson6601e8cdDecodeGithubComMeilisearchMeilisearchGo12(in *jlexer.Lexer, out *Settings) { +func easyjson6601e8cdDecodeGithubComMeilisearchMeilisearchGo13(in *jlexer.Lexer, out *Settings) { isTopLevel := in.IsStart() if in.IsNull() { if isTopLevel { @@ -1489,9 +1672,9 @@ func easyjson6601e8cdDecodeGithubComMeilisearchMeilisearchGo12(in *jlexer.Lexer, out.RankingRules = (out.RankingRules)[:0] } for !in.IsDelim(']') { - var v23 string - v23 = string(in.String()) - out.RankingRules = append(out.RankingRules, v23) + var v32 string + v32 = string(in.String()) + out.RankingRules = append(out.RankingRules, v32) in.WantComma() } in.Delim(']') @@ -1522,9 +1705,9 @@ func easyjson6601e8cdDecodeGithubComMeilisearchMeilisearchGo12(in *jlexer.Lexer, out.SearchableAttributes = (out.SearchableAttributes)[:0] } for !in.IsDelim(']') { - var v24 string - v24 = string(in.String()) - out.SearchableAttributes = append(out.SearchableAttributes, v24) + var v33 string + v33 = string(in.String()) + out.SearchableAttributes = append(out.SearchableAttributes, v33) in.WantComma() } in.Delim(']') @@ -1545,9 +1728,9 @@ func easyjson6601e8cdDecodeGithubComMeilisearchMeilisearchGo12(in *jlexer.Lexer, out.DisplayedAttributes = (out.DisplayedAttributes)[:0] } for !in.IsDelim(']') { - var v25 string - v25 = string(in.String()) - out.DisplayedAttributes = append(out.DisplayedAttributes, v25) + var v34 string + v34 = string(in.String()) + out.DisplayedAttributes = append(out.DisplayedAttributes, v34) in.WantComma() } in.Delim(']') @@ -1568,9 +1751,9 @@ func easyjson6601e8cdDecodeGithubComMeilisearchMeilisearchGo12(in *jlexer.Lexer, out.StopWords = (out.StopWords)[:0] } for !in.IsDelim(']') { - var v26 string - v26 = string(in.String()) - out.StopWords = append(out.StopWords, v26) + var v35 string + v35 = string(in.String()) + out.StopWords = append(out.StopWords, v35) in.WantComma() } in.Delim(']') @@ -1588,30 +1771,30 @@ func easyjson6601e8cdDecodeGithubComMeilisearchMeilisearchGo12(in *jlexer.Lexer, for !in.IsDelim('}') { key := string(in.String()) in.WantColon() - var v27 []string + var v36 []string if in.IsNull() { in.Skip() - v27 = nil + v36 = nil } else { in.Delim('[') - if v27 == nil { + if v36 == nil { if !in.IsDelim(']') { - v27 = make([]string, 0, 4) + v36 = make([]string, 0, 4) } else { - v27 = []string{} + v36 = []string{} } } else { - v27 = (v27)[:0] + v36 = (v36)[:0] } for !in.IsDelim(']') { - var v28 string - v28 = string(in.String()) - v27 = append(v27, v28) + var v37 string + v37 = string(in.String()) + v36 = append(v36, v37) in.WantComma() } in.Delim(']') } - (out.Synonyms)[key] = v27 + (out.Synonyms)[key] = v36 in.WantComma() } in.Delim('}') @@ -1632,9 +1815,9 @@ func easyjson6601e8cdDecodeGithubComMeilisearchMeilisearchGo12(in *jlexer.Lexer, out.FilterableAttributes = (out.FilterableAttributes)[:0] } for !in.IsDelim(']') { - var v29 string - v29 = string(in.String()) - out.FilterableAttributes = append(out.FilterableAttributes, v29) + var v38 string + v38 = string(in.String()) + out.FilterableAttributes = append(out.FilterableAttributes, v38) in.WantComma() } in.Delim(']') @@ -1655,9 +1838,9 @@ func easyjson6601e8cdDecodeGithubComMeilisearchMeilisearchGo12(in *jlexer.Lexer, out.SortableAttributes = (out.SortableAttributes)[:0] } for !in.IsDelim(']') { - var v30 string - v30 = string(in.String()) - out.SortableAttributes = append(out.SortableAttributes, v30) + var v39 string + v39 = string(in.String()) + out.SortableAttributes = append(out.SortableAttributes, v39) in.WantComma() } in.Delim(']') @@ -1702,7 +1885,7 @@ func easyjson6601e8cdDecodeGithubComMeilisearchMeilisearchGo12(in *jlexer.Lexer, in.Consumed() } } -func easyjson6601e8cdEncodeGithubComMeilisearchMeilisearchGo12(out *jwriter.Writer, in Settings) { +func easyjson6601e8cdEncodeGithubComMeilisearchMeilisearchGo13(out *jwriter.Writer, in Settings) { out.RawByte('{') first := true _ = first @@ -1712,11 +1895,11 @@ func easyjson6601e8cdEncodeGithubComMeilisearchMeilisearchGo12(out *jwriter.Writ out.RawString(prefix[1:]) { out.RawByte('[') - for v31, v32 := range in.RankingRules { - if v31 > 0 { + for v40, v41 := range in.RankingRules { + if v40 > 0 { out.RawByte(',') } - out.String(string(v32)) + out.String(string(v41)) } out.RawByte(']') } @@ -1741,11 +1924,11 @@ func easyjson6601e8cdEncodeGithubComMeilisearchMeilisearchGo12(out *jwriter.Writ } { out.RawByte('[') - for v33, v34 := range in.SearchableAttributes { - if v33 > 0 { + for v42, v43 := range in.SearchableAttributes { + if v42 > 0 { out.RawByte(',') } - out.String(string(v34)) + out.String(string(v43)) } out.RawByte(']') } @@ -1760,11 +1943,11 @@ func easyjson6601e8cdEncodeGithubComMeilisearchMeilisearchGo12(out *jwriter.Writ } { out.RawByte('[') - for v35, v36 := range in.DisplayedAttributes { - if v35 > 0 { + for v44, v45 := range in.DisplayedAttributes { + if v44 > 0 { out.RawByte(',') } - out.String(string(v36)) + out.String(string(v45)) } out.RawByte(']') } @@ -1779,11 +1962,11 @@ func easyjson6601e8cdEncodeGithubComMeilisearchMeilisearchGo12(out *jwriter.Writ } { out.RawByte('[') - for v37, v38 := range in.StopWords { - if v37 > 0 { + for v46, v47 := range in.StopWords { + if v46 > 0 { out.RawByte(',') } - out.String(string(v38)) + out.String(string(v47)) } out.RawByte(']') } @@ -1798,24 +1981,24 @@ func easyjson6601e8cdEncodeGithubComMeilisearchMeilisearchGo12(out *jwriter.Writ } { out.RawByte('{') - v39First := true - for v39Name, v39Value := range in.Synonyms { - if v39First { - v39First = false + v48First := true + for v48Name, v48Value := range in.Synonyms { + if v48First { + v48First = false } else { out.RawByte(',') } - out.String(string(v39Name)) + out.String(string(v48Name)) out.RawByte(':') - if v39Value == nil && (out.Flags&jwriter.NilSliceAsEmpty) == 0 { + if v48Value == nil && (out.Flags&jwriter.NilSliceAsEmpty) == 0 { out.RawString("null") } else { out.RawByte('[') - for v40, v41 := range v39Value { - if v40 > 0 { + for v49, v50 := range v48Value { + if v49 > 0 { out.RawByte(',') } - out.String(string(v41)) + out.String(string(v50)) } out.RawByte(']') } @@ -1833,11 +2016,11 @@ func easyjson6601e8cdEncodeGithubComMeilisearchMeilisearchGo12(out *jwriter.Writ } { out.RawByte('[') - for v42, v43 := range in.FilterableAttributes { - if v42 > 0 { + for v51, v52 := range in.FilterableAttributes { + if v51 > 0 { out.RawByte(',') } - out.String(string(v43)) + out.String(string(v52)) } out.RawByte(']') } @@ -1852,11 +2035,11 @@ func easyjson6601e8cdEncodeGithubComMeilisearchMeilisearchGo12(out *jwriter.Writ } { out.RawByte('[') - for v44, v45 := range in.SortableAttributes { - if v44 > 0 { + for v53, v54 := range in.SortableAttributes { + if v53 > 0 { out.RawByte(',') } - out.String(string(v45)) + out.String(string(v54)) } out.RawByte(']') } @@ -1897,27 +2080,27 @@ func easyjson6601e8cdEncodeGithubComMeilisearchMeilisearchGo12(out *jwriter.Writ // MarshalJSON supports json.Marshaler interface func (v Settings) MarshalJSON() ([]byte, error) { w := jwriter.Writer{} - easyjson6601e8cdEncodeGithubComMeilisearchMeilisearchGo12(&w, v) + easyjson6601e8cdEncodeGithubComMeilisearchMeilisearchGo13(&w, v) return w.Buffer.BuildBytes(), w.Error } // MarshalEasyJSON supports easyjson.Marshaler interface func (v Settings) MarshalEasyJSON(w *jwriter.Writer) { - easyjson6601e8cdEncodeGithubComMeilisearchMeilisearchGo12(w, v) + easyjson6601e8cdEncodeGithubComMeilisearchMeilisearchGo13(w, v) } // UnmarshalJSON supports json.Unmarshaler interface func (v *Settings) UnmarshalJSON(data []byte) error { r := jlexer.Lexer{Data: data} - easyjson6601e8cdDecodeGithubComMeilisearchMeilisearchGo12(&r, v) + easyjson6601e8cdDecodeGithubComMeilisearchMeilisearchGo13(&r, v) return r.Error() } // UnmarshalEasyJSON supports easyjson.Unmarshaler interface func (v *Settings) UnmarshalEasyJSON(l *jlexer.Lexer) { - easyjson6601e8cdDecodeGithubComMeilisearchMeilisearchGo12(l, v) + easyjson6601e8cdDecodeGithubComMeilisearchMeilisearchGo13(l, v) } -func easyjson6601e8cdDecodeGithubComMeilisearchMeilisearchGo13(in *jlexer.Lexer, out *SearchResponse) { +func easyjson6601e8cdDecodeGithubComMeilisearchMeilisearchGo14(in *jlexer.Lexer, out *SearchResponse) { isTopLevel := in.IsStart() if in.IsNull() { if isTopLevel { @@ -1952,15 +2135,15 @@ func easyjson6601e8cdDecodeGithubComMeilisearchMeilisearchGo13(in *jlexer.Lexer, out.Hits = (out.Hits)[:0] } for !in.IsDelim(']') { - var v46 interface{} - if m, ok := v46.(easyjson.Unmarshaler); ok { + var v55 interface{} + if m, ok := v55.(easyjson.Unmarshaler); ok { m.UnmarshalEasyJSON(in) - } else if m, ok := v46.(json.Unmarshaler); ok { + } else if m, ok := v55.(json.Unmarshaler); ok { _ = m.UnmarshalJSON(in.Raw()) } else { - v46 = in.Interface() + v55 = in.Interface() } - out.Hits = append(out.Hits, v46) + out.Hits = append(out.Hits, v55) in.WantComma() } in.Delim(']') @@ -1983,6 +2166,14 @@ func easyjson6601e8cdDecodeGithubComMeilisearchMeilisearchGo13(in *jlexer.Lexer, } else { out.FacetDistribution = in.Interface() } + case "totalHits": + out.TotalHits = int64(in.Int64()) + case "hitsPerPage": + out.HitsPerPage = int64(in.Int64()) + case "page": + out.Page = int64(in.Int64()) + case "totalPages": + out.TotalPages = int64(in.Int64()) default: in.SkipRecursive() } @@ -1993,7 +2184,7 @@ func easyjson6601e8cdDecodeGithubComMeilisearchMeilisearchGo13(in *jlexer.Lexer, in.Consumed() } } -func easyjson6601e8cdEncodeGithubComMeilisearchMeilisearchGo13(out *jwriter.Writer, in SearchResponse) { +func easyjson6601e8cdEncodeGithubComMeilisearchMeilisearchGo14(out *jwriter.Writer, in SearchResponse) { out.RawByte('{') first := true _ = first @@ -2004,32 +2195,32 @@ func easyjson6601e8cdEncodeGithubComMeilisearchMeilisearchGo13(out *jwriter.Writ out.RawString("null") } else { out.RawByte('[') - for v47, v48 := range in.Hits { - if v47 > 0 { + for v56, v57 := range in.Hits { + if v56 > 0 { out.RawByte(',') } - if m, ok := v48.(easyjson.Marshaler); ok { + if m, ok := v57.(easyjson.Marshaler); ok { m.MarshalEasyJSON(out) - } else if m, ok := v48.(json.Marshaler); ok { + } else if m, ok := v57.(json.Marshaler); ok { out.Raw(m.MarshalJSON()) } else { - out.Raw(json.Marshal(v48)) + out.Raw(json.Marshal(v57)) } } out.RawByte(']') } } - { + if in.EstimatedTotalHits != 0 { const prefix string = ",\"estimatedTotalHits\":" out.RawString(prefix) out.Int64(int64(in.EstimatedTotalHits)) } - { + if in.Offset != 0 { const prefix string = ",\"offset\":" out.RawString(prefix) out.Int64(int64(in.Offset)) } - { + if in.Limit != 0 { const prefix string = ",\"limit\":" out.RawString(prefix) out.Int64(int64(in.Limit)) @@ -2055,33 +2246,53 @@ func easyjson6601e8cdEncodeGithubComMeilisearchMeilisearchGo13(out *jwriter.Writ out.Raw(json.Marshal(in.FacetDistribution)) } } + if in.TotalHits != 0 { + const prefix string = ",\"totalHits\":" + out.RawString(prefix) + out.Int64(int64(in.TotalHits)) + } + if in.HitsPerPage != 0 { + const prefix string = ",\"hitsPerPage\":" + out.RawString(prefix) + out.Int64(int64(in.HitsPerPage)) + } + if in.Page != 0 { + const prefix string = ",\"page\":" + out.RawString(prefix) + out.Int64(int64(in.Page)) + } + if in.TotalPages != 0 { + const prefix string = ",\"totalPages\":" + out.RawString(prefix) + out.Int64(int64(in.TotalPages)) + } out.RawByte('}') } // MarshalJSON supports json.Marshaler interface func (v SearchResponse) MarshalJSON() ([]byte, error) { w := jwriter.Writer{} - easyjson6601e8cdEncodeGithubComMeilisearchMeilisearchGo13(&w, v) + easyjson6601e8cdEncodeGithubComMeilisearchMeilisearchGo14(&w, v) return w.Buffer.BuildBytes(), w.Error } // MarshalEasyJSON supports easyjson.Marshaler interface func (v SearchResponse) MarshalEasyJSON(w *jwriter.Writer) { - easyjson6601e8cdEncodeGithubComMeilisearchMeilisearchGo13(w, v) + easyjson6601e8cdEncodeGithubComMeilisearchMeilisearchGo14(w, v) } // UnmarshalJSON supports json.Unmarshaler interface func (v *SearchResponse) UnmarshalJSON(data []byte) error { r := jlexer.Lexer{Data: data} - easyjson6601e8cdDecodeGithubComMeilisearchMeilisearchGo13(&r, v) + easyjson6601e8cdDecodeGithubComMeilisearchMeilisearchGo14(&r, v) return r.Error() } // UnmarshalEasyJSON supports easyjson.Unmarshaler interface func (v *SearchResponse) UnmarshalEasyJSON(l *jlexer.Lexer) { - easyjson6601e8cdDecodeGithubComMeilisearchMeilisearchGo13(l, v) + easyjson6601e8cdDecodeGithubComMeilisearchMeilisearchGo14(l, v) } -func easyjson6601e8cdDecodeGithubComMeilisearchMeilisearchGo14(in *jlexer.Lexer, out *SearchRequest) { +func easyjson6601e8cdDecodeGithubComMeilisearchMeilisearchGo15(in *jlexer.Lexer, out *SearchRequest) { isTopLevel := in.IsStart() if in.IsNull() { if isTopLevel { @@ -2120,9 +2331,9 @@ func easyjson6601e8cdDecodeGithubComMeilisearchMeilisearchGo14(in *jlexer.Lexer, out.AttributesToRetrieve = (out.AttributesToRetrieve)[:0] } for !in.IsDelim(']') { - var v49 string - v49 = string(in.String()) - out.AttributesToRetrieve = append(out.AttributesToRetrieve, v49) + var v58 string + v58 = string(in.String()) + out.AttributesToRetrieve = append(out.AttributesToRetrieve, v58) in.WantComma() } in.Delim(']') @@ -2143,9 +2354,9 @@ func easyjson6601e8cdDecodeGithubComMeilisearchMeilisearchGo14(in *jlexer.Lexer, out.AttributesToCrop = (out.AttributesToCrop)[:0] } for !in.IsDelim(']') { - var v50 string - v50 = string(in.String()) - out.AttributesToCrop = append(out.AttributesToCrop, v50) + var v59 string + v59 = string(in.String()) + out.AttributesToCrop = append(out.AttributesToCrop, v59) in.WantComma() } in.Delim(']') @@ -2170,9 +2381,9 @@ func easyjson6601e8cdDecodeGithubComMeilisearchMeilisearchGo14(in *jlexer.Lexer, out.AttributesToHighlight = (out.AttributesToHighlight)[:0] } for !in.IsDelim(']') { - var v51 string - v51 = string(in.String()) - out.AttributesToHighlight = append(out.AttributesToHighlight, v51) + var v60 string + v60 = string(in.String()) + out.AttributesToHighlight = append(out.AttributesToHighlight, v60) in.WantComma() } in.Delim(']') @@ -2209,9 +2420,9 @@ func easyjson6601e8cdDecodeGithubComMeilisearchMeilisearchGo14(in *jlexer.Lexer, out.Facets = (out.Facets)[:0] } for !in.IsDelim(']') { - var v52 string - v52 = string(in.String()) - out.Facets = append(out.Facets, v52) + var v61 string + v61 = string(in.String()) + out.Facets = append(out.Facets, v61) in.WantComma() } in.Delim(']') @@ -2234,13 +2445,17 @@ func easyjson6601e8cdDecodeGithubComMeilisearchMeilisearchGo14(in *jlexer.Lexer, out.Sort = (out.Sort)[:0] } for !in.IsDelim(']') { - var v53 string - v53 = string(in.String()) - out.Sort = append(out.Sort, v53) + var v62 string + v62 = string(in.String()) + out.Sort = append(out.Sort, v62) in.WantComma() } in.Delim(']') } + case "HitsPerPage": + out.HitsPerPage = int64(in.Int64()) + case "Page": + out.Page = int64(in.Int64()) default: in.SkipRecursive() } @@ -2251,7 +2466,7 @@ func easyjson6601e8cdDecodeGithubComMeilisearchMeilisearchGo14(in *jlexer.Lexer, in.Consumed() } } -func easyjson6601e8cdEncodeGithubComMeilisearchMeilisearchGo14(out *jwriter.Writer, in SearchRequest) { +func easyjson6601e8cdEncodeGithubComMeilisearchMeilisearchGo15(out *jwriter.Writer, in SearchRequest) { out.RawByte('{') first := true _ = first @@ -2272,11 +2487,11 @@ func easyjson6601e8cdEncodeGithubComMeilisearchMeilisearchGo14(out *jwriter.Writ out.RawString("null") } else { out.RawByte('[') - for v54, v55 := range in.AttributesToRetrieve { - if v54 > 0 { + for v63, v64 := range in.AttributesToRetrieve { + if v63 > 0 { out.RawByte(',') } - out.String(string(v55)) + out.String(string(v64)) } out.RawByte(']') } @@ -2288,11 +2503,11 @@ func easyjson6601e8cdEncodeGithubComMeilisearchMeilisearchGo14(out *jwriter.Writ out.RawString("null") } else { out.RawByte('[') - for v56, v57 := range in.AttributesToCrop { - if v56 > 0 { + for v65, v66 := range in.AttributesToCrop { + if v65 > 0 { out.RawByte(',') } - out.String(string(v57)) + out.String(string(v66)) } out.RawByte(']') } @@ -2314,11 +2529,11 @@ func easyjson6601e8cdEncodeGithubComMeilisearchMeilisearchGo14(out *jwriter.Writ out.RawString("null") } else { out.RawByte('[') - for v58, v59 := range in.AttributesToHighlight { - if v58 > 0 { + for v67, v68 := range in.AttributesToHighlight { + if v67 > 0 { out.RawByte(',') } - out.String(string(v59)) + out.String(string(v68)) } out.RawByte(']') } @@ -2361,11 +2576,11 @@ func easyjson6601e8cdEncodeGithubComMeilisearchMeilisearchGo14(out *jwriter.Writ out.RawString("null") } else { out.RawByte('[') - for v60, v61 := range in.Facets { - if v60 > 0 { + for v69, v70 := range in.Facets { + if v69 > 0 { out.RawByte(',') } - out.String(string(v61)) + out.String(string(v70)) } out.RawByte(']') } @@ -2382,42 +2597,52 @@ func easyjson6601e8cdEncodeGithubComMeilisearchMeilisearchGo14(out *jwriter.Writ out.RawString("null") } else { out.RawByte('[') - for v62, v63 := range in.Sort { - if v62 > 0 { + for v71, v72 := range in.Sort { + if v71 > 0 { out.RawByte(',') } - out.String(string(v63)) + out.String(string(v72)) } out.RawByte(']') } } + { + const prefix string = ",\"HitsPerPage\":" + out.RawString(prefix) + out.Int64(int64(in.HitsPerPage)) + } + { + const prefix string = ",\"Page\":" + out.RawString(prefix) + out.Int64(int64(in.Page)) + } out.RawByte('}') } // MarshalJSON supports json.Marshaler interface func (v SearchRequest) MarshalJSON() ([]byte, error) { w := jwriter.Writer{} - easyjson6601e8cdEncodeGithubComMeilisearchMeilisearchGo14(&w, v) + easyjson6601e8cdEncodeGithubComMeilisearchMeilisearchGo15(&w, v) return w.Buffer.BuildBytes(), w.Error } // MarshalEasyJSON supports easyjson.Marshaler interface func (v SearchRequest) MarshalEasyJSON(w *jwriter.Writer) { - easyjson6601e8cdEncodeGithubComMeilisearchMeilisearchGo14(w, v) + easyjson6601e8cdEncodeGithubComMeilisearchMeilisearchGo15(w, v) } // UnmarshalJSON supports json.Unmarshaler interface func (v *SearchRequest) UnmarshalJSON(data []byte) error { r := jlexer.Lexer{Data: data} - easyjson6601e8cdDecodeGithubComMeilisearchMeilisearchGo14(&r, v) + easyjson6601e8cdDecodeGithubComMeilisearchMeilisearchGo15(&r, v) return r.Error() } // UnmarshalEasyJSON supports easyjson.Unmarshaler interface func (v *SearchRequest) UnmarshalEasyJSON(l *jlexer.Lexer) { - easyjson6601e8cdDecodeGithubComMeilisearchMeilisearchGo14(l, v) + easyjson6601e8cdDecodeGithubComMeilisearchMeilisearchGo15(l, v) } -func easyjson6601e8cdDecodeGithubComMeilisearchMeilisearchGo15(in *jlexer.Lexer, out *Pagination) { +func easyjson6601e8cdDecodeGithubComMeilisearchMeilisearchGo16(in *jlexer.Lexer, out *Pagination) { isTopLevel := in.IsStart() if in.IsNull() { if isTopLevel { @@ -2448,7 +2673,7 @@ func easyjson6601e8cdDecodeGithubComMeilisearchMeilisearchGo15(in *jlexer.Lexer, in.Consumed() } } -func easyjson6601e8cdEncodeGithubComMeilisearchMeilisearchGo15(out *jwriter.Writer, in Pagination) { +func easyjson6601e8cdEncodeGithubComMeilisearchMeilisearchGo16(out *jwriter.Writer, in Pagination) { out.RawByte('{') first := true _ = first @@ -2463,27 +2688,27 @@ func easyjson6601e8cdEncodeGithubComMeilisearchMeilisearchGo15(out *jwriter.Writ // MarshalJSON supports json.Marshaler interface func (v Pagination) MarshalJSON() ([]byte, error) { w := jwriter.Writer{} - easyjson6601e8cdEncodeGithubComMeilisearchMeilisearchGo15(&w, v) + easyjson6601e8cdEncodeGithubComMeilisearchMeilisearchGo16(&w, v) return w.Buffer.BuildBytes(), w.Error } // MarshalEasyJSON supports easyjson.Marshaler interface func (v Pagination) MarshalEasyJSON(w *jwriter.Writer) { - easyjson6601e8cdEncodeGithubComMeilisearchMeilisearchGo15(w, v) + easyjson6601e8cdEncodeGithubComMeilisearchMeilisearchGo16(w, v) } // UnmarshalJSON supports json.Unmarshaler interface func (v *Pagination) UnmarshalJSON(data []byte) error { r := jlexer.Lexer{Data: data} - easyjson6601e8cdDecodeGithubComMeilisearchMeilisearchGo15(&r, v) + easyjson6601e8cdDecodeGithubComMeilisearchMeilisearchGo16(&r, v) return r.Error() } // UnmarshalEasyJSON supports easyjson.Unmarshaler interface func (v *Pagination) UnmarshalEasyJSON(l *jlexer.Lexer) { - easyjson6601e8cdDecodeGithubComMeilisearchMeilisearchGo15(l, v) + easyjson6601e8cdDecodeGithubComMeilisearchMeilisearchGo16(l, v) } -func easyjson6601e8cdDecodeGithubComMeilisearchMeilisearchGo16(in *jlexer.Lexer, out *MinWordSizeForTypos) { +func easyjson6601e8cdDecodeGithubComMeilisearchMeilisearchGo17(in *jlexer.Lexer, out *MinWordSizeForTypos) { isTopLevel := in.IsStart() if in.IsNull() { if isTopLevel { @@ -2516,7 +2741,7 @@ func easyjson6601e8cdDecodeGithubComMeilisearchMeilisearchGo16(in *jlexer.Lexer, in.Consumed() } } -func easyjson6601e8cdEncodeGithubComMeilisearchMeilisearchGo16(out *jwriter.Writer, in MinWordSizeForTypos) { +func easyjson6601e8cdEncodeGithubComMeilisearchMeilisearchGo17(out *jwriter.Writer, in MinWordSizeForTypos) { out.RawByte('{') first := true _ = first @@ -2542,27 +2767,27 @@ func easyjson6601e8cdEncodeGithubComMeilisearchMeilisearchGo16(out *jwriter.Writ // MarshalJSON supports json.Marshaler interface func (v MinWordSizeForTypos) MarshalJSON() ([]byte, error) { w := jwriter.Writer{} - easyjson6601e8cdEncodeGithubComMeilisearchMeilisearchGo16(&w, v) + easyjson6601e8cdEncodeGithubComMeilisearchMeilisearchGo17(&w, v) return w.Buffer.BuildBytes(), w.Error } // MarshalEasyJSON supports easyjson.Marshaler interface func (v MinWordSizeForTypos) MarshalEasyJSON(w *jwriter.Writer) { - easyjson6601e8cdEncodeGithubComMeilisearchMeilisearchGo16(w, v) + easyjson6601e8cdEncodeGithubComMeilisearchMeilisearchGo17(w, v) } // UnmarshalJSON supports json.Unmarshaler interface func (v *MinWordSizeForTypos) UnmarshalJSON(data []byte) error { r := jlexer.Lexer{Data: data} - easyjson6601e8cdDecodeGithubComMeilisearchMeilisearchGo16(&r, v) + easyjson6601e8cdDecodeGithubComMeilisearchMeilisearchGo17(&r, v) return r.Error() } // UnmarshalEasyJSON supports easyjson.Unmarshaler interface func (v *MinWordSizeForTypos) UnmarshalEasyJSON(l *jlexer.Lexer) { - easyjson6601e8cdDecodeGithubComMeilisearchMeilisearchGo16(l, v) + easyjson6601e8cdDecodeGithubComMeilisearchMeilisearchGo17(l, v) } -func easyjson6601e8cdDecodeGithubComMeilisearchMeilisearchGo17(in *jlexer.Lexer, out *KeysResults) { +func easyjson6601e8cdDecodeGithubComMeilisearchMeilisearchGo18(in *jlexer.Lexer, out *KeysResults) { isTopLevel := in.IsStart() if in.IsNull() { if isTopLevel { @@ -2597,9 +2822,9 @@ func easyjson6601e8cdDecodeGithubComMeilisearchMeilisearchGo17(in *jlexer.Lexer, out.Results = (out.Results)[:0] } for !in.IsDelim(']') { - var v64 Key - (v64).UnmarshalEasyJSON(in) - out.Results = append(out.Results, v64) + var v73 Key + (v73).UnmarshalEasyJSON(in) + out.Results = append(out.Results, v73) in.WantComma() } in.Delim(']') @@ -2620,7 +2845,7 @@ func easyjson6601e8cdDecodeGithubComMeilisearchMeilisearchGo17(in *jlexer.Lexer, in.Consumed() } } -func easyjson6601e8cdEncodeGithubComMeilisearchMeilisearchGo17(out *jwriter.Writer, in KeysResults) { +func easyjson6601e8cdEncodeGithubComMeilisearchMeilisearchGo18(out *jwriter.Writer, in KeysResults) { out.RawByte('{') first := true _ = first @@ -2631,11 +2856,11 @@ func easyjson6601e8cdEncodeGithubComMeilisearchMeilisearchGo17(out *jwriter.Writ out.RawString("null") } else { out.RawByte('[') - for v65, v66 := range in.Results { - if v65 > 0 { + for v74, v75 := range in.Results { + if v74 > 0 { out.RawByte(',') } - (v66).MarshalEasyJSON(out) + (v75).MarshalEasyJSON(out) } out.RawByte(']') } @@ -2661,27 +2886,27 @@ func easyjson6601e8cdEncodeGithubComMeilisearchMeilisearchGo17(out *jwriter.Writ // MarshalJSON supports json.Marshaler interface func (v KeysResults) MarshalJSON() ([]byte, error) { w := jwriter.Writer{} - easyjson6601e8cdEncodeGithubComMeilisearchMeilisearchGo17(&w, v) + easyjson6601e8cdEncodeGithubComMeilisearchMeilisearchGo18(&w, v) return w.Buffer.BuildBytes(), w.Error } // MarshalEasyJSON supports easyjson.Marshaler interface func (v KeysResults) MarshalEasyJSON(w *jwriter.Writer) { - easyjson6601e8cdEncodeGithubComMeilisearchMeilisearchGo17(w, v) + easyjson6601e8cdEncodeGithubComMeilisearchMeilisearchGo18(w, v) } // UnmarshalJSON supports json.Unmarshaler interface func (v *KeysResults) UnmarshalJSON(data []byte) error { r := jlexer.Lexer{Data: data} - easyjson6601e8cdDecodeGithubComMeilisearchMeilisearchGo17(&r, v) + easyjson6601e8cdDecodeGithubComMeilisearchMeilisearchGo18(&r, v) return r.Error() } // UnmarshalEasyJSON supports easyjson.Unmarshaler interface func (v *KeysResults) UnmarshalEasyJSON(l *jlexer.Lexer) { - easyjson6601e8cdDecodeGithubComMeilisearchMeilisearchGo17(l, v) + easyjson6601e8cdDecodeGithubComMeilisearchMeilisearchGo18(l, v) } -func easyjson6601e8cdDecodeGithubComMeilisearchMeilisearchGo18(in *jlexer.Lexer, out *KeysQuery) { +func easyjson6601e8cdDecodeGithubComMeilisearchMeilisearchGo19(in *jlexer.Lexer, out *KeysQuery) { isTopLevel := in.IsStart() if in.IsNull() { if isTopLevel { @@ -2700,9 +2925,9 @@ func easyjson6601e8cdDecodeGithubComMeilisearchMeilisearchGo18(in *jlexer.Lexer, continue } switch key { - case "limit": + case "Limit": out.Limit = int64(in.Int64()) - case "offset": + case "Offset": out.Offset = int64(in.Int64()) default: in.SkipRecursive() @@ -2714,24 +2939,18 @@ func easyjson6601e8cdDecodeGithubComMeilisearchMeilisearchGo18(in *jlexer.Lexer, in.Consumed() } } -func easyjson6601e8cdEncodeGithubComMeilisearchMeilisearchGo18(out *jwriter.Writer, in KeysQuery) { +func easyjson6601e8cdEncodeGithubComMeilisearchMeilisearchGo19(out *jwriter.Writer, in KeysQuery) { out.RawByte('{') first := true _ = first - if in.Limit != 0 { - const prefix string = ",\"limit\":" - first = false + { + const prefix string = ",\"Limit\":" out.RawString(prefix[1:]) out.Int64(int64(in.Limit)) } - if in.Offset != 0 { - const prefix string = ",\"offset\":" - if first { - first = false - out.RawString(prefix[1:]) - } else { - out.RawString(prefix) - } + { + const prefix string = ",\"Offset\":" + out.RawString(prefix) out.Int64(int64(in.Offset)) } out.RawByte('}') @@ -2740,27 +2959,27 @@ func easyjson6601e8cdEncodeGithubComMeilisearchMeilisearchGo18(out *jwriter.Writ // MarshalJSON supports json.Marshaler interface func (v KeysQuery) MarshalJSON() ([]byte, error) { w := jwriter.Writer{} - easyjson6601e8cdEncodeGithubComMeilisearchMeilisearchGo18(&w, v) + easyjson6601e8cdEncodeGithubComMeilisearchMeilisearchGo19(&w, v) return w.Buffer.BuildBytes(), w.Error } // MarshalEasyJSON supports easyjson.Marshaler interface func (v KeysQuery) MarshalEasyJSON(w *jwriter.Writer) { - easyjson6601e8cdEncodeGithubComMeilisearchMeilisearchGo18(w, v) + easyjson6601e8cdEncodeGithubComMeilisearchMeilisearchGo19(w, v) } // UnmarshalJSON supports json.Unmarshaler interface func (v *KeysQuery) UnmarshalJSON(data []byte) error { r := jlexer.Lexer{Data: data} - easyjson6601e8cdDecodeGithubComMeilisearchMeilisearchGo18(&r, v) + easyjson6601e8cdDecodeGithubComMeilisearchMeilisearchGo19(&r, v) return r.Error() } // UnmarshalEasyJSON supports easyjson.Unmarshaler interface func (v *KeysQuery) UnmarshalEasyJSON(l *jlexer.Lexer) { - easyjson6601e8cdDecodeGithubComMeilisearchMeilisearchGo18(l, v) + easyjson6601e8cdDecodeGithubComMeilisearchMeilisearchGo19(l, v) } -func easyjson6601e8cdDecodeGithubComMeilisearchMeilisearchGo19(in *jlexer.Lexer, out *KeyUpdate) { +func easyjson6601e8cdDecodeGithubComMeilisearchMeilisearchGo20(in *jlexer.Lexer, out *KeyUpdate) { isTopLevel := in.IsStart() if in.IsNull() { if isTopLevel { @@ -2793,7 +3012,7 @@ func easyjson6601e8cdDecodeGithubComMeilisearchMeilisearchGo19(in *jlexer.Lexer, in.Consumed() } } -func easyjson6601e8cdEncodeGithubComMeilisearchMeilisearchGo19(out *jwriter.Writer, in KeyUpdate) { +func easyjson6601e8cdEncodeGithubComMeilisearchMeilisearchGo20(out *jwriter.Writer, in KeyUpdate) { out.RawByte('{') first := true _ = first @@ -2819,27 +3038,27 @@ func easyjson6601e8cdEncodeGithubComMeilisearchMeilisearchGo19(out *jwriter.Writ // MarshalJSON supports json.Marshaler interface func (v KeyUpdate) MarshalJSON() ([]byte, error) { w := jwriter.Writer{} - easyjson6601e8cdEncodeGithubComMeilisearchMeilisearchGo19(&w, v) + easyjson6601e8cdEncodeGithubComMeilisearchMeilisearchGo20(&w, v) return w.Buffer.BuildBytes(), w.Error } // MarshalEasyJSON supports easyjson.Marshaler interface func (v KeyUpdate) MarshalEasyJSON(w *jwriter.Writer) { - easyjson6601e8cdEncodeGithubComMeilisearchMeilisearchGo19(w, v) + easyjson6601e8cdEncodeGithubComMeilisearchMeilisearchGo20(w, v) } // UnmarshalJSON supports json.Unmarshaler interface func (v *KeyUpdate) UnmarshalJSON(data []byte) error { r := jlexer.Lexer{Data: data} - easyjson6601e8cdDecodeGithubComMeilisearchMeilisearchGo19(&r, v) + easyjson6601e8cdDecodeGithubComMeilisearchMeilisearchGo20(&r, v) return r.Error() } // UnmarshalEasyJSON supports easyjson.Unmarshaler interface func (v *KeyUpdate) UnmarshalEasyJSON(l *jlexer.Lexer) { - easyjson6601e8cdDecodeGithubComMeilisearchMeilisearchGo19(l, v) + easyjson6601e8cdDecodeGithubComMeilisearchMeilisearchGo20(l, v) } -func easyjson6601e8cdDecodeGithubComMeilisearchMeilisearchGo20(in *jlexer.Lexer, out *KeyParsed) { +func easyjson6601e8cdDecodeGithubComMeilisearchMeilisearchGo21(in *jlexer.Lexer, out *KeyParsed) { isTopLevel := in.IsStart() if in.IsNull() { if isTopLevel { @@ -2880,9 +3099,9 @@ func easyjson6601e8cdDecodeGithubComMeilisearchMeilisearchGo20(in *jlexer.Lexer, out.Actions = (out.Actions)[:0] } for !in.IsDelim(']') { - var v67 string - v67 = string(in.String()) - out.Actions = append(out.Actions, v67) + var v76 string + v76 = string(in.String()) + out.Actions = append(out.Actions, v76) in.WantComma() } in.Delim(']') @@ -2903,9 +3122,9 @@ func easyjson6601e8cdDecodeGithubComMeilisearchMeilisearchGo20(in *jlexer.Lexer, out.Indexes = (out.Indexes)[:0] } for !in.IsDelim(']') { - var v68 string - v68 = string(in.String()) - out.Indexes = append(out.Indexes, v68) + var v77 string + v77 = string(in.String()) + out.Indexes = append(out.Indexes, v77) in.WantComma() } in.Delim(']') @@ -2938,7 +3157,7 @@ func easyjson6601e8cdDecodeGithubComMeilisearchMeilisearchGo20(in *jlexer.Lexer, in.Consumed() } } -func easyjson6601e8cdEncodeGithubComMeilisearchMeilisearchGo20(out *jwriter.Writer, in KeyParsed) { +func easyjson6601e8cdEncodeGithubComMeilisearchMeilisearchGo21(out *jwriter.Writer, in KeyParsed) { out.RawByte('{') first := true _ = first @@ -2962,11 +3181,11 @@ func easyjson6601e8cdEncodeGithubComMeilisearchMeilisearchGo20(out *jwriter.Writ out.RawString(prefix) { out.RawByte('[') - for v69, v70 := range in.Actions { - if v69 > 0 { + for v78, v79 := range in.Actions { + if v78 > 0 { out.RawByte(',') } - out.String(string(v70)) + out.String(string(v79)) } out.RawByte(']') } @@ -2976,11 +3195,11 @@ func easyjson6601e8cdEncodeGithubComMeilisearchMeilisearchGo20(out *jwriter.Writ out.RawString(prefix) { out.RawByte('[') - for v71, v72 := range in.Indexes { - if v71 > 0 { + for v80, v81 := range in.Indexes { + if v80 > 0 { out.RawByte(',') } - out.String(string(v72)) + out.String(string(v81)) } out.RawByte(']') } @@ -3010,27 +3229,27 @@ func easyjson6601e8cdEncodeGithubComMeilisearchMeilisearchGo20(out *jwriter.Writ // MarshalJSON supports json.Marshaler interface func (v KeyParsed) MarshalJSON() ([]byte, error) { w := jwriter.Writer{} - easyjson6601e8cdEncodeGithubComMeilisearchMeilisearchGo20(&w, v) + easyjson6601e8cdEncodeGithubComMeilisearchMeilisearchGo21(&w, v) return w.Buffer.BuildBytes(), w.Error } // MarshalEasyJSON supports easyjson.Marshaler interface func (v KeyParsed) MarshalEasyJSON(w *jwriter.Writer) { - easyjson6601e8cdEncodeGithubComMeilisearchMeilisearchGo20(w, v) + easyjson6601e8cdEncodeGithubComMeilisearchMeilisearchGo21(w, v) } // UnmarshalJSON supports json.Unmarshaler interface func (v *KeyParsed) UnmarshalJSON(data []byte) error { r := jlexer.Lexer{Data: data} - easyjson6601e8cdDecodeGithubComMeilisearchMeilisearchGo20(&r, v) + easyjson6601e8cdDecodeGithubComMeilisearchMeilisearchGo21(&r, v) return r.Error() } // UnmarshalEasyJSON supports easyjson.Unmarshaler interface func (v *KeyParsed) UnmarshalEasyJSON(l *jlexer.Lexer) { - easyjson6601e8cdDecodeGithubComMeilisearchMeilisearchGo20(l, v) + easyjson6601e8cdDecodeGithubComMeilisearchMeilisearchGo21(l, v) } -func easyjson6601e8cdDecodeGithubComMeilisearchMeilisearchGo21(in *jlexer.Lexer, out *Key) { +func easyjson6601e8cdDecodeGithubComMeilisearchMeilisearchGo22(in *jlexer.Lexer, out *Key) { isTopLevel := in.IsStart() if in.IsNull() { if isTopLevel { @@ -3073,9 +3292,9 @@ func easyjson6601e8cdDecodeGithubComMeilisearchMeilisearchGo21(in *jlexer.Lexer, out.Actions = (out.Actions)[:0] } for !in.IsDelim(']') { - var v73 string - v73 = string(in.String()) - out.Actions = append(out.Actions, v73) + var v82 string + v82 = string(in.String()) + out.Actions = append(out.Actions, v82) in.WantComma() } in.Delim(']') @@ -3096,9 +3315,9 @@ func easyjson6601e8cdDecodeGithubComMeilisearchMeilisearchGo21(in *jlexer.Lexer, out.Indexes = (out.Indexes)[:0] } for !in.IsDelim(']') { - var v74 string - v74 = string(in.String()) - out.Indexes = append(out.Indexes, v74) + var v83 string + v83 = string(in.String()) + out.Indexes = append(out.Indexes, v83) in.WantComma() } in.Delim(']') @@ -3125,7 +3344,7 @@ func easyjson6601e8cdDecodeGithubComMeilisearchMeilisearchGo21(in *jlexer.Lexer, in.Consumed() } } -func easyjson6601e8cdEncodeGithubComMeilisearchMeilisearchGo21(out *jwriter.Writer, in Key) { +func easyjson6601e8cdEncodeGithubComMeilisearchMeilisearchGo22(out *jwriter.Writer, in Key) { out.RawByte('{') first := true _ = first @@ -3154,11 +3373,11 @@ func easyjson6601e8cdEncodeGithubComMeilisearchMeilisearchGo21(out *jwriter.Writ out.RawString(prefix) { out.RawByte('[') - for v75, v76 := range in.Actions { - if v75 > 0 { + for v84, v85 := range in.Actions { + if v84 > 0 { out.RawByte(',') } - out.String(string(v76)) + out.String(string(v85)) } out.RawByte(']') } @@ -3168,11 +3387,11 @@ func easyjson6601e8cdEncodeGithubComMeilisearchMeilisearchGo21(out *jwriter.Writ out.RawString(prefix) { out.RawByte('[') - for v77, v78 := range in.Indexes { - if v77 > 0 { + for v86, v87 := range in.Indexes { + if v86 > 0 { out.RawByte(',') } - out.String(string(v78)) + out.String(string(v87)) } out.RawByte(']') } @@ -3198,27 +3417,27 @@ func easyjson6601e8cdEncodeGithubComMeilisearchMeilisearchGo21(out *jwriter.Writ // MarshalJSON supports json.Marshaler interface func (v Key) MarshalJSON() ([]byte, error) { w := jwriter.Writer{} - easyjson6601e8cdEncodeGithubComMeilisearchMeilisearchGo21(&w, v) + easyjson6601e8cdEncodeGithubComMeilisearchMeilisearchGo22(&w, v) return w.Buffer.BuildBytes(), w.Error } // MarshalEasyJSON supports easyjson.Marshaler interface func (v Key) MarshalEasyJSON(w *jwriter.Writer) { - easyjson6601e8cdEncodeGithubComMeilisearchMeilisearchGo21(w, v) + easyjson6601e8cdEncodeGithubComMeilisearchMeilisearchGo22(w, v) } // UnmarshalJSON supports json.Unmarshaler interface func (v *Key) UnmarshalJSON(data []byte) error { r := jlexer.Lexer{Data: data} - easyjson6601e8cdDecodeGithubComMeilisearchMeilisearchGo21(&r, v) + easyjson6601e8cdDecodeGithubComMeilisearchMeilisearchGo22(&r, v) return r.Error() } // UnmarshalEasyJSON supports easyjson.Unmarshaler interface func (v *Key) UnmarshalEasyJSON(l *jlexer.Lexer) { - easyjson6601e8cdDecodeGithubComMeilisearchMeilisearchGo21(l, v) + easyjson6601e8cdDecodeGithubComMeilisearchMeilisearchGo22(l, v) } -func easyjson6601e8cdDecodeGithubComMeilisearchMeilisearchGo22(in *jlexer.Lexer, out *IndexesResults) { +func easyjson6601e8cdDecodeGithubComMeilisearchMeilisearchGo23(in *jlexer.Lexer, out *IndexesResults) { isTopLevel := in.IsStart() if in.IsNull() { if isTopLevel { @@ -3253,9 +3472,9 @@ func easyjson6601e8cdDecodeGithubComMeilisearchMeilisearchGo22(in *jlexer.Lexer, out.Results = (out.Results)[:0] } for !in.IsDelim(']') { - var v79 Index - (v79).UnmarshalEasyJSON(in) - out.Results = append(out.Results, v79) + var v88 Index + (v88).UnmarshalEasyJSON(in) + out.Results = append(out.Results, v88) in.WantComma() } in.Delim(']') @@ -3276,7 +3495,7 @@ func easyjson6601e8cdDecodeGithubComMeilisearchMeilisearchGo22(in *jlexer.Lexer, in.Consumed() } } -func easyjson6601e8cdEncodeGithubComMeilisearchMeilisearchGo22(out *jwriter.Writer, in IndexesResults) { +func easyjson6601e8cdEncodeGithubComMeilisearchMeilisearchGo23(out *jwriter.Writer, in IndexesResults) { out.RawByte('{') first := true _ = first @@ -3287,11 +3506,11 @@ func easyjson6601e8cdEncodeGithubComMeilisearchMeilisearchGo22(out *jwriter.Writ out.RawString("null") } else { out.RawByte('[') - for v80, v81 := range in.Results { - if v80 > 0 { + for v89, v90 := range in.Results { + if v89 > 0 { out.RawByte(',') } - (v81).MarshalEasyJSON(out) + (v90).MarshalEasyJSON(out) } out.RawByte(']') } @@ -3317,27 +3536,27 @@ func easyjson6601e8cdEncodeGithubComMeilisearchMeilisearchGo22(out *jwriter.Writ // MarshalJSON supports json.Marshaler interface func (v IndexesResults) MarshalJSON() ([]byte, error) { w := jwriter.Writer{} - easyjson6601e8cdEncodeGithubComMeilisearchMeilisearchGo22(&w, v) + easyjson6601e8cdEncodeGithubComMeilisearchMeilisearchGo23(&w, v) return w.Buffer.BuildBytes(), w.Error } // MarshalEasyJSON supports easyjson.Marshaler interface func (v IndexesResults) MarshalEasyJSON(w *jwriter.Writer) { - easyjson6601e8cdEncodeGithubComMeilisearchMeilisearchGo22(w, v) + easyjson6601e8cdEncodeGithubComMeilisearchMeilisearchGo23(w, v) } // UnmarshalJSON supports json.Unmarshaler interface func (v *IndexesResults) UnmarshalJSON(data []byte) error { r := jlexer.Lexer{Data: data} - easyjson6601e8cdDecodeGithubComMeilisearchMeilisearchGo22(&r, v) + easyjson6601e8cdDecodeGithubComMeilisearchMeilisearchGo23(&r, v) return r.Error() } // UnmarshalEasyJSON supports easyjson.Unmarshaler interface func (v *IndexesResults) UnmarshalEasyJSON(l *jlexer.Lexer) { - easyjson6601e8cdDecodeGithubComMeilisearchMeilisearchGo22(l, v) + easyjson6601e8cdDecodeGithubComMeilisearchMeilisearchGo23(l, v) } -func easyjson6601e8cdDecodeGithubComMeilisearchMeilisearchGo23(in *jlexer.Lexer, out *IndexesQuery) { +func easyjson6601e8cdDecodeGithubComMeilisearchMeilisearchGo24(in *jlexer.Lexer, out *IndexesQuery) { isTopLevel := in.IsStart() if in.IsNull() { if isTopLevel { @@ -3356,9 +3575,9 @@ func easyjson6601e8cdDecodeGithubComMeilisearchMeilisearchGo23(in *jlexer.Lexer, continue } switch key { - case "limit": + case "Limit": out.Limit = int64(in.Int64()) - case "offset": + case "Offset": out.Offset = int64(in.Int64()) default: in.SkipRecursive() @@ -3370,24 +3589,18 @@ func easyjson6601e8cdDecodeGithubComMeilisearchMeilisearchGo23(in *jlexer.Lexer, in.Consumed() } } -func easyjson6601e8cdEncodeGithubComMeilisearchMeilisearchGo23(out *jwriter.Writer, in IndexesQuery) { +func easyjson6601e8cdEncodeGithubComMeilisearchMeilisearchGo24(out *jwriter.Writer, in IndexesQuery) { out.RawByte('{') first := true _ = first - if in.Limit != 0 { - const prefix string = ",\"limit\":" - first = false + { + const prefix string = ",\"Limit\":" out.RawString(prefix[1:]) out.Int64(int64(in.Limit)) } - if in.Offset != 0 { - const prefix string = ",\"offset\":" - if first { - first = false - out.RawString(prefix[1:]) - } else { - out.RawString(prefix) - } + { + const prefix string = ",\"Offset\":" + out.RawString(prefix) out.Int64(int64(in.Offset)) } out.RawByte('}') @@ -3396,27 +3609,27 @@ func easyjson6601e8cdEncodeGithubComMeilisearchMeilisearchGo23(out *jwriter.Writ // MarshalJSON supports json.Marshaler interface func (v IndexesQuery) MarshalJSON() ([]byte, error) { w := jwriter.Writer{} - easyjson6601e8cdEncodeGithubComMeilisearchMeilisearchGo23(&w, v) + easyjson6601e8cdEncodeGithubComMeilisearchMeilisearchGo24(&w, v) return w.Buffer.BuildBytes(), w.Error } // MarshalEasyJSON supports easyjson.Marshaler interface func (v IndexesQuery) MarshalEasyJSON(w *jwriter.Writer) { - easyjson6601e8cdEncodeGithubComMeilisearchMeilisearchGo23(w, v) + easyjson6601e8cdEncodeGithubComMeilisearchMeilisearchGo24(w, v) } // UnmarshalJSON supports json.Unmarshaler interface func (v *IndexesQuery) UnmarshalJSON(data []byte) error { r := jlexer.Lexer{Data: data} - easyjson6601e8cdDecodeGithubComMeilisearchMeilisearchGo23(&r, v) + easyjson6601e8cdDecodeGithubComMeilisearchMeilisearchGo24(&r, v) return r.Error() } // UnmarshalEasyJSON supports easyjson.Unmarshaler interface func (v *IndexesQuery) UnmarshalEasyJSON(l *jlexer.Lexer) { - easyjson6601e8cdDecodeGithubComMeilisearchMeilisearchGo23(l, v) + easyjson6601e8cdDecodeGithubComMeilisearchMeilisearchGo24(l, v) } -func easyjson6601e8cdDecodeGithubComMeilisearchMeilisearchGo24(in *jlexer.Lexer, out *Index) { +func easyjson6601e8cdDecodeGithubComMeilisearchMeilisearchGo25(in *jlexer.Lexer, out *Index) { isTopLevel := in.IsStart() if in.IsNull() { if isTopLevel { @@ -3457,7 +3670,7 @@ func easyjson6601e8cdDecodeGithubComMeilisearchMeilisearchGo24(in *jlexer.Lexer, in.Consumed() } } -func easyjson6601e8cdEncodeGithubComMeilisearchMeilisearchGo24(out *jwriter.Writer, in Index) { +func easyjson6601e8cdEncodeGithubComMeilisearchMeilisearchGo25(out *jwriter.Writer, in Index) { out.RawByte('{') first := true _ = first @@ -3487,27 +3700,27 @@ func easyjson6601e8cdEncodeGithubComMeilisearchMeilisearchGo24(out *jwriter.Writ // MarshalJSON supports json.Marshaler interface func (v Index) MarshalJSON() ([]byte, error) { w := jwriter.Writer{} - easyjson6601e8cdEncodeGithubComMeilisearchMeilisearchGo24(&w, v) + easyjson6601e8cdEncodeGithubComMeilisearchMeilisearchGo25(&w, v) return w.Buffer.BuildBytes(), w.Error } // MarshalEasyJSON supports easyjson.Marshaler interface func (v Index) MarshalEasyJSON(w *jwriter.Writer) { - easyjson6601e8cdEncodeGithubComMeilisearchMeilisearchGo24(w, v) + easyjson6601e8cdEncodeGithubComMeilisearchMeilisearchGo25(w, v) } // UnmarshalJSON supports json.Unmarshaler interface func (v *Index) UnmarshalJSON(data []byte) error { r := jlexer.Lexer{Data: data} - easyjson6601e8cdDecodeGithubComMeilisearchMeilisearchGo24(&r, v) + easyjson6601e8cdDecodeGithubComMeilisearchMeilisearchGo25(&r, v) return r.Error() } // UnmarshalEasyJSON supports easyjson.Unmarshaler interface func (v *Index) UnmarshalEasyJSON(l *jlexer.Lexer) { - easyjson6601e8cdDecodeGithubComMeilisearchMeilisearchGo24(l, v) + easyjson6601e8cdDecodeGithubComMeilisearchMeilisearchGo25(l, v) } -func easyjson6601e8cdDecodeGithubComMeilisearchMeilisearchGo25(in *jlexer.Lexer, out *Health) { +func easyjson6601e8cdDecodeGithubComMeilisearchMeilisearchGo26(in *jlexer.Lexer, out *Health) { isTopLevel := in.IsStart() if in.IsNull() { if isTopLevel { @@ -3538,7 +3751,7 @@ func easyjson6601e8cdDecodeGithubComMeilisearchMeilisearchGo25(in *jlexer.Lexer, in.Consumed() } } -func easyjson6601e8cdEncodeGithubComMeilisearchMeilisearchGo25(out *jwriter.Writer, in Health) { +func easyjson6601e8cdEncodeGithubComMeilisearchMeilisearchGo26(out *jwriter.Writer, in Health) { out.RawByte('{') first := true _ = first @@ -3553,27 +3766,27 @@ func easyjson6601e8cdEncodeGithubComMeilisearchMeilisearchGo25(out *jwriter.Writ // MarshalJSON supports json.Marshaler interface func (v Health) MarshalJSON() ([]byte, error) { w := jwriter.Writer{} - easyjson6601e8cdEncodeGithubComMeilisearchMeilisearchGo25(&w, v) + easyjson6601e8cdEncodeGithubComMeilisearchMeilisearchGo26(&w, v) return w.Buffer.BuildBytes(), w.Error } // MarshalEasyJSON supports easyjson.Marshaler interface func (v Health) MarshalEasyJSON(w *jwriter.Writer) { - easyjson6601e8cdEncodeGithubComMeilisearchMeilisearchGo25(w, v) + easyjson6601e8cdEncodeGithubComMeilisearchMeilisearchGo26(w, v) } // UnmarshalJSON supports json.Unmarshaler interface func (v *Health) UnmarshalJSON(data []byte) error { r := jlexer.Lexer{Data: data} - easyjson6601e8cdDecodeGithubComMeilisearchMeilisearchGo25(&r, v) + easyjson6601e8cdDecodeGithubComMeilisearchMeilisearchGo26(&r, v) return r.Error() } // UnmarshalEasyJSON supports easyjson.Unmarshaler interface func (v *Health) UnmarshalEasyJSON(l *jlexer.Lexer) { - easyjson6601e8cdDecodeGithubComMeilisearchMeilisearchGo25(l, v) + easyjson6601e8cdDecodeGithubComMeilisearchMeilisearchGo26(l, v) } -func easyjson6601e8cdDecodeGithubComMeilisearchMeilisearchGo26(in *jlexer.Lexer, out *Faceting) { +func easyjson6601e8cdDecodeGithubComMeilisearchMeilisearchGo27(in *jlexer.Lexer, out *Faceting) { isTopLevel := in.IsStart() if in.IsNull() { if isTopLevel { @@ -3604,7 +3817,7 @@ func easyjson6601e8cdDecodeGithubComMeilisearchMeilisearchGo26(in *jlexer.Lexer, in.Consumed() } } -func easyjson6601e8cdEncodeGithubComMeilisearchMeilisearchGo26(out *jwriter.Writer, in Faceting) { +func easyjson6601e8cdEncodeGithubComMeilisearchMeilisearchGo27(out *jwriter.Writer, in Faceting) { out.RawByte('{') first := true _ = first @@ -3619,27 +3832,27 @@ func easyjson6601e8cdEncodeGithubComMeilisearchMeilisearchGo26(out *jwriter.Writ // MarshalJSON supports json.Marshaler interface func (v Faceting) MarshalJSON() ([]byte, error) { w := jwriter.Writer{} - easyjson6601e8cdEncodeGithubComMeilisearchMeilisearchGo26(&w, v) + easyjson6601e8cdEncodeGithubComMeilisearchMeilisearchGo27(&w, v) return w.Buffer.BuildBytes(), w.Error } // MarshalEasyJSON supports easyjson.Marshaler interface func (v Faceting) MarshalEasyJSON(w *jwriter.Writer) { - easyjson6601e8cdEncodeGithubComMeilisearchMeilisearchGo26(w, v) + easyjson6601e8cdEncodeGithubComMeilisearchMeilisearchGo27(w, v) } // UnmarshalJSON supports json.Unmarshaler interface func (v *Faceting) UnmarshalJSON(data []byte) error { r := jlexer.Lexer{Data: data} - easyjson6601e8cdDecodeGithubComMeilisearchMeilisearchGo26(&r, v) + easyjson6601e8cdDecodeGithubComMeilisearchMeilisearchGo27(&r, v) return r.Error() } // UnmarshalEasyJSON supports easyjson.Unmarshaler interface func (v *Faceting) UnmarshalEasyJSON(l *jlexer.Lexer) { - easyjson6601e8cdDecodeGithubComMeilisearchMeilisearchGo26(l, v) + easyjson6601e8cdDecodeGithubComMeilisearchMeilisearchGo27(l, v) } -func easyjson6601e8cdDecodeGithubComMeilisearchMeilisearchGo27(in *jlexer.Lexer, out *DocumentsResult) { +func easyjson6601e8cdDecodeGithubComMeilisearchMeilisearchGo28(in *jlexer.Lexer, out *DocumentsResult) { isTopLevel := in.IsStart() if in.IsNull() { if isTopLevel { @@ -3674,29 +3887,29 @@ func easyjson6601e8cdDecodeGithubComMeilisearchMeilisearchGo27(in *jlexer.Lexer, out.Results = (out.Results)[:0] } for !in.IsDelim(']') { - var v82 map[string]interface{} + var v91 map[string]interface{} if in.IsNull() { in.Skip() } else { in.Delim('{') - v82 = make(map[string]interface{}) + v91 = make(map[string]interface{}) for !in.IsDelim('}') { key := string(in.String()) in.WantColon() - var v83 interface{} - if m, ok := v83.(easyjson.Unmarshaler); ok { + var v92 interface{} + if m, ok := v92.(easyjson.Unmarshaler); ok { m.UnmarshalEasyJSON(in) - } else if m, ok := v83.(json.Unmarshaler); ok { + } else if m, ok := v92.(json.Unmarshaler); ok { _ = m.UnmarshalJSON(in.Raw()) } else { - v83 = in.Interface() + v92 = in.Interface() } - (v82)[key] = v83 + (v91)[key] = v92 in.WantComma() } in.Delim('}') } - out.Results = append(out.Results, v82) + out.Results = append(out.Results, v91) in.WantComma() } in.Delim(']') @@ -3717,7 +3930,7 @@ func easyjson6601e8cdDecodeGithubComMeilisearchMeilisearchGo27(in *jlexer.Lexer, in.Consumed() } } -func easyjson6601e8cdEncodeGithubComMeilisearchMeilisearchGo27(out *jwriter.Writer, in DocumentsResult) { +func easyjson6601e8cdEncodeGithubComMeilisearchMeilisearchGo28(out *jwriter.Writer, in DocumentsResult) { out.RawByte('{') first := true _ = first @@ -3728,29 +3941,29 @@ func easyjson6601e8cdEncodeGithubComMeilisearchMeilisearchGo27(out *jwriter.Writ out.RawString("null") } else { out.RawByte('[') - for v84, v85 := range in.Results { - if v84 > 0 { + for v93, v94 := range in.Results { + if v93 > 0 { out.RawByte(',') } - if v85 == nil && (out.Flags&jwriter.NilMapAsEmpty) == 0 { + if v94 == nil && (out.Flags&jwriter.NilMapAsEmpty) == 0 { out.RawString(`null`) } else { out.RawByte('{') - v86First := true - for v86Name, v86Value := range v85 { - if v86First { - v86First = false + v95First := true + for v95Name, v95Value := range v94 { + if v95First { + v95First = false } else { out.RawByte(',') } - out.String(string(v86Name)) + out.String(string(v95Name)) out.RawByte(':') - if m, ok := v86Value.(easyjson.Marshaler); ok { + if m, ok := v95Value.(easyjson.Marshaler); ok { m.MarshalEasyJSON(out) - } else if m, ok := v86Value.(json.Marshaler); ok { + } else if m, ok := v95Value.(json.Marshaler); ok { out.Raw(m.MarshalJSON()) } else { - out.Raw(json.Marshal(v86Value)) + out.Raw(json.Marshal(v95Value)) } } out.RawByte('}') @@ -3780,27 +3993,27 @@ func easyjson6601e8cdEncodeGithubComMeilisearchMeilisearchGo27(out *jwriter.Writ // MarshalJSON supports json.Marshaler interface func (v DocumentsResult) MarshalJSON() ([]byte, error) { w := jwriter.Writer{} - easyjson6601e8cdEncodeGithubComMeilisearchMeilisearchGo27(&w, v) + easyjson6601e8cdEncodeGithubComMeilisearchMeilisearchGo28(&w, v) return w.Buffer.BuildBytes(), w.Error } // MarshalEasyJSON supports easyjson.Marshaler interface func (v DocumentsResult) MarshalEasyJSON(w *jwriter.Writer) { - easyjson6601e8cdEncodeGithubComMeilisearchMeilisearchGo27(w, v) + easyjson6601e8cdEncodeGithubComMeilisearchMeilisearchGo28(w, v) } // UnmarshalJSON supports json.Unmarshaler interface func (v *DocumentsResult) UnmarshalJSON(data []byte) error { r := jlexer.Lexer{Data: data} - easyjson6601e8cdDecodeGithubComMeilisearchMeilisearchGo27(&r, v) + easyjson6601e8cdDecodeGithubComMeilisearchMeilisearchGo28(&r, v) return r.Error() } // UnmarshalEasyJSON supports easyjson.Unmarshaler interface func (v *DocumentsResult) UnmarshalEasyJSON(l *jlexer.Lexer) { - easyjson6601e8cdDecodeGithubComMeilisearchMeilisearchGo27(l, v) + easyjson6601e8cdDecodeGithubComMeilisearchMeilisearchGo28(l, v) } -func easyjson6601e8cdDecodeGithubComMeilisearchMeilisearchGo28(in *jlexer.Lexer, out *DocumentsQuery) { +func easyjson6601e8cdDecodeGithubComMeilisearchMeilisearchGo29(in *jlexer.Lexer, out *DocumentsQuery) { isTopLevel := in.IsStart() if in.IsNull() { if isTopLevel { @@ -3839,9 +4052,9 @@ func easyjson6601e8cdDecodeGithubComMeilisearchMeilisearchGo28(in *jlexer.Lexer, out.Fields = (out.Fields)[:0] } for !in.IsDelim(']') { - var v87 string - v87 = string(in.String()) - out.Fields = append(out.Fields, v87) + var v96 string + v96 = string(in.String()) + out.Fields = append(out.Fields, v96) in.WantComma() } in.Delim(']') @@ -3856,7 +4069,7 @@ func easyjson6601e8cdDecodeGithubComMeilisearchMeilisearchGo28(in *jlexer.Lexer, in.Consumed() } } -func easyjson6601e8cdEncodeGithubComMeilisearchMeilisearchGo28(out *jwriter.Writer, in DocumentsQuery) { +func easyjson6601e8cdEncodeGithubComMeilisearchMeilisearchGo29(out *jwriter.Writer, in DocumentsQuery) { out.RawByte('{') first := true _ = first @@ -3886,11 +4099,11 @@ func easyjson6601e8cdEncodeGithubComMeilisearchMeilisearchGo28(out *jwriter.Writ } { out.RawByte('[') - for v88, v89 := range in.Fields { - if v88 > 0 { + for v97, v98 := range in.Fields { + if v97 > 0 { out.RawByte(',') } - out.String(string(v89)) + out.String(string(v98)) } out.RawByte(']') } @@ -3901,27 +4114,27 @@ func easyjson6601e8cdEncodeGithubComMeilisearchMeilisearchGo28(out *jwriter.Writ // MarshalJSON supports json.Marshaler interface func (v DocumentsQuery) MarshalJSON() ([]byte, error) { w := jwriter.Writer{} - easyjson6601e8cdEncodeGithubComMeilisearchMeilisearchGo28(&w, v) + easyjson6601e8cdEncodeGithubComMeilisearchMeilisearchGo29(&w, v) return w.Buffer.BuildBytes(), w.Error } // MarshalEasyJSON supports easyjson.Marshaler interface func (v DocumentsQuery) MarshalEasyJSON(w *jwriter.Writer) { - easyjson6601e8cdEncodeGithubComMeilisearchMeilisearchGo28(w, v) + easyjson6601e8cdEncodeGithubComMeilisearchMeilisearchGo29(w, v) } // UnmarshalJSON supports json.Unmarshaler interface func (v *DocumentsQuery) UnmarshalJSON(data []byte) error { r := jlexer.Lexer{Data: data} - easyjson6601e8cdDecodeGithubComMeilisearchMeilisearchGo28(&r, v) + easyjson6601e8cdDecodeGithubComMeilisearchMeilisearchGo29(&r, v) return r.Error() } // UnmarshalEasyJSON supports easyjson.Unmarshaler interface func (v *DocumentsQuery) UnmarshalEasyJSON(l *jlexer.Lexer) { - easyjson6601e8cdDecodeGithubComMeilisearchMeilisearchGo28(l, v) + easyjson6601e8cdDecodeGithubComMeilisearchMeilisearchGo29(l, v) } -func easyjson6601e8cdDecodeGithubComMeilisearchMeilisearchGo29(in *jlexer.Lexer, out *DocumentQuery) { +func easyjson6601e8cdDecodeGithubComMeilisearchMeilisearchGo30(in *jlexer.Lexer, out *DocumentQuery) { isTopLevel := in.IsStart() if in.IsNull() { if isTopLevel { @@ -3956,9 +4169,9 @@ func easyjson6601e8cdDecodeGithubComMeilisearchMeilisearchGo29(in *jlexer.Lexer, out.Fields = (out.Fields)[:0] } for !in.IsDelim(']') { - var v90 string - v90 = string(in.String()) - out.Fields = append(out.Fields, v90) + var v99 string + v99 = string(in.String()) + out.Fields = append(out.Fields, v99) in.WantComma() } in.Delim(']') @@ -3973,7 +4186,7 @@ func easyjson6601e8cdDecodeGithubComMeilisearchMeilisearchGo29(in *jlexer.Lexer, in.Consumed() } } -func easyjson6601e8cdEncodeGithubComMeilisearchMeilisearchGo29(out *jwriter.Writer, in DocumentQuery) { +func easyjson6601e8cdEncodeGithubComMeilisearchMeilisearchGo30(out *jwriter.Writer, in DocumentQuery) { out.RawByte('{') first := true _ = first @@ -3983,11 +4196,11 @@ func easyjson6601e8cdEncodeGithubComMeilisearchMeilisearchGo29(out *jwriter.Writ out.RawString(prefix[1:]) { out.RawByte('[') - for v91, v92 := range in.Fields { - if v91 > 0 { + for v100, v101 := range in.Fields { + if v100 > 0 { out.RawByte(',') } - out.String(string(v92)) + out.String(string(v101)) } out.RawByte(']') } @@ -3998,27 +4211,27 @@ func easyjson6601e8cdEncodeGithubComMeilisearchMeilisearchGo29(out *jwriter.Writ // MarshalJSON supports json.Marshaler interface func (v DocumentQuery) MarshalJSON() ([]byte, error) { w := jwriter.Writer{} - easyjson6601e8cdEncodeGithubComMeilisearchMeilisearchGo29(&w, v) + easyjson6601e8cdEncodeGithubComMeilisearchMeilisearchGo30(&w, v) return w.Buffer.BuildBytes(), w.Error } // MarshalEasyJSON supports easyjson.Marshaler interface func (v DocumentQuery) MarshalEasyJSON(w *jwriter.Writer) { - easyjson6601e8cdEncodeGithubComMeilisearchMeilisearchGo29(w, v) + easyjson6601e8cdEncodeGithubComMeilisearchMeilisearchGo30(w, v) } // UnmarshalJSON supports json.Unmarshaler interface func (v *DocumentQuery) UnmarshalJSON(data []byte) error { r := jlexer.Lexer{Data: data} - easyjson6601e8cdDecodeGithubComMeilisearchMeilisearchGo29(&r, v) + easyjson6601e8cdDecodeGithubComMeilisearchMeilisearchGo30(&r, v) return r.Error() } // UnmarshalEasyJSON supports easyjson.Unmarshaler interface func (v *DocumentQuery) UnmarshalEasyJSON(l *jlexer.Lexer) { - easyjson6601e8cdDecodeGithubComMeilisearchMeilisearchGo29(l, v) + easyjson6601e8cdDecodeGithubComMeilisearchMeilisearchGo30(l, v) } -func easyjson6601e8cdDecodeGithubComMeilisearchMeilisearchGo30(in *jlexer.Lexer, out *Details) { +func easyjson6601e8cdDecodeGithubComMeilisearchMeilisearchGo31(in *jlexer.Lexer, out *Details) { isTopLevel := in.IsStart() if in.IsNull() { if isTopLevel { @@ -4038,13 +4251,15 @@ func easyjson6601e8cdDecodeGithubComMeilisearchMeilisearchGo30(in *jlexer.Lexer, } switch key { case "receivedDocuments": - out.ReceivedDocuments = int(in.Int()) + out.ReceivedDocuments = int64(in.Int64()) case "indexedDocuments": - out.IndexedDocuments = int(in.Int()) + out.IndexedDocuments = int64(in.Int64()) case "deletedDocuments": - out.DeletedDocuments = int(in.Int()) + out.DeletedDocuments = int64(in.Int64()) case "primaryKey": out.PrimaryKey = string(in.String()) + case "providedIds": + out.ProvidedIds = int64(in.Int64()) case "rankingRules": if in.IsNull() { in.Skip() @@ -4061,9 +4276,9 @@ func easyjson6601e8cdDecodeGithubComMeilisearchMeilisearchGo30(in *jlexer.Lexer, out.RankingRules = (out.RankingRules)[:0] } for !in.IsDelim(']') { - var v93 string - v93 = string(in.String()) - out.RankingRules = append(out.RankingRules, v93) + var v102 string + v102 = string(in.String()) + out.RankingRules = append(out.RankingRules, v102) in.WantComma() } in.Delim(']') @@ -4094,9 +4309,9 @@ func easyjson6601e8cdDecodeGithubComMeilisearchMeilisearchGo30(in *jlexer.Lexer, out.SearchableAttributes = (out.SearchableAttributes)[:0] } for !in.IsDelim(']') { - var v94 string - v94 = string(in.String()) - out.SearchableAttributes = append(out.SearchableAttributes, v94) + var v103 string + v103 = string(in.String()) + out.SearchableAttributes = append(out.SearchableAttributes, v103) in.WantComma() } in.Delim(']') @@ -4117,9 +4332,9 @@ func easyjson6601e8cdDecodeGithubComMeilisearchMeilisearchGo30(in *jlexer.Lexer, out.DisplayedAttributes = (out.DisplayedAttributes)[:0] } for !in.IsDelim(']') { - var v95 string - v95 = string(in.String()) - out.DisplayedAttributes = append(out.DisplayedAttributes, v95) + var v104 string + v104 = string(in.String()) + out.DisplayedAttributes = append(out.DisplayedAttributes, v104) in.WantComma() } in.Delim(']') @@ -4140,9 +4355,9 @@ func easyjson6601e8cdDecodeGithubComMeilisearchMeilisearchGo30(in *jlexer.Lexer, out.StopWords = (out.StopWords)[:0] } for !in.IsDelim(']') { - var v96 string - v96 = string(in.String()) - out.StopWords = append(out.StopWords, v96) + var v105 string + v105 = string(in.String()) + out.StopWords = append(out.StopWords, v105) in.WantComma() } in.Delim(']') @@ -4160,30 +4375,30 @@ func easyjson6601e8cdDecodeGithubComMeilisearchMeilisearchGo30(in *jlexer.Lexer, for !in.IsDelim('}') { key := string(in.String()) in.WantColon() - var v97 []string + var v106 []string if in.IsNull() { in.Skip() - v97 = nil + v106 = nil } else { in.Delim('[') - if v97 == nil { + if v106 == nil { if !in.IsDelim(']') { - v97 = make([]string, 0, 4) + v106 = make([]string, 0, 4) } else { - v97 = []string{} + v106 = []string{} } } else { - v97 = (v97)[:0] + v106 = (v106)[:0] } for !in.IsDelim(']') { - var v98 string - v98 = string(in.String()) - v97 = append(v97, v98) + var v107 string + v107 = string(in.String()) + v106 = append(v106, v107) in.WantComma() } in.Delim(']') } - (out.Synonyms)[key] = v97 + (out.Synonyms)[key] = v106 in.WantComma() } in.Delim('}') @@ -4204,9 +4419,9 @@ func easyjson6601e8cdDecodeGithubComMeilisearchMeilisearchGo30(in *jlexer.Lexer, out.FilterableAttributes = (out.FilterableAttributes)[:0] } for !in.IsDelim(']') { - var v99 string - v99 = string(in.String()) - out.FilterableAttributes = append(out.FilterableAttributes, v99) + var v108 string + v108 = string(in.String()) + out.FilterableAttributes = append(out.FilterableAttributes, v108) in.WantComma() } in.Delim(']') @@ -4227,9 +4442,70 @@ func easyjson6601e8cdDecodeGithubComMeilisearchMeilisearchGo30(in *jlexer.Lexer, out.SortableAttributes = (out.SortableAttributes)[:0] } for !in.IsDelim(']') { - var v100 string - v100 = string(in.String()) - out.SortableAttributes = append(out.SortableAttributes, v100) + var v109 string + v109 = string(in.String()) + out.SortableAttributes = append(out.SortableAttributes, v109) + in.WantComma() + } + in.Delim(']') + } + case "typoTolerance": + if in.IsNull() { + in.Skip() + out.TypoTolerance = nil + } else { + if out.TypoTolerance == nil { + out.TypoTolerance = new(TypoTolerance) + } + (*out.TypoTolerance).UnmarshalEasyJSON(in) + } + case "pagination": + if in.IsNull() { + in.Skip() + out.Pagination = nil + } else { + if out.Pagination == nil { + out.Pagination = new(Pagination) + } + (*out.Pagination).UnmarshalEasyJSON(in) + } + case "faceting": + if in.IsNull() { + in.Skip() + out.Faceting = nil + } else { + if out.Faceting == nil { + out.Faceting = new(Faceting) + } + (*out.Faceting).UnmarshalEasyJSON(in) + } + case "matchedTasks": + out.MatchedTasks = int64(in.Int64()) + case "canceledTasks": + out.CanceledTasks = int64(in.Int64()) + case "deletedTasks": + out.DeletedTasks = int64(in.Int64()) + case "originalFilter": + out.OriginalFilter = string(in.String()) + case "swaps": + if in.IsNull() { + in.Skip() + out.Swaps = nil + } else { + in.Delim('[') + if out.Swaps == nil { + if !in.IsDelim(']') { + out.Swaps = make([]SwapIndexesParams, 0, 2) + } else { + out.Swaps = []SwapIndexesParams{} + } + } else { + out.Swaps = (out.Swaps)[:0] + } + for !in.IsDelim(']') { + var v110 SwapIndexesParams + (v110).UnmarshalEasyJSON(in) + out.Swaps = append(out.Swaps, v110) in.WantComma() } in.Delim(']') @@ -4244,7 +4520,7 @@ func easyjson6601e8cdDecodeGithubComMeilisearchMeilisearchGo30(in *jlexer.Lexer, in.Consumed() } } -func easyjson6601e8cdEncodeGithubComMeilisearchMeilisearchGo30(out *jwriter.Writer, in Details) { +func easyjson6601e8cdEncodeGithubComMeilisearchMeilisearchGo31(out *jwriter.Writer, in Details) { out.RawByte('{') first := true _ = first @@ -4252,7 +4528,7 @@ func easyjson6601e8cdEncodeGithubComMeilisearchMeilisearchGo30(out *jwriter.Writ const prefix string = ",\"receivedDocuments\":" first = false out.RawString(prefix[1:]) - out.Int(int(in.ReceivedDocuments)) + out.Int64(int64(in.ReceivedDocuments)) } if in.IndexedDocuments != 0 { const prefix string = ",\"indexedDocuments\":" @@ -4262,7 +4538,7 @@ func easyjson6601e8cdEncodeGithubComMeilisearchMeilisearchGo30(out *jwriter.Writ } else { out.RawString(prefix) } - out.Int(int(in.IndexedDocuments)) + out.Int64(int64(in.IndexedDocuments)) } if in.DeletedDocuments != 0 { const prefix string = ",\"deletedDocuments\":" @@ -4272,7 +4548,7 @@ func easyjson6601e8cdEncodeGithubComMeilisearchMeilisearchGo30(out *jwriter.Writ } else { out.RawString(prefix) } - out.Int(int(in.DeletedDocuments)) + out.Int64(int64(in.DeletedDocuments)) } if in.PrimaryKey != "" { const prefix string = ",\"primaryKey\":" @@ -4284,6 +4560,16 @@ func easyjson6601e8cdEncodeGithubComMeilisearchMeilisearchGo30(out *jwriter.Writ } out.String(string(in.PrimaryKey)) } + if in.ProvidedIds != 0 { + const prefix string = ",\"providedIds\":" + if first { + first = false + out.RawString(prefix[1:]) + } else { + out.RawString(prefix) + } + out.Int64(int64(in.ProvidedIds)) + } if len(in.RankingRules) != 0 { const prefix string = ",\"rankingRules\":" if first { @@ -4294,11 +4580,11 @@ func easyjson6601e8cdEncodeGithubComMeilisearchMeilisearchGo30(out *jwriter.Writ } { out.RawByte('[') - for v101, v102 := range in.RankingRules { - if v101 > 0 { + for v111, v112 := range in.RankingRules { + if v111 > 0 { out.RawByte(',') } - out.String(string(v102)) + out.String(string(v112)) } out.RawByte(']') } @@ -4323,11 +4609,11 @@ func easyjson6601e8cdEncodeGithubComMeilisearchMeilisearchGo30(out *jwriter.Writ } { out.RawByte('[') - for v103, v104 := range in.SearchableAttributes { - if v103 > 0 { + for v113, v114 := range in.SearchableAttributes { + if v113 > 0 { out.RawByte(',') } - out.String(string(v104)) + out.String(string(v114)) } out.RawByte(']') } @@ -4342,11 +4628,11 @@ func easyjson6601e8cdEncodeGithubComMeilisearchMeilisearchGo30(out *jwriter.Writ } { out.RawByte('[') - for v105, v106 := range in.DisplayedAttributes { - if v105 > 0 { + for v115, v116 := range in.DisplayedAttributes { + if v115 > 0 { out.RawByte(',') } - out.String(string(v106)) + out.String(string(v116)) } out.RawByte(']') } @@ -4361,11 +4647,11 @@ func easyjson6601e8cdEncodeGithubComMeilisearchMeilisearchGo30(out *jwriter.Writ } { out.RawByte('[') - for v107, v108 := range in.StopWords { - if v107 > 0 { + for v117, v118 := range in.StopWords { + if v117 > 0 { out.RawByte(',') } - out.String(string(v108)) + out.String(string(v118)) } out.RawByte(']') } @@ -4380,24 +4666,24 @@ func easyjson6601e8cdEncodeGithubComMeilisearchMeilisearchGo30(out *jwriter.Writ } { out.RawByte('{') - v109First := true - for v109Name, v109Value := range in.Synonyms { - if v109First { - v109First = false + v119First := true + for v119Name, v119Value := range in.Synonyms { + if v119First { + v119First = false } else { out.RawByte(',') } - out.String(string(v109Name)) + out.String(string(v119Name)) out.RawByte(':') - if v109Value == nil && (out.Flags&jwriter.NilSliceAsEmpty) == 0 { + if v119Value == nil && (out.Flags&jwriter.NilSliceAsEmpty) == 0 { out.RawString("null") } else { out.RawByte('[') - for v110, v111 := range v109Value { - if v110 > 0 { + for v120, v121 := range v119Value { + if v120 > 0 { out.RawByte(',') } - out.String(string(v111)) + out.String(string(v121)) } out.RawByte(']') } @@ -4415,11 +4701,11 @@ func easyjson6601e8cdEncodeGithubComMeilisearchMeilisearchGo30(out *jwriter.Writ } { out.RawByte('[') - for v112, v113 := range in.FilterableAttributes { - if v112 > 0 { + for v122, v123 := range in.FilterableAttributes { + if v122 > 0 { out.RawByte(',') } - out.String(string(v113)) + out.String(string(v123)) } out.RawByte(']') } @@ -4434,54 +4720,451 @@ func easyjson6601e8cdEncodeGithubComMeilisearchMeilisearchGo30(out *jwriter.Writ } { out.RawByte('[') - for v114, v115 := range in.SortableAttributes { - if v114 > 0 { + for v124, v125 := range in.SortableAttributes { + if v124 > 0 { out.RawByte(',') } - out.String(string(v115)) + out.String(string(v125)) } out.RawByte(']') } } - out.RawByte('}') -} - -// MarshalJSON supports json.Marshaler interface -func (v Details) MarshalJSON() ([]byte, error) { - w := jwriter.Writer{} - easyjson6601e8cdEncodeGithubComMeilisearchMeilisearchGo30(&w, v) - return w.Buffer.BuildBytes(), w.Error -} - -// MarshalEasyJSON supports easyjson.Marshaler interface -func (v Details) MarshalEasyJSON(w *jwriter.Writer) { - easyjson6601e8cdEncodeGithubComMeilisearchMeilisearchGo30(w, v) -} - -// UnmarshalJSON supports json.Unmarshaler interface -func (v *Details) UnmarshalJSON(data []byte) error { - r := jlexer.Lexer{Data: data} - easyjson6601e8cdDecodeGithubComMeilisearchMeilisearchGo30(&r, v) - return r.Error() -} - -// UnmarshalEasyJSON supports easyjson.Unmarshaler interface -func (v *Details) UnmarshalEasyJSON(l *jlexer.Lexer) { - easyjson6601e8cdDecodeGithubComMeilisearchMeilisearchGo30(l, v) -} -func easyjson6601e8cdDecodeGithubComMeilisearchMeilisearchGo31(in *jlexer.Lexer, out *CreateIndexRequest) { - isTopLevel := in.IsStart() - if in.IsNull() { - if isTopLevel { - in.Consumed() + if in.TypoTolerance != nil { + const prefix string = ",\"typoTolerance\":" + if first { + first = false + out.RawString(prefix[1:]) + } else { + out.RawString(prefix) } - in.Skip() - return + (*in.TypoTolerance).MarshalEasyJSON(out) } - in.Delim('{') - for !in.IsDelim('}') { - key := in.UnsafeFieldName(false) - in.WantColon() + if in.Pagination != nil { + const prefix string = ",\"pagination\":" + if first { + first = false + out.RawString(prefix[1:]) + } else { + out.RawString(prefix) + } + (*in.Pagination).MarshalEasyJSON(out) + } + if in.Faceting != nil { + const prefix string = ",\"faceting\":" + if first { + first = false + out.RawString(prefix[1:]) + } else { + out.RawString(prefix) + } + (*in.Faceting).MarshalEasyJSON(out) + } + if in.MatchedTasks != 0 { + const prefix string = ",\"matchedTasks\":" + if first { + first = false + out.RawString(prefix[1:]) + } else { + out.RawString(prefix) + } + out.Int64(int64(in.MatchedTasks)) + } + if in.CanceledTasks != 0 { + const prefix string = ",\"canceledTasks\":" + if first { + first = false + out.RawString(prefix[1:]) + } else { + out.RawString(prefix) + } + out.Int64(int64(in.CanceledTasks)) + } + if in.DeletedTasks != 0 { + const prefix string = ",\"deletedTasks\":" + if first { + first = false + out.RawString(prefix[1:]) + } else { + out.RawString(prefix) + } + out.Int64(int64(in.DeletedTasks)) + } + if in.OriginalFilter != "" { + const prefix string = ",\"originalFilter\":" + if first { + first = false + out.RawString(prefix[1:]) + } else { + out.RawString(prefix) + } + out.String(string(in.OriginalFilter)) + } + if len(in.Swaps) != 0 { + const prefix string = ",\"swaps\":" + if first { + first = false + out.RawString(prefix[1:]) + } else { + out.RawString(prefix) + } + { + out.RawByte('[') + for v126, v127 := range in.Swaps { + if v126 > 0 { + out.RawByte(',') + } + (v127).MarshalEasyJSON(out) + } + out.RawByte(']') + } + } + out.RawByte('}') +} + +// MarshalJSON supports json.Marshaler interface +func (v Details) MarshalJSON() ([]byte, error) { + w := jwriter.Writer{} + easyjson6601e8cdEncodeGithubComMeilisearchMeilisearchGo31(&w, v) + return w.Buffer.BuildBytes(), w.Error +} + +// MarshalEasyJSON supports easyjson.Marshaler interface +func (v Details) MarshalEasyJSON(w *jwriter.Writer) { + easyjson6601e8cdEncodeGithubComMeilisearchMeilisearchGo31(w, v) +} + +// UnmarshalJSON supports json.Unmarshaler interface +func (v *Details) UnmarshalJSON(data []byte) error { + r := jlexer.Lexer{Data: data} + easyjson6601e8cdDecodeGithubComMeilisearchMeilisearchGo31(&r, v) + return r.Error() +} + +// UnmarshalEasyJSON supports easyjson.Unmarshaler interface +func (v *Details) UnmarshalEasyJSON(l *jlexer.Lexer) { + easyjson6601e8cdDecodeGithubComMeilisearchMeilisearchGo31(l, v) +} +func easyjson6601e8cdDecodeGithubComMeilisearchMeilisearchGo32(in *jlexer.Lexer, out *DeleteTasksQuery) { + isTopLevel := in.IsStart() + if in.IsNull() { + if isTopLevel { + in.Consumed() + } + in.Skip() + return + } + in.Delim('{') + for !in.IsDelim('}') { + key := in.UnsafeFieldName(false) + in.WantColon() + if in.IsNull() { + in.Skip() + in.WantComma() + continue + } + switch key { + case "UIDS": + if in.IsNull() { + in.Skip() + out.UIDS = nil + } else { + in.Delim('[') + if out.UIDS == nil { + if !in.IsDelim(']') { + out.UIDS = make([]int64, 0, 8) + } else { + out.UIDS = []int64{} + } + } else { + out.UIDS = (out.UIDS)[:0] + } + for !in.IsDelim(']') { + var v128 int64 + v128 = int64(in.Int64()) + out.UIDS = append(out.UIDS, v128) + in.WantComma() + } + in.Delim(']') + } + case "IndexUIDS": + if in.IsNull() { + in.Skip() + out.IndexUIDS = nil + } else { + in.Delim('[') + if out.IndexUIDS == nil { + if !in.IsDelim(']') { + out.IndexUIDS = make([]string, 0, 4) + } else { + out.IndexUIDS = []string{} + } + } else { + out.IndexUIDS = (out.IndexUIDS)[:0] + } + for !in.IsDelim(']') { + var v129 string + v129 = string(in.String()) + out.IndexUIDS = append(out.IndexUIDS, v129) + in.WantComma() + } + in.Delim(']') + } + case "Statuses": + if in.IsNull() { + in.Skip() + out.Statuses = nil + } else { + in.Delim('[') + if out.Statuses == nil { + if !in.IsDelim(']') { + out.Statuses = make([]string, 0, 4) + } else { + out.Statuses = []string{} + } + } else { + out.Statuses = (out.Statuses)[:0] + } + for !in.IsDelim(']') { + var v130 string + v130 = string(in.String()) + out.Statuses = append(out.Statuses, v130) + in.WantComma() + } + in.Delim(']') + } + case "Types": + if in.IsNull() { + in.Skip() + out.Types = nil + } else { + in.Delim('[') + if out.Types == nil { + if !in.IsDelim(']') { + out.Types = make([]string, 0, 4) + } else { + out.Types = []string{} + } + } else { + out.Types = (out.Types)[:0] + } + for !in.IsDelim(']') { + var v131 string + v131 = string(in.String()) + out.Types = append(out.Types, v131) + in.WantComma() + } + in.Delim(']') + } + case "CanceledBy": + if in.IsNull() { + in.Skip() + out.CanceledBy = nil + } else { + in.Delim('[') + if out.CanceledBy == nil { + if !in.IsDelim(']') { + out.CanceledBy = make([]int64, 0, 8) + } else { + out.CanceledBy = []int64{} + } + } else { + out.CanceledBy = (out.CanceledBy)[:0] + } + for !in.IsDelim(']') { + var v132 int64 + v132 = int64(in.Int64()) + out.CanceledBy = append(out.CanceledBy, v132) + in.WantComma() + } + in.Delim(']') + } + case "BeforeEnqueuedAt": + if data := in.Raw(); in.Ok() { + in.AddError((out.BeforeEnqueuedAt).UnmarshalJSON(data)) + } + case "AfterEnqueuedAt": + if data := in.Raw(); in.Ok() { + in.AddError((out.AfterEnqueuedAt).UnmarshalJSON(data)) + } + case "BeforeStartedAt": + if data := in.Raw(); in.Ok() { + in.AddError((out.BeforeStartedAt).UnmarshalJSON(data)) + } + case "AfterStartedAt": + if data := in.Raw(); in.Ok() { + in.AddError((out.AfterStartedAt).UnmarshalJSON(data)) + } + case "BeforeFinishedAt": + if data := in.Raw(); in.Ok() { + in.AddError((out.BeforeFinishedAt).UnmarshalJSON(data)) + } + case "AfterFinishedAt": + if data := in.Raw(); in.Ok() { + in.AddError((out.AfterFinishedAt).UnmarshalJSON(data)) + } + default: + in.SkipRecursive() + } + in.WantComma() + } + in.Delim('}') + if isTopLevel { + in.Consumed() + } +} +func easyjson6601e8cdEncodeGithubComMeilisearchMeilisearchGo32(out *jwriter.Writer, in DeleteTasksQuery) { + out.RawByte('{') + first := true + _ = first + { + const prefix string = ",\"UIDS\":" + out.RawString(prefix[1:]) + if in.UIDS == nil && (out.Flags&jwriter.NilSliceAsEmpty) == 0 { + out.RawString("null") + } else { + out.RawByte('[') + for v133, v134 := range in.UIDS { + if v133 > 0 { + out.RawByte(',') + } + out.Int64(int64(v134)) + } + out.RawByte(']') + } + } + { + const prefix string = ",\"IndexUIDS\":" + out.RawString(prefix) + if in.IndexUIDS == nil && (out.Flags&jwriter.NilSliceAsEmpty) == 0 { + out.RawString("null") + } else { + out.RawByte('[') + for v135, v136 := range in.IndexUIDS { + if v135 > 0 { + out.RawByte(',') + } + out.String(string(v136)) + } + out.RawByte(']') + } + } + { + const prefix string = ",\"Statuses\":" + out.RawString(prefix) + if in.Statuses == nil && (out.Flags&jwriter.NilSliceAsEmpty) == 0 { + out.RawString("null") + } else { + out.RawByte('[') + for v137, v138 := range in.Statuses { + if v137 > 0 { + out.RawByte(',') + } + out.String(string(v138)) + } + out.RawByte(']') + } + } + { + const prefix string = ",\"Types\":" + out.RawString(prefix) + if in.Types == nil && (out.Flags&jwriter.NilSliceAsEmpty) == 0 { + out.RawString("null") + } else { + out.RawByte('[') + for v139, v140 := range in.Types { + if v139 > 0 { + out.RawByte(',') + } + out.String(string(v140)) + } + out.RawByte(']') + } + } + { + const prefix string = ",\"CanceledBy\":" + out.RawString(prefix) + if in.CanceledBy == nil && (out.Flags&jwriter.NilSliceAsEmpty) == 0 { + out.RawString("null") + } else { + out.RawByte('[') + for v141, v142 := range in.CanceledBy { + if v141 > 0 { + out.RawByte(',') + } + out.Int64(int64(v142)) + } + out.RawByte(']') + } + } + { + const prefix string = ",\"BeforeEnqueuedAt\":" + out.RawString(prefix) + out.Raw((in.BeforeEnqueuedAt).MarshalJSON()) + } + { + const prefix string = ",\"AfterEnqueuedAt\":" + out.RawString(prefix) + out.Raw((in.AfterEnqueuedAt).MarshalJSON()) + } + { + const prefix string = ",\"BeforeStartedAt\":" + out.RawString(prefix) + out.Raw((in.BeforeStartedAt).MarshalJSON()) + } + { + const prefix string = ",\"AfterStartedAt\":" + out.RawString(prefix) + out.Raw((in.AfterStartedAt).MarshalJSON()) + } + { + const prefix string = ",\"BeforeFinishedAt\":" + out.RawString(prefix) + out.Raw((in.BeforeFinishedAt).MarshalJSON()) + } + { + const prefix string = ",\"AfterFinishedAt\":" + out.RawString(prefix) + out.Raw((in.AfterFinishedAt).MarshalJSON()) + } + out.RawByte('}') +} + +// MarshalJSON supports json.Marshaler interface +func (v DeleteTasksQuery) MarshalJSON() ([]byte, error) { + w := jwriter.Writer{} + easyjson6601e8cdEncodeGithubComMeilisearchMeilisearchGo32(&w, v) + return w.Buffer.BuildBytes(), w.Error +} + +// MarshalEasyJSON supports easyjson.Marshaler interface +func (v DeleteTasksQuery) MarshalEasyJSON(w *jwriter.Writer) { + easyjson6601e8cdEncodeGithubComMeilisearchMeilisearchGo32(w, v) +} + +// UnmarshalJSON supports json.Unmarshaler interface +func (v *DeleteTasksQuery) UnmarshalJSON(data []byte) error { + r := jlexer.Lexer{Data: data} + easyjson6601e8cdDecodeGithubComMeilisearchMeilisearchGo32(&r, v) + return r.Error() +} + +// UnmarshalEasyJSON supports easyjson.Unmarshaler interface +func (v *DeleteTasksQuery) UnmarshalEasyJSON(l *jlexer.Lexer) { + easyjson6601e8cdDecodeGithubComMeilisearchMeilisearchGo32(l, v) +} +func easyjson6601e8cdDecodeGithubComMeilisearchMeilisearchGo33(in *jlexer.Lexer, out *CreateIndexRequest) { + isTopLevel := in.IsStart() + if in.IsNull() { + if isTopLevel { + in.Consumed() + } + in.Skip() + return + } + in.Delim('{') + for !in.IsDelim('}') { + key := in.UnsafeFieldName(false) + in.WantColon() if in.IsNull() { in.Skip() in.WantComma() @@ -4502,7 +5185,7 @@ func easyjson6601e8cdDecodeGithubComMeilisearchMeilisearchGo31(in *jlexer.Lexer, in.Consumed() } } -func easyjson6601e8cdEncodeGithubComMeilisearchMeilisearchGo31(out *jwriter.Writer, in CreateIndexRequest) { +func easyjson6601e8cdEncodeGithubComMeilisearchMeilisearchGo33(out *jwriter.Writer, in CreateIndexRequest) { out.RawByte('{') first := true _ = first @@ -4528,27 +5211,27 @@ func easyjson6601e8cdEncodeGithubComMeilisearchMeilisearchGo31(out *jwriter.Writ // MarshalJSON supports json.Marshaler interface func (v CreateIndexRequest) MarshalJSON() ([]byte, error) { w := jwriter.Writer{} - easyjson6601e8cdEncodeGithubComMeilisearchMeilisearchGo31(&w, v) + easyjson6601e8cdEncodeGithubComMeilisearchMeilisearchGo33(&w, v) return w.Buffer.BuildBytes(), w.Error } // MarshalEasyJSON supports easyjson.Marshaler interface func (v CreateIndexRequest) MarshalEasyJSON(w *jwriter.Writer) { - easyjson6601e8cdEncodeGithubComMeilisearchMeilisearchGo31(w, v) + easyjson6601e8cdEncodeGithubComMeilisearchMeilisearchGo33(w, v) } // UnmarshalJSON supports json.Unmarshaler interface func (v *CreateIndexRequest) UnmarshalJSON(data []byte) error { r := jlexer.Lexer{Data: data} - easyjson6601e8cdDecodeGithubComMeilisearchMeilisearchGo31(&r, v) + easyjson6601e8cdDecodeGithubComMeilisearchMeilisearchGo33(&r, v) return r.Error() } // UnmarshalEasyJSON supports easyjson.Unmarshaler interface func (v *CreateIndexRequest) UnmarshalEasyJSON(l *jlexer.Lexer) { - easyjson6601e8cdDecodeGithubComMeilisearchMeilisearchGo31(l, v) + easyjson6601e8cdDecodeGithubComMeilisearchMeilisearchGo33(l, v) } -func easyjson6601e8cdDecodeGithubComMeilisearchMeilisearchGo32(in *jlexer.Lexer, out *Client) { +func easyjson6601e8cdDecodeGithubComMeilisearchMeilisearchGo34(in *jlexer.Lexer, out *Client) { isTopLevel := in.IsStart() if in.IsNull() { if isTopLevel { @@ -4577,7 +5260,7 @@ func easyjson6601e8cdDecodeGithubComMeilisearchMeilisearchGo32(in *jlexer.Lexer, in.Consumed() } } -func easyjson6601e8cdEncodeGithubComMeilisearchMeilisearchGo32(out *jwriter.Writer, in Client) { +func easyjson6601e8cdEncodeGithubComMeilisearchMeilisearchGo34(out *jwriter.Writer, in Client) { out.RawByte('{') first := true _ = first @@ -4587,23 +5270,274 @@ func easyjson6601e8cdEncodeGithubComMeilisearchMeilisearchGo32(out *jwriter.Writ // MarshalJSON supports json.Marshaler interface func (v Client) MarshalJSON() ([]byte, error) { w := jwriter.Writer{} - easyjson6601e8cdEncodeGithubComMeilisearchMeilisearchGo32(&w, v) + easyjson6601e8cdEncodeGithubComMeilisearchMeilisearchGo34(&w, v) return w.Buffer.BuildBytes(), w.Error } // MarshalEasyJSON supports easyjson.Marshaler interface func (v Client) MarshalEasyJSON(w *jwriter.Writer) { - easyjson6601e8cdEncodeGithubComMeilisearchMeilisearchGo32(w, v) + easyjson6601e8cdEncodeGithubComMeilisearchMeilisearchGo34(w, v) } // UnmarshalJSON supports json.Unmarshaler interface func (v *Client) UnmarshalJSON(data []byte) error { r := jlexer.Lexer{Data: data} - easyjson6601e8cdDecodeGithubComMeilisearchMeilisearchGo32(&r, v) + easyjson6601e8cdDecodeGithubComMeilisearchMeilisearchGo34(&r, v) return r.Error() } // UnmarshalEasyJSON supports easyjson.Unmarshaler interface func (v *Client) UnmarshalEasyJSON(l *jlexer.Lexer) { - easyjson6601e8cdDecodeGithubComMeilisearchMeilisearchGo32(l, v) + easyjson6601e8cdDecodeGithubComMeilisearchMeilisearchGo34(l, v) +} +func easyjson6601e8cdDecodeGithubComMeilisearchMeilisearchGo35(in *jlexer.Lexer, out *CancelTasksQuery) { + isTopLevel := in.IsStart() + if in.IsNull() { + if isTopLevel { + in.Consumed() + } + in.Skip() + return + } + in.Delim('{') + for !in.IsDelim('}') { + key := in.UnsafeFieldName(false) + in.WantColon() + if in.IsNull() { + in.Skip() + in.WantComma() + continue + } + switch key { + case "UIDS": + if in.IsNull() { + in.Skip() + out.UIDS = nil + } else { + in.Delim('[') + if out.UIDS == nil { + if !in.IsDelim(']') { + out.UIDS = make([]int64, 0, 8) + } else { + out.UIDS = []int64{} + } + } else { + out.UIDS = (out.UIDS)[:0] + } + for !in.IsDelim(']') { + var v143 int64 + v143 = int64(in.Int64()) + out.UIDS = append(out.UIDS, v143) + in.WantComma() + } + in.Delim(']') + } + case "IndexUIDS": + if in.IsNull() { + in.Skip() + out.IndexUIDS = nil + } else { + in.Delim('[') + if out.IndexUIDS == nil { + if !in.IsDelim(']') { + out.IndexUIDS = make([]string, 0, 4) + } else { + out.IndexUIDS = []string{} + } + } else { + out.IndexUIDS = (out.IndexUIDS)[:0] + } + for !in.IsDelim(']') { + var v144 string + v144 = string(in.String()) + out.IndexUIDS = append(out.IndexUIDS, v144) + in.WantComma() + } + in.Delim(']') + } + case "Statuses": + if in.IsNull() { + in.Skip() + out.Statuses = nil + } else { + in.Delim('[') + if out.Statuses == nil { + if !in.IsDelim(']') { + out.Statuses = make([]string, 0, 4) + } else { + out.Statuses = []string{} + } + } else { + out.Statuses = (out.Statuses)[:0] + } + for !in.IsDelim(']') { + var v145 string + v145 = string(in.String()) + out.Statuses = append(out.Statuses, v145) + in.WantComma() + } + in.Delim(']') + } + case "Types": + if in.IsNull() { + in.Skip() + out.Types = nil + } else { + in.Delim('[') + if out.Types == nil { + if !in.IsDelim(']') { + out.Types = make([]string, 0, 4) + } else { + out.Types = []string{} + } + } else { + out.Types = (out.Types)[:0] + } + for !in.IsDelim(']') { + var v146 string + v146 = string(in.String()) + out.Types = append(out.Types, v146) + in.WantComma() + } + in.Delim(']') + } + case "BeforeEnqueuedAt": + if data := in.Raw(); in.Ok() { + in.AddError((out.BeforeEnqueuedAt).UnmarshalJSON(data)) + } + case "AfterEnqueuedAt": + if data := in.Raw(); in.Ok() { + in.AddError((out.AfterEnqueuedAt).UnmarshalJSON(data)) + } + case "BeforeStartedAt": + if data := in.Raw(); in.Ok() { + in.AddError((out.BeforeStartedAt).UnmarshalJSON(data)) + } + case "AfterStartedAt": + if data := in.Raw(); in.Ok() { + in.AddError((out.AfterStartedAt).UnmarshalJSON(data)) + } + default: + in.SkipRecursive() + } + in.WantComma() + } + in.Delim('}') + if isTopLevel { + in.Consumed() + } +} +func easyjson6601e8cdEncodeGithubComMeilisearchMeilisearchGo35(out *jwriter.Writer, in CancelTasksQuery) { + out.RawByte('{') + first := true + _ = first + { + const prefix string = ",\"UIDS\":" + out.RawString(prefix[1:]) + if in.UIDS == nil && (out.Flags&jwriter.NilSliceAsEmpty) == 0 { + out.RawString("null") + } else { + out.RawByte('[') + for v147, v148 := range in.UIDS { + if v147 > 0 { + out.RawByte(',') + } + out.Int64(int64(v148)) + } + out.RawByte(']') + } + } + { + const prefix string = ",\"IndexUIDS\":" + out.RawString(prefix) + if in.IndexUIDS == nil && (out.Flags&jwriter.NilSliceAsEmpty) == 0 { + out.RawString("null") + } else { + out.RawByte('[') + for v149, v150 := range in.IndexUIDS { + if v149 > 0 { + out.RawByte(',') + } + out.String(string(v150)) + } + out.RawByte(']') + } + } + { + const prefix string = ",\"Statuses\":" + out.RawString(prefix) + if in.Statuses == nil && (out.Flags&jwriter.NilSliceAsEmpty) == 0 { + out.RawString("null") + } else { + out.RawByte('[') + for v151, v152 := range in.Statuses { + if v151 > 0 { + out.RawByte(',') + } + out.String(string(v152)) + } + out.RawByte(']') + } + } + { + const prefix string = ",\"Types\":" + out.RawString(prefix) + if in.Types == nil && (out.Flags&jwriter.NilSliceAsEmpty) == 0 { + out.RawString("null") + } else { + out.RawByte('[') + for v153, v154 := range in.Types { + if v153 > 0 { + out.RawByte(',') + } + out.String(string(v154)) + } + out.RawByte(']') + } + } + { + const prefix string = ",\"BeforeEnqueuedAt\":" + out.RawString(prefix) + out.Raw((in.BeforeEnqueuedAt).MarshalJSON()) + } + { + const prefix string = ",\"AfterEnqueuedAt\":" + out.RawString(prefix) + out.Raw((in.AfterEnqueuedAt).MarshalJSON()) + } + { + const prefix string = ",\"BeforeStartedAt\":" + out.RawString(prefix) + out.Raw((in.BeforeStartedAt).MarshalJSON()) + } + { + const prefix string = ",\"AfterStartedAt\":" + out.RawString(prefix) + out.Raw((in.AfterStartedAt).MarshalJSON()) + } + out.RawByte('}') +} + +// MarshalJSON supports json.Marshaler interface +func (v CancelTasksQuery) MarshalJSON() ([]byte, error) { + w := jwriter.Writer{} + easyjson6601e8cdEncodeGithubComMeilisearchMeilisearchGo35(&w, v) + return w.Buffer.BuildBytes(), w.Error +} + +// MarshalEasyJSON supports easyjson.Marshaler interface +func (v CancelTasksQuery) MarshalEasyJSON(w *jwriter.Writer) { + easyjson6601e8cdEncodeGithubComMeilisearchMeilisearchGo35(w, v) +} + +// UnmarshalJSON supports json.Unmarshaler interface +func (v *CancelTasksQuery) UnmarshalJSON(data []byte) error { + r := jlexer.Lexer{Data: data} + easyjson6601e8cdDecodeGithubComMeilisearchMeilisearchGo35(&r, v) + return r.Error() +} + +// UnmarshalEasyJSON supports easyjson.Unmarshaler interface +func (v *CancelTasksQuery) UnmarshalEasyJSON(l *jlexer.Lexer) { + easyjson6601e8cdDecodeGithubComMeilisearchMeilisearchGo35(l, v) }