From 14758657da5f307f6252d807ea4a5ea279c6dd66 Mon Sep 17 00:00:00 2001 From: meili-bot <74670311+meili-bot@users.noreply.github.com> Date: Mon, 7 Nov 2022 18:07:25 +0100 Subject: [PATCH 01/12] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 8fa15232..3a4abb34 100644 --- a/README.md +++ b/README.md @@ -239,7 +239,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 From 9a66fbd3d7becc2b861714900970a77856a0133b Mon Sep 17 00:00:00 2001 From: alallema Date: Thu, 1 Dec 2022 16:17:18 +0100 Subject: [PATCH 02/12] Add tasks filters for v0.30 --- client.go | 12 +- client_test.go | 80 ++++- index.go | 16 +- types.go | 34 +- types_easyjson.go | 892 ++++++++++++++++++++++++++-------------------- 5 files changed, 593 insertions(+), 441 deletions(-) diff --git a/client.go b/client.go index 8cc61532..eaf1fceb 100644 --- a/client.go +++ b/client.go @@ -283,14 +283,14 @@ func (c *Client) 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 { - req.withQueryParams["indexUid"] = strings.Join(param.IndexUID, ",") + if len(param.IndexUIDs) != 0 { + req.withQueryParams["indexUids"] = strings.Join(param.IndexUIDs, ",") } } if err := c.executeRequest(req); err != nil { diff --git a/client_test.go b/client_test.go index 5323e084..8cb3f4d0 100644 --- a/client_test.go +++ b/client_test.go @@ -747,9 +747,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: []string{"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: 1, }, }, }, @@ -979,7 +1021,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 +1037,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 +1052,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 +1069,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 +1086,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 +1104,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 +1123,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 +1142,7 @@ func TestClient_GenerateTenantToken(t *testing.T) { { name: "TestGenerateTenantTokenWithoutSearchRules", args: args{ - IndexUID: "TestGenerateTenantTokenWithoutSearchRules", + IndexUIDs: "TestGenerateTenantTokenWithoutSearchRules", client: privateClient, APIKeyUID: GetPrivateUIDKey(), searchRules: nil, @@ -1113,7 +1155,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 +1173,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 +1190,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 +1205,7 @@ func TestClient_GenerateTenantToken(t *testing.T) { { name: "TestGenerateTenantTokenWithEmptyAPIKeyUID", args: args{ - IndexUID: "TestGenerateTenantTokenWithEmptyAPIKeyUID", + IndexUIDs: "TestGenerateTenantTokenWithEmptyAPIKeyUID", client: defaultClient, APIKeyUID: "", searchRules: map[string]interface{}{ @@ -1189,11 +1231,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 +1244,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..26641875 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/types.go b/types.go index a28cdf5b..d2c1523a 100644 --- a/types.go +++ b/types.go @@ -130,31 +130,35 @@ 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,omitempty"` + IndexUID string `json:"indexUid"` + Type string `json:"type"` + EnqueuedAt time.Time `json:"enqueuedAt"` } // TasksQuery is the request body for list documents method 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 []string `json:"uids,omitempty"` + Limit int64 `json:"limit,omitempty"` + From int64 `json:"from,omitempty"` + IndexUIDs []string `json:"indexUids,omitempty"` + Statuses []string `json:"statuses,omitempty"` + Types []string `json:"types,omitempty"` + CanceledBy int64 `json:"canceledBy,omitempty"` + BeforeEnqueuedAt time.Time `json:"beforeEnqueuedAt,omitempty"` + AfterEnqueuedAt time.Time `json:"afterEnqueuedAt,omitempty"` + BeforeStartedAt time.Time `json:"beforeStartedAt,omitempty"` + AfterStartedAt time.Time `json:"afterStartedAt,omitempty"` + BeforeFinishedAt time.Time `json:"beforeFinishedAt,omitempty"` + AfterFinishedAt time.Time `json:"afterFinishedAt,omitempty"` } type Details struct { diff --git a/types_easyjson.go b/types_easyjson.go index 99aa443b..7e6cdb89 100644 --- a/types_easyjson.go +++ b/types_easyjson.go @@ -587,79 +587,128 @@ 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([]string, 0, 4) } else { - out.IndexUID = []string{} + out.UIDs = []string{} } } 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) + 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": + out.CanceledBy = int64(in.Int64()) + 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,10 +723,29 @@ func easyjson6601e8cdEncodeGithubComMeilisearchMeilisearchGo5(out *jwriter.Write out.RawByte('{') first := true _ = first - if in.Limit != 0 { - const prefix string = ",\"limit\":" + if len(in.UIDs) != 0 { + const prefix string = ",\"uids\":" first = false out.RawString(prefix[1:]) + { + out.RawByte('[') + for v11, v12 := range in.UIDs { + if v11 > 0 { + out.RawByte(',') + } + out.String(string(v12)) + } + out.RawByte(']') + } + } + if in.Limit != 0 { + const prefix string = ",\"limit\":" + if first { + first = false + out.RawString(prefix[1:]) + } else { + out.RawString(prefix) + } out.Int64(int64(in.Limit)) } if in.From != 0 { @@ -690,8 +758,8 @@ func easyjson6601e8cdEncodeGithubComMeilisearchMeilisearchGo5(out *jwriter.Write } out.Int64(int64(in.From)) } - if len(in.IndexUID) != 0 { - const prefix string = ",\"indexUid\":" + if len(in.IndexUIDs) != 0 { + const prefix string = ",\"indexUids\":" if first { first = false out.RawString(prefix[1:]) @@ -700,17 +768,17 @@ func easyjson6601e8cdEncodeGithubComMeilisearchMeilisearchGo5(out *jwriter.Write } { out.RawByte('[') - for v10, v11 := range in.IndexUID { - if v10 > 0 { + for v13, v14 := range in.IndexUIDs { + if v13 > 0 { out.RawByte(',') } - out.String(string(v11)) + out.String(string(v14)) } out.RawByte(']') } } - if len(in.Status) != 0 { - const prefix string = ",\"status\":" + if len(in.Statuses) != 0 { + const prefix string = ",\"statuses\":" if first { first = false out.RawString(prefix[1:]) @@ -719,17 +787,17 @@ func easyjson6601e8cdEncodeGithubComMeilisearchMeilisearchGo5(out *jwriter.Write } { out.RawByte('[') - for v12, v13 := range in.Status { - if v12 > 0 { + for v15, v16 := range in.Statuses { + if v15 > 0 { out.RawByte(',') } - out.String(string(v13)) + out.String(string(v16)) } out.RawByte(']') } } - if len(in.Type) != 0 { - const prefix string = ",\"type\":" + if len(in.Types) != 0 { + const prefix string = ",\"types\":" if first { first = false out.RawString(prefix[1:]) @@ -738,15 +806,85 @@ func easyjson6601e8cdEncodeGithubComMeilisearchMeilisearchGo5(out *jwriter.Write } { out.RawByte('[') - for v14, v15 := range in.Type { - if v14 > 0 { + for v17, v18 := range in.Types { + if v17 > 0 { out.RawByte(',') } - out.String(string(v15)) + out.String(string(v18)) } out.RawByte(']') } } + if in.CanceledBy != 0 { + const prefix string = ",\"canceledBy\":" + if first { + first = false + out.RawString(prefix[1:]) + } else { + out.RawString(prefix) + } + out.Int64(int64(in.CanceledBy)) + } + if true { + const prefix string = ",\"beforeEnqueuedAt\":" + if first { + first = false + out.RawString(prefix[1:]) + } else { + out.RawString(prefix) + } + out.Raw((in.BeforeEnqueuedAt).MarshalJSON()) + } + if true { + const prefix string = ",\"afterEnqueuedAt\":" + if first { + first = false + out.RawString(prefix[1:]) + } else { + out.RawString(prefix) + } + out.Raw((in.AfterEnqueuedAt).MarshalJSON()) + } + if true { + const prefix string = ",\"beforeStartedAt\":" + if first { + first = false + out.RawString(prefix[1:]) + } else { + out.RawString(prefix) + } + out.Raw((in.BeforeStartedAt).MarshalJSON()) + } + if true { + const prefix string = ",\"afterStartedAt\":" + if first { + first = false + out.RawString(prefix[1:]) + } else { + out.RawString(prefix) + } + out.Raw((in.AfterStartedAt).MarshalJSON()) + } + if true { + const prefix string = ",\"beforeFinishedAt\":" + if first { + first = false + out.RawString(prefix[1:]) + } else { + out.RawString(prefix) + } + out.Raw((in.BeforeFinishedAt).MarshalJSON()) + } + if true { + const prefix string = ",\"afterFinishedAt\":" + if first { + first = false + out.RawString(prefix[1:]) + } else { + out.RawString(prefix) + } + out.Raw((in.AfterFinishedAt).MarshalJSON()) + } out.RawByte('}') } @@ -808,9 +946,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 v19 Task + (v19).UnmarshalEasyJSON(in) + out.Results = append(out.Results, v19) in.WantComma() } in.Delim(']') @@ -842,11 +980,11 @@ func easyjson6601e8cdEncodeGithubComMeilisearchMeilisearchGo6(out *jwriter.Write out.RawString("null") } else { out.RawByte('[') - for v17, v18 := range in.Results { - if v17 > 0 { + for v20, v21 := range in.Results { + if v20 > 0 { out.RawByte(',') } - (v18).MarshalEasyJSON(out) + (v21).MarshalEasyJSON(out) } out.RawByte(']') } @@ -919,24 +1057,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() } @@ -971,36 +1095,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 +1126,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 +1156,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 +1173,8 @@ func easyjson6601e8cdDecodeGithubComMeilisearchMeilisearchGo9(in *jlexer.Lexer, } case "details": (out.Details).UnmarshalEasyJSON(in) + case "canceledBy": + out.CanceledBy = int64(in.Int64()) default: in.SkipRecursive() } @@ -1147,7 +1185,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 +1217,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,31 +1244,99 @@ 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 easyjson6601e8cdDecodeGithubComMeilisearchMeilisearchGo9(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 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 *StatsIndex) { isTopLevel := in.IsStart() @@ -1264,9 +1370,9 @@ func easyjson6601e8cdDecodeGithubComMeilisearchMeilisearchGo10(in *jlexer.Lexer, for !in.IsDelim('}') { key := string(in.String()) in.WantColon() - var v19 int64 - v19 = int64(in.Int64()) - (out.FieldDistribution)[key] = v19 + var v22 int64 + v22 = int64(in.Int64()) + (out.FieldDistribution)[key] = v22 in.WantComma() } in.Delim('}') @@ -1302,16 +1408,16 @@ func easyjson6601e8cdEncodeGithubComMeilisearchMeilisearchGo10(out *jwriter.Writ out.RawString(`null`) } else { out.RawByte('{') - v20First := true - for v20Name, v20Value := range in.FieldDistribution { - if v20First { - v20First = false + v23First := true + for v23Name, v23Value := range in.FieldDistribution { + if v23First { + v23First = false } else { out.RawByte(',') } - out.String(string(v20Name)) + out.String(string(v23Name)) out.RawByte(':') - out.Int64(int64(v20Value)) + out.Int64(int64(v23Value)) } out.RawByte('}') } @@ -1376,9 +1482,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 v24 StatsIndex + (v24).UnmarshalEasyJSON(in) + (out.Indexes)[key] = v24 in.WantComma() } in.Delim('}') @@ -1414,16 +1520,16 @@ func easyjson6601e8cdEncodeGithubComMeilisearchMeilisearchGo11(out *jwriter.Writ out.RawString(`null`) } else { out.RawByte('{') - v22First := true - for v22Name, v22Value := range in.Indexes { - if v22First { - v22First = false + v25First := true + for v25Name, v25Value := range in.Indexes { + if v25First { + v25First = false } else { out.RawByte(',') } - out.String(string(v22Name)) + out.String(string(v25Name)) out.RawByte(':') - (v22Value).MarshalEasyJSON(out) + (v25Value).MarshalEasyJSON(out) } out.RawByte('}') } @@ -1489,9 +1595,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 v26 string + v26 = string(in.String()) + out.RankingRules = append(out.RankingRules, v26) in.WantComma() } in.Delim(']') @@ -1522,9 +1628,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 v27 string + v27 = string(in.String()) + out.SearchableAttributes = append(out.SearchableAttributes, v27) in.WantComma() } in.Delim(']') @@ -1545,9 +1651,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 v28 string + v28 = string(in.String()) + out.DisplayedAttributes = append(out.DisplayedAttributes, v28) in.WantComma() } in.Delim(']') @@ -1568,9 +1674,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 v29 string + v29 = string(in.String()) + out.StopWords = append(out.StopWords, v29) in.WantComma() } in.Delim(']') @@ -1588,30 +1694,30 @@ func easyjson6601e8cdDecodeGithubComMeilisearchMeilisearchGo12(in *jlexer.Lexer, for !in.IsDelim('}') { key := string(in.String()) in.WantColon() - var v27 []string + var v30 []string if in.IsNull() { in.Skip() - v27 = nil + v30 = nil } else { in.Delim('[') - if v27 == nil { + if v30 == nil { if !in.IsDelim(']') { - v27 = make([]string, 0, 4) + v30 = make([]string, 0, 4) } else { - v27 = []string{} + v30 = []string{} } } else { - v27 = (v27)[:0] + v30 = (v30)[:0] } for !in.IsDelim(']') { - var v28 string - v28 = string(in.String()) - v27 = append(v27, v28) + var v31 string + v31 = string(in.String()) + v30 = append(v30, v31) in.WantComma() } in.Delim(']') } - (out.Synonyms)[key] = v27 + (out.Synonyms)[key] = v30 in.WantComma() } in.Delim('}') @@ -1632,9 +1738,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 v32 string + v32 = string(in.String()) + out.FilterableAttributes = append(out.FilterableAttributes, v32) in.WantComma() } in.Delim(']') @@ -1655,9 +1761,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 v33 string + v33 = string(in.String()) + out.SortableAttributes = append(out.SortableAttributes, v33) in.WantComma() } in.Delim(']') @@ -1712,11 +1818,11 @@ func easyjson6601e8cdEncodeGithubComMeilisearchMeilisearchGo12(out *jwriter.Writ out.RawString(prefix[1:]) { out.RawByte('[') - for v31, v32 := range in.RankingRules { - if v31 > 0 { + for v34, v35 := range in.RankingRules { + if v34 > 0 { out.RawByte(',') } - out.String(string(v32)) + out.String(string(v35)) } out.RawByte(']') } @@ -1741,11 +1847,11 @@ func easyjson6601e8cdEncodeGithubComMeilisearchMeilisearchGo12(out *jwriter.Writ } { out.RawByte('[') - for v33, v34 := range in.SearchableAttributes { - if v33 > 0 { + for v36, v37 := range in.SearchableAttributes { + if v36 > 0 { out.RawByte(',') } - out.String(string(v34)) + out.String(string(v37)) } out.RawByte(']') } @@ -1760,11 +1866,11 @@ func easyjson6601e8cdEncodeGithubComMeilisearchMeilisearchGo12(out *jwriter.Writ } { out.RawByte('[') - for v35, v36 := range in.DisplayedAttributes { - if v35 > 0 { + for v38, v39 := range in.DisplayedAttributes { + if v38 > 0 { out.RawByte(',') } - out.String(string(v36)) + out.String(string(v39)) } out.RawByte(']') } @@ -1779,11 +1885,11 @@ func easyjson6601e8cdEncodeGithubComMeilisearchMeilisearchGo12(out *jwriter.Writ } { out.RawByte('[') - for v37, v38 := range in.StopWords { - if v37 > 0 { + for v40, v41 := range in.StopWords { + if v40 > 0 { out.RawByte(',') } - out.String(string(v38)) + out.String(string(v41)) } out.RawByte(']') } @@ -1798,24 +1904,24 @@ func easyjson6601e8cdEncodeGithubComMeilisearchMeilisearchGo12(out *jwriter.Writ } { out.RawByte('{') - v39First := true - for v39Name, v39Value := range in.Synonyms { - if v39First { - v39First = false + v42First := true + for v42Name, v42Value := range in.Synonyms { + if v42First { + v42First = false } else { out.RawByte(',') } - out.String(string(v39Name)) + out.String(string(v42Name)) out.RawByte(':') - if v39Value == nil && (out.Flags&jwriter.NilSliceAsEmpty) == 0 { + if v42Value == nil && (out.Flags&jwriter.NilSliceAsEmpty) == 0 { out.RawString("null") } else { out.RawByte('[') - for v40, v41 := range v39Value { - if v40 > 0 { + for v43, v44 := range v42Value { + if v43 > 0 { out.RawByte(',') } - out.String(string(v41)) + out.String(string(v44)) } out.RawByte(']') } @@ -1833,11 +1939,11 @@ func easyjson6601e8cdEncodeGithubComMeilisearchMeilisearchGo12(out *jwriter.Writ } { out.RawByte('[') - for v42, v43 := range in.FilterableAttributes { - if v42 > 0 { + for v45, v46 := range in.FilterableAttributes { + if v45 > 0 { out.RawByte(',') } - out.String(string(v43)) + out.String(string(v46)) } out.RawByte(']') } @@ -1852,11 +1958,11 @@ func easyjson6601e8cdEncodeGithubComMeilisearchMeilisearchGo12(out *jwriter.Writ } { out.RawByte('[') - for v44, v45 := range in.SortableAttributes { - if v44 > 0 { + for v47, v48 := range in.SortableAttributes { + if v47 > 0 { out.RawByte(',') } - out.String(string(v45)) + out.String(string(v48)) } out.RawByte(']') } @@ -1952,15 +2058,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 v49 interface{} + if m, ok := v49.(easyjson.Unmarshaler); ok { m.UnmarshalEasyJSON(in) - } else if m, ok := v46.(json.Unmarshaler); ok { + } else if m, ok := v49.(json.Unmarshaler); ok { _ = m.UnmarshalJSON(in.Raw()) } else { - v46 = in.Interface() + v49 = in.Interface() } - out.Hits = append(out.Hits, v46) + out.Hits = append(out.Hits, v49) in.WantComma() } in.Delim(']') @@ -2004,16 +2110,16 @@ func easyjson6601e8cdEncodeGithubComMeilisearchMeilisearchGo13(out *jwriter.Writ out.RawString("null") } else { out.RawByte('[') - for v47, v48 := range in.Hits { - if v47 > 0 { + for v50, v51 := range in.Hits { + if v50 > 0 { out.RawByte(',') } - if m, ok := v48.(easyjson.Marshaler); ok { + if m, ok := v51.(easyjson.Marshaler); ok { m.MarshalEasyJSON(out) - } else if m, ok := v48.(json.Marshaler); ok { + } else if m, ok := v51.(json.Marshaler); ok { out.Raw(m.MarshalJSON()) } else { - out.Raw(json.Marshal(v48)) + out.Raw(json.Marshal(v51)) } } out.RawByte(']') @@ -2120,9 +2226,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 v52 string + v52 = string(in.String()) + out.AttributesToRetrieve = append(out.AttributesToRetrieve, v52) in.WantComma() } in.Delim(']') @@ -2143,9 +2249,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 v53 string + v53 = string(in.String()) + out.AttributesToCrop = append(out.AttributesToCrop, v53) in.WantComma() } in.Delim(']') @@ -2170,9 +2276,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 v54 string + v54 = string(in.String()) + out.AttributesToHighlight = append(out.AttributesToHighlight, v54) in.WantComma() } in.Delim(']') @@ -2209,9 +2315,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 v55 string + v55 = string(in.String()) + out.Facets = append(out.Facets, v55) in.WantComma() } in.Delim(']') @@ -2234,9 +2340,9 @@ 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 v56 string + v56 = string(in.String()) + out.Sort = append(out.Sort, v56) in.WantComma() } in.Delim(']') @@ -2272,11 +2378,11 @@ func easyjson6601e8cdEncodeGithubComMeilisearchMeilisearchGo14(out *jwriter.Writ out.RawString("null") } else { out.RawByte('[') - for v54, v55 := range in.AttributesToRetrieve { - if v54 > 0 { + for v57, v58 := range in.AttributesToRetrieve { + if v57 > 0 { out.RawByte(',') } - out.String(string(v55)) + out.String(string(v58)) } out.RawByte(']') } @@ -2288,11 +2394,11 @@ func easyjson6601e8cdEncodeGithubComMeilisearchMeilisearchGo14(out *jwriter.Writ out.RawString("null") } else { out.RawByte('[') - for v56, v57 := range in.AttributesToCrop { - if v56 > 0 { + for v59, v60 := range in.AttributesToCrop { + if v59 > 0 { out.RawByte(',') } - out.String(string(v57)) + out.String(string(v60)) } out.RawByte(']') } @@ -2314,11 +2420,11 @@ func easyjson6601e8cdEncodeGithubComMeilisearchMeilisearchGo14(out *jwriter.Writ out.RawString("null") } else { out.RawByte('[') - for v58, v59 := range in.AttributesToHighlight { - if v58 > 0 { + for v61, v62 := range in.AttributesToHighlight { + if v61 > 0 { out.RawByte(',') } - out.String(string(v59)) + out.String(string(v62)) } out.RawByte(']') } @@ -2361,11 +2467,11 @@ func easyjson6601e8cdEncodeGithubComMeilisearchMeilisearchGo14(out *jwriter.Writ out.RawString("null") } else { out.RawByte('[') - for v60, v61 := range in.Facets { - if v60 > 0 { + for v63, v64 := range in.Facets { + if v63 > 0 { out.RawByte(',') } - out.String(string(v61)) + out.String(string(v64)) } out.RawByte(']') } @@ -2382,11 +2488,11 @@ func easyjson6601e8cdEncodeGithubComMeilisearchMeilisearchGo14(out *jwriter.Writ out.RawString("null") } else { out.RawByte('[') - for v62, v63 := range in.Sort { - if v62 > 0 { + for v65, v66 := range in.Sort { + if v65 > 0 { out.RawByte(',') } - out.String(string(v63)) + out.String(string(v66)) } out.RawByte(']') } @@ -2597,9 +2703,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 v67 Key + (v67).UnmarshalEasyJSON(in) + out.Results = append(out.Results, v67) in.WantComma() } in.Delim(']') @@ -2631,11 +2737,11 @@ func easyjson6601e8cdEncodeGithubComMeilisearchMeilisearchGo17(out *jwriter.Writ out.RawString("null") } else { out.RawByte('[') - for v65, v66 := range in.Results { - if v65 > 0 { + for v68, v69 := range in.Results { + if v68 > 0 { out.RawByte(',') } - (v66).MarshalEasyJSON(out) + (v69).MarshalEasyJSON(out) } out.RawByte(']') } @@ -2880,9 +2986,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 v70 string + v70 = string(in.String()) + out.Actions = append(out.Actions, v70) in.WantComma() } in.Delim(']') @@ -2903,9 +3009,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 v71 string + v71 = string(in.String()) + out.Indexes = append(out.Indexes, v71) in.WantComma() } in.Delim(']') @@ -2962,11 +3068,11 @@ func easyjson6601e8cdEncodeGithubComMeilisearchMeilisearchGo20(out *jwriter.Writ out.RawString(prefix) { out.RawByte('[') - for v69, v70 := range in.Actions { - if v69 > 0 { + for v72, v73 := range in.Actions { + if v72 > 0 { out.RawByte(',') } - out.String(string(v70)) + out.String(string(v73)) } out.RawByte(']') } @@ -2976,11 +3082,11 @@ func easyjson6601e8cdEncodeGithubComMeilisearchMeilisearchGo20(out *jwriter.Writ out.RawString(prefix) { out.RawByte('[') - for v71, v72 := range in.Indexes { - if v71 > 0 { + for v74, v75 := range in.Indexes { + if v74 > 0 { out.RawByte(',') } - out.String(string(v72)) + out.String(string(v75)) } out.RawByte(']') } @@ -3073,9 +3179,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 v76 string + v76 = string(in.String()) + out.Actions = append(out.Actions, v76) in.WantComma() } in.Delim(']') @@ -3096,9 +3202,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 v77 string + v77 = string(in.String()) + out.Indexes = append(out.Indexes, v77) in.WantComma() } in.Delim(']') @@ -3154,11 +3260,11 @@ func easyjson6601e8cdEncodeGithubComMeilisearchMeilisearchGo21(out *jwriter.Writ out.RawString(prefix) { out.RawByte('[') - for v75, v76 := range in.Actions { - if v75 > 0 { + for v78, v79 := range in.Actions { + if v78 > 0 { out.RawByte(',') } - out.String(string(v76)) + out.String(string(v79)) } out.RawByte(']') } @@ -3168,11 +3274,11 @@ func easyjson6601e8cdEncodeGithubComMeilisearchMeilisearchGo21(out *jwriter.Writ out.RawString(prefix) { out.RawByte('[') - for v77, v78 := range in.Indexes { - if v77 > 0 { + for v80, v81 := range in.Indexes { + if v80 > 0 { out.RawByte(',') } - out.String(string(v78)) + out.String(string(v81)) } out.RawByte(']') } @@ -3253,9 +3359,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 v82 Index + (v82).UnmarshalEasyJSON(in) + out.Results = append(out.Results, v82) in.WantComma() } in.Delim(']') @@ -3287,11 +3393,11 @@ func easyjson6601e8cdEncodeGithubComMeilisearchMeilisearchGo22(out *jwriter.Writ out.RawString("null") } else { out.RawByte('[') - for v80, v81 := range in.Results { - if v80 > 0 { + for v83, v84 := range in.Results { + if v83 > 0 { out.RawByte(',') } - (v81).MarshalEasyJSON(out) + (v84).MarshalEasyJSON(out) } out.RawByte(']') } @@ -3674,29 +3780,29 @@ func easyjson6601e8cdDecodeGithubComMeilisearchMeilisearchGo27(in *jlexer.Lexer, out.Results = (out.Results)[:0] } for !in.IsDelim(']') { - var v82 map[string]interface{} + var v85 map[string]interface{} if in.IsNull() { in.Skip() } else { in.Delim('{') - v82 = make(map[string]interface{}) + v85 = make(map[string]interface{}) for !in.IsDelim('}') { key := string(in.String()) in.WantColon() - var v83 interface{} - if m, ok := v83.(easyjson.Unmarshaler); ok { + var v86 interface{} + if m, ok := v86.(easyjson.Unmarshaler); ok { m.UnmarshalEasyJSON(in) - } else if m, ok := v83.(json.Unmarshaler); ok { + } else if m, ok := v86.(json.Unmarshaler); ok { _ = m.UnmarshalJSON(in.Raw()) } else { - v83 = in.Interface() + v86 = in.Interface() } - (v82)[key] = v83 + (v85)[key] = v86 in.WantComma() } in.Delim('}') } - out.Results = append(out.Results, v82) + out.Results = append(out.Results, v85) in.WantComma() } in.Delim(']') @@ -3728,29 +3834,29 @@ func easyjson6601e8cdEncodeGithubComMeilisearchMeilisearchGo27(out *jwriter.Writ out.RawString("null") } else { out.RawByte('[') - for v84, v85 := range in.Results { - if v84 > 0 { + for v87, v88 := range in.Results { + if v87 > 0 { out.RawByte(',') } - if v85 == nil && (out.Flags&jwriter.NilMapAsEmpty) == 0 { + if v88 == nil && (out.Flags&jwriter.NilMapAsEmpty) == 0 { out.RawString(`null`) } else { out.RawByte('{') - v86First := true - for v86Name, v86Value := range v85 { - if v86First { - v86First = false + v89First := true + for v89Name, v89Value := range v88 { + if v89First { + v89First = false } else { out.RawByte(',') } - out.String(string(v86Name)) + out.String(string(v89Name)) out.RawByte(':') - if m, ok := v86Value.(easyjson.Marshaler); ok { + if m, ok := v89Value.(easyjson.Marshaler); ok { m.MarshalEasyJSON(out) - } else if m, ok := v86Value.(json.Marshaler); ok { + } else if m, ok := v89Value.(json.Marshaler); ok { out.Raw(m.MarshalJSON()) } else { - out.Raw(json.Marshal(v86Value)) + out.Raw(json.Marshal(v89Value)) } } out.RawByte('}') @@ -3839,9 +3945,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 v90 string + v90 = string(in.String()) + out.Fields = append(out.Fields, v90) in.WantComma() } in.Delim(']') @@ -3886,11 +3992,11 @@ func easyjson6601e8cdEncodeGithubComMeilisearchMeilisearchGo28(out *jwriter.Writ } { out.RawByte('[') - for v88, v89 := range in.Fields { - if v88 > 0 { + for v91, v92 := range in.Fields { + if v91 > 0 { out.RawByte(',') } - out.String(string(v89)) + out.String(string(v92)) } out.RawByte(']') } @@ -3956,9 +4062,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 v93 string + v93 = string(in.String()) + out.Fields = append(out.Fields, v93) in.WantComma() } in.Delim(']') @@ -3983,11 +4089,11 @@ func easyjson6601e8cdEncodeGithubComMeilisearchMeilisearchGo29(out *jwriter.Writ out.RawString(prefix[1:]) { out.RawByte('[') - for v91, v92 := range in.Fields { - if v91 > 0 { + for v94, v95 := range in.Fields { + if v94 > 0 { out.RawByte(',') } - out.String(string(v92)) + out.String(string(v95)) } out.RawByte(']') } @@ -4061,9 +4167,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 v96 string + v96 = string(in.String()) + out.RankingRules = append(out.RankingRules, v96) in.WantComma() } in.Delim(']') @@ -4094,9 +4200,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 v97 string + v97 = string(in.String()) + out.SearchableAttributes = append(out.SearchableAttributes, v97) in.WantComma() } in.Delim(']') @@ -4117,9 +4223,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 v98 string + v98 = string(in.String()) + out.DisplayedAttributes = append(out.DisplayedAttributes, v98) in.WantComma() } in.Delim(']') @@ -4140,9 +4246,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 v99 string + v99 = string(in.String()) + out.StopWords = append(out.StopWords, v99) in.WantComma() } in.Delim(']') @@ -4160,30 +4266,30 @@ func easyjson6601e8cdDecodeGithubComMeilisearchMeilisearchGo30(in *jlexer.Lexer, for !in.IsDelim('}') { key := string(in.String()) in.WantColon() - var v97 []string + var v100 []string if in.IsNull() { in.Skip() - v97 = nil + v100 = nil } else { in.Delim('[') - if v97 == nil { + if v100 == nil { if !in.IsDelim(']') { - v97 = make([]string, 0, 4) + v100 = make([]string, 0, 4) } else { - v97 = []string{} + v100 = []string{} } } else { - v97 = (v97)[:0] + v100 = (v100)[:0] } for !in.IsDelim(']') { - var v98 string - v98 = string(in.String()) - v97 = append(v97, v98) + var v101 string + v101 = string(in.String()) + v100 = append(v100, v101) in.WantComma() } in.Delim(']') } - (out.Synonyms)[key] = v97 + (out.Synonyms)[key] = v100 in.WantComma() } in.Delim('}') @@ -4204,9 +4310,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 v102 string + v102 = string(in.String()) + out.FilterableAttributes = append(out.FilterableAttributes, v102) in.WantComma() } in.Delim(']') @@ -4227,9 +4333,9 @@ 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 v103 string + v103 = string(in.String()) + out.SortableAttributes = append(out.SortableAttributes, v103) in.WantComma() } in.Delim(']') @@ -4294,11 +4400,11 @@ func easyjson6601e8cdEncodeGithubComMeilisearchMeilisearchGo30(out *jwriter.Writ } { out.RawByte('[') - for v101, v102 := range in.RankingRules { - if v101 > 0 { + for v104, v105 := range in.RankingRules { + if v104 > 0 { out.RawByte(',') } - out.String(string(v102)) + out.String(string(v105)) } out.RawByte(']') } @@ -4323,11 +4429,11 @@ func easyjson6601e8cdEncodeGithubComMeilisearchMeilisearchGo30(out *jwriter.Writ } { out.RawByte('[') - for v103, v104 := range in.SearchableAttributes { - if v103 > 0 { + for v106, v107 := range in.SearchableAttributes { + if v106 > 0 { out.RawByte(',') } - out.String(string(v104)) + out.String(string(v107)) } out.RawByte(']') } @@ -4342,11 +4448,11 @@ func easyjson6601e8cdEncodeGithubComMeilisearchMeilisearchGo30(out *jwriter.Writ } { out.RawByte('[') - for v105, v106 := range in.DisplayedAttributes { - if v105 > 0 { + for v108, v109 := range in.DisplayedAttributes { + if v108 > 0 { out.RawByte(',') } - out.String(string(v106)) + out.String(string(v109)) } out.RawByte(']') } @@ -4361,11 +4467,11 @@ func easyjson6601e8cdEncodeGithubComMeilisearchMeilisearchGo30(out *jwriter.Writ } { out.RawByte('[') - for v107, v108 := range in.StopWords { - if v107 > 0 { + for v110, v111 := range in.StopWords { + if v110 > 0 { out.RawByte(',') } - out.String(string(v108)) + out.String(string(v111)) } out.RawByte(']') } @@ -4380,24 +4486,24 @@ func easyjson6601e8cdEncodeGithubComMeilisearchMeilisearchGo30(out *jwriter.Writ } { out.RawByte('{') - v109First := true - for v109Name, v109Value := range in.Synonyms { - if v109First { - v109First = false + v112First := true + for v112Name, v112Value := range in.Synonyms { + if v112First { + v112First = false } else { out.RawByte(',') } - out.String(string(v109Name)) + out.String(string(v112Name)) out.RawByte(':') - if v109Value == nil && (out.Flags&jwriter.NilSliceAsEmpty) == 0 { + if v112Value == nil && (out.Flags&jwriter.NilSliceAsEmpty) == 0 { out.RawString("null") } else { out.RawByte('[') - for v110, v111 := range v109Value { - if v110 > 0 { + for v113, v114 := range v112Value { + if v113 > 0 { out.RawByte(',') } - out.String(string(v111)) + out.String(string(v114)) } out.RawByte(']') } @@ -4415,11 +4521,11 @@ func easyjson6601e8cdEncodeGithubComMeilisearchMeilisearchGo30(out *jwriter.Writ } { out.RawByte('[') - for v112, v113 := range in.FilterableAttributes { - if v112 > 0 { + for v115, v116 := range in.FilterableAttributes { + if v115 > 0 { out.RawByte(',') } - out.String(string(v113)) + out.String(string(v116)) } out.RawByte(']') } @@ -4434,11 +4540,11 @@ func easyjson6601e8cdEncodeGithubComMeilisearchMeilisearchGo30(out *jwriter.Writ } { out.RawByte('[') - for v114, v115 := range in.SortableAttributes { - if v114 > 0 { + for v117, v118 := range in.SortableAttributes { + if v117 > 0 { out.RawByte(',') } - out.String(string(v115)) + out.String(string(v118)) } out.RawByte(']') } From 225330ce027966f442cc257057225479db66119a Mon Sep 17 00:00:00 2001 From: alallema Date: Mon, 5 Dec 2022 18:04:34 +0100 Subject: [PATCH 03/12] Update code-sample --- .code-samples.meilisearch.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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{ From 029e5034edc092533f801c4c93feb6c5cd75eb9b Mon Sep 17 00:00:00 2001 From: alallema Date: Tue, 6 Dec 2022 12:35:11 +0100 Subject: [PATCH 04/12] Pass canceledBy in array --- client.go | 69 +++- client_test.go | 10 +- types.go | 53 +-- types_easyjson.go | 999 ++++++++++++++++++++-------------------------- 4 files changed, 519 insertions(+), 612 deletions(-) diff --git a/client.go b/client.go index eaf1fceb..05ca451b 100644 --- a/client.go +++ b/client.go @@ -277,21 +277,7 @@ 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.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, ",") - } + encodeTasksQuery(param, &req) } if err := c.executeRequest(req); err != nil { return nil, err @@ -299,6 +285,7 @@ func (c *Client) GetTasks(param *TasksQuery) (resp *TaskResult, err error) { return resp, nil } + // WaitForTask waits for a task to be processed // // The function will check by regular interval provided in parameter interval @@ -390,9 +377,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 +386,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 8cb3f4d0..a6c854aa 100644 --- a/client_test.go +++ b/client_test.go @@ -762,8 +762,8 @@ func TestClient_GetTasks(t *testing.T) { {ID: "123", Name: "Pride and Prejudice"}, }, query: &TasksQuery{ - Limit: 1, - UIDs: []string{"1"}, + Limit: 1, + UIDs: []int64{1}, }, }, }, @@ -776,7 +776,7 @@ func TestClient_GetTasks(t *testing.T) { {ID: "123", Name: "Pride and Prejudice"}, }, query: &TasksQuery{ - Limit: 1, + Limit: 1, BeforeEnqueuedAt: time.Now(), }, }, @@ -790,8 +790,8 @@ func TestClient_GetTasks(t *testing.T) { {ID: "123", Name: "Pride and Prejudice"}, }, query: &TasksQuery{ - Limit: 1, - CanceledBy: 1, + Limit: 1, + CanceledBy: []int64{1}, }, }, }, diff --git a/types.go b/types.go index d2c1523a..a1d59cfd 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,35 +130,39 @@ 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"` - EnqueuedAt time.Time `json:"enqueuedAt"` + 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"` } // TasksQuery is the request body for list documents method type TasksQuery struct { - UIDs []string `json:"uids,omitempty"` - Limit int64 `json:"limit,omitempty"` - From int64 `json:"from,omitempty"` - IndexUIDs []string `json:"indexUids,omitempty"` - Statuses []string `json:"statuses,omitempty"` - Types []string `json:"types,omitempty"` - CanceledBy int64 `json:"canceledBy,omitempty"` - BeforeEnqueuedAt time.Time `json:"beforeEnqueuedAt,omitempty"` - AfterEnqueuedAt time.Time `json:"afterEnqueuedAt,omitempty"` - BeforeStartedAt time.Time `json:"beforeStartedAt,omitempty"` - AfterStartedAt time.Time `json:"afterStartedAt,omitempty"` - BeforeFinishedAt time.Time `json:"beforeFinishedAt,omitempty"` - AfterFinishedAt time.Time `json:"afterFinishedAt,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 } type Details struct { @@ -168,9 +172,6 @@ type Details struct { PrimaryKey string `json:"primaryKey,omitempty"` RankingRules []string `json:"rankingRules,omitempty"` DistinctAttribute *string `json:"distinctAttribute,omitempty"` - SearchableAttributes []string `json:"searchableAttributes,omitempty"` - DisplayedAttributes []string `json:"displayedAttributes,omitempty"` - StopWords []string `json:"stopWords,omitempty"` Synonyms map[string][]string `json:"synonyms,omitempty"` FilterableAttributes []string `json:"filterableAttributes,omitempty"` SortableAttributes []string `json:"sortableAttributes,omitempty"` @@ -226,8 +227,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 diff --git a/types_easyjson.go b/types_easyjson.go index 7e6cdb89..32d0d1e4 100644 --- a/types_easyjson.go +++ b/types_easyjson.go @@ -587,7 +587,7 @@ func easyjson6601e8cdDecodeGithubComMeilisearchMeilisearchGo5(in *jlexer.Lexer, continue } switch key { - case "uids": + case "UIDs": if in.IsNull() { in.Skip() out.UIDs = nil @@ -595,26 +595,26 @@ func easyjson6601e8cdDecodeGithubComMeilisearchMeilisearchGo5(in *jlexer.Lexer, in.Delim('[') if out.UIDs == nil { if !in.IsDelim(']') { - out.UIDs = make([]string, 0, 4) + out.UIDs = make([]int64, 0, 8) } else { - out.UIDs = []string{} + out.UIDs = []int64{} } } else { out.UIDs = (out.UIDs)[:0] } for !in.IsDelim(']') { - var v7 string - v7 = string(in.String()) + var v7 int64 + v7 = int64(in.Int64()) out.UIDs = append(out.UIDs, v7) in.WantComma() } in.Delim(']') } - case "limit": + case "Limit": out.Limit = int64(in.Int64()) - case "from": + case "From": out.From = int64(in.Int64()) - case "indexUids": + case "IndexUIDs": if in.IsNull() { in.Skip() out.IndexUIDs = nil @@ -637,7 +637,7 @@ func easyjson6601e8cdDecodeGithubComMeilisearchMeilisearchGo5(in *jlexer.Lexer, } in.Delim(']') } - case "statuses": + case "Statuses": if in.IsNull() { in.Skip() out.Statuses = nil @@ -660,7 +660,7 @@ func easyjson6601e8cdDecodeGithubComMeilisearchMeilisearchGo5(in *jlexer.Lexer, } in.Delim(']') } - case "types": + case "Types": if in.IsNull() { in.Skip() out.Types = nil @@ -683,29 +683,50 @@ func easyjson6601e8cdDecodeGithubComMeilisearchMeilisearchGo5(in *jlexer.Lexer, } in.Delim(']') } - case "canceledBy": - out.CanceledBy = int64(in.Int64()) - case "beforeEnqueuedAt": + 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": + case "AfterEnqueuedAt": if data := in.Raw(); in.Ok() { in.AddError((out.AfterEnqueuedAt).UnmarshalJSON(data)) } - case "beforeStartedAt": + case "BeforeStartedAt": if data := in.Raw(); in.Ok() { in.AddError((out.BeforeStartedAt).UnmarshalJSON(data)) } - case "afterStartedAt": + case "AfterStartedAt": if data := in.Raw(); in.Ok() { in.AddError((out.AfterStartedAt).UnmarshalJSON(data)) } - case "beforeFinishedAt": + case "BeforeFinishedAt": if data := in.Raw(); in.Ok() { in.AddError((out.BeforeFinishedAt).UnmarshalJSON(data)) } - case "afterFinishedAt": + case "AfterFinishedAt": if data := in.Raw(); in.Ok() { in.AddError((out.AfterFinishedAt).UnmarshalJSON(data)) } @@ -723,166 +744,124 @@ func easyjson6601e8cdEncodeGithubComMeilisearchMeilisearchGo5(out *jwriter.Write out.RawByte('{') first := true _ = first - if len(in.UIDs) != 0 { - const prefix string = ",\"uids\":" - first = false + { + const prefix string = ",\"UIDs\":" out.RawString(prefix[1:]) - { + if in.UIDs == nil && (out.Flags&jwriter.NilSliceAsEmpty) == 0 { + out.RawString("null") + } else { out.RawByte('[') - for v11, v12 := range in.UIDs { - if v11 > 0 { + for v12, v13 := range in.UIDs { + if v12 > 0 { out.RawByte(',') } - out.String(string(v12)) + out.Int64(int64(v13)) } out.RawByte(']') } } - if in.Limit != 0 { - const prefix string = ",\"limit\":" - if first { - first = false - out.RawString(prefix[1:]) - } else { - out.RawString(prefix) - } + { + const prefix string = ",\"Limit\":" + out.RawString(prefix) out.Int64(int64(in.Limit)) } - if in.From != 0 { - const prefix string = ",\"from\":" - if first { - first = false - out.RawString(prefix[1:]) - } else { - out.RawString(prefix) - } + { + const prefix string = ",\"From\":" + out.RawString(prefix) out.Int64(int64(in.From)) } - if len(in.IndexUIDs) != 0 { - const prefix string = ",\"indexUids\":" - 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 v13, v14 := range in.IndexUIDs { - if v13 > 0 { + for v14, v15 := range in.IndexUIDs { + if v14 > 0 { out.RawByte(',') } - out.String(string(v14)) + out.String(string(v15)) } out.RawByte(']') } } - if len(in.Statuses) != 0 { - const prefix string = ",\"statuses\":" - 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 v15, v16 := range in.Statuses { - if v15 > 0 { + for v16, v17 := range in.Statuses { + if v16 > 0 { out.RawByte(',') } - out.String(string(v16)) + out.String(string(v17)) } out.RawByte(']') } } - if len(in.Types) != 0 { - const prefix string = ",\"types\":" - 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 v17, v18 := range in.Types { - if v17 > 0 { + for v18, v19 := range in.Types { + if v18 > 0 { out.RawByte(',') } - out.String(string(v18)) + out.String(string(v19)) } out.RawByte(']') } } - if in.CanceledBy != 0 { - const prefix string = ",\"canceledBy\":" - if first { - first = false - out.RawString(prefix[1:]) + { + const prefix string = ",\"CanceledBy\":" + out.RawString(prefix) + if in.CanceledBy == nil && (out.Flags&jwriter.NilSliceAsEmpty) == 0 { + out.RawString("null") } else { - out.RawString(prefix) + out.RawByte('[') + for v20, v21 := range in.CanceledBy { + if v20 > 0 { + out.RawByte(',') + } + out.Int64(int64(v21)) + } + out.RawByte(']') } - out.Int64(int64(in.CanceledBy)) } - if true { - const prefix string = ",\"beforeEnqueuedAt\":" - if first { - first = false - out.RawString(prefix[1:]) - } else { - out.RawString(prefix) - } + { + const prefix string = ",\"BeforeEnqueuedAt\":" + out.RawString(prefix) out.Raw((in.BeforeEnqueuedAt).MarshalJSON()) } - if true { - const prefix string = ",\"afterEnqueuedAt\":" - if first { - first = false - out.RawString(prefix[1:]) - } else { - out.RawString(prefix) - } + { + const prefix string = ",\"AfterEnqueuedAt\":" + out.RawString(prefix) out.Raw((in.AfterEnqueuedAt).MarshalJSON()) } - if true { - const prefix string = ",\"beforeStartedAt\":" - if first { - first = false - out.RawString(prefix[1:]) - } else { - out.RawString(prefix) - } + { + const prefix string = ",\"BeforeStartedAt\":" + out.RawString(prefix) out.Raw((in.BeforeStartedAt).MarshalJSON()) } - if true { - const prefix string = ",\"afterStartedAt\":" - if first { - first = false - out.RawString(prefix[1:]) - } else { - out.RawString(prefix) - } + { + const prefix string = ",\"AfterStartedAt\":" + out.RawString(prefix) out.Raw((in.AfterStartedAt).MarshalJSON()) } - if true { - const prefix string = ",\"beforeFinishedAt\":" - if first { - first = false - out.RawString(prefix[1:]) - } else { - out.RawString(prefix) - } + { + const prefix string = ",\"BeforeFinishedAt\":" + out.RawString(prefix) out.Raw((in.BeforeFinishedAt).MarshalJSON()) } - if true { - const prefix string = ",\"afterFinishedAt\":" - if first { - first = false - out.RawString(prefix[1:]) - } else { - out.RawString(prefix) - } + { + const prefix string = ",\"AfterFinishedAt\":" + out.RawString(prefix) out.Raw((in.AfterFinishedAt).MarshalJSON()) } out.RawByte('}') @@ -946,9 +925,9 @@ func easyjson6601e8cdDecodeGithubComMeilisearchMeilisearchGo6(in *jlexer.Lexer, out.Results = (out.Results)[:0] } for !in.IsDelim(']') { - var v19 Task - (v19).UnmarshalEasyJSON(in) - out.Results = append(out.Results, v19) + var v22 Task + (v22).UnmarshalEasyJSON(in) + out.Results = append(out.Results, v22) in.WantComma() } in.Delim(']') @@ -980,11 +959,11 @@ func easyjson6601e8cdEncodeGithubComMeilisearchMeilisearchGo6(out *jwriter.Write out.RawString("null") } else { out.RawByte('[') - for v20, v21 := range in.Results { - if v20 > 0 { + for v23, v24 := range in.Results { + if v23 > 0 { out.RawByte(',') } - (v21).MarshalEasyJSON(out) + (v24).MarshalEasyJSON(out) } out.RawByte(']') } @@ -1057,10 +1036,24 @@ 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() } @@ -1095,11 +1088,36 @@ 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('}') } @@ -1126,7 +1144,70 @@ func (v *TaskInfo) UnmarshalJSON(data []byte) error { func (v *TaskInfo) UnmarshalEasyJSON(l *jlexer.Lexer) { easyjson6601e8cdDecodeGithubComMeilisearchMeilisearchGo7(l, v) } -func easyjson6601e8cdDecodeGithubComMeilisearchMeilisearchGo8(in *jlexer.Lexer, out *Task) { +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) { isTopLevel := in.IsStart() if in.IsNull() { if isTopLevel { @@ -1156,7 +1237,7 @@ func easyjson6601e8cdDecodeGithubComMeilisearchMeilisearchGo8(in *jlexer.Lexer, case "type": out.Type = string(in.String()) case "error": - easyjson6601e8cdDecodeGithubComMeilisearchMeilisearchGo9(in, &out.Error) + easyjson6601e8cdDecodeGithubComMeilisearchMeilisearchGo8(in, &out.Error) case "duration": out.Duration = string(in.String()) case "enqueuedAt": @@ -1173,8 +1254,6 @@ func easyjson6601e8cdDecodeGithubComMeilisearchMeilisearchGo8(in *jlexer.Lexer, } case "details": (out.Details).UnmarshalEasyJSON(in) - case "canceledBy": - out.CanceledBy = int64(in.Int64()) default: in.SkipRecursive() } @@ -1185,7 +1264,7 @@ func easyjson6601e8cdDecodeGithubComMeilisearchMeilisearchGo8(in *jlexer.Lexer, in.Consumed() } } -func easyjson6601e8cdEncodeGithubComMeilisearchMeilisearchGo8(out *jwriter.Writer, in Task) { +func easyjson6601e8cdEncodeGithubComMeilisearchMeilisearchGo9(out *jwriter.Writer, in Task) { out.RawByte('{') first := true _ = first @@ -1217,7 +1296,7 @@ func easyjson6601e8cdEncodeGithubComMeilisearchMeilisearchGo8(out *jwriter.Write if true { const prefix string = ",\"error\":" out.RawString(prefix) - easyjson6601e8cdEncodeGithubComMeilisearchMeilisearchGo9(out, in.Error) + easyjson6601e8cdEncodeGithubComMeilisearchMeilisearchGo8(out, in.Error) } if in.Duration != "" { const prefix string = ",\"duration\":" @@ -1244,99 +1323,31 @@ func easyjson6601e8cdEncodeGithubComMeilisearchMeilisearchGo8(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{} - easyjson6601e8cdEncodeGithubComMeilisearchMeilisearchGo8(&w, v) + easyjson6601e8cdEncodeGithubComMeilisearchMeilisearchGo9(&w, v) return w.Buffer.BuildBytes(), w.Error } // MarshalEasyJSON supports easyjson.Marshaler interface func (v Task) MarshalEasyJSON(w *jwriter.Writer) { - easyjson6601e8cdEncodeGithubComMeilisearchMeilisearchGo8(w, v) + easyjson6601e8cdEncodeGithubComMeilisearchMeilisearchGo9(w, v) } // UnmarshalJSON supports json.Unmarshaler interface func (v *Task) UnmarshalJSON(data []byte) error { r := jlexer.Lexer{Data: data} - easyjson6601e8cdDecodeGithubComMeilisearchMeilisearchGo8(&r, v) + easyjson6601e8cdDecodeGithubComMeilisearchMeilisearchGo9(&r, v) return r.Error() } // UnmarshalEasyJSON supports easyjson.Unmarshaler interface func (v *Task) UnmarshalEasyJSON(l *jlexer.Lexer) { - easyjson6601e8cdDecodeGithubComMeilisearchMeilisearchGo8(l, v) -} -func easyjson6601e8cdDecodeGithubComMeilisearchMeilisearchGo9(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 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('}') + easyjson6601e8cdDecodeGithubComMeilisearchMeilisearchGo9(l, v) } func easyjson6601e8cdDecodeGithubComMeilisearchMeilisearchGo10(in *jlexer.Lexer, out *StatsIndex) { isTopLevel := in.IsStart() @@ -1370,9 +1381,9 @@ func easyjson6601e8cdDecodeGithubComMeilisearchMeilisearchGo10(in *jlexer.Lexer, for !in.IsDelim('}') { key := string(in.String()) in.WantColon() - var v22 int64 - v22 = int64(in.Int64()) - (out.FieldDistribution)[key] = v22 + var v25 int64 + v25 = int64(in.Int64()) + (out.FieldDistribution)[key] = v25 in.WantComma() } in.Delim('}') @@ -1408,16 +1419,16 @@ func easyjson6601e8cdEncodeGithubComMeilisearchMeilisearchGo10(out *jwriter.Writ out.RawString(`null`) } else { out.RawByte('{') - v23First := true - for v23Name, v23Value := range in.FieldDistribution { - if v23First { - v23First = false + v26First := true + for v26Name, v26Value := range in.FieldDistribution { + if v26First { + v26First = false } else { out.RawByte(',') } - out.String(string(v23Name)) + out.String(string(v26Name)) out.RawByte(':') - out.Int64(int64(v23Value)) + out.Int64(int64(v26Value)) } out.RawByte('}') } @@ -1482,9 +1493,9 @@ func easyjson6601e8cdDecodeGithubComMeilisearchMeilisearchGo11(in *jlexer.Lexer, for !in.IsDelim('}') { key := string(in.String()) in.WantColon() - var v24 StatsIndex - (v24).UnmarshalEasyJSON(in) - (out.Indexes)[key] = v24 + var v27 StatsIndex + (v27).UnmarshalEasyJSON(in) + (out.Indexes)[key] = v27 in.WantComma() } in.Delim('}') @@ -1520,16 +1531,16 @@ func easyjson6601e8cdEncodeGithubComMeilisearchMeilisearchGo11(out *jwriter.Writ out.RawString(`null`) } else { out.RawByte('{') - v25First := true - for v25Name, v25Value := range in.Indexes { - if v25First { - v25First = false + v28First := true + for v28Name, v28Value := range in.Indexes { + if v28First { + v28First = false } else { out.RawByte(',') } - out.String(string(v25Name)) + out.String(string(v28Name)) out.RawByte(':') - (v25Value).MarshalEasyJSON(out) + (v28Value).MarshalEasyJSON(out) } out.RawByte('}') } @@ -1595,9 +1606,9 @@ func easyjson6601e8cdDecodeGithubComMeilisearchMeilisearchGo12(in *jlexer.Lexer, out.RankingRules = (out.RankingRules)[:0] } for !in.IsDelim(']') { - var v26 string - v26 = string(in.String()) - out.RankingRules = append(out.RankingRules, v26) + var v29 string + v29 = string(in.String()) + out.RankingRules = append(out.RankingRules, v29) in.WantComma() } in.Delim(']') @@ -1628,9 +1639,9 @@ func easyjson6601e8cdDecodeGithubComMeilisearchMeilisearchGo12(in *jlexer.Lexer, out.SearchableAttributes = (out.SearchableAttributes)[:0] } for !in.IsDelim(']') { - var v27 string - v27 = string(in.String()) - out.SearchableAttributes = append(out.SearchableAttributes, v27) + var v30 string + v30 = string(in.String()) + out.SearchableAttributes = append(out.SearchableAttributes, v30) in.WantComma() } in.Delim(']') @@ -1651,9 +1662,9 @@ func easyjson6601e8cdDecodeGithubComMeilisearchMeilisearchGo12(in *jlexer.Lexer, out.DisplayedAttributes = (out.DisplayedAttributes)[:0] } for !in.IsDelim(']') { - var v28 string - v28 = string(in.String()) - out.DisplayedAttributes = append(out.DisplayedAttributes, v28) + var v31 string + v31 = string(in.String()) + out.DisplayedAttributes = append(out.DisplayedAttributes, v31) in.WantComma() } in.Delim(']') @@ -1674,9 +1685,9 @@ func easyjson6601e8cdDecodeGithubComMeilisearchMeilisearchGo12(in *jlexer.Lexer, out.StopWords = (out.StopWords)[:0] } for !in.IsDelim(']') { - var v29 string - v29 = string(in.String()) - out.StopWords = append(out.StopWords, v29) + var v32 string + v32 = string(in.String()) + out.StopWords = append(out.StopWords, v32) in.WantComma() } in.Delim(']') @@ -1694,30 +1705,30 @@ func easyjson6601e8cdDecodeGithubComMeilisearchMeilisearchGo12(in *jlexer.Lexer, for !in.IsDelim('}') { key := string(in.String()) in.WantColon() - var v30 []string + var v33 []string if in.IsNull() { in.Skip() - v30 = nil + v33 = nil } else { in.Delim('[') - if v30 == nil { + if v33 == nil { if !in.IsDelim(']') { - v30 = make([]string, 0, 4) + v33 = make([]string, 0, 4) } else { - v30 = []string{} + v33 = []string{} } } else { - v30 = (v30)[:0] + v33 = (v33)[:0] } for !in.IsDelim(']') { - var v31 string - v31 = string(in.String()) - v30 = append(v30, v31) + var v34 string + v34 = string(in.String()) + v33 = append(v33, v34) in.WantComma() } in.Delim(']') } - (out.Synonyms)[key] = v30 + (out.Synonyms)[key] = v33 in.WantComma() } in.Delim('}') @@ -1738,9 +1749,9 @@ func easyjson6601e8cdDecodeGithubComMeilisearchMeilisearchGo12(in *jlexer.Lexer, out.FilterableAttributes = (out.FilterableAttributes)[:0] } for !in.IsDelim(']') { - var v32 string - v32 = string(in.String()) - out.FilterableAttributes = append(out.FilterableAttributes, v32) + var v35 string + v35 = string(in.String()) + out.FilterableAttributes = append(out.FilterableAttributes, v35) in.WantComma() } in.Delim(']') @@ -1761,9 +1772,9 @@ func easyjson6601e8cdDecodeGithubComMeilisearchMeilisearchGo12(in *jlexer.Lexer, out.SortableAttributes = (out.SortableAttributes)[:0] } for !in.IsDelim(']') { - var v33 string - v33 = string(in.String()) - out.SortableAttributes = append(out.SortableAttributes, v33) + var v36 string + v36 = string(in.String()) + out.SortableAttributes = append(out.SortableAttributes, v36) in.WantComma() } in.Delim(']') @@ -1818,11 +1829,11 @@ func easyjson6601e8cdEncodeGithubComMeilisearchMeilisearchGo12(out *jwriter.Writ out.RawString(prefix[1:]) { out.RawByte('[') - for v34, v35 := range in.RankingRules { - if v34 > 0 { + for v37, v38 := range in.RankingRules { + if v37 > 0 { out.RawByte(',') } - out.String(string(v35)) + out.String(string(v38)) } out.RawByte(']') } @@ -1847,11 +1858,11 @@ func easyjson6601e8cdEncodeGithubComMeilisearchMeilisearchGo12(out *jwriter.Writ } { out.RawByte('[') - for v36, v37 := range in.SearchableAttributes { - if v36 > 0 { + for v39, v40 := range in.SearchableAttributes { + if v39 > 0 { out.RawByte(',') } - out.String(string(v37)) + out.String(string(v40)) } out.RawByte(']') } @@ -1866,11 +1877,11 @@ func easyjson6601e8cdEncodeGithubComMeilisearchMeilisearchGo12(out *jwriter.Writ } { out.RawByte('[') - for v38, v39 := range in.DisplayedAttributes { - if v38 > 0 { + for v41, v42 := range in.DisplayedAttributes { + if v41 > 0 { out.RawByte(',') } - out.String(string(v39)) + out.String(string(v42)) } out.RawByte(']') } @@ -1885,11 +1896,11 @@ func easyjson6601e8cdEncodeGithubComMeilisearchMeilisearchGo12(out *jwriter.Writ } { out.RawByte('[') - for v40, v41 := range in.StopWords { - if v40 > 0 { + for v43, v44 := range in.StopWords { + if v43 > 0 { out.RawByte(',') } - out.String(string(v41)) + out.String(string(v44)) } out.RawByte(']') } @@ -1904,24 +1915,24 @@ func easyjson6601e8cdEncodeGithubComMeilisearchMeilisearchGo12(out *jwriter.Writ } { out.RawByte('{') - v42First := true - for v42Name, v42Value := range in.Synonyms { - if v42First { - v42First = false + v45First := true + for v45Name, v45Value := range in.Synonyms { + if v45First { + v45First = false } else { out.RawByte(',') } - out.String(string(v42Name)) + out.String(string(v45Name)) out.RawByte(':') - if v42Value == nil && (out.Flags&jwriter.NilSliceAsEmpty) == 0 { + if v45Value == nil && (out.Flags&jwriter.NilSliceAsEmpty) == 0 { out.RawString("null") } else { out.RawByte('[') - for v43, v44 := range v42Value { - if v43 > 0 { + for v46, v47 := range v45Value { + if v46 > 0 { out.RawByte(',') } - out.String(string(v44)) + out.String(string(v47)) } out.RawByte(']') } @@ -1939,11 +1950,11 @@ func easyjson6601e8cdEncodeGithubComMeilisearchMeilisearchGo12(out *jwriter.Writ } { out.RawByte('[') - for v45, v46 := range in.FilterableAttributes { - if v45 > 0 { + for v48, v49 := range in.FilterableAttributes { + if v48 > 0 { out.RawByte(',') } - out.String(string(v46)) + out.String(string(v49)) } out.RawByte(']') } @@ -1958,11 +1969,11 @@ func easyjson6601e8cdEncodeGithubComMeilisearchMeilisearchGo12(out *jwriter.Writ } { out.RawByte('[') - for v47, v48 := range in.SortableAttributes { - if v47 > 0 { + for v50, v51 := range in.SortableAttributes { + if v50 > 0 { out.RawByte(',') } - out.String(string(v48)) + out.String(string(v51)) } out.RawByte(']') } @@ -2058,15 +2069,15 @@ func easyjson6601e8cdDecodeGithubComMeilisearchMeilisearchGo13(in *jlexer.Lexer, out.Hits = (out.Hits)[:0] } for !in.IsDelim(']') { - var v49 interface{} - if m, ok := v49.(easyjson.Unmarshaler); ok { + var v52 interface{} + if m, ok := v52.(easyjson.Unmarshaler); ok { m.UnmarshalEasyJSON(in) - } else if m, ok := v49.(json.Unmarshaler); ok { + } else if m, ok := v52.(json.Unmarshaler); ok { _ = m.UnmarshalJSON(in.Raw()) } else { - v49 = in.Interface() + v52 = in.Interface() } - out.Hits = append(out.Hits, v49) + out.Hits = append(out.Hits, v52) in.WantComma() } in.Delim(']') @@ -2110,16 +2121,16 @@ func easyjson6601e8cdEncodeGithubComMeilisearchMeilisearchGo13(out *jwriter.Writ out.RawString("null") } else { out.RawByte('[') - for v50, v51 := range in.Hits { - if v50 > 0 { + for v53, v54 := range in.Hits { + if v53 > 0 { out.RawByte(',') } - if m, ok := v51.(easyjson.Marshaler); ok { + if m, ok := v54.(easyjson.Marshaler); ok { m.MarshalEasyJSON(out) - } else if m, ok := v51.(json.Marshaler); ok { + } else if m, ok := v54.(json.Marshaler); ok { out.Raw(m.MarshalJSON()) } else { - out.Raw(json.Marshal(v51)) + out.Raw(json.Marshal(v54)) } } out.RawByte(']') @@ -2226,9 +2237,9 @@ func easyjson6601e8cdDecodeGithubComMeilisearchMeilisearchGo14(in *jlexer.Lexer, out.AttributesToRetrieve = (out.AttributesToRetrieve)[:0] } for !in.IsDelim(']') { - var v52 string - v52 = string(in.String()) - out.AttributesToRetrieve = append(out.AttributesToRetrieve, v52) + var v55 string + v55 = string(in.String()) + out.AttributesToRetrieve = append(out.AttributesToRetrieve, v55) in.WantComma() } in.Delim(']') @@ -2249,9 +2260,9 @@ func easyjson6601e8cdDecodeGithubComMeilisearchMeilisearchGo14(in *jlexer.Lexer, out.AttributesToCrop = (out.AttributesToCrop)[:0] } for !in.IsDelim(']') { - var v53 string - v53 = string(in.String()) - out.AttributesToCrop = append(out.AttributesToCrop, v53) + var v56 string + v56 = string(in.String()) + out.AttributesToCrop = append(out.AttributesToCrop, v56) in.WantComma() } in.Delim(']') @@ -2276,9 +2287,9 @@ func easyjson6601e8cdDecodeGithubComMeilisearchMeilisearchGo14(in *jlexer.Lexer, out.AttributesToHighlight = (out.AttributesToHighlight)[:0] } for !in.IsDelim(']') { - var v54 string - v54 = string(in.String()) - out.AttributesToHighlight = append(out.AttributesToHighlight, v54) + var v57 string + v57 = string(in.String()) + out.AttributesToHighlight = append(out.AttributesToHighlight, v57) in.WantComma() } in.Delim(']') @@ -2315,9 +2326,9 @@ func easyjson6601e8cdDecodeGithubComMeilisearchMeilisearchGo14(in *jlexer.Lexer, out.Facets = (out.Facets)[:0] } for !in.IsDelim(']') { - var v55 string - v55 = string(in.String()) - out.Facets = append(out.Facets, v55) + var v58 string + v58 = string(in.String()) + out.Facets = append(out.Facets, v58) in.WantComma() } in.Delim(']') @@ -2340,9 +2351,9 @@ func easyjson6601e8cdDecodeGithubComMeilisearchMeilisearchGo14(in *jlexer.Lexer, out.Sort = (out.Sort)[:0] } for !in.IsDelim(']') { - var v56 string - v56 = string(in.String()) - out.Sort = append(out.Sort, v56) + var v59 string + v59 = string(in.String()) + out.Sort = append(out.Sort, v59) in.WantComma() } in.Delim(']') @@ -2378,11 +2389,11 @@ func easyjson6601e8cdEncodeGithubComMeilisearchMeilisearchGo14(out *jwriter.Writ out.RawString("null") } else { out.RawByte('[') - for v57, v58 := range in.AttributesToRetrieve { - if v57 > 0 { + for v60, v61 := range in.AttributesToRetrieve { + if v60 > 0 { out.RawByte(',') } - out.String(string(v58)) + out.String(string(v61)) } out.RawByte(']') } @@ -2394,11 +2405,11 @@ func easyjson6601e8cdEncodeGithubComMeilisearchMeilisearchGo14(out *jwriter.Writ out.RawString("null") } else { out.RawByte('[') - for v59, v60 := range in.AttributesToCrop { - if v59 > 0 { + for v62, v63 := range in.AttributesToCrop { + if v62 > 0 { out.RawByte(',') } - out.String(string(v60)) + out.String(string(v63)) } out.RawByte(']') } @@ -2420,11 +2431,11 @@ func easyjson6601e8cdEncodeGithubComMeilisearchMeilisearchGo14(out *jwriter.Writ out.RawString("null") } else { out.RawByte('[') - for v61, v62 := range in.AttributesToHighlight { - if v61 > 0 { + for v64, v65 := range in.AttributesToHighlight { + if v64 > 0 { out.RawByte(',') } - out.String(string(v62)) + out.String(string(v65)) } out.RawByte(']') } @@ -2467,11 +2478,11 @@ func easyjson6601e8cdEncodeGithubComMeilisearchMeilisearchGo14(out *jwriter.Writ out.RawString("null") } else { out.RawByte('[') - for v63, v64 := range in.Facets { - if v63 > 0 { + for v66, v67 := range in.Facets { + if v66 > 0 { out.RawByte(',') } - out.String(string(v64)) + out.String(string(v67)) } out.RawByte(']') } @@ -2488,11 +2499,11 @@ func easyjson6601e8cdEncodeGithubComMeilisearchMeilisearchGo14(out *jwriter.Writ out.RawString("null") } else { out.RawByte('[') - for v65, v66 := range in.Sort { - if v65 > 0 { + for v68, v69 := range in.Sort { + if v68 > 0 { out.RawByte(',') } - out.String(string(v66)) + out.String(string(v69)) } out.RawByte(']') } @@ -2703,9 +2714,9 @@ func easyjson6601e8cdDecodeGithubComMeilisearchMeilisearchGo17(in *jlexer.Lexer, out.Results = (out.Results)[:0] } for !in.IsDelim(']') { - var v67 Key - (v67).UnmarshalEasyJSON(in) - out.Results = append(out.Results, v67) + var v70 Key + (v70).UnmarshalEasyJSON(in) + out.Results = append(out.Results, v70) in.WantComma() } in.Delim(']') @@ -2737,11 +2748,11 @@ func easyjson6601e8cdEncodeGithubComMeilisearchMeilisearchGo17(out *jwriter.Writ out.RawString("null") } else { out.RawByte('[') - for v68, v69 := range in.Results { - if v68 > 0 { + for v71, v72 := range in.Results { + if v71 > 0 { out.RawByte(',') } - (v69).MarshalEasyJSON(out) + (v72).MarshalEasyJSON(out) } out.RawByte(']') } @@ -2806,9 +2817,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() @@ -2824,20 +2835,14 @@ func easyjson6601e8cdEncodeGithubComMeilisearchMeilisearchGo18(out *jwriter.Writ 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('}') @@ -2986,9 +2991,9 @@ func easyjson6601e8cdDecodeGithubComMeilisearchMeilisearchGo20(in *jlexer.Lexer, out.Actions = (out.Actions)[:0] } for !in.IsDelim(']') { - var v70 string - v70 = string(in.String()) - out.Actions = append(out.Actions, v70) + var v73 string + v73 = string(in.String()) + out.Actions = append(out.Actions, v73) in.WantComma() } in.Delim(']') @@ -3009,9 +3014,9 @@ func easyjson6601e8cdDecodeGithubComMeilisearchMeilisearchGo20(in *jlexer.Lexer, out.Indexes = (out.Indexes)[:0] } for !in.IsDelim(']') { - var v71 string - v71 = string(in.String()) - out.Indexes = append(out.Indexes, v71) + var v74 string + v74 = string(in.String()) + out.Indexes = append(out.Indexes, v74) in.WantComma() } in.Delim(']') @@ -3068,11 +3073,11 @@ func easyjson6601e8cdEncodeGithubComMeilisearchMeilisearchGo20(out *jwriter.Writ out.RawString(prefix) { out.RawByte('[') - for v72, v73 := range in.Actions { - if v72 > 0 { + for v75, v76 := range in.Actions { + if v75 > 0 { out.RawByte(',') } - out.String(string(v73)) + out.String(string(v76)) } out.RawByte(']') } @@ -3082,11 +3087,11 @@ func easyjson6601e8cdEncodeGithubComMeilisearchMeilisearchGo20(out *jwriter.Writ out.RawString(prefix) { out.RawByte('[') - for v74, v75 := range in.Indexes { - if v74 > 0 { + for v77, v78 := range in.Indexes { + if v77 > 0 { out.RawByte(',') } - out.String(string(v75)) + out.String(string(v78)) } out.RawByte(']') } @@ -3179,9 +3184,9 @@ func easyjson6601e8cdDecodeGithubComMeilisearchMeilisearchGo21(in *jlexer.Lexer, out.Actions = (out.Actions)[:0] } for !in.IsDelim(']') { - var v76 string - v76 = string(in.String()) - out.Actions = append(out.Actions, v76) + var v79 string + v79 = string(in.String()) + out.Actions = append(out.Actions, v79) in.WantComma() } in.Delim(']') @@ -3202,9 +3207,9 @@ func easyjson6601e8cdDecodeGithubComMeilisearchMeilisearchGo21(in *jlexer.Lexer, out.Indexes = (out.Indexes)[:0] } for !in.IsDelim(']') { - var v77 string - v77 = string(in.String()) - out.Indexes = append(out.Indexes, v77) + var v80 string + v80 = string(in.String()) + out.Indexes = append(out.Indexes, v80) in.WantComma() } in.Delim(']') @@ -3260,11 +3265,11 @@ func easyjson6601e8cdEncodeGithubComMeilisearchMeilisearchGo21(out *jwriter.Writ out.RawString(prefix) { out.RawByte('[') - for v78, v79 := range in.Actions { - if v78 > 0 { + for v81, v82 := range in.Actions { + if v81 > 0 { out.RawByte(',') } - out.String(string(v79)) + out.String(string(v82)) } out.RawByte(']') } @@ -3274,11 +3279,11 @@ func easyjson6601e8cdEncodeGithubComMeilisearchMeilisearchGo21(out *jwriter.Writ out.RawString(prefix) { out.RawByte('[') - for v80, v81 := range in.Indexes { - if v80 > 0 { + for v83, v84 := range in.Indexes { + if v83 > 0 { out.RawByte(',') } - out.String(string(v81)) + out.String(string(v84)) } out.RawByte(']') } @@ -3359,9 +3364,9 @@ func easyjson6601e8cdDecodeGithubComMeilisearchMeilisearchGo22(in *jlexer.Lexer, out.Results = (out.Results)[:0] } for !in.IsDelim(']') { - var v82 Index - (v82).UnmarshalEasyJSON(in) - out.Results = append(out.Results, v82) + var v85 Index + (v85).UnmarshalEasyJSON(in) + out.Results = append(out.Results, v85) in.WantComma() } in.Delim(']') @@ -3393,11 +3398,11 @@ func easyjson6601e8cdEncodeGithubComMeilisearchMeilisearchGo22(out *jwriter.Writ out.RawString("null") } else { out.RawByte('[') - for v83, v84 := range in.Results { - if v83 > 0 { + for v86, v87 := range in.Results { + if v86 > 0 { out.RawByte(',') } - (v84).MarshalEasyJSON(out) + (v87).MarshalEasyJSON(out) } out.RawByte(']') } @@ -3462,9 +3467,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() @@ -3480,20 +3485,14 @@ func easyjson6601e8cdEncodeGithubComMeilisearchMeilisearchGo23(out *jwriter.Writ 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('}') @@ -3780,29 +3779,29 @@ func easyjson6601e8cdDecodeGithubComMeilisearchMeilisearchGo27(in *jlexer.Lexer, out.Results = (out.Results)[:0] } for !in.IsDelim(']') { - var v85 map[string]interface{} + var v88 map[string]interface{} if in.IsNull() { in.Skip() } else { in.Delim('{') - v85 = make(map[string]interface{}) + v88 = make(map[string]interface{}) for !in.IsDelim('}') { key := string(in.String()) in.WantColon() - var v86 interface{} - if m, ok := v86.(easyjson.Unmarshaler); ok { + var v89 interface{} + if m, ok := v89.(easyjson.Unmarshaler); ok { m.UnmarshalEasyJSON(in) - } else if m, ok := v86.(json.Unmarshaler); ok { + } else if m, ok := v89.(json.Unmarshaler); ok { _ = m.UnmarshalJSON(in.Raw()) } else { - v86 = in.Interface() + v89 = in.Interface() } - (v85)[key] = v86 + (v88)[key] = v89 in.WantComma() } in.Delim('}') } - out.Results = append(out.Results, v85) + out.Results = append(out.Results, v88) in.WantComma() } in.Delim(']') @@ -3834,29 +3833,29 @@ func easyjson6601e8cdEncodeGithubComMeilisearchMeilisearchGo27(out *jwriter.Writ out.RawString("null") } else { out.RawByte('[') - for v87, v88 := range in.Results { - if v87 > 0 { + for v90, v91 := range in.Results { + if v90 > 0 { out.RawByte(',') } - if v88 == nil && (out.Flags&jwriter.NilMapAsEmpty) == 0 { + if v91 == nil && (out.Flags&jwriter.NilMapAsEmpty) == 0 { out.RawString(`null`) } else { out.RawByte('{') - v89First := true - for v89Name, v89Value := range v88 { - if v89First { - v89First = false + v92First := true + for v92Name, v92Value := range v91 { + if v92First { + v92First = false } else { out.RawByte(',') } - out.String(string(v89Name)) + out.String(string(v92Name)) out.RawByte(':') - if m, ok := v89Value.(easyjson.Marshaler); ok { + if m, ok := v92Value.(easyjson.Marshaler); ok { m.MarshalEasyJSON(out) - } else if m, ok := v89Value.(json.Marshaler); ok { + } else if m, ok := v92Value.(json.Marshaler); ok { out.Raw(m.MarshalJSON()) } else { - out.Raw(json.Marshal(v89Value)) + out.Raw(json.Marshal(v92Value)) } } out.RawByte('}') @@ -3945,9 +3944,9 @@ func easyjson6601e8cdDecodeGithubComMeilisearchMeilisearchGo28(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 v93 string + v93 = string(in.String()) + out.Fields = append(out.Fields, v93) in.WantComma() } in.Delim(']') @@ -3992,11 +3991,11 @@ func easyjson6601e8cdEncodeGithubComMeilisearchMeilisearchGo28(out *jwriter.Writ } { out.RawByte('[') - for v91, v92 := range in.Fields { - if v91 > 0 { + for v94, v95 := range in.Fields { + if v94 > 0 { out.RawByte(',') } - out.String(string(v92)) + out.String(string(v95)) } out.RawByte(']') } @@ -4062,9 +4061,9 @@ func easyjson6601e8cdDecodeGithubComMeilisearchMeilisearchGo29(in *jlexer.Lexer, out.Fields = (out.Fields)[:0] } for !in.IsDelim(']') { - var v93 string - v93 = string(in.String()) - out.Fields = append(out.Fields, v93) + var v96 string + v96 = string(in.String()) + out.Fields = append(out.Fields, v96) in.WantComma() } in.Delim(']') @@ -4089,11 +4088,11 @@ func easyjson6601e8cdEncodeGithubComMeilisearchMeilisearchGo29(out *jwriter.Writ out.RawString(prefix[1:]) { out.RawByte('[') - for v94, v95 := range in.Fields { - if v94 > 0 { + for v97, v98 := range in.Fields { + if v97 > 0 { out.RawByte(',') } - out.String(string(v95)) + out.String(string(v98)) } out.RawByte(']') } @@ -4167,9 +4166,9 @@ func easyjson6601e8cdDecodeGithubComMeilisearchMeilisearchGo30(in *jlexer.Lexer, out.RankingRules = (out.RankingRules)[:0] } for !in.IsDelim(']') { - var v96 string - v96 = string(in.String()) - out.RankingRules = append(out.RankingRules, v96) + var v99 string + v99 = string(in.String()) + out.RankingRules = append(out.RankingRules, v99) in.WantComma() } in.Delim(']') @@ -4184,75 +4183,6 @@ func easyjson6601e8cdDecodeGithubComMeilisearchMeilisearchGo30(in *jlexer.Lexer, } *out.DistinctAttribute = string(in.String()) } - case "searchableAttributes": - if in.IsNull() { - in.Skip() - out.SearchableAttributes = nil - } else { - in.Delim('[') - if out.SearchableAttributes == nil { - if !in.IsDelim(']') { - out.SearchableAttributes = make([]string, 0, 4) - } else { - out.SearchableAttributes = []string{} - } - } else { - out.SearchableAttributes = (out.SearchableAttributes)[:0] - } - for !in.IsDelim(']') { - var v97 string - v97 = string(in.String()) - out.SearchableAttributes = append(out.SearchableAttributes, v97) - in.WantComma() - } - in.Delim(']') - } - case "displayedAttributes": - if in.IsNull() { - in.Skip() - out.DisplayedAttributes = nil - } else { - in.Delim('[') - if out.DisplayedAttributes == nil { - if !in.IsDelim(']') { - out.DisplayedAttributes = make([]string, 0, 4) - } else { - out.DisplayedAttributes = []string{} - } - } else { - out.DisplayedAttributes = (out.DisplayedAttributes)[:0] - } - for !in.IsDelim(']') { - var v98 string - v98 = string(in.String()) - out.DisplayedAttributes = append(out.DisplayedAttributes, v98) - in.WantComma() - } - in.Delim(']') - } - case "stopWords": - if in.IsNull() { - in.Skip() - out.StopWords = nil - } else { - in.Delim('[') - if out.StopWords == nil { - if !in.IsDelim(']') { - out.StopWords = make([]string, 0, 4) - } else { - out.StopWords = []string{} - } - } else { - out.StopWords = (out.StopWords)[:0] - } - for !in.IsDelim(']') { - var v99 string - v99 = string(in.String()) - out.StopWords = append(out.StopWords, v99) - in.WantComma() - } - in.Delim(']') - } case "synonyms": if in.IsNull() { in.Skip() @@ -4419,63 +4349,6 @@ func easyjson6601e8cdEncodeGithubComMeilisearchMeilisearchGo30(out *jwriter.Writ } out.String(string(*in.DistinctAttribute)) } - if len(in.SearchableAttributes) != 0 { - const prefix string = ",\"searchableAttributes\":" - if first { - first = false - out.RawString(prefix[1:]) - } else { - out.RawString(prefix) - } - { - out.RawByte('[') - for v106, v107 := range in.SearchableAttributes { - if v106 > 0 { - out.RawByte(',') - } - out.String(string(v107)) - } - out.RawByte(']') - } - } - if len(in.DisplayedAttributes) != 0 { - const prefix string = ",\"displayedAttributes\":" - if first { - first = false - out.RawString(prefix[1:]) - } else { - out.RawString(prefix) - } - { - out.RawByte('[') - for v108, v109 := range in.DisplayedAttributes { - if v108 > 0 { - out.RawByte(',') - } - out.String(string(v109)) - } - out.RawByte(']') - } - } - if len(in.StopWords) != 0 { - const prefix string = ",\"stopWords\":" - if first { - first = false - out.RawString(prefix[1:]) - } else { - out.RawString(prefix) - } - { - out.RawByte('[') - for v110, v111 := range in.StopWords { - if v110 > 0 { - out.RawByte(',') - } - out.String(string(v111)) - } - out.RawByte(']') - } - } if len(in.Synonyms) != 0 { const prefix string = ",\"synonyms\":" if first { @@ -4486,24 +4359,24 @@ func easyjson6601e8cdEncodeGithubComMeilisearchMeilisearchGo30(out *jwriter.Writ } { out.RawByte('{') - v112First := true - for v112Name, v112Value := range in.Synonyms { - if v112First { - v112First = false + v106First := true + for v106Name, v106Value := range in.Synonyms { + if v106First { + v106First = false } else { out.RawByte(',') } - out.String(string(v112Name)) + out.String(string(v106Name)) out.RawByte(':') - if v112Value == nil && (out.Flags&jwriter.NilSliceAsEmpty) == 0 { + if v106Value == nil && (out.Flags&jwriter.NilSliceAsEmpty) == 0 { out.RawString("null") } else { out.RawByte('[') - for v113, v114 := range v112Value { - if v113 > 0 { + for v107, v108 := range v106Value { + if v107 > 0 { out.RawByte(',') } - out.String(string(v114)) + out.String(string(v108)) } out.RawByte(']') } @@ -4521,11 +4394,11 @@ func easyjson6601e8cdEncodeGithubComMeilisearchMeilisearchGo30(out *jwriter.Writ } { out.RawByte('[') - for v115, v116 := range in.FilterableAttributes { - if v115 > 0 { + for v109, v110 := range in.FilterableAttributes { + if v109 > 0 { out.RawByte(',') } - out.String(string(v116)) + out.String(string(v110)) } out.RawByte(']') } @@ -4540,11 +4413,11 @@ func easyjson6601e8cdEncodeGithubComMeilisearchMeilisearchGo30(out *jwriter.Writ } { out.RawByte('[') - for v117, v118 := range in.SortableAttributes { - if v117 > 0 { + for v111, v112 := range in.SortableAttributes { + if v111 > 0 { out.RawByte(',') } - out.String(string(v118)) + out.String(string(v112)) } out.RawByte(']') } From 0d5718926586362dbfd1be8c71a5e04241aecd68 Mon Sep 17 00:00:00 2001 From: alallema Date: Tue, 6 Dec 2022 18:50:37 +0100 Subject: [PATCH 05/12] Modify UIDs for UIDS --- client.go | 9 ++++----- client_test.go | 36 ++++++++++++++++++------------------ index.go | 6 +++--- main_test.go | 6 +++--- types.go | 4 ++-- types_easyjson.go | 40 ++++++++++++++++++++-------------------- 6 files changed, 50 insertions(+), 51 deletions(-) diff --git a/client.go b/client.go index 05ca451b..1019e43a 100644 --- a/client.go +++ b/client.go @@ -285,7 +285,6 @@ func (c *Client) GetTasks(param *TasksQuery) (resp *TaskResult, err error) { return resp, nil } - // WaitForTask waits for a task to be processed // // The function will check by regular interval provided in parameter interval @@ -400,11 +399,11 @@ func encodeTasksQuery(param *TasksQuery, req *internalRequest) { 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.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.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)), ","), "[]") diff --git a/client_test.go b/client_test.go index a6c854aa..0b66907b 100644 --- a/client_test.go +++ b/client_test.go @@ -749,7 +749,7 @@ func TestClient_GetTasks(t *testing.T) { query: &TasksQuery{ Limit: 1, From: 0, - IndexUIDs: []string{"indexUID"}, + IndexUIDS: []string{"indexUID"}, }, }, }, @@ -763,7 +763,7 @@ func TestClient_GetTasks(t *testing.T) { }, query: &TasksQuery{ Limit: 1, - UIDs: []int64{1}, + UIDS: []int64{1}, }, }, }, @@ -1021,7 +1021,7 @@ func TestClient_ConnectionCloseByServer(t *testing.T) { func TestClient_GenerateTenantToken(t *testing.T) { type args struct { - IndexUIDs string + IndexUIDS string client *Client APIKeyUID string searchRules map[string]interface{} @@ -1037,7 +1037,7 @@ func TestClient_GenerateTenantToken(t *testing.T) { { name: "TestDefaultGenerateTenantToken", args: args{ - IndexUIDs: "TestDefaultGenerateTenantToken", + IndexUIDS: "TestDefaultGenerateTenantToken", client: privateClient, APIKeyUID: GetPrivateUIDKey(), searchRules: map[string]interface{}{ @@ -1052,7 +1052,7 @@ func TestClient_GenerateTenantToken(t *testing.T) { { name: "TestGenerateTenantTokenWithApiKey", args: args{ - IndexUIDs: "TestGenerateTenantTokenWithApiKey", + IndexUIDS: "TestGenerateTenantTokenWithApiKey", client: defaultClient, APIKeyUID: GetPrivateUIDKey(), searchRules: map[string]interface{}{ @@ -1069,7 +1069,7 @@ func TestClient_GenerateTenantToken(t *testing.T) { { name: "TestGenerateTenantTokenWithOnlyExpiresAt", args: args{ - IndexUIDs: "TestGenerateTenantTokenWithOnlyExpiresAt", + IndexUIDS: "TestGenerateTenantTokenWithOnlyExpiresAt", client: privateClient, APIKeyUID: GetPrivateUIDKey(), searchRules: map[string]interface{}{ @@ -1086,7 +1086,7 @@ func TestClient_GenerateTenantToken(t *testing.T) { { name: "TestGenerateTenantTokenWithApiKeyAndExpiresAt", args: args{ - IndexUIDs: "TestGenerateTenantTokenWithApiKeyAndExpiresAt", + IndexUIDS: "TestGenerateTenantTokenWithApiKeyAndExpiresAt", client: defaultClient, APIKeyUID: GetPrivateUIDKey(), searchRules: map[string]interface{}{ @@ -1104,7 +1104,7 @@ func TestClient_GenerateTenantToken(t *testing.T) { { name: "TestGenerateTenantTokenWithFilters", args: args{ - IndexUIDs: "indexUID", + IndexUIDS: "indexUID", client: privateClient, APIKeyUID: GetPrivateUIDKey(), searchRules: map[string]interface{}{ @@ -1123,7 +1123,7 @@ func TestClient_GenerateTenantToken(t *testing.T) { { name: "TestGenerateTenantTokenWithFilterOnOneINdex", args: args{ - IndexUIDs: "indexUID", + IndexUIDS: "indexUID", client: privateClient, APIKeyUID: GetPrivateUIDKey(), searchRules: map[string]interface{}{ @@ -1142,7 +1142,7 @@ func TestClient_GenerateTenantToken(t *testing.T) { { name: "TestGenerateTenantTokenWithoutSearchRules", args: args{ - IndexUIDs: "TestGenerateTenantTokenWithoutSearchRules", + IndexUIDS: "TestGenerateTenantTokenWithoutSearchRules", client: privateClient, APIKeyUID: GetPrivateUIDKey(), searchRules: nil, @@ -1155,7 +1155,7 @@ func TestClient_GenerateTenantToken(t *testing.T) { { name: "TestGenerateTenantTokenWithoutApiKey", args: args{ - IndexUIDs: "TestGenerateTenantTokenWithoutApiKey", + IndexUIDS: "TestGenerateTenantTokenWithoutApiKey", client: NewClient(ClientConfig{ Host: getenv("MEILISEARCH_URL", "http://localhost:7700"), APIKey: "", @@ -1173,7 +1173,7 @@ func TestClient_GenerateTenantToken(t *testing.T) { { name: "TestGenerateTenantTokenWithBadExpiresAt", args: args{ - IndexUIDs: "TestGenerateTenantTokenWithBadExpiresAt", + IndexUIDS: "TestGenerateTenantTokenWithBadExpiresAt", client: defaultClient, APIKeyUID: GetPrivateUIDKey(), searchRules: map[string]interface{}{ @@ -1190,7 +1190,7 @@ func TestClient_GenerateTenantToken(t *testing.T) { { name: "TestGenerateTenantTokenWithBadAPIKeyUID", args: args{ - IndexUIDs: "TestGenerateTenantTokenWithBadAPIKeyUID", + IndexUIDS: "TestGenerateTenantTokenWithBadAPIKeyUID", client: defaultClient, APIKeyUID: GetPrivateUIDKey() + "1234", searchRules: map[string]interface{}{ @@ -1205,7 +1205,7 @@ func TestClient_GenerateTenantToken(t *testing.T) { { name: "TestGenerateTenantTokenWithEmptyAPIKeyUID", args: args{ - IndexUIDs: "TestGenerateTenantTokenWithEmptyAPIKeyUID", + IndexUIDS: "TestGenerateTenantTokenWithEmptyAPIKeyUID", client: defaultClient, APIKeyUID: "", searchRules: map[string]interface{}{ @@ -1231,11 +1231,11 @@ func TestClient_GenerateTenantToken(t *testing.T) { require.NoError(t, err) if tt.wantFilter { - gotTask, err := c.Index(tt.args.IndexUIDs).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.IndexUIDs), gotTask) + testWaitForTask(t, c.Index(tt.args.IndexUIDS), gotTask) } else { - _, err := SetUpEmptyIndex(&IndexConfig{Uid: tt.args.IndexUIDs}) + _, err := SetUpEmptyIndex(&IndexConfig{Uid: tt.args.IndexUIDS}) require.NoError(t, err, "CreateIndex() in TestGenerateTenantToken error should be nil") } @@ -1244,7 +1244,7 @@ func TestClient_GenerateTenantToken(t *testing.T) { APIKey: token, }) - _, err = client.Index(tt.args.IndexUIDs).Search("", &SearchRequest{}) + _, err = client.Index(tt.args.IndexUIDS).Search("", &SearchRequest{}) require.NoError(t, err) } diff --git a/index.go b/index.go index 26641875..a64c450f 100644 --- a/index.go +++ b/index.go @@ -189,9 +189,9 @@ func (i Index) GetTasks(param *TasksQuery) (resp *TaskResult, err error) { if len(param.Types) != 0 { req.withQueryParams["types"] = strings.Join(param.Types, ",") } - if len(param.IndexUIDs) != 0 { - param.IndexUIDs = append(param.IndexUIDs, i.UID) - req.withQueryParams["indexUids"] = strings.Join(param.IndexUIDs, ",") + if len(param.IndexUIDS) != 0 { + param.IndexUIDS = append(param.IndexUIDS, i.UID) + req.withQueryParams["indexUids"] = strings.Join(param.IndexUIDS, ",") } else { req.withQueryParams["indexUids"] = i.UID } 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 a1d59cfd..eaa613dd 100644 --- a/types.go +++ b/types.go @@ -150,10 +150,10 @@ type TaskInfo struct { // TasksQuery is the request body for list documents method type TasksQuery struct { - UIDs []int64 + UIDS []int64 Limit int64 From int64 - IndexUIDs []string + IndexUIDS []string Statuses []string Types []string CanceledBy []int64 diff --git a/types_easyjson.go b/types_easyjson.go index 32d0d1e4..3a4c9a35 100644 --- a/types_easyjson.go +++ b/types_easyjson.go @@ -587,25 +587,25 @@ func easyjson6601e8cdDecodeGithubComMeilisearchMeilisearchGo5(in *jlexer.Lexer, continue } switch key { - case "UIDs": + case "UIDS": if in.IsNull() { in.Skip() - out.UIDs = nil + out.UIDS = nil } else { in.Delim('[') - if out.UIDs == nil { + if out.UIDS == nil { if !in.IsDelim(']') { - out.UIDs = make([]int64, 0, 8) + out.UIDS = make([]int64, 0, 8) } else { - out.UIDs = []int64{} + out.UIDS = []int64{} } } else { - out.UIDs = (out.UIDs)[:0] + out.UIDS = (out.UIDS)[:0] } for !in.IsDelim(']') { var v7 int64 v7 = int64(in.Int64()) - out.UIDs = append(out.UIDs, v7) + out.UIDS = append(out.UIDS, v7) in.WantComma() } in.Delim(']') @@ -614,25 +614,25 @@ func easyjson6601e8cdDecodeGithubComMeilisearchMeilisearchGo5(in *jlexer.Lexer, out.Limit = int64(in.Int64()) case "From": out.From = int64(in.Int64()) - case "IndexUIDs": + case "IndexUIDS": if in.IsNull() { in.Skip() - out.IndexUIDs = nil + out.IndexUIDS = nil } else { in.Delim('[') - if out.IndexUIDs == nil { + if out.IndexUIDS == nil { if !in.IsDelim(']') { - out.IndexUIDs = make([]string, 0, 4) + out.IndexUIDS = make([]string, 0, 4) } else { - out.IndexUIDs = []string{} + out.IndexUIDS = []string{} } } else { - out.IndexUIDs = (out.IndexUIDs)[:0] + out.IndexUIDS = (out.IndexUIDS)[:0] } for !in.IsDelim(']') { var v8 string v8 = string(in.String()) - out.IndexUIDs = append(out.IndexUIDs, v8) + out.IndexUIDS = append(out.IndexUIDS, v8) in.WantComma() } in.Delim(']') @@ -745,13 +745,13 @@ func easyjson6601e8cdEncodeGithubComMeilisearchMeilisearchGo5(out *jwriter.Write first := true _ = first { - const prefix string = ",\"UIDs\":" + const prefix string = ",\"UIDS\":" out.RawString(prefix[1:]) - if in.UIDs == nil && (out.Flags&jwriter.NilSliceAsEmpty) == 0 { + if in.UIDS == nil && (out.Flags&jwriter.NilSliceAsEmpty) == 0 { out.RawString("null") } else { out.RawByte('[') - for v12, v13 := range in.UIDs { + for v12, v13 := range in.UIDS { if v12 > 0 { out.RawByte(',') } @@ -771,13 +771,13 @@ func easyjson6601e8cdEncodeGithubComMeilisearchMeilisearchGo5(out *jwriter.Write out.Int64(int64(in.From)) } { - const prefix string = ",\"IndexUIDs\":" + const prefix string = ",\"IndexUIDS\":" out.RawString(prefix) - if in.IndexUIDs == nil && (out.Flags&jwriter.NilSliceAsEmpty) == 0 { + if in.IndexUIDS == nil && (out.Flags&jwriter.NilSliceAsEmpty) == 0 { out.RawString("null") } else { out.RawByte('[') - for v14, v15 := range in.IndexUIDs { + for v14, v15 := range in.IndexUIDS { if v14 > 0 { out.RawByte(',') } From 972ccb93a43bf964ea289f965f5857708649c6da Mon Sep 17 00:00:00 2001 From: alallema Date: Mon, 5 Dec 2022 16:21:22 +0100 Subject: [PATCH 06/12] Add pagination feature for v0.30.0 --- index_search.go | 6 ++ index_search_test.go | 133 +++++++++++++++++++++++++++++++++++++++++++ types.go | 6 ++ types_easyjson.go | 42 ++++++++++++++ 4 files changed, 187 insertions(+) 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/types.go b/types.go index eaa613dd..817cca79 100644 --- a/types.go +++ b/types.go @@ -278,6 +278,8 @@ type SearchRequest struct { Facets []string PlaceholderSearch bool Sort []string + HitsPerPage int64 + Page int64 } // SearchResponse is the response body for search method @@ -289,6 +291,10 @@ type SearchResponse struct { ProcessingTimeMs int64 `json:"processingTimeMs"` Query string `json:"query"` FacetDistribution interface{} `json:"facetDistribution,omitempty"` + TotalHits int64 `json:"totalHits"` + HitsPerPage int64 `json:"hitsPerPage"` + Page int64 `json:"page"` + TotalPages int64 `json:"totalPages"` } // DocumentQuery is the request body get one documents method diff --git a/types_easyjson.go b/types_easyjson.go index 3a4c9a35..e0feba23 100644 --- a/types_easyjson.go +++ b/types_easyjson.go @@ -2100,6 +2100,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() } @@ -2172,6 +2180,26 @@ func easyjson6601e8cdEncodeGithubComMeilisearchMeilisearchGo13(out *jwriter.Writ out.Raw(json.Marshal(in.FacetDistribution)) } } + { + const prefix string = ",\"totalHits\":" + out.RawString(prefix) + out.Int64(int64(in.TotalHits)) + } + { + const prefix string = ",\"hitsPerPage\":" + out.RawString(prefix) + out.Int64(int64(in.HitsPerPage)) + } + { + const prefix string = ",\"page\":" + out.RawString(prefix) + out.Int64(int64(in.Page)) + } + { + const prefix string = ",\"totalPages\":" + out.RawString(prefix) + out.Int64(int64(in.TotalPages)) + } out.RawByte('}') } @@ -2358,6 +2386,10 @@ func easyjson6601e8cdDecodeGithubComMeilisearchMeilisearchGo14(in *jlexer.Lexer, } in.Delim(']') } + case "HitsPerPage": + out.HitsPerPage = int64(in.Int64()) + case "Page": + out.Page = int64(in.Int64()) default: in.SkipRecursive() } @@ -2508,6 +2540,16 @@ func easyjson6601e8cdEncodeGithubComMeilisearchMeilisearchGo14(out *jwriter.Writ 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('}') } From 6e97a765c2f0778c09ab19261e59ad3670842be4 Mon Sep 17 00:00:00 2001 From: alallema Date: Mon, 5 Dec 2022 16:24:59 +0100 Subject: [PATCH 07/12] Add optional on parameters --- types.go | 14 +++++++------- types_easyjson.go | 14 +++++++------- 2 files changed, 14 insertions(+), 14 deletions(-) diff --git a/types.go b/types.go index 817cca79..ec4cabf0 100644 --- a/types.go +++ b/types.go @@ -285,16 +285,16 @@ type SearchRequest struct { // 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"` - HitsPerPage int64 `json:"hitsPerPage"` - Page int64 `json:"page"` - TotalPages int64 `json:"totalPages"` + 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 diff --git a/types_easyjson.go b/types_easyjson.go index e0feba23..5c29fd70 100644 --- a/types_easyjson.go +++ b/types_easyjson.go @@ -2144,17 +2144,17 @@ func easyjson6601e8cdEncodeGithubComMeilisearchMeilisearchGo13(out *jwriter.Writ 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)) @@ -2180,22 +2180,22 @@ 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)) From 478217b34a14dc98c0837320dadb3e848b2589ac Mon Sep 17 00:00:00 2001 From: alallema Date: Wed, 7 Dec 2022 12:18:07 +0100 Subject: [PATCH 08/12] Add cancel task api for v0.30.0 --- client.go | 21 ++ client_test.go | 134 +++++++++++- types.go | 33 +-- types_easyjson.go | 516 ++++++++++++++++++++++++++++++++-------------- 4 files changed, 538 insertions(+), 166 deletions(-) diff --git a/client.go b/client.go index 1019e43a..5aaa5701 100644 --- a/client.go +++ b/client.go @@ -54,6 +54,7 @@ type ClientInterface interface { IsHealthy() bool GetTask(taskUID int64) (resp *Task, err error) GetTasks(param *TasksQuery) (resp *TaskResult, err error) + CancelTasks(param *TasksQuery) (resp *TaskInfo, err error) WaitForTask(taskUID int64, options ...WaitParams) (*Task, error) GenerateTenantToken(APIKeyUID string, searchRules map[string]interface{}, options *TenantTokenOptions) (resp string, err error) } @@ -285,6 +286,26 @@ func (c *Client) GetTasks(param *TasksQuery) (resp *TaskResult, err error) { return resp, nil } +func (c *Client) CancelTasks(param *TasksQuery) (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 { + encodeTasksQuery(param, &req) + } + if err := c.executeRequest(req); err != nil { + return nil, err + } + return resp, nil +} + // WaitForTask waits for a task to be processed // // The function will check by regular interval provided in parameter interval diff --git a/client_test.go b/client_test.go index 0b66907b..0c131c99 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) @@ -827,6 +829,134 @@ func TestClient_GetTasks(t *testing.T) { } } +func TestClient_CancelTasks(t *testing.T) { + type args struct { + UID string + client *Client + query *TasksQuery + } + tests := []struct { + name string + args args + want string + }{ + { + name: "TestBasicCancelTasks", + args: args{ + UID: "indexUID", + client: defaultClient, + query: &TasksQuery{ + Statuses: []string{"succeeded"}, + }, + }, + want: "?statuses=succeeded", + }, + { + name: "TestCancelTasksWithIndexUidFilter", + args: args{ + UID: "indexUID", + client: defaultClient, + query: &TasksQuery{ + IndexUIDS: []string{"0"}, + }, + }, + want: "?indexUids=0", + }, + { + name: "TestCancelTasksWithMultipleIndexUidsFilter", + args: args{ + UID: "indexUID", + client: defaultClient, + query: &TasksQuery{ + IndexUIDS: []string{"0", "1"}, + }, + }, + want: "?indexUids=0%2C1", + }, + { + name: "TestCancelTasksWithUidFilter", + args: args{ + UID: "indexUID", + client: defaultClient, + query: &TasksQuery{ + UIDS: []int64{0}, + }, + }, + want: "?uids=0", + }, + { + name: "TestCancelTasksWithMultipleUidsFilter", + args: args{ + UID: "indexUID", + client: defaultClient, + query: &TasksQuery{ + UIDS: []int64{0, 1}, + }, + }, + want: "?uids=0%2C1", + }, + { + name: "TestCancelTasksWithDateFilter", + args: args{ + UID: "indexUID", + client: defaultClient, + query: &TasksQuery{ + BeforeEnqueuedAt: time.Now(), + }, + }, + want: strings.NewReplacer(":", "%3A").Replace("?beforeEnqueuedAt=" + time.Now().Format("2006-01-02T15:04:05Z")), + }, + { + name: "TestCancelTasksWithCanceledByFilter", + args: args{ + UID: "indexUID", + client: defaultClient, + query: &TasksQuery{ + CanceledBy: []int64{1}, + }, + }, + want: "?canceledBy=1", + }, + { + name: "TestCancelTasksWithParameters", + args: args{ + UID: "indexUID", + client: defaultClient, + query: &TasksQuery{ + 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) + 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_DefaultWaitForTask(t *testing.T) { type args struct { UID string diff --git a/types.go b/types.go index eaa613dd..b70d2f12 100644 --- a/types.go +++ b/types.go @@ -130,22 +130,18 @@ 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 @@ -166,15 +162,26 @@ type TasksQuery struct { } 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"` + DisplayedAttributes []string `json:"displayedAttributes,omitempty"` + StopWords []string `json:"stopWords,omitempty"` 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"` } // Return of multiple tasks is wrap in a TaskResult diff --git a/types_easyjson.go b/types_easyjson.go index 3a4c9a35..0a6bebb0 100644 --- a/types_easyjson.go +++ b/types_easyjson.go @@ -1036,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() } @@ -1073,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)) @@ -1088,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('}') } @@ -1144,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 { @@ -1237,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": @@ -1254,6 +1152,8 @@ func easyjson6601e8cdDecodeGithubComMeilisearchMeilisearchGo9(in *jlexer.Lexer, } case "details": (out.Details).UnmarshalEasyJSON(in) + case "canceledBy": + out.CanceledBy = int64(in.Int64()) default: in.SkipRecursive() } @@ -1264,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 @@ -1296,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\":" @@ -1323,31 +1223,99 @@ 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 easyjson6601e8cdDecodeGithubComMeilisearchMeilisearchGo9(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 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 *StatsIndex) { isTopLevel := in.IsStart() @@ -4143,13 +4111,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() @@ -4183,6 +4153,75 @@ func easyjson6601e8cdDecodeGithubComMeilisearchMeilisearchGo30(in *jlexer.Lexer, } *out.DistinctAttribute = string(in.String()) } + case "searchableAttributes": + if in.IsNull() { + in.Skip() + out.SearchableAttributes = nil + } else { + in.Delim('[') + if out.SearchableAttributes == nil { + if !in.IsDelim(']') { + out.SearchableAttributes = make([]string, 0, 4) + } else { + out.SearchableAttributes = []string{} + } + } else { + out.SearchableAttributes = (out.SearchableAttributes)[:0] + } + for !in.IsDelim(']') { + var v100 string + v100 = string(in.String()) + out.SearchableAttributes = append(out.SearchableAttributes, v100) + in.WantComma() + } + in.Delim(']') + } + case "displayedAttributes": + if in.IsNull() { + in.Skip() + out.DisplayedAttributes = nil + } else { + in.Delim('[') + if out.DisplayedAttributes == nil { + if !in.IsDelim(']') { + out.DisplayedAttributes = make([]string, 0, 4) + } else { + out.DisplayedAttributes = []string{} + } + } else { + out.DisplayedAttributes = (out.DisplayedAttributes)[:0] + } + for !in.IsDelim(']') { + var v101 string + v101 = string(in.String()) + out.DisplayedAttributes = append(out.DisplayedAttributes, v101) + in.WantComma() + } + in.Delim(']') + } + case "stopWords": + if in.IsNull() { + in.Skip() + out.StopWords = nil + } else { + in.Delim('[') + if out.StopWords == nil { + if !in.IsDelim(']') { + out.StopWords = make([]string, 0, 4) + } else { + out.StopWords = []string{} + } + } else { + out.StopWords = (out.StopWords)[:0] + } + for !in.IsDelim(']') { + var v102 string + v102 = string(in.String()) + out.StopWords = append(out.StopWords, v102) + in.WantComma() + } + in.Delim(']') + } case "synonyms": if in.IsNull() { in.Skip() @@ -4196,30 +4235,30 @@ func easyjson6601e8cdDecodeGithubComMeilisearchMeilisearchGo30(in *jlexer.Lexer, for !in.IsDelim('}') { key := string(in.String()) in.WantColon() - var v100 []string + var v103 []string if in.IsNull() { in.Skip() - v100 = nil + v103 = nil } else { in.Delim('[') - if v100 == nil { + if v103 == nil { if !in.IsDelim(']') { - v100 = make([]string, 0, 4) + v103 = make([]string, 0, 4) } else { - v100 = []string{} + v103 = []string{} } } else { - v100 = (v100)[:0] + v103 = (v103)[:0] } for !in.IsDelim(']') { - var v101 string - v101 = string(in.String()) - v100 = append(v100, v101) + var v104 string + v104 = string(in.String()) + v103 = append(v103, v104) in.WantComma() } in.Delim(']') } - (out.Synonyms)[key] = v100 + (out.Synonyms)[key] = v103 in.WantComma() } in.Delim('}') @@ -4240,9 +4279,9 @@ func easyjson6601e8cdDecodeGithubComMeilisearchMeilisearchGo30(in *jlexer.Lexer, out.FilterableAttributes = (out.FilterableAttributes)[:0] } for !in.IsDelim(']') { - var v102 string - v102 = string(in.String()) - out.FilterableAttributes = append(out.FilterableAttributes, v102) + var v105 string + v105 = string(in.String()) + out.FilterableAttributes = append(out.FilterableAttributes, v105) in.WantComma() } in.Delim(']') @@ -4263,13 +4302,51 @@ func easyjson6601e8cdDecodeGithubComMeilisearchMeilisearchGo30(in *jlexer.Lexer, out.SortableAttributes = (out.SortableAttributes)[:0] } for !in.IsDelim(']') { - var v103 string - v103 = string(in.String()) - out.SortableAttributes = append(out.SortableAttributes, v103) + var v106 string + v106 = string(in.String()) + out.SortableAttributes = append(out.SortableAttributes, v106) 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()) default: in.SkipRecursive() } @@ -4288,7 +4365,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\":" @@ -4298,7 +4375,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\":" @@ -4308,7 +4385,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\":" @@ -4320,6 +4397,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 { @@ -4330,11 +4417,11 @@ func easyjson6601e8cdEncodeGithubComMeilisearchMeilisearchGo30(out *jwriter.Writ } { out.RawByte('[') - for v104, v105 := range in.RankingRules { - if v104 > 0 { + for v107, v108 := range in.RankingRules { + if v107 > 0 { out.RawByte(',') } - out.String(string(v105)) + out.String(string(v108)) } out.RawByte(']') } @@ -4349,6 +4436,63 @@ func easyjson6601e8cdEncodeGithubComMeilisearchMeilisearchGo30(out *jwriter.Writ } out.String(string(*in.DistinctAttribute)) } + if len(in.SearchableAttributes) != 0 { + const prefix string = ",\"searchableAttributes\":" + if first { + first = false + out.RawString(prefix[1:]) + } else { + out.RawString(prefix) + } + { + out.RawByte('[') + for v109, v110 := range in.SearchableAttributes { + if v109 > 0 { + out.RawByte(',') + } + out.String(string(v110)) + } + out.RawByte(']') + } + } + if len(in.DisplayedAttributes) != 0 { + const prefix string = ",\"displayedAttributes\":" + if first { + first = false + out.RawString(prefix[1:]) + } else { + out.RawString(prefix) + } + { + out.RawByte('[') + for v111, v112 := range in.DisplayedAttributes { + if v111 > 0 { + out.RawByte(',') + } + out.String(string(v112)) + } + out.RawByte(']') + } + } + if len(in.StopWords) != 0 { + const prefix string = ",\"stopWords\":" + if first { + first = false + out.RawString(prefix[1:]) + } else { + out.RawString(prefix) + } + { + out.RawByte('[') + for v113, v114 := range in.StopWords { + if v113 > 0 { + out.RawByte(',') + } + out.String(string(v114)) + } + out.RawByte(']') + } + } if len(in.Synonyms) != 0 { const prefix string = ",\"synonyms\":" if first { @@ -4359,24 +4503,24 @@ func easyjson6601e8cdEncodeGithubComMeilisearchMeilisearchGo30(out *jwriter.Writ } { out.RawByte('{') - v106First := true - for v106Name, v106Value := range in.Synonyms { - if v106First { - v106First = false + v115First := true + for v115Name, v115Value := range in.Synonyms { + if v115First { + v115First = false } else { out.RawByte(',') } - out.String(string(v106Name)) + out.String(string(v115Name)) out.RawByte(':') - if v106Value == nil && (out.Flags&jwriter.NilSliceAsEmpty) == 0 { + if v115Value == nil && (out.Flags&jwriter.NilSliceAsEmpty) == 0 { out.RawString("null") } else { out.RawByte('[') - for v107, v108 := range v106Value { - if v107 > 0 { + for v116, v117 := range v115Value { + if v116 > 0 { out.RawByte(',') } - out.String(string(v108)) + out.String(string(v117)) } out.RawByte(']') } @@ -4394,11 +4538,11 @@ func easyjson6601e8cdEncodeGithubComMeilisearchMeilisearchGo30(out *jwriter.Writ } { out.RawByte('[') - for v109, v110 := range in.FilterableAttributes { - if v109 > 0 { + for v118, v119 := range in.FilterableAttributes { + if v118 > 0 { out.RawByte(',') } - out.String(string(v110)) + out.String(string(v119)) } out.RawByte(']') } @@ -4413,15 +4557,85 @@ func easyjson6601e8cdEncodeGithubComMeilisearchMeilisearchGo30(out *jwriter.Writ } { out.RawByte('[') - for v111, v112 := range in.SortableAttributes { - if v111 > 0 { + for v120, v121 := range in.SortableAttributes { + if v120 > 0 { out.RawByte(',') } - out.String(string(v112)) + out.String(string(v121)) } out.RawByte(']') } } + if in.TypoTolerance != nil { + const prefix string = ",\"typoTolerance\":" + if first { + first = false + out.RawString(prefix[1:]) + } else { + out.RawString(prefix) + } + (*in.TypoTolerance).MarshalEasyJSON(out) + } + 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)) + } out.RawByte('}') } From 6d8eaedf74ac385e44590ce3a855d3ef4073cdea Mon Sep 17 00:00:00 2001 From: alallema Date: Wed, 7 Dec 2022 13:04:40 +0100 Subject: [PATCH 09/12] Add swap indexes api for v0.30.0 --- client.go | 18 + client_test.go | 57 +++ types.go | 5 + types_easyjson.go | 886 +++++++++++++++++++++++++++------------------- 4 files changed, 593 insertions(+), 373 deletions(-) diff --git a/client.go b/client.go index 5aaa5701..fc3ac87a 100644 --- a/client.go +++ b/client.go @@ -55,6 +55,7 @@ type ClientInterface interface { GetTask(taskUID int64) (resp *Task, err error) GetTasks(param *TasksQuery) (resp *TaskResult, err error) CancelTasks(param *TasksQuery) (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) } @@ -306,6 +307,23 @@ func (c *Client) CancelTasks(param *TasksQuery) (resp *TaskInfo, err error) { 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 + } + return resp, nil +} + // WaitForTask waits for a task to be processed // // The function will check by regular interval provided in parameter interval diff --git a/client_test.go b/client_test.go index 0c131c99..2654ebfe 100644 --- a/client_test.go +++ b/client_test.go @@ -957,6 +957,63 @@ func TestClient_CancelTasks(t *testing.T) { } } +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 diff --git a/types.go b/types.go index b70d2f12..eb0d9edd 100644 --- a/types.go +++ b/types.go @@ -182,6 +182,7 @@ type Details struct { 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 @@ -317,6 +318,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 0a6bebb0..c5977eee 100644 --- a/types_easyjson.go +++ b/types_easyjson.go @@ -1317,7 +1317,105 @@ func easyjson6601e8cdEncodeGithubComMeilisearchMeilisearchGo9(out *jwriter.Write } out.RawByte('}') } -func easyjson6601e8cdDecodeGithubComMeilisearchMeilisearchGo10(in *jlexer.Lexer, out *StatsIndex) { +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 { @@ -1349,9 +1447,9 @@ func easyjson6601e8cdDecodeGithubComMeilisearchMeilisearchGo10(in *jlexer.Lexer, for !in.IsDelim('}') { key := string(in.String()) in.WantColon() - var v25 int64 - v25 = int64(in.Int64()) - (out.FieldDistribution)[key] = v25 + var v28 int64 + v28 = int64(in.Int64()) + (out.FieldDistribution)[key] = v28 in.WantComma() } in.Delim('}') @@ -1366,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 @@ -1387,16 +1485,16 @@ func easyjson6601e8cdEncodeGithubComMeilisearchMeilisearchGo10(out *jwriter.Writ out.RawString(`null`) } else { out.RawByte('{') - v26First := true - for v26Name, v26Value := range in.FieldDistribution { - if v26First { - v26First = false + v29First := true + for v29Name, v29Value := range in.FieldDistribution { + if v29First { + v29First = false } else { out.RawByte(',') } - out.String(string(v26Name)) + out.String(string(v29Name)) out.RawByte(':') - out.Int64(int64(v26Value)) + out.Int64(int64(v29Value)) } out.RawByte('}') } @@ -1407,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 { @@ -1461,9 +1559,9 @@ func easyjson6601e8cdDecodeGithubComMeilisearchMeilisearchGo11(in *jlexer.Lexer, for !in.IsDelim('}') { key := string(in.String()) in.WantColon() - var v27 StatsIndex - (v27).UnmarshalEasyJSON(in) - (out.Indexes)[key] = v27 + var v30 StatsIndex + (v30).UnmarshalEasyJSON(in) + (out.Indexes)[key] = v30 in.WantComma() } in.Delim('}') @@ -1478,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 @@ -1499,16 +1597,16 @@ func easyjson6601e8cdEncodeGithubComMeilisearchMeilisearchGo11(out *jwriter.Writ out.RawString(`null`) } else { out.RawByte('{') - v28First := true - for v28Name, v28Value := range in.Indexes { - if v28First { - v28First = false + v31First := true + for v31Name, v31Value := range in.Indexes { + if v31First { + v31First = false } else { out.RawByte(',') } - out.String(string(v28Name)) + out.String(string(v31Name)) out.RawByte(':') - (v28Value).MarshalEasyJSON(out) + (v31Value).MarshalEasyJSON(out) } out.RawByte('}') } @@ -1519,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 { @@ -1574,9 +1672,9 @@ func easyjson6601e8cdDecodeGithubComMeilisearchMeilisearchGo12(in *jlexer.Lexer, out.RankingRules = (out.RankingRules)[:0] } for !in.IsDelim(']') { - var v29 string - v29 = string(in.String()) - out.RankingRules = append(out.RankingRules, v29) + var v32 string + v32 = string(in.String()) + out.RankingRules = append(out.RankingRules, v32) in.WantComma() } in.Delim(']') @@ -1607,9 +1705,9 @@ func easyjson6601e8cdDecodeGithubComMeilisearchMeilisearchGo12(in *jlexer.Lexer, out.SearchableAttributes = (out.SearchableAttributes)[:0] } for !in.IsDelim(']') { - var v30 string - v30 = string(in.String()) - out.SearchableAttributes = append(out.SearchableAttributes, v30) + var v33 string + v33 = string(in.String()) + out.SearchableAttributes = append(out.SearchableAttributes, v33) in.WantComma() } in.Delim(']') @@ -1630,9 +1728,9 @@ func easyjson6601e8cdDecodeGithubComMeilisearchMeilisearchGo12(in *jlexer.Lexer, out.DisplayedAttributes = (out.DisplayedAttributes)[:0] } for !in.IsDelim(']') { - var v31 string - v31 = string(in.String()) - out.DisplayedAttributes = append(out.DisplayedAttributes, v31) + var v34 string + v34 = string(in.String()) + out.DisplayedAttributes = append(out.DisplayedAttributes, v34) in.WantComma() } in.Delim(']') @@ -1653,9 +1751,9 @@ func easyjson6601e8cdDecodeGithubComMeilisearchMeilisearchGo12(in *jlexer.Lexer, out.StopWords = (out.StopWords)[:0] } for !in.IsDelim(']') { - var v32 string - v32 = string(in.String()) - out.StopWords = append(out.StopWords, v32) + var v35 string + v35 = string(in.String()) + out.StopWords = append(out.StopWords, v35) in.WantComma() } in.Delim(']') @@ -1673,30 +1771,30 @@ func easyjson6601e8cdDecodeGithubComMeilisearchMeilisearchGo12(in *jlexer.Lexer, for !in.IsDelim('}') { key := string(in.String()) in.WantColon() - var v33 []string + var v36 []string if in.IsNull() { in.Skip() - v33 = nil + v36 = nil } else { in.Delim('[') - if v33 == nil { + if v36 == nil { if !in.IsDelim(']') { - v33 = make([]string, 0, 4) + v36 = make([]string, 0, 4) } else { - v33 = []string{} + v36 = []string{} } } else { - v33 = (v33)[:0] + v36 = (v36)[:0] } for !in.IsDelim(']') { - var v34 string - v34 = string(in.String()) - v33 = append(v33, v34) + var v37 string + v37 = string(in.String()) + v36 = append(v36, v37) in.WantComma() } in.Delim(']') } - (out.Synonyms)[key] = v33 + (out.Synonyms)[key] = v36 in.WantComma() } in.Delim('}') @@ -1717,9 +1815,9 @@ func easyjson6601e8cdDecodeGithubComMeilisearchMeilisearchGo12(in *jlexer.Lexer, out.FilterableAttributes = (out.FilterableAttributes)[:0] } for !in.IsDelim(']') { - var v35 string - v35 = string(in.String()) - out.FilterableAttributes = append(out.FilterableAttributes, v35) + var v38 string + v38 = string(in.String()) + out.FilterableAttributes = append(out.FilterableAttributes, v38) in.WantComma() } in.Delim(']') @@ -1740,9 +1838,9 @@ func easyjson6601e8cdDecodeGithubComMeilisearchMeilisearchGo12(in *jlexer.Lexer, out.SortableAttributes = (out.SortableAttributes)[:0] } for !in.IsDelim(']') { - var v36 string - v36 = string(in.String()) - out.SortableAttributes = append(out.SortableAttributes, v36) + var v39 string + v39 = string(in.String()) + out.SortableAttributes = append(out.SortableAttributes, v39) in.WantComma() } in.Delim(']') @@ -1787,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 @@ -1797,11 +1895,11 @@ func easyjson6601e8cdEncodeGithubComMeilisearchMeilisearchGo12(out *jwriter.Writ out.RawString(prefix[1:]) { out.RawByte('[') - for v37, v38 := range in.RankingRules { - if v37 > 0 { + for v40, v41 := range in.RankingRules { + if v40 > 0 { out.RawByte(',') } - out.String(string(v38)) + out.String(string(v41)) } out.RawByte(']') } @@ -1826,11 +1924,11 @@ func easyjson6601e8cdEncodeGithubComMeilisearchMeilisearchGo12(out *jwriter.Writ } { out.RawByte('[') - for v39, v40 := range in.SearchableAttributes { - if v39 > 0 { + for v42, v43 := range in.SearchableAttributes { + if v42 > 0 { out.RawByte(',') } - out.String(string(v40)) + out.String(string(v43)) } out.RawByte(']') } @@ -1845,11 +1943,11 @@ func easyjson6601e8cdEncodeGithubComMeilisearchMeilisearchGo12(out *jwriter.Writ } { out.RawByte('[') - for v41, v42 := range in.DisplayedAttributes { - if v41 > 0 { + for v44, v45 := range in.DisplayedAttributes { + if v44 > 0 { out.RawByte(',') } - out.String(string(v42)) + out.String(string(v45)) } out.RawByte(']') } @@ -1864,11 +1962,11 @@ func easyjson6601e8cdEncodeGithubComMeilisearchMeilisearchGo12(out *jwriter.Writ } { out.RawByte('[') - for v43, v44 := range in.StopWords { - if v43 > 0 { + for v46, v47 := range in.StopWords { + if v46 > 0 { out.RawByte(',') } - out.String(string(v44)) + out.String(string(v47)) } out.RawByte(']') } @@ -1883,24 +1981,24 @@ func easyjson6601e8cdEncodeGithubComMeilisearchMeilisearchGo12(out *jwriter.Writ } { out.RawByte('{') - v45First := true - for v45Name, v45Value := range in.Synonyms { - if v45First { - v45First = false + v48First := true + for v48Name, v48Value := range in.Synonyms { + if v48First { + v48First = false } else { out.RawByte(',') } - out.String(string(v45Name)) + out.String(string(v48Name)) out.RawByte(':') - if v45Value == nil && (out.Flags&jwriter.NilSliceAsEmpty) == 0 { + if v48Value == nil && (out.Flags&jwriter.NilSliceAsEmpty) == 0 { out.RawString("null") } else { out.RawByte('[') - for v46, v47 := range v45Value { - if v46 > 0 { + for v49, v50 := range v48Value { + if v49 > 0 { out.RawByte(',') } - out.String(string(v47)) + out.String(string(v50)) } out.RawByte(']') } @@ -1918,11 +2016,11 @@ func easyjson6601e8cdEncodeGithubComMeilisearchMeilisearchGo12(out *jwriter.Writ } { out.RawByte('[') - for v48, v49 := range in.FilterableAttributes { - if v48 > 0 { + for v51, v52 := range in.FilterableAttributes { + if v51 > 0 { out.RawByte(',') } - out.String(string(v49)) + out.String(string(v52)) } out.RawByte(']') } @@ -1937,11 +2035,11 @@ func easyjson6601e8cdEncodeGithubComMeilisearchMeilisearchGo12(out *jwriter.Writ } { out.RawByte('[') - for v50, v51 := range in.SortableAttributes { - if v50 > 0 { + for v53, v54 := range in.SortableAttributes { + if v53 > 0 { out.RawByte(',') } - out.String(string(v51)) + out.String(string(v54)) } out.RawByte(']') } @@ -1982,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 { @@ -2037,15 +2135,15 @@ func easyjson6601e8cdDecodeGithubComMeilisearchMeilisearchGo13(in *jlexer.Lexer, out.Hits = (out.Hits)[:0] } for !in.IsDelim(']') { - var v52 interface{} - if m, ok := v52.(easyjson.Unmarshaler); ok { + var v55 interface{} + if m, ok := v55.(easyjson.Unmarshaler); ok { m.UnmarshalEasyJSON(in) - } else if m, ok := v52.(json.Unmarshaler); ok { + } else if m, ok := v55.(json.Unmarshaler); ok { _ = m.UnmarshalJSON(in.Raw()) } else { - v52 = in.Interface() + v55 = in.Interface() } - out.Hits = append(out.Hits, v52) + out.Hits = append(out.Hits, v55) in.WantComma() } in.Delim(']') @@ -2078,7 +2176,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 @@ -2089,16 +2187,16 @@ func easyjson6601e8cdEncodeGithubComMeilisearchMeilisearchGo13(out *jwriter.Writ out.RawString("null") } else { out.RawByte('[') - for v53, v54 := range in.Hits { - if v53 > 0 { + for v56, v57 := range in.Hits { + if v56 > 0 { out.RawByte(',') } - if m, ok := v54.(easyjson.Marshaler); ok { + if m, ok := v57.(easyjson.Marshaler); ok { m.MarshalEasyJSON(out) - } else if m, ok := v54.(json.Marshaler); ok { + } else if m, ok := v57.(json.Marshaler); ok { out.Raw(m.MarshalJSON()) } else { - out.Raw(json.Marshal(v54)) + out.Raw(json.Marshal(v57)) } } out.RawByte(']') @@ -2146,27 +2244,27 @@ func easyjson6601e8cdEncodeGithubComMeilisearchMeilisearchGo13(out *jwriter.Writ // 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 { @@ -2205,9 +2303,9 @@ func easyjson6601e8cdDecodeGithubComMeilisearchMeilisearchGo14(in *jlexer.Lexer, out.AttributesToRetrieve = (out.AttributesToRetrieve)[:0] } for !in.IsDelim(']') { - var v55 string - v55 = string(in.String()) - out.AttributesToRetrieve = append(out.AttributesToRetrieve, v55) + var v58 string + v58 = string(in.String()) + out.AttributesToRetrieve = append(out.AttributesToRetrieve, v58) in.WantComma() } in.Delim(']') @@ -2228,9 +2326,9 @@ func easyjson6601e8cdDecodeGithubComMeilisearchMeilisearchGo14(in *jlexer.Lexer, out.AttributesToCrop = (out.AttributesToCrop)[:0] } for !in.IsDelim(']') { - var v56 string - v56 = string(in.String()) - out.AttributesToCrop = append(out.AttributesToCrop, v56) + var v59 string + v59 = string(in.String()) + out.AttributesToCrop = append(out.AttributesToCrop, v59) in.WantComma() } in.Delim(']') @@ -2255,9 +2353,9 @@ func easyjson6601e8cdDecodeGithubComMeilisearchMeilisearchGo14(in *jlexer.Lexer, out.AttributesToHighlight = (out.AttributesToHighlight)[:0] } for !in.IsDelim(']') { - var v57 string - v57 = string(in.String()) - out.AttributesToHighlight = append(out.AttributesToHighlight, v57) + var v60 string + v60 = string(in.String()) + out.AttributesToHighlight = append(out.AttributesToHighlight, v60) in.WantComma() } in.Delim(']') @@ -2294,9 +2392,9 @@ func easyjson6601e8cdDecodeGithubComMeilisearchMeilisearchGo14(in *jlexer.Lexer, out.Facets = (out.Facets)[:0] } for !in.IsDelim(']') { - var v58 string - v58 = string(in.String()) - out.Facets = append(out.Facets, v58) + var v61 string + v61 = string(in.String()) + out.Facets = append(out.Facets, v61) in.WantComma() } in.Delim(']') @@ -2319,9 +2417,9 @@ func easyjson6601e8cdDecodeGithubComMeilisearchMeilisearchGo14(in *jlexer.Lexer, out.Sort = (out.Sort)[:0] } for !in.IsDelim(']') { - var v59 string - v59 = string(in.String()) - out.Sort = append(out.Sort, v59) + var v62 string + v62 = string(in.String()) + out.Sort = append(out.Sort, v62) in.WantComma() } in.Delim(']') @@ -2336,7 +2434,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 @@ -2357,11 +2455,11 @@ func easyjson6601e8cdEncodeGithubComMeilisearchMeilisearchGo14(out *jwriter.Writ out.RawString("null") } else { out.RawByte('[') - for v60, v61 := range in.AttributesToRetrieve { - if v60 > 0 { + for v63, v64 := range in.AttributesToRetrieve { + if v63 > 0 { out.RawByte(',') } - out.String(string(v61)) + out.String(string(v64)) } out.RawByte(']') } @@ -2373,11 +2471,11 @@ func easyjson6601e8cdEncodeGithubComMeilisearchMeilisearchGo14(out *jwriter.Writ out.RawString("null") } else { out.RawByte('[') - for v62, v63 := range in.AttributesToCrop { - if v62 > 0 { + for v65, v66 := range in.AttributesToCrop { + if v65 > 0 { out.RawByte(',') } - out.String(string(v63)) + out.String(string(v66)) } out.RawByte(']') } @@ -2399,11 +2497,11 @@ func easyjson6601e8cdEncodeGithubComMeilisearchMeilisearchGo14(out *jwriter.Writ out.RawString("null") } else { out.RawByte('[') - for v64, v65 := range in.AttributesToHighlight { - if v64 > 0 { + for v67, v68 := range in.AttributesToHighlight { + if v67 > 0 { out.RawByte(',') } - out.String(string(v65)) + out.String(string(v68)) } out.RawByte(']') } @@ -2446,11 +2544,11 @@ func easyjson6601e8cdEncodeGithubComMeilisearchMeilisearchGo14(out *jwriter.Writ out.RawString("null") } else { out.RawByte('[') - for v66, v67 := range in.Facets { - if v66 > 0 { + for v69, v70 := range in.Facets { + if v69 > 0 { out.RawByte(',') } - out.String(string(v67)) + out.String(string(v70)) } out.RawByte(']') } @@ -2467,11 +2565,11 @@ func easyjson6601e8cdEncodeGithubComMeilisearchMeilisearchGo14(out *jwriter.Writ out.RawString("null") } else { out.RawByte('[') - for v68, v69 := range in.Sort { - if v68 > 0 { + for v71, v72 := range in.Sort { + if v71 > 0 { out.RawByte(',') } - out.String(string(v69)) + out.String(string(v72)) } out.RawByte(']') } @@ -2482,27 +2580,27 @@ func easyjson6601e8cdEncodeGithubComMeilisearchMeilisearchGo14(out *jwriter.Writ // 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 { @@ -2533,7 +2631,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 @@ -2548,27 +2646,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 { @@ -2601,7 +2699,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 @@ -2627,27 +2725,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 { @@ -2682,9 +2780,9 @@ func easyjson6601e8cdDecodeGithubComMeilisearchMeilisearchGo17(in *jlexer.Lexer, out.Results = (out.Results)[:0] } for !in.IsDelim(']') { - var v70 Key - (v70).UnmarshalEasyJSON(in) - out.Results = append(out.Results, v70) + var v73 Key + (v73).UnmarshalEasyJSON(in) + out.Results = append(out.Results, v73) in.WantComma() } in.Delim(']') @@ -2705,7 +2803,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 @@ -2716,11 +2814,11 @@ func easyjson6601e8cdEncodeGithubComMeilisearchMeilisearchGo17(out *jwriter.Writ out.RawString("null") } else { out.RawByte('[') - for v71, v72 := range in.Results { - if v71 > 0 { + for v74, v75 := range in.Results { + if v74 > 0 { out.RawByte(',') } - (v72).MarshalEasyJSON(out) + (v75).MarshalEasyJSON(out) } out.RawByte(']') } @@ -2746,27 +2844,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 { @@ -2799,7 +2897,7 @@ 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 @@ -2819,27 +2917,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 { @@ -2872,7 +2970,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 @@ -2898,27 +2996,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 { @@ -2959,9 +3057,9 @@ func easyjson6601e8cdDecodeGithubComMeilisearchMeilisearchGo20(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 v76 string + v76 = string(in.String()) + out.Actions = append(out.Actions, v76) in.WantComma() } in.Delim(']') @@ -2982,9 +3080,9 @@ func easyjson6601e8cdDecodeGithubComMeilisearchMeilisearchGo20(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 v77 string + v77 = string(in.String()) + out.Indexes = append(out.Indexes, v77) in.WantComma() } in.Delim(']') @@ -3017,7 +3115,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 @@ -3041,11 +3139,11 @@ func easyjson6601e8cdEncodeGithubComMeilisearchMeilisearchGo20(out *jwriter.Writ out.RawString(prefix) { out.RawByte('[') - for v75, v76 := range in.Actions { - if v75 > 0 { + for v78, v79 := range in.Actions { + if v78 > 0 { out.RawByte(',') } - out.String(string(v76)) + out.String(string(v79)) } out.RawByte(']') } @@ -3055,11 +3153,11 @@ func easyjson6601e8cdEncodeGithubComMeilisearchMeilisearchGo20(out *jwriter.Writ out.RawString(prefix) { out.RawByte('[') - for v77, v78 := range in.Indexes { - if v77 > 0 { + for v80, v81 := range in.Indexes { + if v80 > 0 { out.RawByte(',') } - out.String(string(v78)) + out.String(string(v81)) } out.RawByte(']') } @@ -3089,27 +3187,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 { @@ -3152,9 +3250,9 @@ func easyjson6601e8cdDecodeGithubComMeilisearchMeilisearchGo21(in *jlexer.Lexer, out.Actions = (out.Actions)[:0] } for !in.IsDelim(']') { - var v79 string - v79 = string(in.String()) - out.Actions = append(out.Actions, v79) + var v82 string + v82 = string(in.String()) + out.Actions = append(out.Actions, v82) in.WantComma() } in.Delim(']') @@ -3175,9 +3273,9 @@ func easyjson6601e8cdDecodeGithubComMeilisearchMeilisearchGo21(in *jlexer.Lexer, out.Indexes = (out.Indexes)[:0] } for !in.IsDelim(']') { - var v80 string - v80 = string(in.String()) - out.Indexes = append(out.Indexes, v80) + var v83 string + v83 = string(in.String()) + out.Indexes = append(out.Indexes, v83) in.WantComma() } in.Delim(']') @@ -3204,7 +3302,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 @@ -3233,11 +3331,11 @@ func easyjson6601e8cdEncodeGithubComMeilisearchMeilisearchGo21(out *jwriter.Writ out.RawString(prefix) { out.RawByte('[') - for v81, v82 := range in.Actions { - if v81 > 0 { + for v84, v85 := range in.Actions { + if v84 > 0 { out.RawByte(',') } - out.String(string(v82)) + out.String(string(v85)) } out.RawByte(']') } @@ -3247,11 +3345,11 @@ func easyjson6601e8cdEncodeGithubComMeilisearchMeilisearchGo21(out *jwriter.Writ out.RawString(prefix) { out.RawByte('[') - for v83, v84 := range in.Indexes { - if v83 > 0 { + for v86, v87 := range in.Indexes { + if v86 > 0 { out.RawByte(',') } - out.String(string(v84)) + out.String(string(v87)) } out.RawByte(']') } @@ -3277,27 +3375,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 { @@ -3332,9 +3430,9 @@ func easyjson6601e8cdDecodeGithubComMeilisearchMeilisearchGo22(in *jlexer.Lexer, out.Results = (out.Results)[:0] } for !in.IsDelim(']') { - var v85 Index - (v85).UnmarshalEasyJSON(in) - out.Results = append(out.Results, v85) + var v88 Index + (v88).UnmarshalEasyJSON(in) + out.Results = append(out.Results, v88) in.WantComma() } in.Delim(']') @@ -3355,7 +3453,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 @@ -3366,11 +3464,11 @@ func easyjson6601e8cdEncodeGithubComMeilisearchMeilisearchGo22(out *jwriter.Writ out.RawString("null") } else { out.RawByte('[') - for v86, v87 := range in.Results { - if v86 > 0 { + for v89, v90 := range in.Results { + if v89 > 0 { out.RawByte(',') } - (v87).MarshalEasyJSON(out) + (v90).MarshalEasyJSON(out) } out.RawByte(']') } @@ -3396,27 +3494,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 { @@ -3449,7 +3547,7 @@ 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 @@ -3469,27 +3567,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 { @@ -3530,7 +3628,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 @@ -3560,27 +3658,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 { @@ -3611,7 +3709,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 @@ -3626,27 +3724,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 { @@ -3677,7 +3775,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 @@ -3692,27 +3790,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 { @@ -3747,29 +3845,29 @@ func easyjson6601e8cdDecodeGithubComMeilisearchMeilisearchGo27(in *jlexer.Lexer, out.Results = (out.Results)[:0] } for !in.IsDelim(']') { - var v88 map[string]interface{} + var v91 map[string]interface{} if in.IsNull() { in.Skip() } else { in.Delim('{') - v88 = make(map[string]interface{}) + v91 = make(map[string]interface{}) for !in.IsDelim('}') { key := string(in.String()) in.WantColon() - var v89 interface{} - if m, ok := v89.(easyjson.Unmarshaler); ok { + var v92 interface{} + if m, ok := v92.(easyjson.Unmarshaler); ok { m.UnmarshalEasyJSON(in) - } else if m, ok := v89.(json.Unmarshaler); ok { + } else if m, ok := v92.(json.Unmarshaler); ok { _ = m.UnmarshalJSON(in.Raw()) } else { - v89 = in.Interface() + v92 = in.Interface() } - (v88)[key] = v89 + (v91)[key] = v92 in.WantComma() } in.Delim('}') } - out.Results = append(out.Results, v88) + out.Results = append(out.Results, v91) in.WantComma() } in.Delim(']') @@ -3790,7 +3888,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 @@ -3801,29 +3899,29 @@ func easyjson6601e8cdEncodeGithubComMeilisearchMeilisearchGo27(out *jwriter.Writ out.RawString("null") } else { out.RawByte('[') - for v90, v91 := range in.Results { - if v90 > 0 { + for v93, v94 := range in.Results { + if v93 > 0 { out.RawByte(',') } - if v91 == nil && (out.Flags&jwriter.NilMapAsEmpty) == 0 { + if v94 == nil && (out.Flags&jwriter.NilMapAsEmpty) == 0 { out.RawString(`null`) } else { out.RawByte('{') - v92First := true - for v92Name, v92Value := range v91 { - if v92First { - v92First = false + v95First := true + for v95Name, v95Value := range v94 { + if v95First { + v95First = false } else { out.RawByte(',') } - out.String(string(v92Name)) + out.String(string(v95Name)) out.RawByte(':') - if m, ok := v92Value.(easyjson.Marshaler); ok { + if m, ok := v95Value.(easyjson.Marshaler); ok { m.MarshalEasyJSON(out) - } else if m, ok := v92Value.(json.Marshaler); ok { + } else if m, ok := v95Value.(json.Marshaler); ok { out.Raw(m.MarshalJSON()) } else { - out.Raw(json.Marshal(v92Value)) + out.Raw(json.Marshal(v95Value)) } } out.RawByte('}') @@ -3853,27 +3951,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 { @@ -3912,9 +4010,9 @@ func easyjson6601e8cdDecodeGithubComMeilisearchMeilisearchGo28(in *jlexer.Lexer, out.Fields = (out.Fields)[:0] } for !in.IsDelim(']') { - var v93 string - v93 = string(in.String()) - out.Fields = append(out.Fields, v93) + var v96 string + v96 = string(in.String()) + out.Fields = append(out.Fields, v96) in.WantComma() } in.Delim(']') @@ -3929,7 +4027,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 @@ -3959,11 +4057,11 @@ func easyjson6601e8cdEncodeGithubComMeilisearchMeilisearchGo28(out *jwriter.Writ } { out.RawByte('[') - for v94, v95 := range in.Fields { - if v94 > 0 { + for v97, v98 := range in.Fields { + if v97 > 0 { out.RawByte(',') } - out.String(string(v95)) + out.String(string(v98)) } out.RawByte(']') } @@ -3974,27 +4072,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 { @@ -4029,9 +4127,9 @@ func easyjson6601e8cdDecodeGithubComMeilisearchMeilisearchGo29(in *jlexer.Lexer, out.Fields = (out.Fields)[:0] } for !in.IsDelim(']') { - var v96 string - v96 = string(in.String()) - out.Fields = append(out.Fields, v96) + var v99 string + v99 = string(in.String()) + out.Fields = append(out.Fields, v99) in.WantComma() } in.Delim(']') @@ -4046,7 +4144,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 @@ -4056,11 +4154,11 @@ func easyjson6601e8cdEncodeGithubComMeilisearchMeilisearchGo29(out *jwriter.Writ out.RawString(prefix[1:]) { out.RawByte('[') - for v97, v98 := range in.Fields { - if v97 > 0 { + for v100, v101 := range in.Fields { + if v100 > 0 { out.RawByte(',') } - out.String(string(v98)) + out.String(string(v101)) } out.RawByte(']') } @@ -4071,27 +4169,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 { @@ -4136,9 +4234,9 @@ func easyjson6601e8cdDecodeGithubComMeilisearchMeilisearchGo30(in *jlexer.Lexer, out.RankingRules = (out.RankingRules)[:0] } for !in.IsDelim(']') { - var v99 string - v99 = string(in.String()) - out.RankingRules = append(out.RankingRules, v99) + var v102 string + v102 = string(in.String()) + out.RankingRules = append(out.RankingRules, v102) in.WantComma() } in.Delim(']') @@ -4169,9 +4267,9 @@ func easyjson6601e8cdDecodeGithubComMeilisearchMeilisearchGo30(in *jlexer.Lexer, out.SearchableAttributes = (out.SearchableAttributes)[:0] } for !in.IsDelim(']') { - var v100 string - v100 = string(in.String()) - out.SearchableAttributes = append(out.SearchableAttributes, v100) + var v103 string + v103 = string(in.String()) + out.SearchableAttributes = append(out.SearchableAttributes, v103) in.WantComma() } in.Delim(']') @@ -4192,9 +4290,9 @@ func easyjson6601e8cdDecodeGithubComMeilisearchMeilisearchGo30(in *jlexer.Lexer, out.DisplayedAttributes = (out.DisplayedAttributes)[:0] } for !in.IsDelim(']') { - var v101 string - v101 = string(in.String()) - out.DisplayedAttributes = append(out.DisplayedAttributes, v101) + var v104 string + v104 = string(in.String()) + out.DisplayedAttributes = append(out.DisplayedAttributes, v104) in.WantComma() } in.Delim(']') @@ -4215,9 +4313,9 @@ func easyjson6601e8cdDecodeGithubComMeilisearchMeilisearchGo30(in *jlexer.Lexer, out.StopWords = (out.StopWords)[:0] } for !in.IsDelim(']') { - var v102 string - v102 = string(in.String()) - out.StopWords = append(out.StopWords, v102) + var v105 string + v105 = string(in.String()) + out.StopWords = append(out.StopWords, v105) in.WantComma() } in.Delim(']') @@ -4235,30 +4333,30 @@ func easyjson6601e8cdDecodeGithubComMeilisearchMeilisearchGo30(in *jlexer.Lexer, for !in.IsDelim('}') { key := string(in.String()) in.WantColon() - var v103 []string + var v106 []string if in.IsNull() { in.Skip() - v103 = nil + v106 = nil } else { in.Delim('[') - if v103 == nil { + if v106 == nil { if !in.IsDelim(']') { - v103 = make([]string, 0, 4) + v106 = make([]string, 0, 4) } else { - v103 = []string{} + v106 = []string{} } } else { - v103 = (v103)[:0] + v106 = (v106)[:0] } for !in.IsDelim(']') { - var v104 string - v104 = string(in.String()) - v103 = append(v103, v104) + var v107 string + v107 = string(in.String()) + v106 = append(v106, v107) in.WantComma() } in.Delim(']') } - (out.Synonyms)[key] = v103 + (out.Synonyms)[key] = v106 in.WantComma() } in.Delim('}') @@ -4279,9 +4377,9 @@ func easyjson6601e8cdDecodeGithubComMeilisearchMeilisearchGo30(in *jlexer.Lexer, out.FilterableAttributes = (out.FilterableAttributes)[:0] } for !in.IsDelim(']') { - var v105 string - v105 = string(in.String()) - out.FilterableAttributes = append(out.FilterableAttributes, v105) + var v108 string + v108 = string(in.String()) + out.FilterableAttributes = append(out.FilterableAttributes, v108) in.WantComma() } in.Delim(']') @@ -4302,9 +4400,9 @@ func easyjson6601e8cdDecodeGithubComMeilisearchMeilisearchGo30(in *jlexer.Lexer, out.SortableAttributes = (out.SortableAttributes)[:0] } for !in.IsDelim(']') { - var v106 string - v106 = string(in.String()) - out.SortableAttributes = append(out.SortableAttributes, v106) + var v109 string + v109 = string(in.String()) + out.SortableAttributes = append(out.SortableAttributes, v109) in.WantComma() } in.Delim(']') @@ -4347,6 +4445,29 @@ func easyjson6601e8cdDecodeGithubComMeilisearchMeilisearchGo30(in *jlexer.Lexer, 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(']') + } default: in.SkipRecursive() } @@ -4357,7 +4478,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 @@ -4417,11 +4538,11 @@ func easyjson6601e8cdEncodeGithubComMeilisearchMeilisearchGo30(out *jwriter.Writ } { out.RawByte('[') - for v107, v108 := range in.RankingRules { - if v107 > 0 { + for v111, v112 := range in.RankingRules { + if v111 > 0 { out.RawByte(',') } - out.String(string(v108)) + out.String(string(v112)) } out.RawByte(']') } @@ -4446,11 +4567,11 @@ func easyjson6601e8cdEncodeGithubComMeilisearchMeilisearchGo30(out *jwriter.Writ } { out.RawByte('[') - for v109, v110 := range in.SearchableAttributes { - if v109 > 0 { + for v113, v114 := range in.SearchableAttributes { + if v113 > 0 { out.RawByte(',') } - out.String(string(v110)) + out.String(string(v114)) } out.RawByte(']') } @@ -4465,11 +4586,11 @@ func easyjson6601e8cdEncodeGithubComMeilisearchMeilisearchGo30(out *jwriter.Writ } { out.RawByte('[') - for v111, v112 := range in.DisplayedAttributes { - if v111 > 0 { + for v115, v116 := range in.DisplayedAttributes { + if v115 > 0 { out.RawByte(',') } - out.String(string(v112)) + out.String(string(v116)) } out.RawByte(']') } @@ -4484,11 +4605,11 @@ func easyjson6601e8cdEncodeGithubComMeilisearchMeilisearchGo30(out *jwriter.Writ } { out.RawByte('[') - for v113, v114 := range in.StopWords { - if v113 > 0 { + for v117, v118 := range in.StopWords { + if v117 > 0 { out.RawByte(',') } - out.String(string(v114)) + out.String(string(v118)) } out.RawByte(']') } @@ -4503,24 +4624,24 @@ func easyjson6601e8cdEncodeGithubComMeilisearchMeilisearchGo30(out *jwriter.Writ } { out.RawByte('{') - v115First := true - for v115Name, v115Value := range in.Synonyms { - if v115First { - v115First = false + v119First := true + for v119Name, v119Value := range in.Synonyms { + if v119First { + v119First = false } else { out.RawByte(',') } - out.String(string(v115Name)) + out.String(string(v119Name)) out.RawByte(':') - if v115Value == nil && (out.Flags&jwriter.NilSliceAsEmpty) == 0 { + if v119Value == nil && (out.Flags&jwriter.NilSliceAsEmpty) == 0 { out.RawString("null") } else { out.RawByte('[') - for v116, v117 := range v115Value { - if v116 > 0 { + for v120, v121 := range v119Value { + if v120 > 0 { out.RawByte(',') } - out.String(string(v117)) + out.String(string(v121)) } out.RawByte(']') } @@ -4538,11 +4659,11 @@ func easyjson6601e8cdEncodeGithubComMeilisearchMeilisearchGo30(out *jwriter.Writ } { out.RawByte('[') - for v118, v119 := range in.FilterableAttributes { - if v118 > 0 { + for v122, v123 := range in.FilterableAttributes { + if v122 > 0 { out.RawByte(',') } - out.String(string(v119)) + out.String(string(v123)) } out.RawByte(']') } @@ -4557,11 +4678,11 @@ func easyjson6601e8cdEncodeGithubComMeilisearchMeilisearchGo30(out *jwriter.Writ } { out.RawByte('[') - for v120, v121 := range in.SortableAttributes { - if v120 > 0 { + for v124, v125 := range in.SortableAttributes { + if v124 > 0 { out.RawByte(',') } - out.String(string(v121)) + out.String(string(v125)) } out.RawByte(']') } @@ -4636,33 +4757,52 @@ func easyjson6601e8cdEncodeGithubComMeilisearchMeilisearchGo30(out *jwriter.Writ } 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{} - easyjson6601e8cdEncodeGithubComMeilisearchMeilisearchGo30(&w, v) + easyjson6601e8cdEncodeGithubComMeilisearchMeilisearchGo31(&w, v) return w.Buffer.BuildBytes(), w.Error } // MarshalEasyJSON supports easyjson.Marshaler interface func (v Details) MarshalEasyJSON(w *jwriter.Writer) { - easyjson6601e8cdEncodeGithubComMeilisearchMeilisearchGo30(w, v) + easyjson6601e8cdEncodeGithubComMeilisearchMeilisearchGo31(w, v) } // UnmarshalJSON supports json.Unmarshaler interface func (v *Details) UnmarshalJSON(data []byte) error { r := jlexer.Lexer{Data: data} - easyjson6601e8cdDecodeGithubComMeilisearchMeilisearchGo30(&r, v) + easyjson6601e8cdDecodeGithubComMeilisearchMeilisearchGo31(&r, v) return r.Error() } // UnmarshalEasyJSON supports easyjson.Unmarshaler interface func (v *Details) UnmarshalEasyJSON(l *jlexer.Lexer) { - easyjson6601e8cdDecodeGithubComMeilisearchMeilisearchGo30(l, v) + easyjson6601e8cdDecodeGithubComMeilisearchMeilisearchGo31(l, v) } -func easyjson6601e8cdDecodeGithubComMeilisearchMeilisearchGo31(in *jlexer.Lexer, out *CreateIndexRequest) { +func easyjson6601e8cdDecodeGithubComMeilisearchMeilisearchGo32(in *jlexer.Lexer, out *CreateIndexRequest) { isTopLevel := in.IsStart() if in.IsNull() { if isTopLevel { @@ -4695,7 +4835,7 @@ func easyjson6601e8cdDecodeGithubComMeilisearchMeilisearchGo31(in *jlexer.Lexer, in.Consumed() } } -func easyjson6601e8cdEncodeGithubComMeilisearchMeilisearchGo31(out *jwriter.Writer, in CreateIndexRequest) { +func easyjson6601e8cdEncodeGithubComMeilisearchMeilisearchGo32(out *jwriter.Writer, in CreateIndexRequest) { out.RawByte('{') first := true _ = first @@ -4721,27 +4861,27 @@ func easyjson6601e8cdEncodeGithubComMeilisearchMeilisearchGo31(out *jwriter.Writ // MarshalJSON supports json.Marshaler interface func (v CreateIndexRequest) MarshalJSON() ([]byte, error) { w := jwriter.Writer{} - easyjson6601e8cdEncodeGithubComMeilisearchMeilisearchGo31(&w, v) + easyjson6601e8cdEncodeGithubComMeilisearchMeilisearchGo32(&w, v) return w.Buffer.BuildBytes(), w.Error } // MarshalEasyJSON supports easyjson.Marshaler interface func (v CreateIndexRequest) MarshalEasyJSON(w *jwriter.Writer) { - easyjson6601e8cdEncodeGithubComMeilisearchMeilisearchGo31(w, v) + easyjson6601e8cdEncodeGithubComMeilisearchMeilisearchGo32(w, v) } // UnmarshalJSON supports json.Unmarshaler interface func (v *CreateIndexRequest) UnmarshalJSON(data []byte) error { r := jlexer.Lexer{Data: data} - easyjson6601e8cdDecodeGithubComMeilisearchMeilisearchGo31(&r, v) + easyjson6601e8cdDecodeGithubComMeilisearchMeilisearchGo32(&r, v) return r.Error() } // UnmarshalEasyJSON supports easyjson.Unmarshaler interface func (v *CreateIndexRequest) UnmarshalEasyJSON(l *jlexer.Lexer) { - easyjson6601e8cdDecodeGithubComMeilisearchMeilisearchGo31(l, v) + easyjson6601e8cdDecodeGithubComMeilisearchMeilisearchGo32(l, v) } -func easyjson6601e8cdDecodeGithubComMeilisearchMeilisearchGo32(in *jlexer.Lexer, out *Client) { +func easyjson6601e8cdDecodeGithubComMeilisearchMeilisearchGo33(in *jlexer.Lexer, out *Client) { isTopLevel := in.IsStart() if in.IsNull() { if isTopLevel { @@ -4770,7 +4910,7 @@ func easyjson6601e8cdDecodeGithubComMeilisearchMeilisearchGo32(in *jlexer.Lexer, in.Consumed() } } -func easyjson6601e8cdEncodeGithubComMeilisearchMeilisearchGo32(out *jwriter.Writer, in Client) { +func easyjson6601e8cdEncodeGithubComMeilisearchMeilisearchGo33(out *jwriter.Writer, in Client) { out.RawByte('{') first := true _ = first @@ -4780,23 +4920,23 @@ func easyjson6601e8cdEncodeGithubComMeilisearchMeilisearchGo32(out *jwriter.Writ // MarshalJSON supports json.Marshaler interface func (v Client) MarshalJSON() ([]byte, error) { w := jwriter.Writer{} - easyjson6601e8cdEncodeGithubComMeilisearchMeilisearchGo32(&w, v) + easyjson6601e8cdEncodeGithubComMeilisearchMeilisearchGo33(&w, v) return w.Buffer.BuildBytes(), w.Error } // MarshalEasyJSON supports easyjson.Marshaler interface func (v Client) MarshalEasyJSON(w *jwriter.Writer) { - easyjson6601e8cdEncodeGithubComMeilisearchMeilisearchGo32(w, v) + easyjson6601e8cdEncodeGithubComMeilisearchMeilisearchGo33(w, v) } // UnmarshalJSON supports json.Unmarshaler interface func (v *Client) UnmarshalJSON(data []byte) error { r := jlexer.Lexer{Data: data} - easyjson6601e8cdDecodeGithubComMeilisearchMeilisearchGo32(&r, v) + easyjson6601e8cdDecodeGithubComMeilisearchMeilisearchGo33(&r, v) return r.Error() } // UnmarshalEasyJSON supports easyjson.Unmarshaler interface func (v *Client) UnmarshalEasyJSON(l *jlexer.Lexer) { - easyjson6601e8cdDecodeGithubComMeilisearchMeilisearchGo32(l, v) + easyjson6601e8cdDecodeGithubComMeilisearchMeilisearchGo33(l, v) } From d62995075e34d9a42c9ce4259567eedc5879d2e3 Mon Sep 17 00:00:00 2001 From: alallema Date: Tue, 13 Dec 2022 11:32:04 +0100 Subject: [PATCH 10/12] Duplicate struct for CancelTasks --- client.go | 16 ++- client_test.go | 68 +++++++------ types.go | 14 ++- types_easyjson.go | 251 ++++++++++++++++++++++++++++++++++++++++++++++ 4 files changed, 313 insertions(+), 36 deletions(-) diff --git a/client.go b/client.go index 5aaa5701..85a6cf33 100644 --- a/client.go +++ b/client.go @@ -54,7 +54,7 @@ type ClientInterface interface { IsHealthy() bool GetTask(taskUID int64) (resp *Task, err error) GetTasks(param *TasksQuery) (resp *TaskResult, err error) - CancelTasks(param *TasksQuery) (resp *TaskInfo, err error) + CancelTasks(param *CancelTasksQuery) (resp *TaskInfo, err error) WaitForTask(taskUID int64, options ...WaitParams) (*Task, error) GenerateTenantToken(APIKeyUID string, searchRules map[string]interface{}, options *TenantTokenOptions) (resp string, err error) } @@ -286,7 +286,7 @@ func (c *Client) GetTasks(param *TasksQuery) (resp *TaskResult, err error) { return resp, nil } -func (c *Client) CancelTasks(param *TasksQuery) (resp *TaskInfo, err error) { +func (c *Client) CancelTasks(param *CancelTasksQuery) (resp *TaskInfo, err error) { resp = &TaskInfo{} req := internalRequest{ endpoint: "/tasks/cancel", @@ -298,7 +298,17 @@ func (c *Client) CancelTasks(param *TasksQuery) (resp *TaskInfo, err error) { functionName: "CancelTasks", } if param != nil { - encodeTasksQuery(param, &req) + 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, + } + encodeTasksQuery(paramToSend, &req) } if err := c.executeRequest(req); err != nil { return nil, err diff --git a/client_test.go b/client_test.go index 0c131c99..e2b7e6af 100644 --- a/client_test.go +++ b/client_test.go @@ -833,7 +833,7 @@ func TestClient_CancelTasks(t *testing.T) { type args struct { UID string client *Client - query *TasksQuery + query *CancelTasksQuery } tests := []struct { name string @@ -841,11 +841,20 @@ func TestClient_CancelTasks(t *testing.T) { want string }{ { - name: "TestBasicCancelTasks", + name: "TestCancelTasksWithNoFilters", args: args{ UID: "indexUID", client: defaultClient, - query: &TasksQuery{ + query: nil, + }, + want: "", + }, + { + name: "TestCancelTasksWithStatutes", + args: args{ + UID: "indexUID", + client: defaultClient, + query: &CancelTasksQuery{ Statuses: []string{"succeeded"}, }, }, @@ -856,7 +865,7 @@ func TestClient_CancelTasks(t *testing.T) { args: args{ UID: "indexUID", client: defaultClient, - query: &TasksQuery{ + query: &CancelTasksQuery{ IndexUIDS: []string{"0"}, }, }, @@ -867,7 +876,7 @@ func TestClient_CancelTasks(t *testing.T) { args: args{ UID: "indexUID", client: defaultClient, - query: &TasksQuery{ + query: &CancelTasksQuery{ IndexUIDS: []string{"0", "1"}, }, }, @@ -878,7 +887,7 @@ func TestClient_CancelTasks(t *testing.T) { args: args{ UID: "indexUID", client: defaultClient, - query: &TasksQuery{ + query: &CancelTasksQuery{ UIDS: []int64{0}, }, }, @@ -889,7 +898,7 @@ func TestClient_CancelTasks(t *testing.T) { args: args{ UID: "indexUID", client: defaultClient, - query: &TasksQuery{ + query: &CancelTasksQuery{ UIDS: []int64{0, 1}, }, }, @@ -900,29 +909,18 @@ func TestClient_CancelTasks(t *testing.T) { args: args{ UID: "indexUID", client: defaultClient, - query: &TasksQuery{ + query: &CancelTasksQuery{ BeforeEnqueuedAt: time.Now(), }, }, want: strings.NewReplacer(":", "%3A").Replace("?beforeEnqueuedAt=" + time.Now().Format("2006-01-02T15:04:05Z")), }, - { - name: "TestCancelTasksWithCanceledByFilter", - args: args{ - UID: "indexUID", - client: defaultClient, - query: &TasksQuery{ - CanceledBy: []int64{1}, - }, - }, - want: "?canceledBy=1", - }, { name: "TestCancelTasksWithParameters", args: args{ UID: "indexUID", client: defaultClient, - query: &TasksQuery{ + query: &CancelTasksQuery{ Statuses: []string{"enqueued"}, IndexUIDS: []string{"indexUID"}, UIDS: []int64{1}, @@ -938,21 +936,27 @@ func TestClient_CancelTasks(t *testing.T) { t.Cleanup(cleanup(c)) gotResp, err := c.CancelTasks(tt.args.query) - require.NoError(t, err) + 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) + _, err = c.WaitForTask(gotResp.TaskUID) + require.NoError(t, err) - gotTask, err := c.GetTask(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) + 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) + } }) } } diff --git a/types.go b/types.go index b70d2f12..01cb4469 100644 --- a/types.go +++ b/types.go @@ -144,7 +144,7 @@ type TaskInfo struct { 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 { UIDS []int64 Limit int64 @@ -161,6 +161,18 @@ type TasksQuery struct { 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 +} + type Details struct { ReceivedDocuments int64 `json:"receivedDocuments,omitempty"` IndexedDocuments int64 `json:"indexedDocuments,omitempty"` diff --git a/types_easyjson.go b/types_easyjson.go index 0a6bebb0..ddfff718 100644 --- a/types_easyjson.go +++ b/types_easyjson.go @@ -4800,3 +4800,254 @@ func (v *Client) UnmarshalJSON(data []byte) error { func (v *Client) UnmarshalEasyJSON(l *jlexer.Lexer) { easyjson6601e8cdDecodeGithubComMeilisearchMeilisearchGo32(l, v) } +func easyjson6601e8cdDecodeGithubComMeilisearchMeilisearchGo33(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 v122 int64 + v122 = int64(in.Int64()) + out.UIDS = append(out.UIDS, v122) + 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 v123 string + v123 = string(in.String()) + out.IndexUIDS = append(out.IndexUIDS, v123) + 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 v124 string + v124 = string(in.String()) + out.Statuses = append(out.Statuses, v124) + 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 v125 string + v125 = string(in.String()) + out.Types = append(out.Types, v125) + 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 easyjson6601e8cdEncodeGithubComMeilisearchMeilisearchGo33(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 v126, v127 := range in.UIDS { + if v126 > 0 { + out.RawByte(',') + } + out.Int64(int64(v127)) + } + 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 v128, v129 := range in.IndexUIDS { + if v128 > 0 { + out.RawByte(',') + } + out.String(string(v129)) + } + 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 v130, v131 := range in.Statuses { + if v130 > 0 { + out.RawByte(',') + } + out.String(string(v131)) + } + 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 v132, v133 := range in.Types { + if v132 > 0 { + out.RawByte(',') + } + out.String(string(v133)) + } + 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{} + easyjson6601e8cdEncodeGithubComMeilisearchMeilisearchGo33(&w, v) + return w.Buffer.BuildBytes(), w.Error +} + +// MarshalEasyJSON supports easyjson.Marshaler interface +func (v CancelTasksQuery) MarshalEasyJSON(w *jwriter.Writer) { + easyjson6601e8cdEncodeGithubComMeilisearchMeilisearchGo33(w, v) +} + +// UnmarshalJSON supports json.Unmarshaler interface +func (v *CancelTasksQuery) UnmarshalJSON(data []byte) error { + r := jlexer.Lexer{Data: data} + easyjson6601e8cdDecodeGithubComMeilisearchMeilisearchGo33(&r, v) + return r.Error() +} + +// UnmarshalEasyJSON supports easyjson.Unmarshaler interface +func (v *CancelTasksQuery) UnmarshalEasyJSON(l *jlexer.Lexer) { + easyjson6601e8cdDecodeGithubComMeilisearchMeilisearchGo33(l, v) +} From c41800ebe4cfdfe8cc8dd91e2b69b47862cd7bbb Mon Sep 17 00:00:00 2001 From: alallema Date: Wed, 7 Dec 2022 12:38:11 +0100 Subject: [PATCH 11/12] Add delete task api for v0.30.0 --- client.go | 34 ++++ client_test.go | 129 +++++++++++++++ types.go | 15 ++ types_easyjson.go | 392 +++++++++++++++++++++++++++++++++++++++++----- 4 files changed, 528 insertions(+), 42 deletions(-) diff --git a/client.go b/client.go index 85a6cf33..b25828c3 100644 --- a/client.go +++ b/client.go @@ -55,6 +55,7 @@ type ClientInterface interface { 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) WaitForTask(taskUID int64, options ...WaitParams) (*Task, error) GenerateTenantToken(APIKeyUID string, searchRules map[string]interface{}, options *TenantTokenOptions) (resp string, err error) } @@ -316,6 +317,39 @@ func (c *Client) CancelTasks(param *CancelTasksQuery) (resp *TaskInfo, err error 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 +} + // WaitForTask waits for a task to be processed // // The function will check by regular interval provided in parameter interval diff --git a/client_test.go b/client_test.go index e2b7e6af..20b0d729 100644 --- a/client_test.go +++ b/client_test.go @@ -961,6 +961,135 @@ func TestClient_CancelTasks(t *testing.T) { } } +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_DefaultWaitForTask(t *testing.T) { type args struct { UID string diff --git a/types.go b/types.go index 01cb4469..bcbe33f1 100644 --- a/types.go +++ b/types.go @@ -173,6 +173,21 @@ type CancelTasksQuery struct { 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 int64 `json:"receivedDocuments,omitempty"` IndexedDocuments int64 `json:"indexedDocuments,omitempty"` diff --git a/types_easyjson.go b/types_easyjson.go index ddfff718..1f00230e 100644 --- a/types_easyjson.go +++ b/types_easyjson.go @@ -4662,7 +4662,315 @@ func (v *Details) UnmarshalJSON(data []byte) error { func (v *Details) UnmarshalEasyJSON(l *jlexer.Lexer) { easyjson6601e8cdDecodeGithubComMeilisearchMeilisearchGo30(l, v) } -func easyjson6601e8cdDecodeGithubComMeilisearchMeilisearchGo31(in *jlexer.Lexer, out *CreateIndexRequest) { +func easyjson6601e8cdDecodeGithubComMeilisearchMeilisearchGo31(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 v122 int64 + v122 = int64(in.Int64()) + out.UIDS = append(out.UIDS, v122) + 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 v123 string + v123 = string(in.String()) + out.IndexUIDS = append(out.IndexUIDS, v123) + 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 v124 string + v124 = string(in.String()) + out.Statuses = append(out.Statuses, v124) + 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 v125 string + v125 = string(in.String()) + out.Types = append(out.Types, v125) + 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 v126 int64 + v126 = int64(in.Int64()) + out.CanceledBy = append(out.CanceledBy, v126) + 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 easyjson6601e8cdEncodeGithubComMeilisearchMeilisearchGo31(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 v127, v128 := range in.UIDS { + if v127 > 0 { + out.RawByte(',') + } + out.Int64(int64(v128)) + } + 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 v129, v130 := range in.IndexUIDS { + if v129 > 0 { + out.RawByte(',') + } + out.String(string(v130)) + } + 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 v131, v132 := range in.Statuses { + if v131 > 0 { + out.RawByte(',') + } + out.String(string(v132)) + } + 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 v133, v134 := range in.Types { + if v133 > 0 { + out.RawByte(',') + } + out.String(string(v134)) + } + 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 v135, v136 := range in.CanceledBy { + if v135 > 0 { + out.RawByte(',') + } + out.Int64(int64(v136)) + } + 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{} + easyjson6601e8cdEncodeGithubComMeilisearchMeilisearchGo31(&w, v) + return w.Buffer.BuildBytes(), w.Error +} + +// MarshalEasyJSON supports easyjson.Marshaler interface +func (v DeleteTasksQuery) MarshalEasyJSON(w *jwriter.Writer) { + easyjson6601e8cdEncodeGithubComMeilisearchMeilisearchGo31(w, v) +} + +// UnmarshalJSON supports json.Unmarshaler interface +func (v *DeleteTasksQuery) UnmarshalJSON(data []byte) error { + r := jlexer.Lexer{Data: data} + easyjson6601e8cdDecodeGithubComMeilisearchMeilisearchGo31(&r, v) + return r.Error() +} + +// UnmarshalEasyJSON supports easyjson.Unmarshaler interface +func (v *DeleteTasksQuery) UnmarshalEasyJSON(l *jlexer.Lexer) { + easyjson6601e8cdDecodeGithubComMeilisearchMeilisearchGo31(l, v) +} +func easyjson6601e8cdDecodeGithubComMeilisearchMeilisearchGo32(in *jlexer.Lexer, out *CreateIndexRequest) { isTopLevel := in.IsStart() if in.IsNull() { if isTopLevel { @@ -4695,7 +5003,7 @@ func easyjson6601e8cdDecodeGithubComMeilisearchMeilisearchGo31(in *jlexer.Lexer, in.Consumed() } } -func easyjson6601e8cdEncodeGithubComMeilisearchMeilisearchGo31(out *jwriter.Writer, in CreateIndexRequest) { +func easyjson6601e8cdEncodeGithubComMeilisearchMeilisearchGo32(out *jwriter.Writer, in CreateIndexRequest) { out.RawByte('{') first := true _ = first @@ -4721,27 +5029,27 @@ func easyjson6601e8cdEncodeGithubComMeilisearchMeilisearchGo31(out *jwriter.Writ // MarshalJSON supports json.Marshaler interface func (v CreateIndexRequest) MarshalJSON() ([]byte, error) { w := jwriter.Writer{} - easyjson6601e8cdEncodeGithubComMeilisearchMeilisearchGo31(&w, v) + easyjson6601e8cdEncodeGithubComMeilisearchMeilisearchGo32(&w, v) return w.Buffer.BuildBytes(), w.Error } // MarshalEasyJSON supports easyjson.Marshaler interface func (v CreateIndexRequest) MarshalEasyJSON(w *jwriter.Writer) { - easyjson6601e8cdEncodeGithubComMeilisearchMeilisearchGo31(w, v) + easyjson6601e8cdEncodeGithubComMeilisearchMeilisearchGo32(w, v) } // UnmarshalJSON supports json.Unmarshaler interface func (v *CreateIndexRequest) UnmarshalJSON(data []byte) error { r := jlexer.Lexer{Data: data} - easyjson6601e8cdDecodeGithubComMeilisearchMeilisearchGo31(&r, v) + easyjson6601e8cdDecodeGithubComMeilisearchMeilisearchGo32(&r, v) return r.Error() } // UnmarshalEasyJSON supports easyjson.Unmarshaler interface func (v *CreateIndexRequest) UnmarshalEasyJSON(l *jlexer.Lexer) { - easyjson6601e8cdDecodeGithubComMeilisearchMeilisearchGo31(l, v) + easyjson6601e8cdDecodeGithubComMeilisearchMeilisearchGo32(l, v) } -func easyjson6601e8cdDecodeGithubComMeilisearchMeilisearchGo32(in *jlexer.Lexer, out *Client) { +func easyjson6601e8cdDecodeGithubComMeilisearchMeilisearchGo33(in *jlexer.Lexer, out *Client) { isTopLevel := in.IsStart() if in.IsNull() { if isTopLevel { @@ -4770,7 +5078,7 @@ func easyjson6601e8cdDecodeGithubComMeilisearchMeilisearchGo32(in *jlexer.Lexer, in.Consumed() } } -func easyjson6601e8cdEncodeGithubComMeilisearchMeilisearchGo32(out *jwriter.Writer, in Client) { +func easyjson6601e8cdEncodeGithubComMeilisearchMeilisearchGo33(out *jwriter.Writer, in Client) { out.RawByte('{') first := true _ = first @@ -4780,27 +5088,27 @@ func easyjson6601e8cdEncodeGithubComMeilisearchMeilisearchGo32(out *jwriter.Writ // MarshalJSON supports json.Marshaler interface func (v Client) MarshalJSON() ([]byte, error) { w := jwriter.Writer{} - easyjson6601e8cdEncodeGithubComMeilisearchMeilisearchGo32(&w, v) + easyjson6601e8cdEncodeGithubComMeilisearchMeilisearchGo33(&w, v) return w.Buffer.BuildBytes(), w.Error } // MarshalEasyJSON supports easyjson.Marshaler interface func (v Client) MarshalEasyJSON(w *jwriter.Writer) { - easyjson6601e8cdEncodeGithubComMeilisearchMeilisearchGo32(w, v) + easyjson6601e8cdEncodeGithubComMeilisearchMeilisearchGo33(w, v) } // UnmarshalJSON supports json.Unmarshaler interface func (v *Client) UnmarshalJSON(data []byte) error { r := jlexer.Lexer{Data: data} - easyjson6601e8cdDecodeGithubComMeilisearchMeilisearchGo32(&r, v) + easyjson6601e8cdDecodeGithubComMeilisearchMeilisearchGo33(&r, v) return r.Error() } // UnmarshalEasyJSON supports easyjson.Unmarshaler interface func (v *Client) UnmarshalEasyJSON(l *jlexer.Lexer) { - easyjson6601e8cdDecodeGithubComMeilisearchMeilisearchGo32(l, v) + easyjson6601e8cdDecodeGithubComMeilisearchMeilisearchGo33(l, v) } -func easyjson6601e8cdDecodeGithubComMeilisearchMeilisearchGo33(in *jlexer.Lexer, out *CancelTasksQuery) { +func easyjson6601e8cdDecodeGithubComMeilisearchMeilisearchGo34(in *jlexer.Lexer, out *CancelTasksQuery) { isTopLevel := in.IsStart() if in.IsNull() { if isTopLevel { @@ -4835,9 +5143,9 @@ func easyjson6601e8cdDecodeGithubComMeilisearchMeilisearchGo33(in *jlexer.Lexer, out.UIDS = (out.UIDS)[:0] } for !in.IsDelim(']') { - var v122 int64 - v122 = int64(in.Int64()) - out.UIDS = append(out.UIDS, v122) + var v137 int64 + v137 = int64(in.Int64()) + out.UIDS = append(out.UIDS, v137) in.WantComma() } in.Delim(']') @@ -4858,9 +5166,9 @@ func easyjson6601e8cdDecodeGithubComMeilisearchMeilisearchGo33(in *jlexer.Lexer, out.IndexUIDS = (out.IndexUIDS)[:0] } for !in.IsDelim(']') { - var v123 string - v123 = string(in.String()) - out.IndexUIDS = append(out.IndexUIDS, v123) + var v138 string + v138 = string(in.String()) + out.IndexUIDS = append(out.IndexUIDS, v138) in.WantComma() } in.Delim(']') @@ -4881,9 +5189,9 @@ func easyjson6601e8cdDecodeGithubComMeilisearchMeilisearchGo33(in *jlexer.Lexer, out.Statuses = (out.Statuses)[:0] } for !in.IsDelim(']') { - var v124 string - v124 = string(in.String()) - out.Statuses = append(out.Statuses, v124) + var v139 string + v139 = string(in.String()) + out.Statuses = append(out.Statuses, v139) in.WantComma() } in.Delim(']') @@ -4904,9 +5212,9 @@ func easyjson6601e8cdDecodeGithubComMeilisearchMeilisearchGo33(in *jlexer.Lexer, out.Types = (out.Types)[:0] } for !in.IsDelim(']') { - var v125 string - v125 = string(in.String()) - out.Types = append(out.Types, v125) + var v140 string + v140 = string(in.String()) + out.Types = append(out.Types, v140) in.WantComma() } in.Delim(']') @@ -4937,7 +5245,7 @@ func easyjson6601e8cdDecodeGithubComMeilisearchMeilisearchGo33(in *jlexer.Lexer, in.Consumed() } } -func easyjson6601e8cdEncodeGithubComMeilisearchMeilisearchGo33(out *jwriter.Writer, in CancelTasksQuery) { +func easyjson6601e8cdEncodeGithubComMeilisearchMeilisearchGo34(out *jwriter.Writer, in CancelTasksQuery) { out.RawByte('{') first := true _ = first @@ -4948,11 +5256,11 @@ func easyjson6601e8cdEncodeGithubComMeilisearchMeilisearchGo33(out *jwriter.Writ out.RawString("null") } else { out.RawByte('[') - for v126, v127 := range in.UIDS { - if v126 > 0 { + for v141, v142 := range in.UIDS { + if v141 > 0 { out.RawByte(',') } - out.Int64(int64(v127)) + out.Int64(int64(v142)) } out.RawByte(']') } @@ -4964,11 +5272,11 @@ func easyjson6601e8cdEncodeGithubComMeilisearchMeilisearchGo33(out *jwriter.Writ out.RawString("null") } else { out.RawByte('[') - for v128, v129 := range in.IndexUIDS { - if v128 > 0 { + for v143, v144 := range in.IndexUIDS { + if v143 > 0 { out.RawByte(',') } - out.String(string(v129)) + out.String(string(v144)) } out.RawByte(']') } @@ -4980,11 +5288,11 @@ func easyjson6601e8cdEncodeGithubComMeilisearchMeilisearchGo33(out *jwriter.Writ out.RawString("null") } else { out.RawByte('[') - for v130, v131 := range in.Statuses { - if v130 > 0 { + for v145, v146 := range in.Statuses { + if v145 > 0 { out.RawByte(',') } - out.String(string(v131)) + out.String(string(v146)) } out.RawByte(']') } @@ -4996,11 +5304,11 @@ func easyjson6601e8cdEncodeGithubComMeilisearchMeilisearchGo33(out *jwriter.Writ out.RawString("null") } else { out.RawByte('[') - for v132, v133 := range in.Types { - if v132 > 0 { + for v147, v148 := range in.Types { + if v147 > 0 { out.RawByte(',') } - out.String(string(v133)) + out.String(string(v148)) } out.RawByte(']') } @@ -5031,23 +5339,23 @@ func easyjson6601e8cdEncodeGithubComMeilisearchMeilisearchGo33(out *jwriter.Writ // MarshalJSON supports json.Marshaler interface func (v CancelTasksQuery) MarshalJSON() ([]byte, error) { w := jwriter.Writer{} - easyjson6601e8cdEncodeGithubComMeilisearchMeilisearchGo33(&w, v) + easyjson6601e8cdEncodeGithubComMeilisearchMeilisearchGo34(&w, v) return w.Buffer.BuildBytes(), w.Error } // MarshalEasyJSON supports easyjson.Marshaler interface func (v CancelTasksQuery) MarshalEasyJSON(w *jwriter.Writer) { - easyjson6601e8cdEncodeGithubComMeilisearchMeilisearchGo33(w, v) + easyjson6601e8cdEncodeGithubComMeilisearchMeilisearchGo34(w, v) } // UnmarshalJSON supports json.Unmarshaler interface func (v *CancelTasksQuery) UnmarshalJSON(data []byte) error { r := jlexer.Lexer{Data: data} - easyjson6601e8cdDecodeGithubComMeilisearchMeilisearchGo33(&r, v) + easyjson6601e8cdDecodeGithubComMeilisearchMeilisearchGo34(&r, v) return r.Error() } // UnmarshalEasyJSON supports easyjson.Unmarshaler interface func (v *CancelTasksQuery) UnmarshalEasyJSON(l *jlexer.Lexer) { - easyjson6601e8cdDecodeGithubComMeilisearchMeilisearchGo33(l, v) + easyjson6601e8cdDecodeGithubComMeilisearchMeilisearchGo34(l, v) } From a55baa0ae17cb87c3b4b28f284ce6bba236ed6f2 Mon Sep 17 00:00:00 2001 From: alallema Date: Wed, 14 Dec 2022 18:45:29 +0100 Subject: [PATCH 12/12] Fix auto generate easyJson --- client.go | 2 +- types_easyjson.go | 156 +++++++++++++++++++++++----------------------- 2 files changed, 79 insertions(+), 79 deletions(-) diff --git a/client.go b/client.go index 6505d89c..3ca5f9d7 100644 --- a/client.go +++ b/client.go @@ -55,7 +55,7 @@ type ClientInterface interface { 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) + 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) diff --git a/types_easyjson.go b/types_easyjson.go index f0aea413..527aacb2 100644 --- a/types_easyjson.go +++ b/types_easyjson.go @@ -4802,7 +4802,7 @@ func (v *Details) UnmarshalJSON(data []byte) error { func (v *Details) UnmarshalEasyJSON(l *jlexer.Lexer) { easyjson6601e8cdDecodeGithubComMeilisearchMeilisearchGo31(l, v) } -func easyjson6601e8cdDecodeGithubComMeilisearchMeilisearchGo31(in *jlexer.Lexer, out *DeleteTasksQuery) { +func easyjson6601e8cdDecodeGithubComMeilisearchMeilisearchGo32(in *jlexer.Lexer, out *DeleteTasksQuery) { isTopLevel := in.IsStart() if in.IsNull() { if isTopLevel { @@ -4837,9 +4837,9 @@ func easyjson6601e8cdDecodeGithubComMeilisearchMeilisearchGo31(in *jlexer.Lexer, out.UIDS = (out.UIDS)[:0] } for !in.IsDelim(']') { - var v122 int64 - v122 = int64(in.Int64()) - out.UIDS = append(out.UIDS, v122) + var v128 int64 + v128 = int64(in.Int64()) + out.UIDS = append(out.UIDS, v128) in.WantComma() } in.Delim(']') @@ -4860,9 +4860,9 @@ func easyjson6601e8cdDecodeGithubComMeilisearchMeilisearchGo31(in *jlexer.Lexer, out.IndexUIDS = (out.IndexUIDS)[:0] } for !in.IsDelim(']') { - var v123 string - v123 = string(in.String()) - out.IndexUIDS = append(out.IndexUIDS, v123) + var v129 string + v129 = string(in.String()) + out.IndexUIDS = append(out.IndexUIDS, v129) in.WantComma() } in.Delim(']') @@ -4883,9 +4883,9 @@ func easyjson6601e8cdDecodeGithubComMeilisearchMeilisearchGo31(in *jlexer.Lexer, out.Statuses = (out.Statuses)[:0] } for !in.IsDelim(']') { - var v124 string - v124 = string(in.String()) - out.Statuses = append(out.Statuses, v124) + var v130 string + v130 = string(in.String()) + out.Statuses = append(out.Statuses, v130) in.WantComma() } in.Delim(']') @@ -4906,9 +4906,9 @@ func easyjson6601e8cdDecodeGithubComMeilisearchMeilisearchGo31(in *jlexer.Lexer, out.Types = (out.Types)[:0] } for !in.IsDelim(']') { - var v125 string - v125 = string(in.String()) - out.Types = append(out.Types, v125) + var v131 string + v131 = string(in.String()) + out.Types = append(out.Types, v131) in.WantComma() } in.Delim(']') @@ -4929,9 +4929,9 @@ func easyjson6601e8cdDecodeGithubComMeilisearchMeilisearchGo31(in *jlexer.Lexer, out.CanceledBy = (out.CanceledBy)[:0] } for !in.IsDelim(']') { - var v126 int64 - v126 = int64(in.Int64()) - out.CanceledBy = append(out.CanceledBy, v126) + var v132 int64 + v132 = int64(in.Int64()) + out.CanceledBy = append(out.CanceledBy, v132) in.WantComma() } in.Delim(']') @@ -4970,7 +4970,7 @@ func easyjson6601e8cdDecodeGithubComMeilisearchMeilisearchGo31(in *jlexer.Lexer, in.Consumed() } } -func easyjson6601e8cdEncodeGithubComMeilisearchMeilisearchGo31(out *jwriter.Writer, in DeleteTasksQuery) { +func easyjson6601e8cdEncodeGithubComMeilisearchMeilisearchGo32(out *jwriter.Writer, in DeleteTasksQuery) { out.RawByte('{') first := true _ = first @@ -4981,11 +4981,11 @@ func easyjson6601e8cdEncodeGithubComMeilisearchMeilisearchGo31(out *jwriter.Writ out.RawString("null") } else { out.RawByte('[') - for v127, v128 := range in.UIDS { - if v127 > 0 { + for v133, v134 := range in.UIDS { + if v133 > 0 { out.RawByte(',') } - out.Int64(int64(v128)) + out.Int64(int64(v134)) } out.RawByte(']') } @@ -4997,11 +4997,11 @@ func easyjson6601e8cdEncodeGithubComMeilisearchMeilisearchGo31(out *jwriter.Writ out.RawString("null") } else { out.RawByte('[') - for v129, v130 := range in.IndexUIDS { - if v129 > 0 { + for v135, v136 := range in.IndexUIDS { + if v135 > 0 { out.RawByte(',') } - out.String(string(v130)) + out.String(string(v136)) } out.RawByte(']') } @@ -5013,11 +5013,11 @@ func easyjson6601e8cdEncodeGithubComMeilisearchMeilisearchGo31(out *jwriter.Writ out.RawString("null") } else { out.RawByte('[') - for v131, v132 := range in.Statuses { - if v131 > 0 { + for v137, v138 := range in.Statuses { + if v137 > 0 { out.RawByte(',') } - out.String(string(v132)) + out.String(string(v138)) } out.RawByte(']') } @@ -5029,11 +5029,11 @@ func easyjson6601e8cdEncodeGithubComMeilisearchMeilisearchGo31(out *jwriter.Writ out.RawString("null") } else { out.RawByte('[') - for v133, v134 := range in.Types { - if v133 > 0 { + for v139, v140 := range in.Types { + if v139 > 0 { out.RawByte(',') } - out.String(string(v134)) + out.String(string(v140)) } out.RawByte(']') } @@ -5045,11 +5045,11 @@ func easyjson6601e8cdEncodeGithubComMeilisearchMeilisearchGo31(out *jwriter.Writ out.RawString("null") } else { out.RawByte('[') - for v135, v136 := range in.CanceledBy { - if v135 > 0 { + for v141, v142 := range in.CanceledBy { + if v141 > 0 { out.RawByte(',') } - out.Int64(int64(v136)) + out.Int64(int64(v142)) } out.RawByte(']') } @@ -5090,27 +5090,27 @@ func easyjson6601e8cdEncodeGithubComMeilisearchMeilisearchGo31(out *jwriter.Writ // MarshalJSON supports json.Marshaler interface func (v DeleteTasksQuery) MarshalJSON() ([]byte, error) { w := jwriter.Writer{} - easyjson6601e8cdEncodeGithubComMeilisearchMeilisearchGo31(&w, v) + easyjson6601e8cdEncodeGithubComMeilisearchMeilisearchGo32(&w, v) return w.Buffer.BuildBytes(), w.Error } // MarshalEasyJSON supports easyjson.Marshaler interface func (v DeleteTasksQuery) MarshalEasyJSON(w *jwriter.Writer) { - easyjson6601e8cdEncodeGithubComMeilisearchMeilisearchGo31(w, v) + easyjson6601e8cdEncodeGithubComMeilisearchMeilisearchGo32(w, v) } // UnmarshalJSON supports json.Unmarshaler interface func (v *DeleteTasksQuery) UnmarshalJSON(data []byte) error { r := jlexer.Lexer{Data: data} - easyjson6601e8cdDecodeGithubComMeilisearchMeilisearchGo31(&r, v) + easyjson6601e8cdDecodeGithubComMeilisearchMeilisearchGo32(&r, v) return r.Error() } // UnmarshalEasyJSON supports easyjson.Unmarshaler interface func (v *DeleteTasksQuery) UnmarshalEasyJSON(l *jlexer.Lexer) { - easyjson6601e8cdDecodeGithubComMeilisearchMeilisearchGo31(l, v) + easyjson6601e8cdDecodeGithubComMeilisearchMeilisearchGo32(l, v) } -func easyjson6601e8cdDecodeGithubComMeilisearchMeilisearchGo32(in *jlexer.Lexer, out *CreateIndexRequest) { +func easyjson6601e8cdDecodeGithubComMeilisearchMeilisearchGo33(in *jlexer.Lexer, out *CreateIndexRequest) { isTopLevel := in.IsStart() if in.IsNull() { if isTopLevel { @@ -5143,7 +5143,7 @@ func easyjson6601e8cdDecodeGithubComMeilisearchMeilisearchGo32(in *jlexer.Lexer, in.Consumed() } } -func easyjson6601e8cdEncodeGithubComMeilisearchMeilisearchGo32(out *jwriter.Writer, in CreateIndexRequest) { +func easyjson6601e8cdEncodeGithubComMeilisearchMeilisearchGo33(out *jwriter.Writer, in CreateIndexRequest) { out.RawByte('{') first := true _ = first @@ -5169,27 +5169,27 @@ func easyjson6601e8cdEncodeGithubComMeilisearchMeilisearchGo32(out *jwriter.Writ // MarshalJSON supports json.Marshaler interface func (v CreateIndexRequest) MarshalJSON() ([]byte, error) { w := jwriter.Writer{} - easyjson6601e8cdEncodeGithubComMeilisearchMeilisearchGo32(&w, v) + easyjson6601e8cdEncodeGithubComMeilisearchMeilisearchGo33(&w, v) return w.Buffer.BuildBytes(), w.Error } // MarshalEasyJSON supports easyjson.Marshaler interface func (v CreateIndexRequest) MarshalEasyJSON(w *jwriter.Writer) { - easyjson6601e8cdEncodeGithubComMeilisearchMeilisearchGo32(w, v) + easyjson6601e8cdEncodeGithubComMeilisearchMeilisearchGo33(w, v) } // UnmarshalJSON supports json.Unmarshaler interface func (v *CreateIndexRequest) UnmarshalJSON(data []byte) error { r := jlexer.Lexer{Data: data} - easyjson6601e8cdDecodeGithubComMeilisearchMeilisearchGo32(&r, v) + easyjson6601e8cdDecodeGithubComMeilisearchMeilisearchGo33(&r, v) return r.Error() } // UnmarshalEasyJSON supports easyjson.Unmarshaler interface func (v *CreateIndexRequest) UnmarshalEasyJSON(l *jlexer.Lexer) { - easyjson6601e8cdDecodeGithubComMeilisearchMeilisearchGo32(l, v) + easyjson6601e8cdDecodeGithubComMeilisearchMeilisearchGo33(l, v) } -func easyjson6601e8cdDecodeGithubComMeilisearchMeilisearchGo33(in *jlexer.Lexer, out *Client) { +func easyjson6601e8cdDecodeGithubComMeilisearchMeilisearchGo34(in *jlexer.Lexer, out *Client) { isTopLevel := in.IsStart() if in.IsNull() { if isTopLevel { @@ -5218,7 +5218,7 @@ func easyjson6601e8cdDecodeGithubComMeilisearchMeilisearchGo33(in *jlexer.Lexer, in.Consumed() } } -func easyjson6601e8cdEncodeGithubComMeilisearchMeilisearchGo33(out *jwriter.Writer, in Client) { +func easyjson6601e8cdEncodeGithubComMeilisearchMeilisearchGo34(out *jwriter.Writer, in Client) { out.RawByte('{') first := true _ = first @@ -5228,27 +5228,27 @@ func easyjson6601e8cdEncodeGithubComMeilisearchMeilisearchGo33(out *jwriter.Writ // MarshalJSON supports json.Marshaler interface func (v Client) MarshalJSON() ([]byte, error) { w := jwriter.Writer{} - easyjson6601e8cdEncodeGithubComMeilisearchMeilisearchGo33(&w, v) + easyjson6601e8cdEncodeGithubComMeilisearchMeilisearchGo34(&w, v) return w.Buffer.BuildBytes(), w.Error } // MarshalEasyJSON supports easyjson.Marshaler interface func (v Client) MarshalEasyJSON(w *jwriter.Writer) { - easyjson6601e8cdEncodeGithubComMeilisearchMeilisearchGo33(w, v) + easyjson6601e8cdEncodeGithubComMeilisearchMeilisearchGo34(w, v) } // UnmarshalJSON supports json.Unmarshaler interface func (v *Client) UnmarshalJSON(data []byte) error { r := jlexer.Lexer{Data: data} - easyjson6601e8cdDecodeGithubComMeilisearchMeilisearchGo33(&r, v) + easyjson6601e8cdDecodeGithubComMeilisearchMeilisearchGo34(&r, v) return r.Error() } // UnmarshalEasyJSON supports easyjson.Unmarshaler interface func (v *Client) UnmarshalEasyJSON(l *jlexer.Lexer) { - easyjson6601e8cdDecodeGithubComMeilisearchMeilisearchGo33(l, v) + easyjson6601e8cdDecodeGithubComMeilisearchMeilisearchGo34(l, v) } -func easyjson6601e8cdDecodeGithubComMeilisearchMeilisearchGo34(in *jlexer.Lexer, out *CancelTasksQuery) { +func easyjson6601e8cdDecodeGithubComMeilisearchMeilisearchGo35(in *jlexer.Lexer, out *CancelTasksQuery) { isTopLevel := in.IsStart() if in.IsNull() { if isTopLevel { @@ -5283,9 +5283,9 @@ func easyjson6601e8cdDecodeGithubComMeilisearchMeilisearchGo34(in *jlexer.Lexer, out.UIDS = (out.UIDS)[:0] } for !in.IsDelim(']') { - var v137 int64 - v137 = int64(in.Int64()) - out.UIDS = append(out.UIDS, v137) + var v143 int64 + v143 = int64(in.Int64()) + out.UIDS = append(out.UIDS, v143) in.WantComma() } in.Delim(']') @@ -5306,9 +5306,9 @@ func easyjson6601e8cdDecodeGithubComMeilisearchMeilisearchGo34(in *jlexer.Lexer, out.IndexUIDS = (out.IndexUIDS)[:0] } for !in.IsDelim(']') { - var v138 string - v138 = string(in.String()) - out.IndexUIDS = append(out.IndexUIDS, v138) + var v144 string + v144 = string(in.String()) + out.IndexUIDS = append(out.IndexUIDS, v144) in.WantComma() } in.Delim(']') @@ -5329,9 +5329,9 @@ func easyjson6601e8cdDecodeGithubComMeilisearchMeilisearchGo34(in *jlexer.Lexer, out.Statuses = (out.Statuses)[:0] } for !in.IsDelim(']') { - var v139 string - v139 = string(in.String()) - out.Statuses = append(out.Statuses, v139) + var v145 string + v145 = string(in.String()) + out.Statuses = append(out.Statuses, v145) in.WantComma() } in.Delim(']') @@ -5352,9 +5352,9 @@ func easyjson6601e8cdDecodeGithubComMeilisearchMeilisearchGo34(in *jlexer.Lexer, out.Types = (out.Types)[:0] } for !in.IsDelim(']') { - var v140 string - v140 = string(in.String()) - out.Types = append(out.Types, v140) + var v146 string + v146 = string(in.String()) + out.Types = append(out.Types, v146) in.WantComma() } in.Delim(']') @@ -5385,7 +5385,7 @@ func easyjson6601e8cdDecodeGithubComMeilisearchMeilisearchGo34(in *jlexer.Lexer, in.Consumed() } } -func easyjson6601e8cdEncodeGithubComMeilisearchMeilisearchGo34(out *jwriter.Writer, in CancelTasksQuery) { +func easyjson6601e8cdEncodeGithubComMeilisearchMeilisearchGo35(out *jwriter.Writer, in CancelTasksQuery) { out.RawByte('{') first := true _ = first @@ -5396,11 +5396,11 @@ func easyjson6601e8cdEncodeGithubComMeilisearchMeilisearchGo34(out *jwriter.Writ out.RawString("null") } else { out.RawByte('[') - for v141, v142 := range in.UIDS { - if v141 > 0 { + for v147, v148 := range in.UIDS { + if v147 > 0 { out.RawByte(',') } - out.Int64(int64(v142)) + out.Int64(int64(v148)) } out.RawByte(']') } @@ -5412,11 +5412,11 @@ func easyjson6601e8cdEncodeGithubComMeilisearchMeilisearchGo34(out *jwriter.Writ out.RawString("null") } else { out.RawByte('[') - for v143, v144 := range in.IndexUIDS { - if v143 > 0 { + for v149, v150 := range in.IndexUIDS { + if v149 > 0 { out.RawByte(',') } - out.String(string(v144)) + out.String(string(v150)) } out.RawByte(']') } @@ -5428,11 +5428,11 @@ func easyjson6601e8cdEncodeGithubComMeilisearchMeilisearchGo34(out *jwriter.Writ out.RawString("null") } else { out.RawByte('[') - for v145, v146 := range in.Statuses { - if v145 > 0 { + for v151, v152 := range in.Statuses { + if v151 > 0 { out.RawByte(',') } - out.String(string(v146)) + out.String(string(v152)) } out.RawByte(']') } @@ -5444,11 +5444,11 @@ func easyjson6601e8cdEncodeGithubComMeilisearchMeilisearchGo34(out *jwriter.Writ out.RawString("null") } else { out.RawByte('[') - for v147, v148 := range in.Types { - if v147 > 0 { + for v153, v154 := range in.Types { + if v153 > 0 { out.RawByte(',') } - out.String(string(v148)) + out.String(string(v154)) } out.RawByte(']') } @@ -5479,23 +5479,23 @@ func easyjson6601e8cdEncodeGithubComMeilisearchMeilisearchGo34(out *jwriter.Writ // MarshalJSON supports json.Marshaler interface func (v CancelTasksQuery) MarshalJSON() ([]byte, error) { w := jwriter.Writer{} - easyjson6601e8cdEncodeGithubComMeilisearchMeilisearchGo34(&w, v) + easyjson6601e8cdEncodeGithubComMeilisearchMeilisearchGo35(&w, v) return w.Buffer.BuildBytes(), w.Error } // MarshalEasyJSON supports easyjson.Marshaler interface func (v CancelTasksQuery) MarshalEasyJSON(w *jwriter.Writer) { - easyjson6601e8cdEncodeGithubComMeilisearchMeilisearchGo34(w, v) + easyjson6601e8cdEncodeGithubComMeilisearchMeilisearchGo35(w, v) } // UnmarshalJSON supports json.Unmarshaler interface func (v *CancelTasksQuery) UnmarshalJSON(data []byte) error { r := jlexer.Lexer{Data: data} - easyjson6601e8cdDecodeGithubComMeilisearchMeilisearchGo34(&r, v) + easyjson6601e8cdDecodeGithubComMeilisearchMeilisearchGo35(&r, v) return r.Error() } // UnmarshalEasyJSON supports easyjson.Unmarshaler interface func (v *CancelTasksQuery) UnmarshalEasyJSON(l *jlexer.Lexer) { - easyjson6601e8cdDecodeGithubComMeilisearchMeilisearchGo34(l, v) + easyjson6601e8cdDecodeGithubComMeilisearchMeilisearchGo35(l, v) }