From 0bf611f20072bd5a3238dbe230208fd47685c0ec Mon Sep 17 00:00:00 2001 From: algolia-bot Date: Thu, 11 May 2023 10:10:06 +0000 Subject: [PATCH] chore: generated code for commit fe7057d1d77c7dc9cd3d46fcf0aaaee5f44fc193. [skip ci] Co-authored-by: Mehmet Ali Gok <33124154+mehmetaligok@users.noreply.github.com> --- .../algolia/analytics/api_analytics.go | 401 +++++------ .../algolia/ingestion/api_ingestion.go | 288 ++++---- .../algolia/insights/api_insights.go | 33 +- .../personalization/api_personalization.go | 61 +- .../algolia/predict/api_predict.go | 175 ++--- .../api_query_suggestions.go | 79 +-- .../algolia/recommend/api_recommend.go | 33 +- .../algolia/search/api_search.go | 639 ++++++------------ .../methods/requests/personalization_test.go | 5 +- .../go/tests/methods/requests/predict_test.go | 10 +- .../requests/query-suggestions_test.go | 5 +- .../go/tests/methods/requests/search_test.go | 30 +- 12 files changed, 648 insertions(+), 1111 deletions(-) diff --git a/clients/algoliasearch-client-go/algolia/analytics/api_analytics.go b/clients/algoliasearch-client-go/algolia/analytics/api_analytics.go index 70dd9fa010..36809967ca 100644 --- a/clients/algoliasearch-client-go/algolia/analytics/api_analytics.go +++ b/clients/algoliasearch-client-go/algolia/analytics/api_analytics.go @@ -46,7 +46,7 @@ func (r *ApiDelRequest) UnmarshalJSON(b []byte) error { if err != nil { return err } - if v, ok := req["path"]; ok { //path + if v, ok := req["path"]; ok { err = json.Unmarshal(v, &r.path) if err != nil { err = json.Unmarshal(b, &r.path) @@ -55,7 +55,7 @@ func (r *ApiDelRequest) UnmarshalJSON(b []byte) error { } } } - if v, ok := req["parameters"]; ok { //parameters + if v, ok := req["parameters"]; ok { err = json.Unmarshal(v, &r.parameters) if err != nil { err = json.Unmarshal(b, &r.parameters) @@ -197,7 +197,7 @@ func (r *ApiGetRequest) UnmarshalJSON(b []byte) error { if err != nil { return err } - if v, ok := req["path"]; ok { //path + if v, ok := req["path"]; ok { err = json.Unmarshal(v, &r.path) if err != nil { err = json.Unmarshal(b, &r.path) @@ -206,7 +206,7 @@ func (r *ApiGetRequest) UnmarshalJSON(b []byte) error { } } } - if v, ok := req["parameters"]; ok { //parameters + if v, ok := req["parameters"]; ok { err = json.Unmarshal(v, &r.parameters) if err != nil { err = json.Unmarshal(b, &r.parameters) @@ -350,7 +350,7 @@ func (r *ApiGetAverageClickPositionRequest) UnmarshalJSON(b []byte) error { if err != nil { return err } - if v, ok := req["index"]; ok { //index + if v, ok := req["index"]; ok { err = json.Unmarshal(v, &r.index) if err != nil { err = json.Unmarshal(b, &r.index) @@ -359,7 +359,7 @@ func (r *ApiGetAverageClickPositionRequest) UnmarshalJSON(b []byte) error { } } } - if v, ok := req["startDate"]; ok { //startDate + if v, ok := req["startDate"]; ok { err = json.Unmarshal(v, &r.startDate) if err != nil { err = json.Unmarshal(b, &r.startDate) @@ -368,7 +368,7 @@ func (r *ApiGetAverageClickPositionRequest) UnmarshalJSON(b []byte) error { } } } - if v, ok := req["endDate"]; ok { //endDate + if v, ok := req["endDate"]; ok { err = json.Unmarshal(v, &r.endDate) if err != nil { err = json.Unmarshal(b, &r.endDate) @@ -377,7 +377,7 @@ func (r *ApiGetAverageClickPositionRequest) UnmarshalJSON(b []byte) error { } } } - if v, ok := req["tags"]; ok { //tags + if v, ok := req["tags"]; ok { err = json.Unmarshal(v, &r.tags) if err != nil { err = json.Unmarshal(b, &r.tags) @@ -390,12 +390,6 @@ func (r *ApiGetAverageClickPositionRequest) UnmarshalJSON(b []byte) error { return nil } -// The index name to target. -func (r ApiGetAverageClickPositionRequest) WithIndex(index string) ApiGetAverageClickPositionRequest { - r.index = index - return r -} - // The lower bound timestamp (a date, a string like \"2006-01-02\") of the period to analyze. func (r ApiGetAverageClickPositionRequest) WithStartDate(startDate string) ApiGetAverageClickPositionRequest { r.startDate = startDate @@ -415,8 +409,10 @@ func (r ApiGetAverageClickPositionRequest) WithTags(tags string) ApiGetAverageCl } // @return ApiGetAverageClickPositionRequest -func (c *APIClient) NewApiGetAverageClickPositionRequest() ApiGetAverageClickPositionRequest { - return ApiGetAverageClickPositionRequest{} +func (c *APIClient) NewApiGetAverageClickPositionRequest(index string) ApiGetAverageClickPositionRequest { + return ApiGetAverageClickPositionRequest{ + index: index, + } } // GetAverageClickPosition wraps GetAverageClickPositionWithContext using context.Background. @@ -544,7 +540,7 @@ func (r *ApiGetClickPositionsRequest) UnmarshalJSON(b []byte) error { if err != nil { return err } - if v, ok := req["index"]; ok { //index + if v, ok := req["index"]; ok { err = json.Unmarshal(v, &r.index) if err != nil { err = json.Unmarshal(b, &r.index) @@ -553,7 +549,7 @@ func (r *ApiGetClickPositionsRequest) UnmarshalJSON(b []byte) error { } } } - if v, ok := req["startDate"]; ok { //startDate + if v, ok := req["startDate"]; ok { err = json.Unmarshal(v, &r.startDate) if err != nil { err = json.Unmarshal(b, &r.startDate) @@ -562,7 +558,7 @@ func (r *ApiGetClickPositionsRequest) UnmarshalJSON(b []byte) error { } } } - if v, ok := req["endDate"]; ok { //endDate + if v, ok := req["endDate"]; ok { err = json.Unmarshal(v, &r.endDate) if err != nil { err = json.Unmarshal(b, &r.endDate) @@ -571,7 +567,7 @@ func (r *ApiGetClickPositionsRequest) UnmarshalJSON(b []byte) error { } } } - if v, ok := req["tags"]; ok { //tags + if v, ok := req["tags"]; ok { err = json.Unmarshal(v, &r.tags) if err != nil { err = json.Unmarshal(b, &r.tags) @@ -584,12 +580,6 @@ func (r *ApiGetClickPositionsRequest) UnmarshalJSON(b []byte) error { return nil } -// The index name to target. -func (r ApiGetClickPositionsRequest) WithIndex(index string) ApiGetClickPositionsRequest { - r.index = index - return r -} - // The lower bound timestamp (a date, a string like \"2006-01-02\") of the period to analyze. func (r ApiGetClickPositionsRequest) WithStartDate(startDate string) ApiGetClickPositionsRequest { r.startDate = startDate @@ -609,8 +599,10 @@ func (r ApiGetClickPositionsRequest) WithTags(tags string) ApiGetClickPositionsR } // @return ApiGetClickPositionsRequest -func (c *APIClient) NewApiGetClickPositionsRequest() ApiGetClickPositionsRequest { - return ApiGetClickPositionsRequest{} +func (c *APIClient) NewApiGetClickPositionsRequest(index string) ApiGetClickPositionsRequest { + return ApiGetClickPositionsRequest{ + index: index, + } } // GetClickPositions wraps GetClickPositionsWithContext using context.Background. @@ -738,7 +730,7 @@ func (r *ApiGetClickThroughRateRequest) UnmarshalJSON(b []byte) error { if err != nil { return err } - if v, ok := req["index"]; ok { //index + if v, ok := req["index"]; ok { err = json.Unmarshal(v, &r.index) if err != nil { err = json.Unmarshal(b, &r.index) @@ -747,7 +739,7 @@ func (r *ApiGetClickThroughRateRequest) UnmarshalJSON(b []byte) error { } } } - if v, ok := req["startDate"]; ok { //startDate + if v, ok := req["startDate"]; ok { err = json.Unmarshal(v, &r.startDate) if err != nil { err = json.Unmarshal(b, &r.startDate) @@ -756,7 +748,7 @@ func (r *ApiGetClickThroughRateRequest) UnmarshalJSON(b []byte) error { } } } - if v, ok := req["endDate"]; ok { //endDate + if v, ok := req["endDate"]; ok { err = json.Unmarshal(v, &r.endDate) if err != nil { err = json.Unmarshal(b, &r.endDate) @@ -765,7 +757,7 @@ func (r *ApiGetClickThroughRateRequest) UnmarshalJSON(b []byte) error { } } } - if v, ok := req["tags"]; ok { //tags + if v, ok := req["tags"]; ok { err = json.Unmarshal(v, &r.tags) if err != nil { err = json.Unmarshal(b, &r.tags) @@ -778,12 +770,6 @@ func (r *ApiGetClickThroughRateRequest) UnmarshalJSON(b []byte) error { return nil } -// The index name to target. -func (r ApiGetClickThroughRateRequest) WithIndex(index string) ApiGetClickThroughRateRequest { - r.index = index - return r -} - // The lower bound timestamp (a date, a string like \"2006-01-02\") of the period to analyze. func (r ApiGetClickThroughRateRequest) WithStartDate(startDate string) ApiGetClickThroughRateRequest { r.startDate = startDate @@ -803,8 +789,10 @@ func (r ApiGetClickThroughRateRequest) WithTags(tags string) ApiGetClickThroughR } // @return ApiGetClickThroughRateRequest -func (c *APIClient) NewApiGetClickThroughRateRequest() ApiGetClickThroughRateRequest { - return ApiGetClickThroughRateRequest{} +func (c *APIClient) NewApiGetClickThroughRateRequest(index string) ApiGetClickThroughRateRequest { + return ApiGetClickThroughRateRequest{ + index: index, + } } // GetClickThroughRate wraps GetClickThroughRateWithContext using context.Background. @@ -932,7 +920,7 @@ func (r *ApiGetConversationRateRequest) UnmarshalJSON(b []byte) error { if err != nil { return err } - if v, ok := req["index"]; ok { //index + if v, ok := req["index"]; ok { err = json.Unmarshal(v, &r.index) if err != nil { err = json.Unmarshal(b, &r.index) @@ -941,7 +929,7 @@ func (r *ApiGetConversationRateRequest) UnmarshalJSON(b []byte) error { } } } - if v, ok := req["startDate"]; ok { //startDate + if v, ok := req["startDate"]; ok { err = json.Unmarshal(v, &r.startDate) if err != nil { err = json.Unmarshal(b, &r.startDate) @@ -950,7 +938,7 @@ func (r *ApiGetConversationRateRequest) UnmarshalJSON(b []byte) error { } } } - if v, ok := req["endDate"]; ok { //endDate + if v, ok := req["endDate"]; ok { err = json.Unmarshal(v, &r.endDate) if err != nil { err = json.Unmarshal(b, &r.endDate) @@ -959,7 +947,7 @@ func (r *ApiGetConversationRateRequest) UnmarshalJSON(b []byte) error { } } } - if v, ok := req["tags"]; ok { //tags + if v, ok := req["tags"]; ok { err = json.Unmarshal(v, &r.tags) if err != nil { err = json.Unmarshal(b, &r.tags) @@ -972,12 +960,6 @@ func (r *ApiGetConversationRateRequest) UnmarshalJSON(b []byte) error { return nil } -// The index name to target. -func (r ApiGetConversationRateRequest) WithIndex(index string) ApiGetConversationRateRequest { - r.index = index - return r -} - // The lower bound timestamp (a date, a string like \"2006-01-02\") of the period to analyze. func (r ApiGetConversationRateRequest) WithStartDate(startDate string) ApiGetConversationRateRequest { r.startDate = startDate @@ -997,8 +979,10 @@ func (r ApiGetConversationRateRequest) WithTags(tags string) ApiGetConversationR } // @return ApiGetConversationRateRequest -func (c *APIClient) NewApiGetConversationRateRequest() ApiGetConversationRateRequest { - return ApiGetConversationRateRequest{} +func (c *APIClient) NewApiGetConversationRateRequest(index string) ApiGetConversationRateRequest { + return ApiGetConversationRateRequest{ + index: index, + } } // GetConversationRate wraps GetConversationRateWithContext using context.Background. @@ -1126,7 +1110,7 @@ func (r *ApiGetNoClickRateRequest) UnmarshalJSON(b []byte) error { if err != nil { return err } - if v, ok := req["index"]; ok { //index + if v, ok := req["index"]; ok { err = json.Unmarshal(v, &r.index) if err != nil { err = json.Unmarshal(b, &r.index) @@ -1135,7 +1119,7 @@ func (r *ApiGetNoClickRateRequest) UnmarshalJSON(b []byte) error { } } } - if v, ok := req["startDate"]; ok { //startDate + if v, ok := req["startDate"]; ok { err = json.Unmarshal(v, &r.startDate) if err != nil { err = json.Unmarshal(b, &r.startDate) @@ -1144,7 +1128,7 @@ func (r *ApiGetNoClickRateRequest) UnmarshalJSON(b []byte) error { } } } - if v, ok := req["endDate"]; ok { //endDate + if v, ok := req["endDate"]; ok { err = json.Unmarshal(v, &r.endDate) if err != nil { err = json.Unmarshal(b, &r.endDate) @@ -1153,7 +1137,7 @@ func (r *ApiGetNoClickRateRequest) UnmarshalJSON(b []byte) error { } } } - if v, ok := req["tags"]; ok { //tags + if v, ok := req["tags"]; ok { err = json.Unmarshal(v, &r.tags) if err != nil { err = json.Unmarshal(b, &r.tags) @@ -1166,12 +1150,6 @@ func (r *ApiGetNoClickRateRequest) UnmarshalJSON(b []byte) error { return nil } -// The index name to target. -func (r ApiGetNoClickRateRequest) WithIndex(index string) ApiGetNoClickRateRequest { - r.index = index - return r -} - // The lower bound timestamp (a date, a string like \"2006-01-02\") of the period to analyze. func (r ApiGetNoClickRateRequest) WithStartDate(startDate string) ApiGetNoClickRateRequest { r.startDate = startDate @@ -1191,8 +1169,10 @@ func (r ApiGetNoClickRateRequest) WithTags(tags string) ApiGetNoClickRateRequest } // @return ApiGetNoClickRateRequest -func (c *APIClient) NewApiGetNoClickRateRequest() ApiGetNoClickRateRequest { - return ApiGetNoClickRateRequest{} +func (c *APIClient) NewApiGetNoClickRateRequest(index string) ApiGetNoClickRateRequest { + return ApiGetNoClickRateRequest{ + index: index, + } } // GetNoClickRate wraps GetNoClickRateWithContext using context.Background. @@ -1320,7 +1300,7 @@ func (r *ApiGetNoResultsRateRequest) UnmarshalJSON(b []byte) error { if err != nil { return err } - if v, ok := req["index"]; ok { //index + if v, ok := req["index"]; ok { err = json.Unmarshal(v, &r.index) if err != nil { err = json.Unmarshal(b, &r.index) @@ -1329,7 +1309,7 @@ func (r *ApiGetNoResultsRateRequest) UnmarshalJSON(b []byte) error { } } } - if v, ok := req["startDate"]; ok { //startDate + if v, ok := req["startDate"]; ok { err = json.Unmarshal(v, &r.startDate) if err != nil { err = json.Unmarshal(b, &r.startDate) @@ -1338,7 +1318,7 @@ func (r *ApiGetNoResultsRateRequest) UnmarshalJSON(b []byte) error { } } } - if v, ok := req["endDate"]; ok { //endDate + if v, ok := req["endDate"]; ok { err = json.Unmarshal(v, &r.endDate) if err != nil { err = json.Unmarshal(b, &r.endDate) @@ -1347,7 +1327,7 @@ func (r *ApiGetNoResultsRateRequest) UnmarshalJSON(b []byte) error { } } } - if v, ok := req["tags"]; ok { //tags + if v, ok := req["tags"]; ok { err = json.Unmarshal(v, &r.tags) if err != nil { err = json.Unmarshal(b, &r.tags) @@ -1360,12 +1340,6 @@ func (r *ApiGetNoResultsRateRequest) UnmarshalJSON(b []byte) error { return nil } -// The index name to target. -func (r ApiGetNoResultsRateRequest) WithIndex(index string) ApiGetNoResultsRateRequest { - r.index = index - return r -} - // The lower bound timestamp (a date, a string like \"2006-01-02\") of the period to analyze. func (r ApiGetNoResultsRateRequest) WithStartDate(startDate string) ApiGetNoResultsRateRequest { r.startDate = startDate @@ -1385,8 +1359,10 @@ func (r ApiGetNoResultsRateRequest) WithTags(tags string) ApiGetNoResultsRateReq } // @return ApiGetNoResultsRateRequest -func (c *APIClient) NewApiGetNoResultsRateRequest() ApiGetNoResultsRateRequest { - return ApiGetNoResultsRateRequest{} +func (c *APIClient) NewApiGetNoResultsRateRequest(index string) ApiGetNoResultsRateRequest { + return ApiGetNoResultsRateRequest{ + index: index, + } } // GetNoResultsRate wraps GetNoResultsRateWithContext using context.Background. @@ -1514,7 +1490,7 @@ func (r *ApiGetSearchesCountRequest) UnmarshalJSON(b []byte) error { if err != nil { return err } - if v, ok := req["index"]; ok { //index + if v, ok := req["index"]; ok { err = json.Unmarshal(v, &r.index) if err != nil { err = json.Unmarshal(b, &r.index) @@ -1523,7 +1499,7 @@ func (r *ApiGetSearchesCountRequest) UnmarshalJSON(b []byte) error { } } } - if v, ok := req["startDate"]; ok { //startDate + if v, ok := req["startDate"]; ok { err = json.Unmarshal(v, &r.startDate) if err != nil { err = json.Unmarshal(b, &r.startDate) @@ -1532,7 +1508,7 @@ func (r *ApiGetSearchesCountRequest) UnmarshalJSON(b []byte) error { } } } - if v, ok := req["endDate"]; ok { //endDate + if v, ok := req["endDate"]; ok { err = json.Unmarshal(v, &r.endDate) if err != nil { err = json.Unmarshal(b, &r.endDate) @@ -1541,7 +1517,7 @@ func (r *ApiGetSearchesCountRequest) UnmarshalJSON(b []byte) error { } } } - if v, ok := req["tags"]; ok { //tags + if v, ok := req["tags"]; ok { err = json.Unmarshal(v, &r.tags) if err != nil { err = json.Unmarshal(b, &r.tags) @@ -1554,12 +1530,6 @@ func (r *ApiGetSearchesCountRequest) UnmarshalJSON(b []byte) error { return nil } -// The index name to target. -func (r ApiGetSearchesCountRequest) WithIndex(index string) ApiGetSearchesCountRequest { - r.index = index - return r -} - // The lower bound timestamp (a date, a string like \"2006-01-02\") of the period to analyze. func (r ApiGetSearchesCountRequest) WithStartDate(startDate string) ApiGetSearchesCountRequest { r.startDate = startDate @@ -1579,8 +1549,10 @@ func (r ApiGetSearchesCountRequest) WithTags(tags string) ApiGetSearchesCountReq } // @return ApiGetSearchesCountRequest -func (c *APIClient) NewApiGetSearchesCountRequest() ApiGetSearchesCountRequest { - return ApiGetSearchesCountRequest{} +func (c *APIClient) NewApiGetSearchesCountRequest(index string) ApiGetSearchesCountRequest { + return ApiGetSearchesCountRequest{ + index: index, + } } // GetSearchesCount wraps GetSearchesCountWithContext using context.Background. @@ -1710,7 +1682,7 @@ func (r *ApiGetSearchesNoClicksRequest) UnmarshalJSON(b []byte) error { if err != nil { return err } - if v, ok := req["index"]; ok { //index + if v, ok := req["index"]; ok { err = json.Unmarshal(v, &r.index) if err != nil { err = json.Unmarshal(b, &r.index) @@ -1719,7 +1691,7 @@ func (r *ApiGetSearchesNoClicksRequest) UnmarshalJSON(b []byte) error { } } } - if v, ok := req["startDate"]; ok { //startDate + if v, ok := req["startDate"]; ok { err = json.Unmarshal(v, &r.startDate) if err != nil { err = json.Unmarshal(b, &r.startDate) @@ -1728,7 +1700,7 @@ func (r *ApiGetSearchesNoClicksRequest) UnmarshalJSON(b []byte) error { } } } - if v, ok := req["endDate"]; ok { //endDate + if v, ok := req["endDate"]; ok { err = json.Unmarshal(v, &r.endDate) if err != nil { err = json.Unmarshal(b, &r.endDate) @@ -1737,7 +1709,7 @@ func (r *ApiGetSearchesNoClicksRequest) UnmarshalJSON(b []byte) error { } } } - if v, ok := req["limit"]; ok { //limit + if v, ok := req["limit"]; ok { err = json.Unmarshal(v, &r.limit) if err != nil { err = json.Unmarshal(b, &r.limit) @@ -1746,7 +1718,7 @@ func (r *ApiGetSearchesNoClicksRequest) UnmarshalJSON(b []byte) error { } } } - if v, ok := req["offset"]; ok { //offset + if v, ok := req["offset"]; ok { err = json.Unmarshal(v, &r.offset) if err != nil { err = json.Unmarshal(b, &r.offset) @@ -1755,7 +1727,7 @@ func (r *ApiGetSearchesNoClicksRequest) UnmarshalJSON(b []byte) error { } } } - if v, ok := req["tags"]; ok { //tags + if v, ok := req["tags"]; ok { err = json.Unmarshal(v, &r.tags) if err != nil { err = json.Unmarshal(b, &r.tags) @@ -1768,12 +1740,6 @@ func (r *ApiGetSearchesNoClicksRequest) UnmarshalJSON(b []byte) error { return nil } -// The index name to target. -func (r ApiGetSearchesNoClicksRequest) WithIndex(index string) ApiGetSearchesNoClicksRequest { - r.index = index - return r -} - // The lower bound timestamp (a date, a string like \"2006-01-02\") of the period to analyze. func (r ApiGetSearchesNoClicksRequest) WithStartDate(startDate string) ApiGetSearchesNoClicksRequest { r.startDate = startDate @@ -1805,8 +1771,10 @@ func (r ApiGetSearchesNoClicksRequest) WithTags(tags string) ApiGetSearchesNoCli } // @return ApiGetSearchesNoClicksRequest -func (c *APIClient) NewApiGetSearchesNoClicksRequest() ApiGetSearchesNoClicksRequest { - return ApiGetSearchesNoClicksRequest{} +func (c *APIClient) NewApiGetSearchesNoClicksRequest(index string) ApiGetSearchesNoClicksRequest { + return ApiGetSearchesNoClicksRequest{ + index: index, + } } // GetSearchesNoClicks wraps GetSearchesNoClicksWithContext using context.Background. @@ -1942,7 +1910,7 @@ func (r *ApiGetSearchesNoResultsRequest) UnmarshalJSON(b []byte) error { if err != nil { return err } - if v, ok := req["index"]; ok { //index + if v, ok := req["index"]; ok { err = json.Unmarshal(v, &r.index) if err != nil { err = json.Unmarshal(b, &r.index) @@ -1951,7 +1919,7 @@ func (r *ApiGetSearchesNoResultsRequest) UnmarshalJSON(b []byte) error { } } } - if v, ok := req["startDate"]; ok { //startDate + if v, ok := req["startDate"]; ok { err = json.Unmarshal(v, &r.startDate) if err != nil { err = json.Unmarshal(b, &r.startDate) @@ -1960,7 +1928,7 @@ func (r *ApiGetSearchesNoResultsRequest) UnmarshalJSON(b []byte) error { } } } - if v, ok := req["endDate"]; ok { //endDate + if v, ok := req["endDate"]; ok { err = json.Unmarshal(v, &r.endDate) if err != nil { err = json.Unmarshal(b, &r.endDate) @@ -1969,7 +1937,7 @@ func (r *ApiGetSearchesNoResultsRequest) UnmarshalJSON(b []byte) error { } } } - if v, ok := req["limit"]; ok { //limit + if v, ok := req["limit"]; ok { err = json.Unmarshal(v, &r.limit) if err != nil { err = json.Unmarshal(b, &r.limit) @@ -1978,7 +1946,7 @@ func (r *ApiGetSearchesNoResultsRequest) UnmarshalJSON(b []byte) error { } } } - if v, ok := req["offset"]; ok { //offset + if v, ok := req["offset"]; ok { err = json.Unmarshal(v, &r.offset) if err != nil { err = json.Unmarshal(b, &r.offset) @@ -1987,7 +1955,7 @@ func (r *ApiGetSearchesNoResultsRequest) UnmarshalJSON(b []byte) error { } } } - if v, ok := req["tags"]; ok { //tags + if v, ok := req["tags"]; ok { err = json.Unmarshal(v, &r.tags) if err != nil { err = json.Unmarshal(b, &r.tags) @@ -2000,12 +1968,6 @@ func (r *ApiGetSearchesNoResultsRequest) UnmarshalJSON(b []byte) error { return nil } -// The index name to target. -func (r ApiGetSearchesNoResultsRequest) WithIndex(index string) ApiGetSearchesNoResultsRequest { - r.index = index - return r -} - // The lower bound timestamp (a date, a string like \"2006-01-02\") of the period to analyze. func (r ApiGetSearchesNoResultsRequest) WithStartDate(startDate string) ApiGetSearchesNoResultsRequest { r.startDate = startDate @@ -2037,8 +1999,10 @@ func (r ApiGetSearchesNoResultsRequest) WithTags(tags string) ApiGetSearchesNoRe } // @return ApiGetSearchesNoResultsRequest -func (c *APIClient) NewApiGetSearchesNoResultsRequest() ApiGetSearchesNoResultsRequest { - return ApiGetSearchesNoResultsRequest{} +func (c *APIClient) NewApiGetSearchesNoResultsRequest(index string) ApiGetSearchesNoResultsRequest { + return ApiGetSearchesNoResultsRequest{ + index: index, + } } // GetSearchesNoResults wraps GetSearchesNoResultsWithContext using context.Background. @@ -2169,7 +2133,7 @@ func (r *ApiGetStatusRequest) UnmarshalJSON(b []byte) error { if err != nil { return err } - if v, ok := req["index"]; ok { //index + if v, ok := req["index"]; ok { err = json.Unmarshal(v, &r.index) if err != nil { err = json.Unmarshal(b, &r.index) @@ -2182,15 +2146,11 @@ func (r *ApiGetStatusRequest) UnmarshalJSON(b []byte) error { return nil } -// The index name to target. -func (r ApiGetStatusRequest) WithIndex(index string) ApiGetStatusRequest { - r.index = index - return r -} - // @return ApiGetStatusRequest -func (c *APIClient) NewApiGetStatusRequest() ApiGetStatusRequest { - return ApiGetStatusRequest{} +func (c *APIClient) NewApiGetStatusRequest(index string) ApiGetStatusRequest { + return ApiGetStatusRequest{ + index: index, + } } // GetStatus wraps GetStatusWithContext using context.Background. @@ -2311,7 +2271,7 @@ func (r *ApiGetTopCountriesRequest) UnmarshalJSON(b []byte) error { if err != nil { return err } - if v, ok := req["index"]; ok { //index + if v, ok := req["index"]; ok { err = json.Unmarshal(v, &r.index) if err != nil { err = json.Unmarshal(b, &r.index) @@ -2320,7 +2280,7 @@ func (r *ApiGetTopCountriesRequest) UnmarshalJSON(b []byte) error { } } } - if v, ok := req["startDate"]; ok { //startDate + if v, ok := req["startDate"]; ok { err = json.Unmarshal(v, &r.startDate) if err != nil { err = json.Unmarshal(b, &r.startDate) @@ -2329,7 +2289,7 @@ func (r *ApiGetTopCountriesRequest) UnmarshalJSON(b []byte) error { } } } - if v, ok := req["endDate"]; ok { //endDate + if v, ok := req["endDate"]; ok { err = json.Unmarshal(v, &r.endDate) if err != nil { err = json.Unmarshal(b, &r.endDate) @@ -2338,7 +2298,7 @@ func (r *ApiGetTopCountriesRequest) UnmarshalJSON(b []byte) error { } } } - if v, ok := req["limit"]; ok { //limit + if v, ok := req["limit"]; ok { err = json.Unmarshal(v, &r.limit) if err != nil { err = json.Unmarshal(b, &r.limit) @@ -2347,7 +2307,7 @@ func (r *ApiGetTopCountriesRequest) UnmarshalJSON(b []byte) error { } } } - if v, ok := req["offset"]; ok { //offset + if v, ok := req["offset"]; ok { err = json.Unmarshal(v, &r.offset) if err != nil { err = json.Unmarshal(b, &r.offset) @@ -2356,7 +2316,7 @@ func (r *ApiGetTopCountriesRequest) UnmarshalJSON(b []byte) error { } } } - if v, ok := req["tags"]; ok { //tags + if v, ok := req["tags"]; ok { err = json.Unmarshal(v, &r.tags) if err != nil { err = json.Unmarshal(b, &r.tags) @@ -2369,12 +2329,6 @@ func (r *ApiGetTopCountriesRequest) UnmarshalJSON(b []byte) error { return nil } -// The index name to target. -func (r ApiGetTopCountriesRequest) WithIndex(index string) ApiGetTopCountriesRequest { - r.index = index - return r -} - // The lower bound timestamp (a date, a string like \"2006-01-02\") of the period to analyze. func (r ApiGetTopCountriesRequest) WithStartDate(startDate string) ApiGetTopCountriesRequest { r.startDate = startDate @@ -2406,8 +2360,10 @@ func (r ApiGetTopCountriesRequest) WithTags(tags string) ApiGetTopCountriesReque } // @return ApiGetTopCountriesRequest -func (c *APIClient) NewApiGetTopCountriesRequest() ApiGetTopCountriesRequest { - return ApiGetTopCountriesRequest{} +func (c *APIClient) NewApiGetTopCountriesRequest(index string) ApiGetTopCountriesRequest { + return ApiGetTopCountriesRequest{ + index: index, + } } // GetTopCountries wraps GetTopCountriesWithContext using context.Background. @@ -2544,7 +2500,7 @@ func (r *ApiGetTopFilterAttributesRequest) UnmarshalJSON(b []byte) error { if err != nil { return err } - if v, ok := req["index"]; ok { //index + if v, ok := req["index"]; ok { err = json.Unmarshal(v, &r.index) if err != nil { err = json.Unmarshal(b, &r.index) @@ -2553,7 +2509,7 @@ func (r *ApiGetTopFilterAttributesRequest) UnmarshalJSON(b []byte) error { } } } - if v, ok := req["search"]; ok { //search + if v, ok := req["search"]; ok { err = json.Unmarshal(v, &r.search) if err != nil { err = json.Unmarshal(b, &r.search) @@ -2562,7 +2518,7 @@ func (r *ApiGetTopFilterAttributesRequest) UnmarshalJSON(b []byte) error { } } } - if v, ok := req["startDate"]; ok { //startDate + if v, ok := req["startDate"]; ok { err = json.Unmarshal(v, &r.startDate) if err != nil { err = json.Unmarshal(b, &r.startDate) @@ -2571,7 +2527,7 @@ func (r *ApiGetTopFilterAttributesRequest) UnmarshalJSON(b []byte) error { } } } - if v, ok := req["endDate"]; ok { //endDate + if v, ok := req["endDate"]; ok { err = json.Unmarshal(v, &r.endDate) if err != nil { err = json.Unmarshal(b, &r.endDate) @@ -2580,7 +2536,7 @@ func (r *ApiGetTopFilterAttributesRequest) UnmarshalJSON(b []byte) error { } } } - if v, ok := req["limit"]; ok { //limit + if v, ok := req["limit"]; ok { err = json.Unmarshal(v, &r.limit) if err != nil { err = json.Unmarshal(b, &r.limit) @@ -2589,7 +2545,7 @@ func (r *ApiGetTopFilterAttributesRequest) UnmarshalJSON(b []byte) error { } } } - if v, ok := req["offset"]; ok { //offset + if v, ok := req["offset"]; ok { err = json.Unmarshal(v, &r.offset) if err != nil { err = json.Unmarshal(b, &r.offset) @@ -2598,7 +2554,7 @@ func (r *ApiGetTopFilterAttributesRequest) UnmarshalJSON(b []byte) error { } } } - if v, ok := req["tags"]; ok { //tags + if v, ok := req["tags"]; ok { err = json.Unmarshal(v, &r.tags) if err != nil { err = json.Unmarshal(b, &r.tags) @@ -2611,12 +2567,6 @@ func (r *ApiGetTopFilterAttributesRequest) UnmarshalJSON(b []byte) error { return nil } -// The index name to target. -func (r ApiGetTopFilterAttributesRequest) WithIndex(index string) ApiGetTopFilterAttributesRequest { - r.index = index - return r -} - // The query term to search for. Must match the exact user input. func (r ApiGetTopFilterAttributesRequest) WithSearch(search string) ApiGetTopFilterAttributesRequest { r.search = search @@ -2654,8 +2604,10 @@ func (r ApiGetTopFilterAttributesRequest) WithTags(tags string) ApiGetTopFilterA } // @return ApiGetTopFilterAttributesRequest -func (c *APIClient) NewApiGetTopFilterAttributesRequest() ApiGetTopFilterAttributesRequest { - return ApiGetTopFilterAttributesRequest{} +func (c *APIClient) NewApiGetTopFilterAttributesRequest(index string) ApiGetTopFilterAttributesRequest { + return ApiGetTopFilterAttributesRequest{ + index: index, + } } // GetTopFilterAttributes wraps GetTopFilterAttributesWithContext using context.Background. @@ -2796,7 +2748,7 @@ func (r *ApiGetTopFilterForAttributeRequest) UnmarshalJSON(b []byte) error { if err != nil { return err } - if v, ok := req["attribute"]; ok { //attribute + if v, ok := req["attribute"]; ok { err = json.Unmarshal(v, &r.attribute) if err != nil { err = json.Unmarshal(b, &r.attribute) @@ -2805,7 +2757,7 @@ func (r *ApiGetTopFilterForAttributeRequest) UnmarshalJSON(b []byte) error { } } } - if v, ok := req["index"]; ok { //index + if v, ok := req["index"]; ok { err = json.Unmarshal(v, &r.index) if err != nil { err = json.Unmarshal(b, &r.index) @@ -2814,7 +2766,7 @@ func (r *ApiGetTopFilterForAttributeRequest) UnmarshalJSON(b []byte) error { } } } - if v, ok := req["search"]; ok { //search + if v, ok := req["search"]; ok { err = json.Unmarshal(v, &r.search) if err != nil { err = json.Unmarshal(b, &r.search) @@ -2823,7 +2775,7 @@ func (r *ApiGetTopFilterForAttributeRequest) UnmarshalJSON(b []byte) error { } } } - if v, ok := req["startDate"]; ok { //startDate + if v, ok := req["startDate"]; ok { err = json.Unmarshal(v, &r.startDate) if err != nil { err = json.Unmarshal(b, &r.startDate) @@ -2832,7 +2784,7 @@ func (r *ApiGetTopFilterForAttributeRequest) UnmarshalJSON(b []byte) error { } } } - if v, ok := req["endDate"]; ok { //endDate + if v, ok := req["endDate"]; ok { err = json.Unmarshal(v, &r.endDate) if err != nil { err = json.Unmarshal(b, &r.endDate) @@ -2841,7 +2793,7 @@ func (r *ApiGetTopFilterForAttributeRequest) UnmarshalJSON(b []byte) error { } } } - if v, ok := req["limit"]; ok { //limit + if v, ok := req["limit"]; ok { err = json.Unmarshal(v, &r.limit) if err != nil { err = json.Unmarshal(b, &r.limit) @@ -2850,7 +2802,7 @@ func (r *ApiGetTopFilterForAttributeRequest) UnmarshalJSON(b []byte) error { } } } - if v, ok := req["offset"]; ok { //offset + if v, ok := req["offset"]; ok { err = json.Unmarshal(v, &r.offset) if err != nil { err = json.Unmarshal(b, &r.offset) @@ -2859,7 +2811,7 @@ func (r *ApiGetTopFilterForAttributeRequest) UnmarshalJSON(b []byte) error { } } } - if v, ok := req["tags"]; ok { //tags + if v, ok := req["tags"]; ok { err = json.Unmarshal(v, &r.tags) if err != nil { err = json.Unmarshal(b, &r.tags) @@ -2872,12 +2824,6 @@ func (r *ApiGetTopFilterForAttributeRequest) UnmarshalJSON(b []byte) error { return nil } -// The index name to target. -func (r ApiGetTopFilterForAttributeRequest) WithIndex(index string) ApiGetTopFilterForAttributeRequest { - r.index = index - return r -} - // The query term to search for. Must match the exact user input. func (r ApiGetTopFilterForAttributeRequest) WithSearch(search string) ApiGetTopFilterForAttributeRequest { r.search = search @@ -2915,9 +2861,10 @@ func (r ApiGetTopFilterForAttributeRequest) WithTags(tags string) ApiGetTopFilte } // @return ApiGetTopFilterForAttributeRequest -func (c *APIClient) NewApiGetTopFilterForAttributeRequest(attribute string) ApiGetTopFilterForAttributeRequest { +func (c *APIClient) NewApiGetTopFilterForAttributeRequest(attribute string, index string) ApiGetTopFilterForAttributeRequest { return ApiGetTopFilterForAttributeRequest{ attribute: attribute, + index: index, } } @@ -3059,7 +3006,7 @@ func (r *ApiGetTopFiltersNoResultsRequest) UnmarshalJSON(b []byte) error { if err != nil { return err } - if v, ok := req["index"]; ok { //index + if v, ok := req["index"]; ok { err = json.Unmarshal(v, &r.index) if err != nil { err = json.Unmarshal(b, &r.index) @@ -3068,7 +3015,7 @@ func (r *ApiGetTopFiltersNoResultsRequest) UnmarshalJSON(b []byte) error { } } } - if v, ok := req["search"]; ok { //search + if v, ok := req["search"]; ok { err = json.Unmarshal(v, &r.search) if err != nil { err = json.Unmarshal(b, &r.search) @@ -3077,7 +3024,7 @@ func (r *ApiGetTopFiltersNoResultsRequest) UnmarshalJSON(b []byte) error { } } } - if v, ok := req["startDate"]; ok { //startDate + if v, ok := req["startDate"]; ok { err = json.Unmarshal(v, &r.startDate) if err != nil { err = json.Unmarshal(b, &r.startDate) @@ -3086,7 +3033,7 @@ func (r *ApiGetTopFiltersNoResultsRequest) UnmarshalJSON(b []byte) error { } } } - if v, ok := req["endDate"]; ok { //endDate + if v, ok := req["endDate"]; ok { err = json.Unmarshal(v, &r.endDate) if err != nil { err = json.Unmarshal(b, &r.endDate) @@ -3095,7 +3042,7 @@ func (r *ApiGetTopFiltersNoResultsRequest) UnmarshalJSON(b []byte) error { } } } - if v, ok := req["limit"]; ok { //limit + if v, ok := req["limit"]; ok { err = json.Unmarshal(v, &r.limit) if err != nil { err = json.Unmarshal(b, &r.limit) @@ -3104,7 +3051,7 @@ func (r *ApiGetTopFiltersNoResultsRequest) UnmarshalJSON(b []byte) error { } } } - if v, ok := req["offset"]; ok { //offset + if v, ok := req["offset"]; ok { err = json.Unmarshal(v, &r.offset) if err != nil { err = json.Unmarshal(b, &r.offset) @@ -3113,7 +3060,7 @@ func (r *ApiGetTopFiltersNoResultsRequest) UnmarshalJSON(b []byte) error { } } } - if v, ok := req["tags"]; ok { //tags + if v, ok := req["tags"]; ok { err = json.Unmarshal(v, &r.tags) if err != nil { err = json.Unmarshal(b, &r.tags) @@ -3126,12 +3073,6 @@ func (r *ApiGetTopFiltersNoResultsRequest) UnmarshalJSON(b []byte) error { return nil } -// The index name to target. -func (r ApiGetTopFiltersNoResultsRequest) WithIndex(index string) ApiGetTopFiltersNoResultsRequest { - r.index = index - return r -} - // The query term to search for. Must match the exact user input. func (r ApiGetTopFiltersNoResultsRequest) WithSearch(search string) ApiGetTopFiltersNoResultsRequest { r.search = search @@ -3169,8 +3110,10 @@ func (r ApiGetTopFiltersNoResultsRequest) WithTags(tags string) ApiGetTopFilters } // @return ApiGetTopFiltersNoResultsRequest -func (c *APIClient) NewApiGetTopFiltersNoResultsRequest() ApiGetTopFiltersNoResultsRequest { - return ApiGetTopFiltersNoResultsRequest{} +func (c *APIClient) NewApiGetTopFiltersNoResultsRequest(index string) ApiGetTopFiltersNoResultsRequest { + return ApiGetTopFiltersNoResultsRequest{ + index: index, + } } // GetTopFiltersNoResults wraps GetTopFiltersNoResultsWithContext using context.Background. @@ -3311,7 +3254,7 @@ func (r *ApiGetTopHitsRequest) UnmarshalJSON(b []byte) error { if err != nil { return err } - if v, ok := req["index"]; ok { //index + if v, ok := req["index"]; ok { err = json.Unmarshal(v, &r.index) if err != nil { err = json.Unmarshal(b, &r.index) @@ -3320,7 +3263,7 @@ func (r *ApiGetTopHitsRequest) UnmarshalJSON(b []byte) error { } } } - if v, ok := req["search"]; ok { //search + if v, ok := req["search"]; ok { err = json.Unmarshal(v, &r.search) if err != nil { err = json.Unmarshal(b, &r.search) @@ -3329,7 +3272,7 @@ func (r *ApiGetTopHitsRequest) UnmarshalJSON(b []byte) error { } } } - if v, ok := req["clickAnalytics"]; ok { //clickAnalytics + if v, ok := req["clickAnalytics"]; ok { err = json.Unmarshal(v, &r.clickAnalytics) if err != nil { err = json.Unmarshal(b, &r.clickAnalytics) @@ -3338,7 +3281,7 @@ func (r *ApiGetTopHitsRequest) UnmarshalJSON(b []byte) error { } } } - if v, ok := req["startDate"]; ok { //startDate + if v, ok := req["startDate"]; ok { err = json.Unmarshal(v, &r.startDate) if err != nil { err = json.Unmarshal(b, &r.startDate) @@ -3347,7 +3290,7 @@ func (r *ApiGetTopHitsRequest) UnmarshalJSON(b []byte) error { } } } - if v, ok := req["endDate"]; ok { //endDate + if v, ok := req["endDate"]; ok { err = json.Unmarshal(v, &r.endDate) if err != nil { err = json.Unmarshal(b, &r.endDate) @@ -3356,7 +3299,7 @@ func (r *ApiGetTopHitsRequest) UnmarshalJSON(b []byte) error { } } } - if v, ok := req["limit"]; ok { //limit + if v, ok := req["limit"]; ok { err = json.Unmarshal(v, &r.limit) if err != nil { err = json.Unmarshal(b, &r.limit) @@ -3365,7 +3308,7 @@ func (r *ApiGetTopHitsRequest) UnmarshalJSON(b []byte) error { } } } - if v, ok := req["offset"]; ok { //offset + if v, ok := req["offset"]; ok { err = json.Unmarshal(v, &r.offset) if err != nil { err = json.Unmarshal(b, &r.offset) @@ -3374,7 +3317,7 @@ func (r *ApiGetTopHitsRequest) UnmarshalJSON(b []byte) error { } } } - if v, ok := req["tags"]; ok { //tags + if v, ok := req["tags"]; ok { err = json.Unmarshal(v, &r.tags) if err != nil { err = json.Unmarshal(b, &r.tags) @@ -3387,12 +3330,6 @@ func (r *ApiGetTopHitsRequest) UnmarshalJSON(b []byte) error { return nil } -// The index name to target. -func (r ApiGetTopHitsRequest) WithIndex(index string) ApiGetTopHitsRequest { - r.index = index - return r -} - // The query term to search for. Must match the exact user input. func (r ApiGetTopHitsRequest) WithSearch(search string) ApiGetTopHitsRequest { r.search = search @@ -3436,8 +3373,10 @@ func (r ApiGetTopHitsRequest) WithTags(tags string) ApiGetTopHitsRequest { } // @return ApiGetTopHitsRequest -func (c *APIClient) NewApiGetTopHitsRequest() ApiGetTopHitsRequest { - return ApiGetTopHitsRequest{} +func (c *APIClient) NewApiGetTopHitsRequest(index string) ApiGetTopHitsRequest { + return ApiGetTopHitsRequest{ + index: index, + } } // GetTopHits wraps GetTopHitsWithContext using context.Background. @@ -3582,7 +3521,7 @@ func (r *ApiGetTopSearchesRequest) UnmarshalJSON(b []byte) error { if err != nil { return err } - if v, ok := req["index"]; ok { //index + if v, ok := req["index"]; ok { err = json.Unmarshal(v, &r.index) if err != nil { err = json.Unmarshal(b, &r.index) @@ -3591,7 +3530,7 @@ func (r *ApiGetTopSearchesRequest) UnmarshalJSON(b []byte) error { } } } - if v, ok := req["clickAnalytics"]; ok { //clickAnalytics + if v, ok := req["clickAnalytics"]; ok { err = json.Unmarshal(v, &r.clickAnalytics) if err != nil { err = json.Unmarshal(b, &r.clickAnalytics) @@ -3600,7 +3539,7 @@ func (r *ApiGetTopSearchesRequest) UnmarshalJSON(b []byte) error { } } } - if v, ok := req["startDate"]; ok { //startDate + if v, ok := req["startDate"]; ok { err = json.Unmarshal(v, &r.startDate) if err != nil { err = json.Unmarshal(b, &r.startDate) @@ -3609,7 +3548,7 @@ func (r *ApiGetTopSearchesRequest) UnmarshalJSON(b []byte) error { } } } - if v, ok := req["endDate"]; ok { //endDate + if v, ok := req["endDate"]; ok { err = json.Unmarshal(v, &r.endDate) if err != nil { err = json.Unmarshal(b, &r.endDate) @@ -3618,7 +3557,7 @@ func (r *ApiGetTopSearchesRequest) UnmarshalJSON(b []byte) error { } } } - if v, ok := req["orderBy"]; ok { //orderBy + if v, ok := req["orderBy"]; ok { err = json.Unmarshal(v, &r.orderBy) if err != nil { err = json.Unmarshal(b, &r.orderBy) @@ -3627,7 +3566,7 @@ func (r *ApiGetTopSearchesRequest) UnmarshalJSON(b []byte) error { } } } - if v, ok := req["direction"]; ok { //direction + if v, ok := req["direction"]; ok { err = json.Unmarshal(v, &r.direction) if err != nil { err = json.Unmarshal(b, &r.direction) @@ -3636,7 +3575,7 @@ func (r *ApiGetTopSearchesRequest) UnmarshalJSON(b []byte) error { } } } - if v, ok := req["limit"]; ok { //limit + if v, ok := req["limit"]; ok { err = json.Unmarshal(v, &r.limit) if err != nil { err = json.Unmarshal(b, &r.limit) @@ -3645,7 +3584,7 @@ func (r *ApiGetTopSearchesRequest) UnmarshalJSON(b []byte) error { } } } - if v, ok := req["offset"]; ok { //offset + if v, ok := req["offset"]; ok { err = json.Unmarshal(v, &r.offset) if err != nil { err = json.Unmarshal(b, &r.offset) @@ -3654,7 +3593,7 @@ func (r *ApiGetTopSearchesRequest) UnmarshalJSON(b []byte) error { } } } - if v, ok := req["tags"]; ok { //tags + if v, ok := req["tags"]; ok { err = json.Unmarshal(v, &r.tags) if err != nil { err = json.Unmarshal(b, &r.tags) @@ -3667,12 +3606,6 @@ func (r *ApiGetTopSearchesRequest) UnmarshalJSON(b []byte) error { return nil } -// The index name to target. -func (r ApiGetTopSearchesRequest) WithIndex(index string) ApiGetTopSearchesRequest { - r.index = index - return r -} - // Whether to include the click-through and conversion rates for a search. func (r ApiGetTopSearchesRequest) WithClickAnalytics(clickAnalytics bool) ApiGetTopSearchesRequest { r.clickAnalytics = clickAnalytics @@ -3722,8 +3655,10 @@ func (r ApiGetTopSearchesRequest) WithTags(tags string) ApiGetTopSearchesRequest } // @return ApiGetTopSearchesRequest -func (c *APIClient) NewApiGetTopSearchesRequest() ApiGetTopSearchesRequest { - return ApiGetTopSearchesRequest{} +func (c *APIClient) NewApiGetTopSearchesRequest(index string) ApiGetTopSearchesRequest { + return ApiGetTopSearchesRequest{ + index: index, + } } // GetTopSearches wraps GetTopSearchesWithContext using context.Background. @@ -3866,7 +3801,7 @@ func (r *ApiGetUsersCountRequest) UnmarshalJSON(b []byte) error { if err != nil { return err } - if v, ok := req["index"]; ok { //index + if v, ok := req["index"]; ok { err = json.Unmarshal(v, &r.index) if err != nil { err = json.Unmarshal(b, &r.index) @@ -3875,7 +3810,7 @@ func (r *ApiGetUsersCountRequest) UnmarshalJSON(b []byte) error { } } } - if v, ok := req["startDate"]; ok { //startDate + if v, ok := req["startDate"]; ok { err = json.Unmarshal(v, &r.startDate) if err != nil { err = json.Unmarshal(b, &r.startDate) @@ -3884,7 +3819,7 @@ func (r *ApiGetUsersCountRequest) UnmarshalJSON(b []byte) error { } } } - if v, ok := req["endDate"]; ok { //endDate + if v, ok := req["endDate"]; ok { err = json.Unmarshal(v, &r.endDate) if err != nil { err = json.Unmarshal(b, &r.endDate) @@ -3893,7 +3828,7 @@ func (r *ApiGetUsersCountRequest) UnmarshalJSON(b []byte) error { } } } - if v, ok := req["tags"]; ok { //tags + if v, ok := req["tags"]; ok { err = json.Unmarshal(v, &r.tags) if err != nil { err = json.Unmarshal(b, &r.tags) @@ -3906,12 +3841,6 @@ func (r *ApiGetUsersCountRequest) UnmarshalJSON(b []byte) error { return nil } -// The index name to target. -func (r ApiGetUsersCountRequest) WithIndex(index string) ApiGetUsersCountRequest { - r.index = index - return r -} - // The lower bound timestamp (a date, a string like \"2006-01-02\") of the period to analyze. func (r ApiGetUsersCountRequest) WithStartDate(startDate string) ApiGetUsersCountRequest { r.startDate = startDate @@ -3931,8 +3860,10 @@ func (r ApiGetUsersCountRequest) WithTags(tags string) ApiGetUsersCountRequest { } // @return ApiGetUsersCountRequest -func (c *APIClient) NewApiGetUsersCountRequest() ApiGetUsersCountRequest { - return ApiGetUsersCountRequest{} +func (c *APIClient) NewApiGetUsersCountRequest(index string) ApiGetUsersCountRequest { + return ApiGetUsersCountRequest{ + index: index, + } } // GetUsersCount wraps GetUsersCountWithContext using context.Background. @@ -4059,7 +3990,7 @@ func (r *ApiPostRequest) UnmarshalJSON(b []byte) error { if err != nil { return err } - if v, ok := req["path"]; ok { //path + if v, ok := req["path"]; ok { err = json.Unmarshal(v, &r.path) if err != nil { err = json.Unmarshal(b, &r.path) @@ -4068,7 +3999,7 @@ func (r *ApiPostRequest) UnmarshalJSON(b []byte) error { } } } - if v, ok := req["parameters"]; ok { //parameters + if v, ok := req["parameters"]; ok { err = json.Unmarshal(v, &r.parameters) if err != nil { err = json.Unmarshal(b, &r.parameters) @@ -4077,7 +4008,7 @@ func (r *ApiPostRequest) UnmarshalJSON(b []byte) error { } } } - if v, ok := req["body"]; ok { //body + if v, ok := req["body"]; ok { err = json.Unmarshal(v, &r.body) if err != nil { err = json.Unmarshal(b, &r.body) @@ -4232,7 +4163,7 @@ func (r *ApiPutRequest) UnmarshalJSON(b []byte) error { if err != nil { return err } - if v, ok := req["path"]; ok { //path + if v, ok := req["path"]; ok { err = json.Unmarshal(v, &r.path) if err != nil { err = json.Unmarshal(b, &r.path) @@ -4241,7 +4172,7 @@ func (r *ApiPutRequest) UnmarshalJSON(b []byte) error { } } } - if v, ok := req["parameters"]; ok { //parameters + if v, ok := req["parameters"]; ok { err = json.Unmarshal(v, &r.parameters) if err != nil { err = json.Unmarshal(b, &r.parameters) @@ -4250,7 +4181,7 @@ func (r *ApiPutRequest) UnmarshalJSON(b []byte) error { } } } - if v, ok := req["body"]; ok { //body + if v, ok := req["body"]; ok { err = json.Unmarshal(v, &r.body) if err != nil { err = json.Unmarshal(b, &r.body) diff --git a/clients/algoliasearch-client-go/algolia/ingestion/api_ingestion.go b/clients/algoliasearch-client-go/algolia/ingestion/api_ingestion.go index 257d5e7004..ece506054f 100644 --- a/clients/algoliasearch-client-go/algolia/ingestion/api_ingestion.go +++ b/clients/algoliasearch-client-go/algolia/ingestion/api_ingestion.go @@ -45,7 +45,7 @@ func (r *ApiCreateAuthenticationRequest) UnmarshalJSON(b []byte) error { if err != nil { return err } - if v, ok := req["authenticationCreate"]; ok { //authenticationCreate + if v, ok := req["authenticationCreate"]; ok { err = json.Unmarshal(v, &r.authenticationCreate) if err != nil { err = json.Unmarshal(b, &r.authenticationCreate) @@ -63,14 +63,11 @@ func (r *ApiCreateAuthenticationRequest) UnmarshalJSON(b []byte) error { return nil } -func (r ApiCreateAuthenticationRequest) WithAuthenticationCreate(authenticationCreate *AuthenticationCreate) ApiCreateAuthenticationRequest { - r.authenticationCreate = authenticationCreate - return r -} - // @return ApiCreateAuthenticationRequest -func (c *APIClient) NewApiCreateAuthenticationRequest() ApiCreateAuthenticationRequest { - return ApiCreateAuthenticationRequest{} +func (c *APIClient) NewApiCreateAuthenticationRequest(authenticationCreate *AuthenticationCreate) ApiCreateAuthenticationRequest { + return ApiCreateAuthenticationRequest{ + authenticationCreate: authenticationCreate, + } } // CreateAuthentication wraps CreateAuthenticationWithContext using context.Background. @@ -159,7 +156,7 @@ func (r *ApiCreateDestinationRequest) UnmarshalJSON(b []byte) error { if err != nil { return err } - if v, ok := req["destinationCreate"]; ok { //destinationCreate + if v, ok := req["destinationCreate"]; ok { err = json.Unmarshal(v, &r.destinationCreate) if err != nil { err = json.Unmarshal(b, &r.destinationCreate) @@ -177,14 +174,11 @@ func (r *ApiCreateDestinationRequest) UnmarshalJSON(b []byte) error { return nil } -func (r ApiCreateDestinationRequest) WithDestinationCreate(destinationCreate *DestinationCreate) ApiCreateDestinationRequest { - r.destinationCreate = destinationCreate - return r -} - // @return ApiCreateDestinationRequest -func (c *APIClient) NewApiCreateDestinationRequest() ApiCreateDestinationRequest { - return ApiCreateDestinationRequest{} +func (c *APIClient) NewApiCreateDestinationRequest(destinationCreate *DestinationCreate) ApiCreateDestinationRequest { + return ApiCreateDestinationRequest{ + destinationCreate: destinationCreate, + } } // CreateDestination wraps CreateDestinationWithContext using context.Background. @@ -273,7 +267,7 @@ func (r *ApiCreateSourceRequest) UnmarshalJSON(b []byte) error { if err != nil { return err } - if v, ok := req["sourceCreate"]; ok { //sourceCreate + if v, ok := req["sourceCreate"]; ok { err = json.Unmarshal(v, &r.sourceCreate) if err != nil { err = json.Unmarshal(b, &r.sourceCreate) @@ -291,14 +285,11 @@ func (r *ApiCreateSourceRequest) UnmarshalJSON(b []byte) error { return nil } -func (r ApiCreateSourceRequest) WithSourceCreate(sourceCreate *SourceCreate) ApiCreateSourceRequest { - r.sourceCreate = sourceCreate - return r -} - // @return ApiCreateSourceRequest -func (c *APIClient) NewApiCreateSourceRequest() ApiCreateSourceRequest { - return ApiCreateSourceRequest{} +func (c *APIClient) NewApiCreateSourceRequest(sourceCreate *SourceCreate) ApiCreateSourceRequest { + return ApiCreateSourceRequest{ + sourceCreate: sourceCreate, + } } // CreateSource wraps CreateSourceWithContext using context.Background. @@ -387,7 +378,7 @@ func (r *ApiCreateTaskRequest) UnmarshalJSON(b []byte) error { if err != nil { return err } - if v, ok := req["taskCreate"]; ok { //taskCreate + if v, ok := req["taskCreate"]; ok { err = json.Unmarshal(v, &r.taskCreate) if err != nil { err = json.Unmarshal(b, &r.taskCreate) @@ -405,14 +396,11 @@ func (r *ApiCreateTaskRequest) UnmarshalJSON(b []byte) error { return nil } -func (r ApiCreateTaskRequest) WithTaskCreate(taskCreate *TaskCreate) ApiCreateTaskRequest { - r.taskCreate = taskCreate - return r -} - // @return ApiCreateTaskRequest -func (c *APIClient) NewApiCreateTaskRequest() ApiCreateTaskRequest { - return ApiCreateTaskRequest{} +func (c *APIClient) NewApiCreateTaskRequest(taskCreate *TaskCreate) ApiCreateTaskRequest { + return ApiCreateTaskRequest{ + taskCreate: taskCreate, + } } // CreateTask wraps CreateTaskWithContext using context.Background. @@ -502,7 +490,7 @@ func (r *ApiDelRequest) UnmarshalJSON(b []byte) error { if err != nil { return err } - if v, ok := req["path"]; ok { //path + if v, ok := req["path"]; ok { err = json.Unmarshal(v, &r.path) if err != nil { err = json.Unmarshal(b, &r.path) @@ -511,7 +499,7 @@ func (r *ApiDelRequest) UnmarshalJSON(b []byte) error { } } } - if v, ok := req["parameters"]; ok { //parameters + if v, ok := req["parameters"]; ok { err = json.Unmarshal(v, &r.parameters) if err != nil { err = json.Unmarshal(b, &r.parameters) @@ -652,7 +640,7 @@ func (r *ApiDeleteAuthenticationRequest) UnmarshalJSON(b []byte) error { if err != nil { return err } - if v, ok := req["authenticationID"]; ok { //authenticationID + if v, ok := req["authenticationID"]; ok { err = json.Unmarshal(v, &r.authenticationID) if err != nil { err = json.Unmarshal(b, &r.authenticationID) @@ -754,7 +742,7 @@ func (r *ApiDeleteDestinationRequest) UnmarshalJSON(b []byte) error { if err != nil { return err } - if v, ok := req["destinationID"]; ok { //destinationID + if v, ok := req["destinationID"]; ok { err = json.Unmarshal(v, &r.destinationID) if err != nil { err = json.Unmarshal(b, &r.destinationID) @@ -856,7 +844,7 @@ func (r *ApiDeleteSourceRequest) UnmarshalJSON(b []byte) error { if err != nil { return err } - if v, ok := req["sourceID"]; ok { //sourceID + if v, ok := req["sourceID"]; ok { err = json.Unmarshal(v, &r.sourceID) if err != nil { err = json.Unmarshal(b, &r.sourceID) @@ -958,7 +946,7 @@ func (r *ApiDeleteTaskRequest) UnmarshalJSON(b []byte) error { if err != nil { return err } - if v, ok := req["taskID"]; ok { //taskID + if v, ok := req["taskID"]; ok { err = json.Unmarshal(v, &r.taskID) if err != nil { err = json.Unmarshal(b, &r.taskID) @@ -1060,7 +1048,7 @@ func (r *ApiDisableTaskRequest) UnmarshalJSON(b []byte) error { if err != nil { return err } - if v, ok := req["taskID"]; ok { //taskID + if v, ok := req["taskID"]; ok { err = json.Unmarshal(v, &r.taskID) if err != nil { err = json.Unmarshal(b, &r.taskID) @@ -1162,7 +1150,7 @@ func (r *ApiEnableTaskRequest) UnmarshalJSON(b []byte) error { if err != nil { return err } - if v, ok := req["taskID"]; ok { //taskID + if v, ok := req["taskID"]; ok { err = json.Unmarshal(v, &r.taskID) if err != nil { err = json.Unmarshal(b, &r.taskID) @@ -1265,7 +1253,7 @@ func (r *ApiGetRequest) UnmarshalJSON(b []byte) error { if err != nil { return err } - if v, ok := req["path"]; ok { //path + if v, ok := req["path"]; ok { err = json.Unmarshal(v, &r.path) if err != nil { err = json.Unmarshal(b, &r.path) @@ -1274,7 +1262,7 @@ func (r *ApiGetRequest) UnmarshalJSON(b []byte) error { } } } - if v, ok := req["parameters"]; ok { //parameters + if v, ok := req["parameters"]; ok { err = json.Unmarshal(v, &r.parameters) if err != nil { err = json.Unmarshal(b, &r.parameters) @@ -1415,7 +1403,7 @@ func (r *ApiGetAuthenticationRequest) UnmarshalJSON(b []byte) error { if err != nil { return err } - if v, ok := req["authenticationID"]; ok { //authenticationID + if v, ok := req["authenticationID"]; ok { err = json.Unmarshal(v, &r.authenticationID) if err != nil { err = json.Unmarshal(b, &r.authenticationID) @@ -1522,7 +1510,7 @@ func (r *ApiGetAuthenticationsRequest) UnmarshalJSON(b []byte) error { if err != nil { return err } - if v, ok := req["itemsPerPage"]; ok { //itemsPerPage + if v, ok := req["itemsPerPage"]; ok { err = json.Unmarshal(v, &r.itemsPerPage) if err != nil { err = json.Unmarshal(b, &r.itemsPerPage) @@ -1531,7 +1519,7 @@ func (r *ApiGetAuthenticationsRequest) UnmarshalJSON(b []byte) error { } } } - if v, ok := req["page"]; ok { //page + if v, ok := req["page"]; ok { err = json.Unmarshal(v, &r.page) if err != nil { err = json.Unmarshal(b, &r.page) @@ -1540,7 +1528,7 @@ func (r *ApiGetAuthenticationsRequest) UnmarshalJSON(b []byte) error { } } } - if v, ok := req["type"]; ok { //type_ + if v, ok := req["type"]; ok { err = json.Unmarshal(v, &r.type_) if err != nil { err = json.Unmarshal(b, &r.type_) @@ -1549,7 +1537,7 @@ func (r *ApiGetAuthenticationsRequest) UnmarshalJSON(b []byte) error { } } } - if v, ok := req["platform"]; ok { //platform + if v, ok := req["platform"]; ok { err = json.Unmarshal(v, &r.platform) if err != nil { err = json.Unmarshal(b, &r.platform) @@ -1558,7 +1546,7 @@ func (r *ApiGetAuthenticationsRequest) UnmarshalJSON(b []byte) error { } } } - if v, ok := req["sort"]; ok { //sort + if v, ok := req["sort"]; ok { err = json.Unmarshal(v, &r.sort) if err != nil { err = json.Unmarshal(b, &r.sort) @@ -1567,7 +1555,7 @@ func (r *ApiGetAuthenticationsRequest) UnmarshalJSON(b []byte) error { } } } - if v, ok := req["order"]; ok { //order + if v, ok := req["order"]; ok { err = json.Unmarshal(v, &r.order) if err != nil { err = json.Unmarshal(b, &r.order) @@ -1721,7 +1709,7 @@ func (r *ApiGetDestinationRequest) UnmarshalJSON(b []byte) error { if err != nil { return err } - if v, ok := req["destinationID"]; ok { //destinationID + if v, ok := req["destinationID"]; ok { err = json.Unmarshal(v, &r.destinationID) if err != nil { err = json.Unmarshal(b, &r.destinationID) @@ -1828,7 +1816,7 @@ func (r *ApiGetDestinationsRequest) UnmarshalJSON(b []byte) error { if err != nil { return err } - if v, ok := req["itemsPerPage"]; ok { //itemsPerPage + if v, ok := req["itemsPerPage"]; ok { err = json.Unmarshal(v, &r.itemsPerPage) if err != nil { err = json.Unmarshal(b, &r.itemsPerPage) @@ -1837,7 +1825,7 @@ func (r *ApiGetDestinationsRequest) UnmarshalJSON(b []byte) error { } } } - if v, ok := req["page"]; ok { //page + if v, ok := req["page"]; ok { err = json.Unmarshal(v, &r.page) if err != nil { err = json.Unmarshal(b, &r.page) @@ -1846,7 +1834,7 @@ func (r *ApiGetDestinationsRequest) UnmarshalJSON(b []byte) error { } } } - if v, ok := req["type"]; ok { //type_ + if v, ok := req["type"]; ok { err = json.Unmarshal(v, &r.type_) if err != nil { err = json.Unmarshal(b, &r.type_) @@ -1855,7 +1843,7 @@ func (r *ApiGetDestinationsRequest) UnmarshalJSON(b []byte) error { } } } - if v, ok := req["authenticationID"]; ok { //authenticationID + if v, ok := req["authenticationID"]; ok { err = json.Unmarshal(v, &r.authenticationID) if err != nil { err = json.Unmarshal(b, &r.authenticationID) @@ -1864,7 +1852,7 @@ func (r *ApiGetDestinationsRequest) UnmarshalJSON(b []byte) error { } } } - if v, ok := req["sort"]; ok { //sort + if v, ok := req["sort"]; ok { err = json.Unmarshal(v, &r.sort) if err != nil { err = json.Unmarshal(b, &r.sort) @@ -1873,7 +1861,7 @@ func (r *ApiGetDestinationsRequest) UnmarshalJSON(b []byte) error { } } } - if v, ok := req["order"]; ok { //order + if v, ok := req["order"]; ok { err = json.Unmarshal(v, &r.order) if err != nil { err = json.Unmarshal(b, &r.order) @@ -2028,7 +2016,7 @@ func (r *ApiGetEventRequest) UnmarshalJSON(b []byte) error { if err != nil { return err } - if v, ok := req["runID"]; ok { //runID + if v, ok := req["runID"]; ok { err = json.Unmarshal(v, &r.runID) if err != nil { err = json.Unmarshal(b, &r.runID) @@ -2037,7 +2025,7 @@ func (r *ApiGetEventRequest) UnmarshalJSON(b []byte) error { } } } - if v, ok := req["eventID"]; ok { //eventID + if v, ok := req["eventID"]; ok { err = json.Unmarshal(v, &r.eventID) if err != nil { err = json.Unmarshal(b, &r.eventID) @@ -2147,7 +2135,7 @@ func (r *ApiGetEventsRequest) UnmarshalJSON(b []byte) error { if err != nil { return err } - if v, ok := req["runID"]; ok { //runID + if v, ok := req["runID"]; ok { err = json.Unmarshal(v, &r.runID) if err != nil { err = json.Unmarshal(b, &r.runID) @@ -2156,7 +2144,7 @@ func (r *ApiGetEventsRequest) UnmarshalJSON(b []byte) error { } } } - if v, ok := req["itemsPerPage"]; ok { //itemsPerPage + if v, ok := req["itemsPerPage"]; ok { err = json.Unmarshal(v, &r.itemsPerPage) if err != nil { err = json.Unmarshal(b, &r.itemsPerPage) @@ -2165,7 +2153,7 @@ func (r *ApiGetEventsRequest) UnmarshalJSON(b []byte) error { } } } - if v, ok := req["page"]; ok { //page + if v, ok := req["page"]; ok { err = json.Unmarshal(v, &r.page) if err != nil { err = json.Unmarshal(b, &r.page) @@ -2174,7 +2162,7 @@ func (r *ApiGetEventsRequest) UnmarshalJSON(b []byte) error { } } } - if v, ok := req["status"]; ok { //status + if v, ok := req["status"]; ok { err = json.Unmarshal(v, &r.status) if err != nil { err = json.Unmarshal(b, &r.status) @@ -2183,7 +2171,7 @@ func (r *ApiGetEventsRequest) UnmarshalJSON(b []byte) error { } } } - if v, ok := req["type"]; ok { //type_ + if v, ok := req["type"]; ok { err = json.Unmarshal(v, &r.type_) if err != nil { err = json.Unmarshal(b, &r.type_) @@ -2192,7 +2180,7 @@ func (r *ApiGetEventsRequest) UnmarshalJSON(b []byte) error { } } } - if v, ok := req["sort"]; ok { //sort + if v, ok := req["sort"]; ok { err = json.Unmarshal(v, &r.sort) if err != nil { err = json.Unmarshal(b, &r.sort) @@ -2201,7 +2189,7 @@ func (r *ApiGetEventsRequest) UnmarshalJSON(b []byte) error { } } } - if v, ok := req["order"]; ok { //order + if v, ok := req["order"]; ok { err = json.Unmarshal(v, &r.order) if err != nil { err = json.Unmarshal(b, &r.order) @@ -2358,7 +2346,7 @@ func (r *ApiGetRunRequest) UnmarshalJSON(b []byte) error { if err != nil { return err } - if v, ok := req["runID"]; ok { //runID + if v, ok := req["runID"]; ok { err = json.Unmarshal(v, &r.runID) if err != nil { err = json.Unmarshal(b, &r.runID) @@ -2465,7 +2453,7 @@ func (r *ApiGetRunsRequest) UnmarshalJSON(b []byte) error { if err != nil { return err } - if v, ok := req["itemsPerPage"]; ok { //itemsPerPage + if v, ok := req["itemsPerPage"]; ok { err = json.Unmarshal(v, &r.itemsPerPage) if err != nil { err = json.Unmarshal(b, &r.itemsPerPage) @@ -2474,7 +2462,7 @@ func (r *ApiGetRunsRequest) UnmarshalJSON(b []byte) error { } } } - if v, ok := req["page"]; ok { //page + if v, ok := req["page"]; ok { err = json.Unmarshal(v, &r.page) if err != nil { err = json.Unmarshal(b, &r.page) @@ -2483,7 +2471,7 @@ func (r *ApiGetRunsRequest) UnmarshalJSON(b []byte) error { } } } - if v, ok := req["status"]; ok { //status + if v, ok := req["status"]; ok { err = json.Unmarshal(v, &r.status) if err != nil { err = json.Unmarshal(b, &r.status) @@ -2492,7 +2480,7 @@ func (r *ApiGetRunsRequest) UnmarshalJSON(b []byte) error { } } } - if v, ok := req["taskID"]; ok { //taskID + if v, ok := req["taskID"]; ok { err = json.Unmarshal(v, &r.taskID) if err != nil { err = json.Unmarshal(b, &r.taskID) @@ -2501,7 +2489,7 @@ func (r *ApiGetRunsRequest) UnmarshalJSON(b []byte) error { } } } - if v, ok := req["sort"]; ok { //sort + if v, ok := req["sort"]; ok { err = json.Unmarshal(v, &r.sort) if err != nil { err = json.Unmarshal(b, &r.sort) @@ -2510,7 +2498,7 @@ func (r *ApiGetRunsRequest) UnmarshalJSON(b []byte) error { } } } - if v, ok := req["order"]; ok { //order + if v, ok := req["order"]; ok { err = json.Unmarshal(v, &r.order) if err != nil { err = json.Unmarshal(b, &r.order) @@ -2664,7 +2652,7 @@ func (r *ApiGetSourceRequest) UnmarshalJSON(b []byte) error { if err != nil { return err } - if v, ok := req["sourceID"]; ok { //sourceID + if v, ok := req["sourceID"]; ok { err = json.Unmarshal(v, &r.sourceID) if err != nil { err = json.Unmarshal(b, &r.sourceID) @@ -2771,7 +2759,7 @@ func (r *ApiGetSourcesRequest) UnmarshalJSON(b []byte) error { if err != nil { return err } - if v, ok := req["itemsPerPage"]; ok { //itemsPerPage + if v, ok := req["itemsPerPage"]; ok { err = json.Unmarshal(v, &r.itemsPerPage) if err != nil { err = json.Unmarshal(b, &r.itemsPerPage) @@ -2780,7 +2768,7 @@ func (r *ApiGetSourcesRequest) UnmarshalJSON(b []byte) error { } } } - if v, ok := req["page"]; ok { //page + if v, ok := req["page"]; ok { err = json.Unmarshal(v, &r.page) if err != nil { err = json.Unmarshal(b, &r.page) @@ -2789,7 +2777,7 @@ func (r *ApiGetSourcesRequest) UnmarshalJSON(b []byte) error { } } } - if v, ok := req["type"]; ok { //type_ + if v, ok := req["type"]; ok { err = json.Unmarshal(v, &r.type_) if err != nil { err = json.Unmarshal(b, &r.type_) @@ -2798,7 +2786,7 @@ func (r *ApiGetSourcesRequest) UnmarshalJSON(b []byte) error { } } } - if v, ok := req["authenticationID"]; ok { //authenticationID + if v, ok := req["authenticationID"]; ok { err = json.Unmarshal(v, &r.authenticationID) if err != nil { err = json.Unmarshal(b, &r.authenticationID) @@ -2807,7 +2795,7 @@ func (r *ApiGetSourcesRequest) UnmarshalJSON(b []byte) error { } } } - if v, ok := req["sort"]; ok { //sort + if v, ok := req["sort"]; ok { err = json.Unmarshal(v, &r.sort) if err != nil { err = json.Unmarshal(b, &r.sort) @@ -2816,7 +2804,7 @@ func (r *ApiGetSourcesRequest) UnmarshalJSON(b []byte) error { } } } - if v, ok := req["order"]; ok { //order + if v, ok := req["order"]; ok { err = json.Unmarshal(v, &r.order) if err != nil { err = json.Unmarshal(b, &r.order) @@ -2970,7 +2958,7 @@ func (r *ApiGetTaskRequest) UnmarshalJSON(b []byte) error { if err != nil { return err } - if v, ok := req["taskID"]; ok { //taskID + if v, ok := req["taskID"]; ok { err = json.Unmarshal(v, &r.taskID) if err != nil { err = json.Unmarshal(b, &r.taskID) @@ -3080,7 +3068,7 @@ func (r *ApiGetTasksRequest) UnmarshalJSON(b []byte) error { if err != nil { return err } - if v, ok := req["itemsPerPage"]; ok { //itemsPerPage + if v, ok := req["itemsPerPage"]; ok { err = json.Unmarshal(v, &r.itemsPerPage) if err != nil { err = json.Unmarshal(b, &r.itemsPerPage) @@ -3089,7 +3077,7 @@ func (r *ApiGetTasksRequest) UnmarshalJSON(b []byte) error { } } } - if v, ok := req["page"]; ok { //page + if v, ok := req["page"]; ok { err = json.Unmarshal(v, &r.page) if err != nil { err = json.Unmarshal(b, &r.page) @@ -3098,7 +3086,7 @@ func (r *ApiGetTasksRequest) UnmarshalJSON(b []byte) error { } } } - if v, ok := req["action"]; ok { //action + if v, ok := req["action"]; ok { err = json.Unmarshal(v, &r.action) if err != nil { err = json.Unmarshal(b, &r.action) @@ -3107,7 +3095,7 @@ func (r *ApiGetTasksRequest) UnmarshalJSON(b []byte) error { } } } - if v, ok := req["enabled"]; ok { //enabled + if v, ok := req["enabled"]; ok { err = json.Unmarshal(v, &r.enabled) if err != nil { err = json.Unmarshal(b, &r.enabled) @@ -3116,7 +3104,7 @@ func (r *ApiGetTasksRequest) UnmarshalJSON(b []byte) error { } } } - if v, ok := req["sourceID"]; ok { //sourceID + if v, ok := req["sourceID"]; ok { err = json.Unmarshal(v, &r.sourceID) if err != nil { err = json.Unmarshal(b, &r.sourceID) @@ -3125,7 +3113,7 @@ func (r *ApiGetTasksRequest) UnmarshalJSON(b []byte) error { } } } - if v, ok := req["destinationID"]; ok { //destinationID + if v, ok := req["destinationID"]; ok { err = json.Unmarshal(v, &r.destinationID) if err != nil { err = json.Unmarshal(b, &r.destinationID) @@ -3134,7 +3122,7 @@ func (r *ApiGetTasksRequest) UnmarshalJSON(b []byte) error { } } } - if v, ok := req["triggerType"]; ok { //triggerType + if v, ok := req["triggerType"]; ok { err = json.Unmarshal(v, &r.triggerType) if err != nil { err = json.Unmarshal(b, &r.triggerType) @@ -3143,7 +3131,7 @@ func (r *ApiGetTasksRequest) UnmarshalJSON(b []byte) error { } } } - if v, ok := req["sort"]; ok { //sort + if v, ok := req["sort"]; ok { err = json.Unmarshal(v, &r.sort) if err != nil { err = json.Unmarshal(b, &r.sort) @@ -3152,7 +3140,7 @@ func (r *ApiGetTasksRequest) UnmarshalJSON(b []byte) error { } } } - if v, ok := req["order"]; ok { //order + if v, ok := req["order"]; ok { err = json.Unmarshal(v, &r.order) if err != nil { err = json.Unmarshal(b, &r.order) @@ -3335,7 +3323,7 @@ func (r *ApiPostRequest) UnmarshalJSON(b []byte) error { if err != nil { return err } - if v, ok := req["path"]; ok { //path + if v, ok := req["path"]; ok { err = json.Unmarshal(v, &r.path) if err != nil { err = json.Unmarshal(b, &r.path) @@ -3344,7 +3332,7 @@ func (r *ApiPostRequest) UnmarshalJSON(b []byte) error { } } } - if v, ok := req["parameters"]; ok { //parameters + if v, ok := req["parameters"]; ok { err = json.Unmarshal(v, &r.parameters) if err != nil { err = json.Unmarshal(b, &r.parameters) @@ -3353,7 +3341,7 @@ func (r *ApiPostRequest) UnmarshalJSON(b []byte) error { } } } - if v, ok := req["body"]; ok { //body + if v, ok := req["body"]; ok { err = json.Unmarshal(v, &r.body) if err != nil { err = json.Unmarshal(b, &r.body) @@ -3508,7 +3496,7 @@ func (r *ApiPutRequest) UnmarshalJSON(b []byte) error { if err != nil { return err } - if v, ok := req["path"]; ok { //path + if v, ok := req["path"]; ok { err = json.Unmarshal(v, &r.path) if err != nil { err = json.Unmarshal(b, &r.path) @@ -3517,7 +3505,7 @@ func (r *ApiPutRequest) UnmarshalJSON(b []byte) error { } } } - if v, ok := req["parameters"]; ok { //parameters + if v, ok := req["parameters"]; ok { err = json.Unmarshal(v, &r.parameters) if err != nil { err = json.Unmarshal(b, &r.parameters) @@ -3526,7 +3514,7 @@ func (r *ApiPutRequest) UnmarshalJSON(b []byte) error { } } } - if v, ok := req["body"]; ok { //body + if v, ok := req["body"]; ok { err = json.Unmarshal(v, &r.body) if err != nil { err = json.Unmarshal(b, &r.body) @@ -3679,7 +3667,7 @@ func (r *ApiRunTaskRequest) UnmarshalJSON(b []byte) error { if err != nil { return err } - if v, ok := req["taskID"]; ok { //taskID + if v, ok := req["taskID"]; ok { err = json.Unmarshal(v, &r.taskID) if err != nil { err = json.Unmarshal(b, &r.taskID) @@ -3781,7 +3769,7 @@ func (r *ApiSearchAuthenticationsRequest) UnmarshalJSON(b []byte) error { if err != nil { return err } - if v, ok := req["authenticationSearch"]; ok { //authenticationSearch + if v, ok := req["authenticationSearch"]; ok { err = json.Unmarshal(v, &r.authenticationSearch) if err != nil { err = json.Unmarshal(b, &r.authenticationSearch) @@ -3799,14 +3787,11 @@ func (r *ApiSearchAuthenticationsRequest) UnmarshalJSON(b []byte) error { return nil } -func (r ApiSearchAuthenticationsRequest) WithAuthenticationSearch(authenticationSearch *AuthenticationSearch) ApiSearchAuthenticationsRequest { - r.authenticationSearch = authenticationSearch - return r -} - // @return ApiSearchAuthenticationsRequest -func (c *APIClient) NewApiSearchAuthenticationsRequest() ApiSearchAuthenticationsRequest { - return ApiSearchAuthenticationsRequest{} +func (c *APIClient) NewApiSearchAuthenticationsRequest(authenticationSearch *AuthenticationSearch) ApiSearchAuthenticationsRequest { + return ApiSearchAuthenticationsRequest{ + authenticationSearch: authenticationSearch, + } } // SearchAuthentications wraps SearchAuthenticationsWithContext using context.Background. @@ -3895,7 +3880,7 @@ func (r *ApiSearchDestinationsRequest) UnmarshalJSON(b []byte) error { if err != nil { return err } - if v, ok := req["destinationSearch"]; ok { //destinationSearch + if v, ok := req["destinationSearch"]; ok { err = json.Unmarshal(v, &r.destinationSearch) if err != nil { err = json.Unmarshal(b, &r.destinationSearch) @@ -3913,14 +3898,11 @@ func (r *ApiSearchDestinationsRequest) UnmarshalJSON(b []byte) error { return nil } -func (r ApiSearchDestinationsRequest) WithDestinationSearch(destinationSearch *DestinationSearch) ApiSearchDestinationsRequest { - r.destinationSearch = destinationSearch - return r -} - // @return ApiSearchDestinationsRequest -func (c *APIClient) NewApiSearchDestinationsRequest() ApiSearchDestinationsRequest { - return ApiSearchDestinationsRequest{} +func (c *APIClient) NewApiSearchDestinationsRequest(destinationSearch *DestinationSearch) ApiSearchDestinationsRequest { + return ApiSearchDestinationsRequest{ + destinationSearch: destinationSearch, + } } // SearchDestinations wraps SearchDestinationsWithContext using context.Background. @@ -4009,7 +3991,7 @@ func (r *ApiSearchSourcesRequest) UnmarshalJSON(b []byte) error { if err != nil { return err } - if v, ok := req["sourceSearch"]; ok { //sourceSearch + if v, ok := req["sourceSearch"]; ok { err = json.Unmarshal(v, &r.sourceSearch) if err != nil { err = json.Unmarshal(b, &r.sourceSearch) @@ -4027,14 +4009,11 @@ func (r *ApiSearchSourcesRequest) UnmarshalJSON(b []byte) error { return nil } -func (r ApiSearchSourcesRequest) WithSourceSearch(sourceSearch *SourceSearch) ApiSearchSourcesRequest { - r.sourceSearch = sourceSearch - return r -} - // @return ApiSearchSourcesRequest -func (c *APIClient) NewApiSearchSourcesRequest() ApiSearchSourcesRequest { - return ApiSearchSourcesRequest{} +func (c *APIClient) NewApiSearchSourcesRequest(sourceSearch *SourceSearch) ApiSearchSourcesRequest { + return ApiSearchSourcesRequest{ + sourceSearch: sourceSearch, + } } // SearchSources wraps SearchSourcesWithContext using context.Background. @@ -4123,7 +4102,7 @@ func (r *ApiSearchTasksRequest) UnmarshalJSON(b []byte) error { if err != nil { return err } - if v, ok := req["taskSearch"]; ok { //taskSearch + if v, ok := req["taskSearch"]; ok { err = json.Unmarshal(v, &r.taskSearch) if err != nil { err = json.Unmarshal(b, &r.taskSearch) @@ -4141,14 +4120,11 @@ func (r *ApiSearchTasksRequest) UnmarshalJSON(b []byte) error { return nil } -func (r ApiSearchTasksRequest) WithTaskSearch(taskSearch *TaskSearch) ApiSearchTasksRequest { - r.taskSearch = taskSearch - return r -} - // @return ApiSearchTasksRequest -func (c *APIClient) NewApiSearchTasksRequest() ApiSearchTasksRequest { - return ApiSearchTasksRequest{} +func (c *APIClient) NewApiSearchTasksRequest(taskSearch *TaskSearch) ApiSearchTasksRequest { + return ApiSearchTasksRequest{ + taskSearch: taskSearch, + } } // SearchTasks wraps SearchTasksWithContext using context.Background. @@ -4238,7 +4214,7 @@ func (r *ApiUpdateAuthenticationRequest) UnmarshalJSON(b []byte) error { if err != nil { return err } - if v, ok := req["authenticationID"]; ok { //authenticationID + if v, ok := req["authenticationID"]; ok { err = json.Unmarshal(v, &r.authenticationID) if err != nil { err = json.Unmarshal(b, &r.authenticationID) @@ -4247,7 +4223,7 @@ func (r *ApiUpdateAuthenticationRequest) UnmarshalJSON(b []byte) error { } } } - if v, ok := req["authenticationUpdate"]; ok { //authenticationUpdate + if v, ok := req["authenticationUpdate"]; ok { err = json.Unmarshal(v, &r.authenticationUpdate) if err != nil { err = json.Unmarshal(b, &r.authenticationUpdate) @@ -4265,15 +4241,11 @@ func (r *ApiUpdateAuthenticationRequest) UnmarshalJSON(b []byte) error { return nil } -func (r ApiUpdateAuthenticationRequest) WithAuthenticationUpdate(authenticationUpdate *AuthenticationUpdate) ApiUpdateAuthenticationRequest { - r.authenticationUpdate = authenticationUpdate - return r -} - // @return ApiUpdateAuthenticationRequest -func (c *APIClient) NewApiUpdateAuthenticationRequest(authenticationID string) ApiUpdateAuthenticationRequest { +func (c *APIClient) NewApiUpdateAuthenticationRequest(authenticationID string, authenticationUpdate *AuthenticationUpdate) ApiUpdateAuthenticationRequest { return ApiUpdateAuthenticationRequest{ - authenticationID: authenticationID, + authenticationID: authenticationID, + authenticationUpdate: authenticationUpdate, } } @@ -4365,7 +4337,7 @@ func (r *ApiUpdateDestinationRequest) UnmarshalJSON(b []byte) error { if err != nil { return err } - if v, ok := req["destinationID"]; ok { //destinationID + if v, ok := req["destinationID"]; ok { err = json.Unmarshal(v, &r.destinationID) if err != nil { err = json.Unmarshal(b, &r.destinationID) @@ -4374,7 +4346,7 @@ func (r *ApiUpdateDestinationRequest) UnmarshalJSON(b []byte) error { } } } - if v, ok := req["destinationUpdate"]; ok { //destinationUpdate + if v, ok := req["destinationUpdate"]; ok { err = json.Unmarshal(v, &r.destinationUpdate) if err != nil { err = json.Unmarshal(b, &r.destinationUpdate) @@ -4392,15 +4364,11 @@ func (r *ApiUpdateDestinationRequest) UnmarshalJSON(b []byte) error { return nil } -func (r ApiUpdateDestinationRequest) WithDestinationUpdate(destinationUpdate *DestinationUpdate) ApiUpdateDestinationRequest { - r.destinationUpdate = destinationUpdate - return r -} - // @return ApiUpdateDestinationRequest -func (c *APIClient) NewApiUpdateDestinationRequest(destinationID string) ApiUpdateDestinationRequest { +func (c *APIClient) NewApiUpdateDestinationRequest(destinationID string, destinationUpdate *DestinationUpdate) ApiUpdateDestinationRequest { return ApiUpdateDestinationRequest{ - destinationID: destinationID, + destinationID: destinationID, + destinationUpdate: destinationUpdate, } } @@ -4492,7 +4460,7 @@ func (r *ApiUpdateSourceRequest) UnmarshalJSON(b []byte) error { if err != nil { return err } - if v, ok := req["sourceID"]; ok { //sourceID + if v, ok := req["sourceID"]; ok { err = json.Unmarshal(v, &r.sourceID) if err != nil { err = json.Unmarshal(b, &r.sourceID) @@ -4501,7 +4469,7 @@ func (r *ApiUpdateSourceRequest) UnmarshalJSON(b []byte) error { } } } - if v, ok := req["sourceUpdate"]; ok { //sourceUpdate + if v, ok := req["sourceUpdate"]; ok { err = json.Unmarshal(v, &r.sourceUpdate) if err != nil { err = json.Unmarshal(b, &r.sourceUpdate) @@ -4519,15 +4487,11 @@ func (r *ApiUpdateSourceRequest) UnmarshalJSON(b []byte) error { return nil } -func (r ApiUpdateSourceRequest) WithSourceUpdate(sourceUpdate *SourceUpdate) ApiUpdateSourceRequest { - r.sourceUpdate = sourceUpdate - return r -} - // @return ApiUpdateSourceRequest -func (c *APIClient) NewApiUpdateSourceRequest(sourceID string) ApiUpdateSourceRequest { +func (c *APIClient) NewApiUpdateSourceRequest(sourceID string, sourceUpdate *SourceUpdate) ApiUpdateSourceRequest { return ApiUpdateSourceRequest{ - sourceID: sourceID, + sourceID: sourceID, + sourceUpdate: sourceUpdate, } } @@ -4619,7 +4583,7 @@ func (r *ApiUpdateTaskRequest) UnmarshalJSON(b []byte) error { if err != nil { return err } - if v, ok := req["taskID"]; ok { //taskID + if v, ok := req["taskID"]; ok { err = json.Unmarshal(v, &r.taskID) if err != nil { err = json.Unmarshal(b, &r.taskID) @@ -4628,7 +4592,7 @@ func (r *ApiUpdateTaskRequest) UnmarshalJSON(b []byte) error { } } } - if v, ok := req["taskUpdate"]; ok { //taskUpdate + if v, ok := req["taskUpdate"]; ok { err = json.Unmarshal(v, &r.taskUpdate) if err != nil { err = json.Unmarshal(b, &r.taskUpdate) @@ -4646,15 +4610,11 @@ func (r *ApiUpdateTaskRequest) UnmarshalJSON(b []byte) error { return nil } -func (r ApiUpdateTaskRequest) WithTaskUpdate(taskUpdate *TaskUpdate) ApiUpdateTaskRequest { - r.taskUpdate = taskUpdate - return r -} - // @return ApiUpdateTaskRequest -func (c *APIClient) NewApiUpdateTaskRequest(taskID string) ApiUpdateTaskRequest { +func (c *APIClient) NewApiUpdateTaskRequest(taskID string, taskUpdate *TaskUpdate) ApiUpdateTaskRequest { return ApiUpdateTaskRequest{ - taskID: taskID, + taskID: taskID, + taskUpdate: taskUpdate, } } diff --git a/clients/algoliasearch-client-go/algolia/insights/api_insights.go b/clients/algoliasearch-client-go/algolia/insights/api_insights.go index d63c3b493b..1fd4c26409 100644 --- a/clients/algoliasearch-client-go/algolia/insights/api_insights.go +++ b/clients/algoliasearch-client-go/algolia/insights/api_insights.go @@ -46,7 +46,7 @@ func (r *ApiDelRequest) UnmarshalJSON(b []byte) error { if err != nil { return err } - if v, ok := req["path"]; ok { //path + if v, ok := req["path"]; ok { err = json.Unmarshal(v, &r.path) if err != nil { err = json.Unmarshal(b, &r.path) @@ -55,7 +55,7 @@ func (r *ApiDelRequest) UnmarshalJSON(b []byte) error { } } } - if v, ok := req["parameters"]; ok { //parameters + if v, ok := req["parameters"]; ok { err = json.Unmarshal(v, &r.parameters) if err != nil { err = json.Unmarshal(b, &r.parameters) @@ -197,7 +197,7 @@ func (r *ApiGetRequest) UnmarshalJSON(b []byte) error { if err != nil { return err } - if v, ok := req["path"]; ok { //path + if v, ok := req["path"]; ok { err = json.Unmarshal(v, &r.path) if err != nil { err = json.Unmarshal(b, &r.path) @@ -206,7 +206,7 @@ func (r *ApiGetRequest) UnmarshalJSON(b []byte) error { } } } - if v, ok := req["parameters"]; ok { //parameters + if v, ok := req["parameters"]; ok { err = json.Unmarshal(v, &r.parameters) if err != nil { err = json.Unmarshal(b, &r.parameters) @@ -349,7 +349,7 @@ func (r *ApiPostRequest) UnmarshalJSON(b []byte) error { if err != nil { return err } - if v, ok := req["path"]; ok { //path + if v, ok := req["path"]; ok { err = json.Unmarshal(v, &r.path) if err != nil { err = json.Unmarshal(b, &r.path) @@ -358,7 +358,7 @@ func (r *ApiPostRequest) UnmarshalJSON(b []byte) error { } } } - if v, ok := req["parameters"]; ok { //parameters + if v, ok := req["parameters"]; ok { err = json.Unmarshal(v, &r.parameters) if err != nil { err = json.Unmarshal(b, &r.parameters) @@ -367,7 +367,7 @@ func (r *ApiPostRequest) UnmarshalJSON(b []byte) error { } } } - if v, ok := req["body"]; ok { //body + if v, ok := req["body"]; ok { err = json.Unmarshal(v, &r.body) if err != nil { err = json.Unmarshal(b, &r.body) @@ -520,7 +520,7 @@ func (r *ApiPushEventsRequest) UnmarshalJSON(b []byte) error { if err != nil { return err } - if v, ok := req["insightEvents"]; ok { //insightEvents + if v, ok := req["insightEvents"]; ok { err = json.Unmarshal(v, &r.insightEvents) if err != nil { err = json.Unmarshal(b, &r.insightEvents) @@ -538,14 +538,11 @@ func (r *ApiPushEventsRequest) UnmarshalJSON(b []byte) error { return nil } -func (r ApiPushEventsRequest) WithInsightEvents(insightEvents *InsightEvents) ApiPushEventsRequest { - r.insightEvents = insightEvents - return r -} - // @return ApiPushEventsRequest -func (c *APIClient) NewApiPushEventsRequest() ApiPushEventsRequest { - return ApiPushEventsRequest{} +func (c *APIClient) NewApiPushEventsRequest(insightEvents *InsightEvents) ApiPushEventsRequest { + return ApiPushEventsRequest{ + insightEvents: insightEvents, + } } // PushEvents wraps PushEventsWithContext using context.Background. @@ -663,7 +660,7 @@ func (r *ApiPutRequest) UnmarshalJSON(b []byte) error { if err != nil { return err } - if v, ok := req["path"]; ok { //path + if v, ok := req["path"]; ok { err = json.Unmarshal(v, &r.path) if err != nil { err = json.Unmarshal(b, &r.path) @@ -672,7 +669,7 @@ func (r *ApiPutRequest) UnmarshalJSON(b []byte) error { } } } - if v, ok := req["parameters"]; ok { //parameters + if v, ok := req["parameters"]; ok { err = json.Unmarshal(v, &r.parameters) if err != nil { err = json.Unmarshal(b, &r.parameters) @@ -681,7 +678,7 @@ func (r *ApiPutRequest) UnmarshalJSON(b []byte) error { } } } - if v, ok := req["body"]; ok { //body + if v, ok := req["body"]; ok { err = json.Unmarshal(v, &r.body) if err != nil { err = json.Unmarshal(b, &r.body) diff --git a/clients/algoliasearch-client-go/algolia/personalization/api_personalization.go b/clients/algoliasearch-client-go/algolia/personalization/api_personalization.go index 0526db41c4..7358e5592a 100644 --- a/clients/algoliasearch-client-go/algolia/personalization/api_personalization.go +++ b/clients/algoliasearch-client-go/algolia/personalization/api_personalization.go @@ -46,7 +46,7 @@ func (r *ApiDelRequest) UnmarshalJSON(b []byte) error { if err != nil { return err } - if v, ok := req["path"]; ok { //path + if v, ok := req["path"]; ok { err = json.Unmarshal(v, &r.path) if err != nil { err = json.Unmarshal(b, &r.path) @@ -55,7 +55,7 @@ func (r *ApiDelRequest) UnmarshalJSON(b []byte) error { } } } - if v, ok := req["parameters"]; ok { //parameters + if v, ok := req["parameters"]; ok { err = json.Unmarshal(v, &r.parameters) if err != nil { err = json.Unmarshal(b, &r.parameters) @@ -196,7 +196,7 @@ func (r *ApiDeleteUserProfileRequest) UnmarshalJSON(b []byte) error { if err != nil { return err } - if v, ok := req["userToken"]; ok { //userToken + if v, ok := req["userToken"]; ok { err = json.Unmarshal(v, &r.userToken) if err != nil { err = json.Unmarshal(b, &r.userToken) @@ -326,7 +326,7 @@ func (r *ApiGetRequest) UnmarshalJSON(b []byte) error { if err != nil { return err } - if v, ok := req["path"]; ok { //path + if v, ok := req["path"]; ok { err = json.Unmarshal(v, &r.path) if err != nil { err = json.Unmarshal(b, &r.path) @@ -335,7 +335,7 @@ func (r *ApiGetRequest) UnmarshalJSON(b []byte) error { } } } - if v, ok := req["parameters"]; ok { //parameters + if v, ok := req["parameters"]; ok { err = json.Unmarshal(v, &r.parameters) if err != nil { err = json.Unmarshal(b, &r.parameters) @@ -466,31 +466,13 @@ func (c *APIClient) GetWithContext(ctx context.Context, r ApiGetRequest, opts .. return returnValue, nil } -type ApiGetPersonalizationStrategyRequest struct { -} - -func (r *ApiGetPersonalizationStrategyRequest) UnmarshalJSON(b []byte) error { - req := map[string]json.RawMessage{} - err := json.Unmarshal(b, &req) - if err != nil { - return err - } - - return nil -} - -// @return ApiGetPersonalizationStrategyRequest -func (c *APIClient) NewApiGetPersonalizationStrategyRequest() ApiGetPersonalizationStrategyRequest { - return ApiGetPersonalizationStrategyRequest{} -} - // GetPersonalizationStrategy wraps GetPersonalizationStrategyWithContext using context.Background. -func (c *APIClient) GetPersonalizationStrategy(r ApiGetPersonalizationStrategyRequest, opts ...Option) (*PersonalizationStrategyParams, error) { - return c.GetPersonalizationStrategyWithContext(context.Background(), r, opts...) +func (c *APIClient) GetPersonalizationStrategy(opts ...Option) (*PersonalizationStrategyParams, error) { + return c.GetPersonalizationStrategyWithContext(context.Background(), opts...) } // @return PersonalizationStrategyParams -func (c *APIClient) GetPersonalizationStrategyWithContext(ctx context.Context, r ApiGetPersonalizationStrategyRequest, opts ...Option) (*PersonalizationStrategyParams, error) { +func (c *APIClient) GetPersonalizationStrategyWithContext(ctx context.Context, opts ...Option) (*PersonalizationStrategyParams, error) { var ( postBody any returnValue *PersonalizationStrategyParams @@ -592,7 +574,7 @@ func (r *ApiGetUserTokenProfileRequest) UnmarshalJSON(b []byte) error { if err != nil { return err } - if v, ok := req["userToken"]; ok { //userToken + if v, ok := req["userToken"]; ok { err = json.Unmarshal(v, &r.userToken) if err != nil { err = json.Unmarshal(b, &r.userToken) @@ -723,7 +705,7 @@ func (r *ApiPostRequest) UnmarshalJSON(b []byte) error { if err != nil { return err } - if v, ok := req["path"]; ok { //path + if v, ok := req["path"]; ok { err = json.Unmarshal(v, &r.path) if err != nil { err = json.Unmarshal(b, &r.path) @@ -732,7 +714,7 @@ func (r *ApiPostRequest) UnmarshalJSON(b []byte) error { } } } - if v, ok := req["parameters"]; ok { //parameters + if v, ok := req["parameters"]; ok { err = json.Unmarshal(v, &r.parameters) if err != nil { err = json.Unmarshal(b, &r.parameters) @@ -741,7 +723,7 @@ func (r *ApiPostRequest) UnmarshalJSON(b []byte) error { } } } - if v, ok := req["body"]; ok { //body + if v, ok := req["body"]; ok { err = json.Unmarshal(v, &r.body) if err != nil { err = json.Unmarshal(b, &r.body) @@ -896,7 +878,7 @@ func (r *ApiPutRequest) UnmarshalJSON(b []byte) error { if err != nil { return err } - if v, ok := req["path"]; ok { //path + if v, ok := req["path"]; ok { err = json.Unmarshal(v, &r.path) if err != nil { err = json.Unmarshal(b, &r.path) @@ -905,7 +887,7 @@ func (r *ApiPutRequest) UnmarshalJSON(b []byte) error { } } } - if v, ok := req["parameters"]; ok { //parameters + if v, ok := req["parameters"]; ok { err = json.Unmarshal(v, &r.parameters) if err != nil { err = json.Unmarshal(b, &r.parameters) @@ -914,7 +896,7 @@ func (r *ApiPutRequest) UnmarshalJSON(b []byte) error { } } } - if v, ok := req["body"]; ok { //body + if v, ok := req["body"]; ok { err = json.Unmarshal(v, &r.body) if err != nil { err = json.Unmarshal(b, &r.body) @@ -1067,7 +1049,7 @@ func (r *ApiSetPersonalizationStrategyRequest) UnmarshalJSON(b []byte) error { if err != nil { return err } - if v, ok := req["personalizationStrategyParams"]; ok { //personalizationStrategyParams + if v, ok := req["personalizationStrategyParams"]; ok { err = json.Unmarshal(v, &r.personalizationStrategyParams) if err != nil { err = json.Unmarshal(b, &r.personalizationStrategyParams) @@ -1085,14 +1067,11 @@ func (r *ApiSetPersonalizationStrategyRequest) UnmarshalJSON(b []byte) error { return nil } -func (r ApiSetPersonalizationStrategyRequest) WithPersonalizationStrategyParams(personalizationStrategyParams *PersonalizationStrategyParams) ApiSetPersonalizationStrategyRequest { - r.personalizationStrategyParams = personalizationStrategyParams - return r -} - // @return ApiSetPersonalizationStrategyRequest -func (c *APIClient) NewApiSetPersonalizationStrategyRequest() ApiSetPersonalizationStrategyRequest { - return ApiSetPersonalizationStrategyRequest{} +func (c *APIClient) NewApiSetPersonalizationStrategyRequest(personalizationStrategyParams *PersonalizationStrategyParams) ApiSetPersonalizationStrategyRequest { + return ApiSetPersonalizationStrategyRequest{ + personalizationStrategyParams: personalizationStrategyParams, + } } // SetPersonalizationStrategy wraps SetPersonalizationStrategyWithContext using context.Background. diff --git a/clients/algoliasearch-client-go/algolia/predict/api_predict.go b/clients/algoliasearch-client-go/algolia/predict/api_predict.go index c69fc590dc..9b947bcbb9 100644 --- a/clients/algoliasearch-client-go/algolia/predict/api_predict.go +++ b/clients/algoliasearch-client-go/algolia/predict/api_predict.go @@ -45,7 +45,7 @@ func (r *ApiActivateModelInstanceRequest) UnmarshalJSON(b []byte) error { if err != nil { return err } - if v, ok := req["activateModelParams"]; ok { //activateModelParams + if v, ok := req["activateModelParams"]; ok { err = json.Unmarshal(v, &r.activateModelParams) if err != nil { err = json.Unmarshal(b, &r.activateModelParams) @@ -63,14 +63,11 @@ func (r *ApiActivateModelInstanceRequest) UnmarshalJSON(b []byte) error { return nil } -func (r ApiActivateModelInstanceRequest) WithActivateModelParams(activateModelParams *ActivateModelParams) ApiActivateModelInstanceRequest { - r.activateModelParams = activateModelParams - return r -} - // @return ApiActivateModelInstanceRequest -func (c *APIClient) NewApiActivateModelInstanceRequest() ApiActivateModelInstanceRequest { - return ApiActivateModelInstanceRequest{} +func (c *APIClient) NewApiActivateModelInstanceRequest(activateModelParams *ActivateModelParams) ApiActivateModelInstanceRequest { + return ApiActivateModelInstanceRequest{ + activateModelParams: activateModelParams, + } } // ActivateModelInstance wraps ActivateModelInstanceWithContext using context.Background. @@ -177,7 +174,7 @@ func (r *ApiCreateSegmentRequest) UnmarshalJSON(b []byte) error { if err != nil { return err } - if v, ok := req["createSegmentParams"]; ok { //createSegmentParams + if v, ok := req["createSegmentParams"]; ok { err = json.Unmarshal(v, &r.createSegmentParams) if err != nil { err = json.Unmarshal(b, &r.createSegmentParams) @@ -195,14 +192,11 @@ func (r *ApiCreateSegmentRequest) UnmarshalJSON(b []byte) error { return nil } -func (r ApiCreateSegmentRequest) WithCreateSegmentParams(createSegmentParams *CreateSegmentParams) ApiCreateSegmentRequest { - r.createSegmentParams = createSegmentParams - return r -} - // @return ApiCreateSegmentRequest -func (c *APIClient) NewApiCreateSegmentRequest() ApiCreateSegmentRequest { - return ApiCreateSegmentRequest{} +func (c *APIClient) NewApiCreateSegmentRequest(createSegmentParams *CreateSegmentParams) ApiCreateSegmentRequest { + return ApiCreateSegmentRequest{ + createSegmentParams: createSegmentParams, + } } // CreateSegment wraps CreateSegmentWithContext using context.Background. @@ -319,7 +313,7 @@ func (r *ApiDelRequest) UnmarshalJSON(b []byte) error { if err != nil { return err } - if v, ok := req["path"]; ok { //path + if v, ok := req["path"]; ok { err = json.Unmarshal(v, &r.path) if err != nil { err = json.Unmarshal(b, &r.path) @@ -328,7 +322,7 @@ func (r *ApiDelRequest) UnmarshalJSON(b []byte) error { } } } - if v, ok := req["parameters"]; ok { //parameters + if v, ok := req["parameters"]; ok { err = json.Unmarshal(v, &r.parameters) if err != nil { err = json.Unmarshal(b, &r.parameters) @@ -469,7 +463,7 @@ func (r *ApiDeleteModelInstanceRequest) UnmarshalJSON(b []byte) error { if err != nil { return err } - if v, ok := req["modelID"]; ok { //modelID + if v, ok := req["modelID"]; ok { err = json.Unmarshal(v, &r.modelID) if err != nil { err = json.Unmarshal(b, &r.modelID) @@ -598,7 +592,7 @@ func (r *ApiDeleteSegmentRequest) UnmarshalJSON(b []byte) error { if err != nil { return err } - if v, ok := req["segmentID"]; ok { //segmentID + if v, ok := req["segmentID"]; ok { err = json.Unmarshal(v, &r.segmentID) if err != nil { err = json.Unmarshal(b, &r.segmentID) @@ -727,7 +721,7 @@ func (r *ApiDeleteUserProfileRequest) UnmarshalJSON(b []byte) error { if err != nil { return err } - if v, ok := req["userID"]; ok { //userID + if v, ok := req["userID"]; ok { err = json.Unmarshal(v, &r.userID) if err != nil { err = json.Unmarshal(b, &r.userID) @@ -856,7 +850,7 @@ func (r *ApiFetchAllSegmentsRequest) UnmarshalJSON(b []byte) error { if err != nil { return err } - if v, ok := req["type"]; ok { //type_ + if v, ok := req["type"]; ok { err = json.Unmarshal(v, &r.type_) if err != nil { err = json.Unmarshal(b, &r.type_) @@ -983,7 +977,7 @@ func (r *ApiFetchAllUserProfilesRequest) UnmarshalJSON(b []byte) error { if err != nil { return err } - if v, ok := req["fetchAllUserProfilesParams"]; ok { //fetchAllUserProfilesParams + if v, ok := req["fetchAllUserProfilesParams"]; ok { err = json.Unmarshal(v, &r.fetchAllUserProfilesParams) if err != nil { err = json.Unmarshal(b, &r.fetchAllUserProfilesParams) @@ -1001,14 +995,11 @@ func (r *ApiFetchAllUserProfilesRequest) UnmarshalJSON(b []byte) error { return nil } -func (r ApiFetchAllUserProfilesRequest) WithFetchAllUserProfilesParams(fetchAllUserProfilesParams *FetchAllUserProfilesParams) ApiFetchAllUserProfilesRequest { - r.fetchAllUserProfilesParams = fetchAllUserProfilesParams - return r -} - // @return ApiFetchAllUserProfilesRequest -func (c *APIClient) NewApiFetchAllUserProfilesRequest() ApiFetchAllUserProfilesRequest { - return ApiFetchAllUserProfilesRequest{} +func (c *APIClient) NewApiFetchAllUserProfilesRequest(fetchAllUserProfilesParams *FetchAllUserProfilesParams) ApiFetchAllUserProfilesRequest { + return ApiFetchAllUserProfilesRequest{ + fetchAllUserProfilesParams: fetchAllUserProfilesParams, + } } // FetchAllUserProfiles wraps FetchAllUserProfilesWithContext using context.Background. @@ -1124,7 +1115,7 @@ func (r *ApiFetchSegmentRequest) UnmarshalJSON(b []byte) error { if err != nil { return err } - if v, ok := req["segmentID"]; ok { //segmentID + if v, ok := req["segmentID"]; ok { err = json.Unmarshal(v, &r.segmentID) if err != nil { err = json.Unmarshal(b, &r.segmentID) @@ -1245,7 +1236,7 @@ func (r *ApiFetchUserProfileRequest) UnmarshalJSON(b []byte) error { if err != nil { return err } - if v, ok := req["userID"]; ok { //userID + if v, ok := req["userID"]; ok { err = json.Unmarshal(v, &r.userID) if err != nil { err = json.Unmarshal(b, &r.userID) @@ -1254,7 +1245,7 @@ func (r *ApiFetchUserProfileRequest) UnmarshalJSON(b []byte) error { } } } - if v, ok := req["params"]; ok { //params + if v, ok := req["params"]; ok { err = json.Unmarshal(v, &r.params) if err != nil { err = json.Unmarshal(b, &r.params) @@ -1272,15 +1263,11 @@ func (r *ApiFetchUserProfileRequest) UnmarshalJSON(b []byte) error { return nil } -func (r ApiFetchUserProfileRequest) WithParams(params *Params) ApiFetchUserProfileRequest { - r.params = params - return r -} - // @return ApiFetchUserProfileRequest -func (c *APIClient) NewApiFetchUserProfileRequest(userID string) ApiFetchUserProfileRequest { +func (c *APIClient) NewApiFetchUserProfileRequest(userID string, params *Params) ApiFetchUserProfileRequest { return ApiFetchUserProfileRequest{ userID: userID, + params: params, } } @@ -1390,7 +1377,7 @@ func (r *ApiGetRequest) UnmarshalJSON(b []byte) error { if err != nil { return err } - if v, ok := req["path"]; ok { //path + if v, ok := req["path"]; ok { err = json.Unmarshal(v, &r.path) if err != nil { err = json.Unmarshal(b, &r.path) @@ -1399,7 +1386,7 @@ func (r *ApiGetRequest) UnmarshalJSON(b []byte) error { } } } - if v, ok := req["parameters"]; ok { //parameters + if v, ok := req["parameters"]; ok { err = json.Unmarshal(v, &r.parameters) if err != nil { err = json.Unmarshal(b, &r.parameters) @@ -1530,31 +1517,13 @@ func (c *APIClient) GetWithContext(ctx context.Context, r ApiGetRequest, opts .. return returnValue, nil } -type ApiGetAvailableModelTypesRequest struct { -} - -func (r *ApiGetAvailableModelTypesRequest) UnmarshalJSON(b []byte) error { - req := map[string]json.RawMessage{} - err := json.Unmarshal(b, &req) - if err != nil { - return err - } - - return nil -} - -// @return ApiGetAvailableModelTypesRequest -func (c *APIClient) NewApiGetAvailableModelTypesRequest() ApiGetAvailableModelTypesRequest { - return ApiGetAvailableModelTypesRequest{} -} - // GetAvailableModelTypes wraps GetAvailableModelTypesWithContext using context.Background. -func (c *APIClient) GetAvailableModelTypes(r ApiGetAvailableModelTypesRequest, opts ...Option) ([]GetAvailableModelTypesResponseInner, error) { - return c.GetAvailableModelTypesWithContext(context.Background(), r, opts...) +func (c *APIClient) GetAvailableModelTypes(opts ...Option) ([]GetAvailableModelTypesResponseInner, error) { + return c.GetAvailableModelTypesWithContext(context.Background(), opts...) } // @return []GetAvailableModelTypesResponseInner -func (c *APIClient) GetAvailableModelTypesWithContext(ctx context.Context, r ApiGetAvailableModelTypesRequest, opts ...Option) ([]GetAvailableModelTypesResponseInner, error) { +func (c *APIClient) GetAvailableModelTypesWithContext(ctx context.Context, opts ...Option) ([]GetAvailableModelTypesResponseInner, error) { var ( postBody any returnValue []GetAvailableModelTypesResponseInner @@ -1647,7 +1616,7 @@ func (r *ApiGetModelInstanceConfigRequest) UnmarshalJSON(b []byte) error { if err != nil { return err } - if v, ok := req["modelID"]; ok { //modelID + if v, ok := req["modelID"]; ok { err = json.Unmarshal(v, &r.modelID) if err != nil { err = json.Unmarshal(b, &r.modelID) @@ -1766,31 +1735,13 @@ func (c *APIClient) GetModelInstanceConfigWithContext(ctx context.Context, r Api return returnValue, nil } -type ApiGetModelInstancesRequest struct { -} - -func (r *ApiGetModelInstancesRequest) UnmarshalJSON(b []byte) error { - req := map[string]json.RawMessage{} - err := json.Unmarshal(b, &req) - if err != nil { - return err - } - - return nil -} - -// @return ApiGetModelInstancesRequest -func (c *APIClient) NewApiGetModelInstancesRequest() ApiGetModelInstancesRequest { - return ApiGetModelInstancesRequest{} -} - // GetModelInstances wraps GetModelInstancesWithContext using context.Background. -func (c *APIClient) GetModelInstances(r ApiGetModelInstancesRequest, opts ...Option) ([]ModelInstance, error) { - return c.GetModelInstancesWithContext(context.Background(), r, opts...) +func (c *APIClient) GetModelInstances(opts ...Option) ([]ModelInstance, error) { + return c.GetModelInstancesWithContext(context.Background(), opts...) } // @return []ModelInstance -func (c *APIClient) GetModelInstancesWithContext(ctx context.Context, r ApiGetModelInstancesRequest, opts ...Option) ([]ModelInstance, error) { +func (c *APIClient) GetModelInstancesWithContext(ctx context.Context, opts ...Option) ([]ModelInstance, error) { var ( postBody any returnValue []ModelInstance @@ -1883,7 +1834,7 @@ func (r *ApiGetModelMetricsRequest) UnmarshalJSON(b []byte) error { if err != nil { return err } - if v, ok := req["modelID"]; ok { //modelID + if v, ok := req["modelID"]; ok { err = json.Unmarshal(v, &r.modelID) if err != nil { err = json.Unmarshal(b, &r.modelID) @@ -2013,7 +1964,7 @@ func (r *ApiGetSegmentUsersRequest) UnmarshalJSON(b []byte) error { if err != nil { return err } - if v, ok := req["segmentID"]; ok { //segmentID + if v, ok := req["segmentID"]; ok { err = json.Unmarshal(v, &r.segmentID) if err != nil { err = json.Unmarshal(b, &r.segmentID) @@ -2022,7 +1973,7 @@ func (r *ApiGetSegmentUsersRequest) UnmarshalJSON(b []byte) error { } } } - if v, ok := req["fetchAllUserProfilesParams"]; ok { //fetchAllUserProfilesParams + if v, ok := req["fetchAllUserProfilesParams"]; ok { err = json.Unmarshal(v, &r.fetchAllUserProfilesParams) if err != nil { err = json.Unmarshal(b, &r.fetchAllUserProfilesParams) @@ -2040,15 +1991,11 @@ func (r *ApiGetSegmentUsersRequest) UnmarshalJSON(b []byte) error { return nil } -func (r ApiGetSegmentUsersRequest) WithFetchAllUserProfilesParams(fetchAllUserProfilesParams *FetchAllUserProfilesParams) ApiGetSegmentUsersRequest { - r.fetchAllUserProfilesParams = fetchAllUserProfilesParams - return r -} - // @return ApiGetSegmentUsersRequest -func (c *APIClient) NewApiGetSegmentUsersRequest(segmentID string) ApiGetSegmentUsersRequest { +func (c *APIClient) NewApiGetSegmentUsersRequest(segmentID string, fetchAllUserProfilesParams *FetchAllUserProfilesParams) ApiGetSegmentUsersRequest { return ApiGetSegmentUsersRequest{ - segmentID: segmentID, + segmentID: segmentID, + fetchAllUserProfilesParams: fetchAllUserProfilesParams, } } @@ -2177,7 +2124,7 @@ func (r *ApiPostRequest) UnmarshalJSON(b []byte) error { if err != nil { return err } - if v, ok := req["path"]; ok { //path + if v, ok := req["path"]; ok { err = json.Unmarshal(v, &r.path) if err != nil { err = json.Unmarshal(b, &r.path) @@ -2186,7 +2133,7 @@ func (r *ApiPostRequest) UnmarshalJSON(b []byte) error { } } } - if v, ok := req["parameters"]; ok { //parameters + if v, ok := req["parameters"]; ok { err = json.Unmarshal(v, &r.parameters) if err != nil { err = json.Unmarshal(b, &r.parameters) @@ -2195,7 +2142,7 @@ func (r *ApiPostRequest) UnmarshalJSON(b []byte) error { } } } - if v, ok := req["body"]; ok { //body + if v, ok := req["body"]; ok { err = json.Unmarshal(v, &r.body) if err != nil { err = json.Unmarshal(b, &r.body) @@ -2350,7 +2297,7 @@ func (r *ApiPutRequest) UnmarshalJSON(b []byte) error { if err != nil { return err } - if v, ok := req["path"]; ok { //path + if v, ok := req["path"]; ok { err = json.Unmarshal(v, &r.path) if err != nil { err = json.Unmarshal(b, &r.path) @@ -2359,7 +2306,7 @@ func (r *ApiPutRequest) UnmarshalJSON(b []byte) error { } } } - if v, ok := req["parameters"]; ok { //parameters + if v, ok := req["parameters"]; ok { err = json.Unmarshal(v, &r.parameters) if err != nil { err = json.Unmarshal(b, &r.parameters) @@ -2368,7 +2315,7 @@ func (r *ApiPutRequest) UnmarshalJSON(b []byte) error { } } } - if v, ok := req["body"]; ok { //body + if v, ok := req["body"]; ok { err = json.Unmarshal(v, &r.body) if err != nil { err = json.Unmarshal(b, &r.body) @@ -2522,7 +2469,7 @@ func (r *ApiUpdateModelInstanceRequest) UnmarshalJSON(b []byte) error { if err != nil { return err } - if v, ok := req["modelID"]; ok { //modelID + if v, ok := req["modelID"]; ok { err = json.Unmarshal(v, &r.modelID) if err != nil { err = json.Unmarshal(b, &r.modelID) @@ -2531,7 +2478,7 @@ func (r *ApiUpdateModelInstanceRequest) UnmarshalJSON(b []byte) error { } } } - if v, ok := req["updateModelParams"]; ok { //updateModelParams + if v, ok := req["updateModelParams"]; ok { err = json.Unmarshal(v, &r.updateModelParams) if err != nil { err = json.Unmarshal(b, &r.updateModelParams) @@ -2549,15 +2496,11 @@ func (r *ApiUpdateModelInstanceRequest) UnmarshalJSON(b []byte) error { return nil } -func (r ApiUpdateModelInstanceRequest) WithUpdateModelParams(updateModelParams *UpdateModelParams) ApiUpdateModelInstanceRequest { - r.updateModelParams = updateModelParams - return r -} - // @return ApiUpdateModelInstanceRequest -func (c *APIClient) NewApiUpdateModelInstanceRequest(modelID string) ApiUpdateModelInstanceRequest { +func (c *APIClient) NewApiUpdateModelInstanceRequest(modelID string, updateModelParams *UpdateModelParams) ApiUpdateModelInstanceRequest { return ApiUpdateModelInstanceRequest{ - modelID: modelID, + modelID: modelID, + updateModelParams: updateModelParams, } } @@ -2676,7 +2619,7 @@ func (r *ApiUpdateSegmentRequest) UnmarshalJSON(b []byte) error { if err != nil { return err } - if v, ok := req["segmentID"]; ok { //segmentID + if v, ok := req["segmentID"]; ok { err = json.Unmarshal(v, &r.segmentID) if err != nil { err = json.Unmarshal(b, &r.segmentID) @@ -2685,7 +2628,7 @@ func (r *ApiUpdateSegmentRequest) UnmarshalJSON(b []byte) error { } } } - if v, ok := req["updateSegmentParams"]; ok { //updateSegmentParams + if v, ok := req["updateSegmentParams"]; ok { err = json.Unmarshal(v, &r.updateSegmentParams) if err != nil { err = json.Unmarshal(b, &r.updateSegmentParams) @@ -2703,15 +2646,11 @@ func (r *ApiUpdateSegmentRequest) UnmarshalJSON(b []byte) error { return nil } -func (r ApiUpdateSegmentRequest) WithUpdateSegmentParams(updateSegmentParams *UpdateSegmentParams) ApiUpdateSegmentRequest { - r.updateSegmentParams = updateSegmentParams - return r -} - // @return ApiUpdateSegmentRequest -func (c *APIClient) NewApiUpdateSegmentRequest(segmentID string) ApiUpdateSegmentRequest { +func (c *APIClient) NewApiUpdateSegmentRequest(segmentID string, updateSegmentParams *UpdateSegmentParams) ApiUpdateSegmentRequest { return ApiUpdateSegmentRequest{ - segmentID: segmentID, + segmentID: segmentID, + updateSegmentParams: updateSegmentParams, } } diff --git a/clients/algoliasearch-client-go/algolia/query-suggestions/api_query_suggestions.go b/clients/algoliasearch-client-go/algolia/query-suggestions/api_query_suggestions.go index 4e943b754c..9b6f20f30e 100644 --- a/clients/algoliasearch-client-go/algolia/query-suggestions/api_query_suggestions.go +++ b/clients/algoliasearch-client-go/algolia/query-suggestions/api_query_suggestions.go @@ -45,7 +45,7 @@ func (r *ApiCreateConfigRequest) UnmarshalJSON(b []byte) error { if err != nil { return err } - if v, ok := req["querySuggestionsIndexWithIndexParam"]; ok { //querySuggestionsIndexWithIndexParam + if v, ok := req["querySuggestionsIndexWithIndexParam"]; ok { err = json.Unmarshal(v, &r.querySuggestionsIndexWithIndexParam) if err != nil { err = json.Unmarshal(b, &r.querySuggestionsIndexWithIndexParam) @@ -63,14 +63,11 @@ func (r *ApiCreateConfigRequest) UnmarshalJSON(b []byte) error { return nil } -func (r ApiCreateConfigRequest) WithQuerySuggestionsIndexWithIndexParam(querySuggestionsIndexWithIndexParam *QuerySuggestionsIndexWithIndexParam) ApiCreateConfigRequest { - r.querySuggestionsIndexWithIndexParam = querySuggestionsIndexWithIndexParam - return r -} - // @return ApiCreateConfigRequest -func (c *APIClient) NewApiCreateConfigRequest() ApiCreateConfigRequest { - return ApiCreateConfigRequest{} +func (c *APIClient) NewApiCreateConfigRequest(querySuggestionsIndexWithIndexParam *QuerySuggestionsIndexWithIndexParam) ApiCreateConfigRequest { + return ApiCreateConfigRequest{ + querySuggestionsIndexWithIndexParam: querySuggestionsIndexWithIndexParam, + } } // CreateConfig wraps CreateConfigWithContext using context.Background. @@ -196,7 +193,7 @@ func (r *ApiDelRequest) UnmarshalJSON(b []byte) error { if err != nil { return err } - if v, ok := req["path"]; ok { //path + if v, ok := req["path"]; ok { err = json.Unmarshal(v, &r.path) if err != nil { err = json.Unmarshal(b, &r.path) @@ -205,7 +202,7 @@ func (r *ApiDelRequest) UnmarshalJSON(b []byte) error { } } } - if v, ok := req["parameters"]; ok { //parameters + if v, ok := req["parameters"]; ok { err = json.Unmarshal(v, &r.parameters) if err != nil { err = json.Unmarshal(b, &r.parameters) @@ -346,7 +343,7 @@ func (r *ApiDeleteConfigRequest) UnmarshalJSON(b []byte) error { if err != nil { return err } - if v, ok := req["indexName"]; ok { //indexName + if v, ok := req["indexName"]; ok { err = json.Unmarshal(v, &r.indexName) if err != nil { err = json.Unmarshal(b, &r.indexName) @@ -467,7 +464,7 @@ func (r *ApiGetRequest) UnmarshalJSON(b []byte) error { if err != nil { return err } - if v, ok := req["path"]; ok { //path + if v, ok := req["path"]; ok { err = json.Unmarshal(v, &r.path) if err != nil { err = json.Unmarshal(b, &r.path) @@ -476,7 +473,7 @@ func (r *ApiGetRequest) UnmarshalJSON(b []byte) error { } } } - if v, ok := req["parameters"]; ok { //parameters + if v, ok := req["parameters"]; ok { err = json.Unmarshal(v, &r.parameters) if err != nil { err = json.Unmarshal(b, &r.parameters) @@ -607,31 +604,13 @@ func (c *APIClient) GetWithContext(ctx context.Context, r ApiGetRequest, opts .. return returnValue, nil } -type ApiGetAllConfigsRequest struct { -} - -func (r *ApiGetAllConfigsRequest) UnmarshalJSON(b []byte) error { - req := map[string]json.RawMessage{} - err := json.Unmarshal(b, &req) - if err != nil { - return err - } - - return nil -} - -// @return ApiGetAllConfigsRequest -func (c *APIClient) NewApiGetAllConfigsRequest() ApiGetAllConfigsRequest { - return ApiGetAllConfigsRequest{} -} - // GetAllConfigs wraps GetAllConfigsWithContext using context.Background. -func (c *APIClient) GetAllConfigs(r ApiGetAllConfigsRequest, opts ...Option) ([]QuerySuggestionsIndex, error) { - return c.GetAllConfigsWithContext(context.Background(), r, opts...) +func (c *APIClient) GetAllConfigs(opts ...Option) ([]QuerySuggestionsIndex, error) { + return c.GetAllConfigsWithContext(context.Background(), opts...) } // @return []QuerySuggestionsIndex -func (c *APIClient) GetAllConfigsWithContext(ctx context.Context, r ApiGetAllConfigsRequest, opts ...Option) ([]QuerySuggestionsIndex, error) { +func (c *APIClient) GetAllConfigsWithContext(ctx context.Context, opts ...Option) ([]QuerySuggestionsIndex, error) { var ( postBody any returnValue []QuerySuggestionsIndex @@ -733,7 +712,7 @@ func (r *ApiGetConfigRequest) UnmarshalJSON(b []byte) error { if err != nil { return err } - if v, ok := req["indexName"]; ok { //indexName + if v, ok := req["indexName"]; ok { err = json.Unmarshal(v, &r.indexName) if err != nil { err = json.Unmarshal(b, &r.indexName) @@ -871,7 +850,7 @@ func (r *ApiGetConfigStatusRequest) UnmarshalJSON(b []byte) error { if err != nil { return err } - if v, ok := req["indexName"]; ok { //indexName + if v, ok := req["indexName"]; ok { err = json.Unmarshal(v, &r.indexName) if err != nil { err = json.Unmarshal(b, &r.indexName) @@ -991,7 +970,7 @@ func (r *ApiGetLogFileRequest) UnmarshalJSON(b []byte) error { if err != nil { return err } - if v, ok := req["indexName"]; ok { //indexName + if v, ok := req["indexName"]; ok { err = json.Unmarshal(v, &r.indexName) if err != nil { err = json.Unmarshal(b, &r.indexName) @@ -1122,7 +1101,7 @@ func (r *ApiPostRequest) UnmarshalJSON(b []byte) error { if err != nil { return err } - if v, ok := req["path"]; ok { //path + if v, ok := req["path"]; ok { err = json.Unmarshal(v, &r.path) if err != nil { err = json.Unmarshal(b, &r.path) @@ -1131,7 +1110,7 @@ func (r *ApiPostRequest) UnmarshalJSON(b []byte) error { } } } - if v, ok := req["parameters"]; ok { //parameters + if v, ok := req["parameters"]; ok { err = json.Unmarshal(v, &r.parameters) if err != nil { err = json.Unmarshal(b, &r.parameters) @@ -1140,7 +1119,7 @@ func (r *ApiPostRequest) UnmarshalJSON(b []byte) error { } } } - if v, ok := req["body"]; ok { //body + if v, ok := req["body"]; ok { err = json.Unmarshal(v, &r.body) if err != nil { err = json.Unmarshal(b, &r.body) @@ -1295,7 +1274,7 @@ func (r *ApiPutRequest) UnmarshalJSON(b []byte) error { if err != nil { return err } - if v, ok := req["path"]; ok { //path + if v, ok := req["path"]; ok { err = json.Unmarshal(v, &r.path) if err != nil { err = json.Unmarshal(b, &r.path) @@ -1304,7 +1283,7 @@ func (r *ApiPutRequest) UnmarshalJSON(b []byte) error { } } } - if v, ok := req["parameters"]; ok { //parameters + if v, ok := req["parameters"]; ok { err = json.Unmarshal(v, &r.parameters) if err != nil { err = json.Unmarshal(b, &r.parameters) @@ -1313,7 +1292,7 @@ func (r *ApiPutRequest) UnmarshalJSON(b []byte) error { } } } - if v, ok := req["body"]; ok { //body + if v, ok := req["body"]; ok { err = json.Unmarshal(v, &r.body) if err != nil { err = json.Unmarshal(b, &r.body) @@ -1467,7 +1446,7 @@ func (r *ApiUpdateConfigRequest) UnmarshalJSON(b []byte) error { if err != nil { return err } - if v, ok := req["indexName"]; ok { //indexName + if v, ok := req["indexName"]; ok { err = json.Unmarshal(v, &r.indexName) if err != nil { err = json.Unmarshal(b, &r.indexName) @@ -1476,7 +1455,7 @@ func (r *ApiUpdateConfigRequest) UnmarshalJSON(b []byte) error { } } } - if v, ok := req["querySuggestionsIndexParam"]; ok { //querySuggestionsIndexParam + if v, ok := req["querySuggestionsIndexParam"]; ok { err = json.Unmarshal(v, &r.querySuggestionsIndexParam) if err != nil { err = json.Unmarshal(b, &r.querySuggestionsIndexParam) @@ -1494,15 +1473,11 @@ func (r *ApiUpdateConfigRequest) UnmarshalJSON(b []byte) error { return nil } -func (r ApiUpdateConfigRequest) WithQuerySuggestionsIndexParam(querySuggestionsIndexParam *QuerySuggestionsIndexParam) ApiUpdateConfigRequest { - r.querySuggestionsIndexParam = querySuggestionsIndexParam - return r -} - // @return ApiUpdateConfigRequest -func (c *APIClient) NewApiUpdateConfigRequest(indexName string) ApiUpdateConfigRequest { +func (c *APIClient) NewApiUpdateConfigRequest(indexName string, querySuggestionsIndexParam *QuerySuggestionsIndexParam) ApiUpdateConfigRequest { return ApiUpdateConfigRequest{ - indexName: indexName, + indexName: indexName, + querySuggestionsIndexParam: querySuggestionsIndexParam, } } diff --git a/clients/algoliasearch-client-go/algolia/recommend/api_recommend.go b/clients/algoliasearch-client-go/algolia/recommend/api_recommend.go index 95c6bf6c15..f3ae515268 100644 --- a/clients/algoliasearch-client-go/algolia/recommend/api_recommend.go +++ b/clients/algoliasearch-client-go/algolia/recommend/api_recommend.go @@ -46,7 +46,7 @@ func (r *ApiDelRequest) UnmarshalJSON(b []byte) error { if err != nil { return err } - if v, ok := req["path"]; ok { //path + if v, ok := req["path"]; ok { err = json.Unmarshal(v, &r.path) if err != nil { err = json.Unmarshal(b, &r.path) @@ -55,7 +55,7 @@ func (r *ApiDelRequest) UnmarshalJSON(b []byte) error { } } } - if v, ok := req["parameters"]; ok { //parameters + if v, ok := req["parameters"]; ok { err = json.Unmarshal(v, &r.parameters) if err != nil { err = json.Unmarshal(b, &r.parameters) @@ -197,7 +197,7 @@ func (r *ApiGetRequest) UnmarshalJSON(b []byte) error { if err != nil { return err } - if v, ok := req["path"]; ok { //path + if v, ok := req["path"]; ok { err = json.Unmarshal(v, &r.path) if err != nil { err = json.Unmarshal(b, &r.path) @@ -206,7 +206,7 @@ func (r *ApiGetRequest) UnmarshalJSON(b []byte) error { } } } - if v, ok := req["parameters"]; ok { //parameters + if v, ok := req["parameters"]; ok { err = json.Unmarshal(v, &r.parameters) if err != nil { err = json.Unmarshal(b, &r.parameters) @@ -347,7 +347,7 @@ func (r *ApiGetRecommendationsRequest) UnmarshalJSON(b []byte) error { if err != nil { return err } - if v, ok := req["getRecommendationsParams"]; ok { //getRecommendationsParams + if v, ok := req["getRecommendationsParams"]; ok { err = json.Unmarshal(v, &r.getRecommendationsParams) if err != nil { err = json.Unmarshal(b, &r.getRecommendationsParams) @@ -365,14 +365,11 @@ func (r *ApiGetRecommendationsRequest) UnmarshalJSON(b []byte) error { return nil } -func (r ApiGetRecommendationsRequest) WithGetRecommendationsParams(getRecommendationsParams *GetRecommendationsParams) ApiGetRecommendationsRequest { - r.getRecommendationsParams = getRecommendationsParams - return r -} - // @return ApiGetRecommendationsRequest -func (c *APIClient) NewApiGetRecommendationsRequest() ApiGetRecommendationsRequest { - return ApiGetRecommendationsRequest{} +func (c *APIClient) NewApiGetRecommendationsRequest(getRecommendationsParams *GetRecommendationsParams) ApiGetRecommendationsRequest { + return ApiGetRecommendationsRequest{ + getRecommendationsParams: getRecommendationsParams, + } } // GetRecommendations wraps GetRecommendationsWithContext using context.Background. @@ -490,7 +487,7 @@ func (r *ApiPostRequest) UnmarshalJSON(b []byte) error { if err != nil { return err } - if v, ok := req["path"]; ok { //path + if v, ok := req["path"]; ok { err = json.Unmarshal(v, &r.path) if err != nil { err = json.Unmarshal(b, &r.path) @@ -499,7 +496,7 @@ func (r *ApiPostRequest) UnmarshalJSON(b []byte) error { } } } - if v, ok := req["parameters"]; ok { //parameters + if v, ok := req["parameters"]; ok { err = json.Unmarshal(v, &r.parameters) if err != nil { err = json.Unmarshal(b, &r.parameters) @@ -508,7 +505,7 @@ func (r *ApiPostRequest) UnmarshalJSON(b []byte) error { } } } - if v, ok := req["body"]; ok { //body + if v, ok := req["body"]; ok { err = json.Unmarshal(v, &r.body) if err != nil { err = json.Unmarshal(b, &r.body) @@ -663,7 +660,7 @@ func (r *ApiPutRequest) UnmarshalJSON(b []byte) error { if err != nil { return err } - if v, ok := req["path"]; ok { //path + if v, ok := req["path"]; ok { err = json.Unmarshal(v, &r.path) if err != nil { err = json.Unmarshal(b, &r.path) @@ -672,7 +669,7 @@ func (r *ApiPutRequest) UnmarshalJSON(b []byte) error { } } } - if v, ok := req["parameters"]; ok { //parameters + if v, ok := req["parameters"]; ok { err = json.Unmarshal(v, &r.parameters) if err != nil { err = json.Unmarshal(b, &r.parameters) @@ -681,7 +678,7 @@ func (r *ApiPutRequest) UnmarshalJSON(b []byte) error { } } } - if v, ok := req["body"]; ok { //body + if v, ok := req["body"]; ok { err = json.Unmarshal(v, &r.body) if err != nil { err = json.Unmarshal(b, &r.body) diff --git a/clients/algoliasearch-client-go/algolia/search/api_search.go b/clients/algoliasearch-client-go/algolia/search/api_search.go index 836d06a334..536474da5d 100644 --- a/clients/algoliasearch-client-go/algolia/search/api_search.go +++ b/clients/algoliasearch-client-go/algolia/search/api_search.go @@ -45,7 +45,7 @@ func (r *ApiAddApiKeyRequest) UnmarshalJSON(b []byte) error { if err != nil { return err } - if v, ok := req["apiKey"]; ok { //apiKey + if v, ok := req["apiKey"]; ok { err = json.Unmarshal(v, &r.apiKey) if err != nil { err = json.Unmarshal(b, &r.apiKey) @@ -63,14 +63,11 @@ func (r *ApiAddApiKeyRequest) UnmarshalJSON(b []byte) error { return nil } -func (r ApiAddApiKeyRequest) WithApiKey(apiKey *ApiKey) ApiAddApiKeyRequest { - r.apiKey = apiKey - return r -} - // @return ApiAddApiKeyRequest -func (c *APIClient) NewApiAddApiKeyRequest() ApiAddApiKeyRequest { - return ApiAddApiKeyRequest{} +func (c *APIClient) NewApiAddApiKeyRequest(apiKey *ApiKey) ApiAddApiKeyRequest { + return ApiAddApiKeyRequest{ + apiKey: apiKey, + } } // AddApiKey wraps AddApiKeyWithContext using context.Background. @@ -188,7 +185,7 @@ func (r *ApiAddOrUpdateObjectRequest) UnmarshalJSON(b []byte) error { if err != nil { return err } - if v, ok := req["indexName"]; ok { //indexName + if v, ok := req["indexName"]; ok { err = json.Unmarshal(v, &r.indexName) if err != nil { err = json.Unmarshal(b, &r.indexName) @@ -197,7 +194,7 @@ func (r *ApiAddOrUpdateObjectRequest) UnmarshalJSON(b []byte) error { } } } - if v, ok := req["objectID"]; ok { //objectID + if v, ok := req["objectID"]; ok { err = json.Unmarshal(v, &r.objectID) if err != nil { err = json.Unmarshal(b, &r.objectID) @@ -206,7 +203,7 @@ func (r *ApiAddOrUpdateObjectRequest) UnmarshalJSON(b []byte) error { } } } - if v, ok := req["body"]; ok { //body + if v, ok := req["body"]; ok { err = json.Unmarshal(v, &r.body) if err != nil { err = json.Unmarshal(b, &r.body) @@ -224,17 +221,12 @@ func (r *ApiAddOrUpdateObjectRequest) UnmarshalJSON(b []byte) error { return nil } -// The Algolia object. -func (r ApiAddOrUpdateObjectRequest) WithBody(body map[string]interface{}) ApiAddOrUpdateObjectRequest { - r.body = body - return r -} - // @return ApiAddOrUpdateObjectRequest -func (c *APIClient) NewApiAddOrUpdateObjectRequest(indexName string, objectID string) ApiAddOrUpdateObjectRequest { +func (c *APIClient) NewApiAddOrUpdateObjectRequest(indexName string, objectID string, body map[string]interface{}) ApiAddOrUpdateObjectRequest { return ApiAddOrUpdateObjectRequest{ indexName: indexName, objectID: objectID, + body: body, } } @@ -350,7 +342,7 @@ func (r *ApiAppendSourceRequest) UnmarshalJSON(b []byte) error { if err != nil { return err } - if v, ok := req["source"]; ok { //source + if v, ok := req["source"]; ok { err = json.Unmarshal(v, &r.source) if err != nil { err = json.Unmarshal(b, &r.source) @@ -368,15 +360,11 @@ func (r *ApiAppendSourceRequest) UnmarshalJSON(b []byte) error { return nil } -// The source to add. -func (r ApiAppendSourceRequest) WithSource(source *Source) ApiAppendSourceRequest { - r.source = source - return r -} - // @return ApiAppendSourceRequest -func (c *APIClient) NewApiAppendSourceRequest() ApiAppendSourceRequest { - return ApiAppendSourceRequest{} +func (c *APIClient) NewApiAppendSourceRequest(source *Source) ApiAppendSourceRequest { + return ApiAppendSourceRequest{ + source: source, + } } // AppendSource wraps AppendSourceWithContext using context.Background. @@ -493,7 +481,7 @@ func (r *ApiAssignUserIdRequest) UnmarshalJSON(b []byte) error { if err != nil { return err } - if v, ok := req["xAlgoliaUserID"]; ok { //xAlgoliaUserID + if v, ok := req["xAlgoliaUserID"]; ok { err = json.Unmarshal(v, &r.xAlgoliaUserID) if err != nil { err = json.Unmarshal(b, &r.xAlgoliaUserID) @@ -502,7 +490,7 @@ func (r *ApiAssignUserIdRequest) UnmarshalJSON(b []byte) error { } } } - if v, ok := req["assignUserIdParams"]; ok { //assignUserIdParams + if v, ok := req["assignUserIdParams"]; ok { err = json.Unmarshal(v, &r.assignUserIdParams) if err != nil { err = json.Unmarshal(b, &r.assignUserIdParams) @@ -520,20 +508,12 @@ func (r *ApiAssignUserIdRequest) UnmarshalJSON(b []byte) error { return nil } -// userID to assign. -func (r ApiAssignUserIdRequest) WithXAlgoliaUserID(xAlgoliaUserID string) ApiAssignUserIdRequest { - r.xAlgoliaUserID = xAlgoliaUserID - return r -} - -func (r ApiAssignUserIdRequest) WithAssignUserIdParams(assignUserIdParams *AssignUserIdParams) ApiAssignUserIdRequest { - r.assignUserIdParams = assignUserIdParams - return r -} - // @return ApiAssignUserIdRequest -func (c *APIClient) NewApiAssignUserIdRequest() ApiAssignUserIdRequest { - return ApiAssignUserIdRequest{} +func (c *APIClient) NewApiAssignUserIdRequest(xAlgoliaUserID string, assignUserIdParams *AssignUserIdParams) ApiAssignUserIdRequest { + return ApiAssignUserIdRequest{ + xAlgoliaUserID: xAlgoliaUserID, + assignUserIdParams: assignUserIdParams, + } } // AssignUserId wraps AssignUserIdWithContext using context.Background. @@ -655,7 +635,7 @@ func (r *ApiBatchRequest) UnmarshalJSON(b []byte) error { if err != nil { return err } - if v, ok := req["indexName"]; ok { //indexName + if v, ok := req["indexName"]; ok { err = json.Unmarshal(v, &r.indexName) if err != nil { err = json.Unmarshal(b, &r.indexName) @@ -664,7 +644,7 @@ func (r *ApiBatchRequest) UnmarshalJSON(b []byte) error { } } } - if v, ok := req["batchWriteParams"]; ok { //batchWriteParams + if v, ok := req["batchWriteParams"]; ok { err = json.Unmarshal(v, &r.batchWriteParams) if err != nil { err = json.Unmarshal(b, &r.batchWriteParams) @@ -682,15 +662,11 @@ func (r *ApiBatchRequest) UnmarshalJSON(b []byte) error { return nil } -func (r ApiBatchRequest) WithBatchWriteParams(batchWriteParams *BatchWriteParams) ApiBatchRequest { - r.batchWriteParams = batchWriteParams - return r -} - // @return ApiBatchRequest -func (c *APIClient) NewApiBatchRequest(indexName string) ApiBatchRequest { +func (c *APIClient) NewApiBatchRequest(indexName string, batchWriteParams *BatchWriteParams) ApiBatchRequest { return ApiBatchRequest{ - indexName: indexName, + indexName: indexName, + batchWriteParams: batchWriteParams, } } @@ -809,7 +785,7 @@ func (r *ApiBatchAssignUserIdsRequest) UnmarshalJSON(b []byte) error { if err != nil { return err } - if v, ok := req["xAlgoliaUserID"]; ok { //xAlgoliaUserID + if v, ok := req["xAlgoliaUserID"]; ok { err = json.Unmarshal(v, &r.xAlgoliaUserID) if err != nil { err = json.Unmarshal(b, &r.xAlgoliaUserID) @@ -818,7 +794,7 @@ func (r *ApiBatchAssignUserIdsRequest) UnmarshalJSON(b []byte) error { } } } - if v, ok := req["batchAssignUserIdsParams"]; ok { //batchAssignUserIdsParams + if v, ok := req["batchAssignUserIdsParams"]; ok { err = json.Unmarshal(v, &r.batchAssignUserIdsParams) if err != nil { err = json.Unmarshal(b, &r.batchAssignUserIdsParams) @@ -836,20 +812,12 @@ func (r *ApiBatchAssignUserIdsRequest) UnmarshalJSON(b []byte) error { return nil } -// userID to assign. -func (r ApiBatchAssignUserIdsRequest) WithXAlgoliaUserID(xAlgoliaUserID string) ApiBatchAssignUserIdsRequest { - r.xAlgoliaUserID = xAlgoliaUserID - return r -} - -func (r ApiBatchAssignUserIdsRequest) WithBatchAssignUserIdsParams(batchAssignUserIdsParams *BatchAssignUserIdsParams) ApiBatchAssignUserIdsRequest { - r.batchAssignUserIdsParams = batchAssignUserIdsParams - return r -} - // @return ApiBatchAssignUserIdsRequest -func (c *APIClient) NewApiBatchAssignUserIdsRequest() ApiBatchAssignUserIdsRequest { - return ApiBatchAssignUserIdsRequest{} +func (c *APIClient) NewApiBatchAssignUserIdsRequest(xAlgoliaUserID string, batchAssignUserIdsParams *BatchAssignUserIdsParams) ApiBatchAssignUserIdsRequest { + return ApiBatchAssignUserIdsRequest{ + xAlgoliaUserID: xAlgoliaUserID, + batchAssignUserIdsParams: batchAssignUserIdsParams, + } } // BatchAssignUserIds wraps BatchAssignUserIdsWithContext using context.Background. @@ -971,7 +939,7 @@ func (r *ApiBatchDictionaryEntriesRequest) UnmarshalJSON(b []byte) error { if err != nil { return err } - if v, ok := req["dictionaryName"]; ok { //dictionaryName + if v, ok := req["dictionaryName"]; ok { err = json.Unmarshal(v, &r.dictionaryName) if err != nil { err = json.Unmarshal(b, &r.dictionaryName) @@ -980,7 +948,7 @@ func (r *ApiBatchDictionaryEntriesRequest) UnmarshalJSON(b []byte) error { } } } - if v, ok := req["batchDictionaryEntriesParams"]; ok { //batchDictionaryEntriesParams + if v, ok := req["batchDictionaryEntriesParams"]; ok { err = json.Unmarshal(v, &r.batchDictionaryEntriesParams) if err != nil { err = json.Unmarshal(b, &r.batchDictionaryEntriesParams) @@ -998,15 +966,11 @@ func (r *ApiBatchDictionaryEntriesRequest) UnmarshalJSON(b []byte) error { return nil } -func (r ApiBatchDictionaryEntriesRequest) WithBatchDictionaryEntriesParams(batchDictionaryEntriesParams *BatchDictionaryEntriesParams) ApiBatchDictionaryEntriesRequest { - r.batchDictionaryEntriesParams = batchDictionaryEntriesParams - return r -} - // @return ApiBatchDictionaryEntriesRequest -func (c *APIClient) NewApiBatchDictionaryEntriesRequest(dictionaryName DictionaryType) ApiBatchDictionaryEntriesRequest { +func (c *APIClient) NewApiBatchDictionaryEntriesRequest(dictionaryName DictionaryType, batchDictionaryEntriesParams *BatchDictionaryEntriesParams) ApiBatchDictionaryEntriesRequest { return ApiBatchDictionaryEntriesRequest{ - dictionaryName: dictionaryName, + dictionaryName: dictionaryName, + batchDictionaryEntriesParams: batchDictionaryEntriesParams, } } @@ -1125,7 +1089,7 @@ func (r *ApiBrowseRequest) UnmarshalJSON(b []byte) error { if err != nil { return err } - if v, ok := req["indexName"]; ok { //indexName + if v, ok := req["indexName"]; ok { err = json.Unmarshal(v, &r.indexName) if err != nil { err = json.Unmarshal(b, &r.indexName) @@ -1134,7 +1098,7 @@ func (r *ApiBrowseRequest) UnmarshalJSON(b []byte) error { } } } - if v, ok := req["browseParams"]; ok { //browseParams + if v, ok := req["browseParams"]; ok { err = json.Unmarshal(v, &r.browseParams) if err != nil { err = json.Unmarshal(b, &r.browseParams) @@ -1275,7 +1239,7 @@ func (r *ApiClearAllSynonymsRequest) UnmarshalJSON(b []byte) error { if err != nil { return err } - if v, ok := req["indexName"]; ok { //indexName + if v, ok := req["indexName"]; ok { err = json.Unmarshal(v, &r.indexName) if err != nil { err = json.Unmarshal(b, &r.indexName) @@ -1284,7 +1248,7 @@ func (r *ApiClearAllSynonymsRequest) UnmarshalJSON(b []byte) error { } } } - if v, ok := req["forwardToReplicas"]; ok { //forwardToReplicas + if v, ok := req["forwardToReplicas"]; ok { err = json.Unmarshal(v, &r.forwardToReplicas) if err != nil { err = json.Unmarshal(b, &r.forwardToReplicas) @@ -1423,7 +1387,7 @@ func (r *ApiClearObjectsRequest) UnmarshalJSON(b []byte) error { if err != nil { return err } - if v, ok := req["indexName"]; ok { //indexName + if v, ok := req["indexName"]; ok { err = json.Unmarshal(v, &r.indexName) if err != nil { err = json.Unmarshal(b, &r.indexName) @@ -1553,7 +1517,7 @@ func (r *ApiClearRulesRequest) UnmarshalJSON(b []byte) error { if err != nil { return err } - if v, ok := req["indexName"]; ok { //indexName + if v, ok := req["indexName"]; ok { err = json.Unmarshal(v, &r.indexName) if err != nil { err = json.Unmarshal(b, &r.indexName) @@ -1562,7 +1526,7 @@ func (r *ApiClearRulesRequest) UnmarshalJSON(b []byte) error { } } } - if v, ok := req["forwardToReplicas"]; ok { //forwardToReplicas + if v, ok := req["forwardToReplicas"]; ok { err = json.Unmarshal(v, &r.forwardToReplicas) if err != nil { err = json.Unmarshal(b, &r.forwardToReplicas) @@ -1702,7 +1666,7 @@ func (r *ApiDelRequest) UnmarshalJSON(b []byte) error { if err != nil { return err } - if v, ok := req["path"]; ok { //path + if v, ok := req["path"]; ok { err = json.Unmarshal(v, &r.path) if err != nil { err = json.Unmarshal(b, &r.path) @@ -1711,7 +1675,7 @@ func (r *ApiDelRequest) UnmarshalJSON(b []byte) error { } } } - if v, ok := req["parameters"]; ok { //parameters + if v, ok := req["parameters"]; ok { err = json.Unmarshal(v, &r.parameters) if err != nil { err = json.Unmarshal(b, &r.parameters) @@ -1852,7 +1816,7 @@ func (r *ApiDeleteApiKeyRequest) UnmarshalJSON(b []byte) error { if err != nil { return err } - if v, ok := req["key"]; ok { //key + if v, ok := req["key"]; ok { err = json.Unmarshal(v, &r.key) if err != nil { err = json.Unmarshal(b, &r.key) @@ -1982,7 +1946,7 @@ func (r *ApiDeleteByRequest) UnmarshalJSON(b []byte) error { if err != nil { return err } - if v, ok := req["indexName"]; ok { //indexName + if v, ok := req["indexName"]; ok { err = json.Unmarshal(v, &r.indexName) if err != nil { err = json.Unmarshal(b, &r.indexName) @@ -1991,7 +1955,7 @@ func (r *ApiDeleteByRequest) UnmarshalJSON(b []byte) error { } } } - if v, ok := req["deleteByParams"]; ok { //deleteByParams + if v, ok := req["deleteByParams"]; ok { err = json.Unmarshal(v, &r.deleteByParams) if err != nil { err = json.Unmarshal(b, &r.deleteByParams) @@ -2009,15 +1973,11 @@ func (r *ApiDeleteByRequest) UnmarshalJSON(b []byte) error { return nil } -func (r ApiDeleteByRequest) WithDeleteByParams(deleteByParams *DeleteByParams) ApiDeleteByRequest { - r.deleteByParams = deleteByParams - return r -} - // @return ApiDeleteByRequest -func (c *APIClient) NewApiDeleteByRequest(indexName string) ApiDeleteByRequest { +func (c *APIClient) NewApiDeleteByRequest(indexName string, deleteByParams *DeleteByParams) ApiDeleteByRequest { return ApiDeleteByRequest{ - indexName: indexName, + indexName: indexName, + deleteByParams: deleteByParams, } } @@ -2135,7 +2095,7 @@ func (r *ApiDeleteIndexRequest) UnmarshalJSON(b []byte) error { if err != nil { return err } - if v, ok := req["indexName"]; ok { //indexName + if v, ok := req["indexName"]; ok { err = json.Unmarshal(v, &r.indexName) if err != nil { err = json.Unmarshal(b, &r.indexName) @@ -2265,7 +2225,7 @@ func (r *ApiDeleteObjectRequest) UnmarshalJSON(b []byte) error { if err != nil { return err } - if v, ok := req["indexName"]; ok { //indexName + if v, ok := req["indexName"]; ok { err = json.Unmarshal(v, &r.indexName) if err != nil { err = json.Unmarshal(b, &r.indexName) @@ -2274,7 +2234,7 @@ func (r *ApiDeleteObjectRequest) UnmarshalJSON(b []byte) error { } } } - if v, ok := req["objectID"]; ok { //objectID + if v, ok := req["objectID"]; ok { err = json.Unmarshal(v, &r.objectID) if err != nil { err = json.Unmarshal(b, &r.objectID) @@ -2407,7 +2367,7 @@ func (r *ApiDeleteRuleRequest) UnmarshalJSON(b []byte) error { if err != nil { return err } - if v, ok := req["indexName"]; ok { //indexName + if v, ok := req["indexName"]; ok { err = json.Unmarshal(v, &r.indexName) if err != nil { err = json.Unmarshal(b, &r.indexName) @@ -2416,7 +2376,7 @@ func (r *ApiDeleteRuleRequest) UnmarshalJSON(b []byte) error { } } } - if v, ok := req["objectID"]; ok { //objectID + if v, ok := req["objectID"]; ok { err = json.Unmarshal(v, &r.objectID) if err != nil { err = json.Unmarshal(b, &r.objectID) @@ -2425,7 +2385,7 @@ func (r *ApiDeleteRuleRequest) UnmarshalJSON(b []byte) error { } } } - if v, ok := req["forwardToReplicas"]; ok { //forwardToReplicas + if v, ok := req["forwardToReplicas"]; ok { err = json.Unmarshal(v, &r.forwardToReplicas) if err != nil { err = json.Unmarshal(b, &r.forwardToReplicas) @@ -2566,7 +2526,7 @@ func (r *ApiDeleteSourceRequest) UnmarshalJSON(b []byte) error { if err != nil { return err } - if v, ok := req["source"]; ok { //source + if v, ok := req["source"]; ok { err = json.Unmarshal(v, &r.source) if err != nil { err = json.Unmarshal(b, &r.source) @@ -2697,7 +2657,7 @@ func (r *ApiDeleteSynonymRequest) UnmarshalJSON(b []byte) error { if err != nil { return err } - if v, ok := req["indexName"]; ok { //indexName + if v, ok := req["indexName"]; ok { err = json.Unmarshal(v, &r.indexName) if err != nil { err = json.Unmarshal(b, &r.indexName) @@ -2706,7 +2666,7 @@ func (r *ApiDeleteSynonymRequest) UnmarshalJSON(b []byte) error { } } } - if v, ok := req["objectID"]; ok { //objectID + if v, ok := req["objectID"]; ok { err = json.Unmarshal(v, &r.objectID) if err != nil { err = json.Unmarshal(b, &r.objectID) @@ -2715,7 +2675,7 @@ func (r *ApiDeleteSynonymRequest) UnmarshalJSON(b []byte) error { } } } - if v, ok := req["forwardToReplicas"]; ok { //forwardToReplicas + if v, ok := req["forwardToReplicas"]; ok { err = json.Unmarshal(v, &r.forwardToReplicas) if err != nil { err = json.Unmarshal(b, &r.forwardToReplicas) @@ -2857,7 +2817,7 @@ func (r *ApiGetRequest) UnmarshalJSON(b []byte) error { if err != nil { return err } - if v, ok := req["path"]; ok { //path + if v, ok := req["path"]; ok { err = json.Unmarshal(v, &r.path) if err != nil { err = json.Unmarshal(b, &r.path) @@ -2866,7 +2826,7 @@ func (r *ApiGetRequest) UnmarshalJSON(b []byte) error { } } } - if v, ok := req["parameters"]; ok { //parameters + if v, ok := req["parameters"]; ok { err = json.Unmarshal(v, &r.parameters) if err != nil { err = json.Unmarshal(b, &r.parameters) @@ -3007,7 +2967,7 @@ func (r *ApiGetApiKeyRequest) UnmarshalJSON(b []byte) error { if err != nil { return err } - if v, ok := req["key"]; ok { //key + if v, ok := req["key"]; ok { err = json.Unmarshal(v, &r.key) if err != nil { err = json.Unmarshal(b, &r.key) @@ -3126,31 +3086,13 @@ func (c *APIClient) GetApiKeyWithContext(ctx context.Context, r ApiGetApiKeyRequ return returnValue, nil } -type ApiGetDictionaryLanguagesRequest struct { -} - -func (r *ApiGetDictionaryLanguagesRequest) UnmarshalJSON(b []byte) error { - req := map[string]json.RawMessage{} - err := json.Unmarshal(b, &req) - if err != nil { - return err - } - - return nil -} - -// @return ApiGetDictionaryLanguagesRequest -func (c *APIClient) NewApiGetDictionaryLanguagesRequest() ApiGetDictionaryLanguagesRequest { - return ApiGetDictionaryLanguagesRequest{} -} - // GetDictionaryLanguages wraps GetDictionaryLanguagesWithContext using context.Background. -func (c *APIClient) GetDictionaryLanguages(r ApiGetDictionaryLanguagesRequest, opts ...Option) (*map[string]Languages, error) { - return c.GetDictionaryLanguagesWithContext(context.Background(), r, opts...) +func (c *APIClient) GetDictionaryLanguages(opts ...Option) (*map[string]Languages, error) { + return c.GetDictionaryLanguagesWithContext(context.Background(), opts...) } // @return map[string]Languages -func (c *APIClient) GetDictionaryLanguagesWithContext(ctx context.Context, r ApiGetDictionaryLanguagesRequest, opts ...Option) (*map[string]Languages, error) { +func (c *APIClient) GetDictionaryLanguagesWithContext(ctx context.Context, opts ...Option) (*map[string]Languages, error) { var ( postBody any returnValue *map[string]Languages @@ -3242,31 +3184,13 @@ func (c *APIClient) GetDictionaryLanguagesWithContext(ctx context.Context, r Api return returnValue, nil } -type ApiGetDictionarySettingsRequest struct { -} - -func (r *ApiGetDictionarySettingsRequest) UnmarshalJSON(b []byte) error { - req := map[string]json.RawMessage{} - err := json.Unmarshal(b, &req) - if err != nil { - return err - } - - return nil -} - -// @return ApiGetDictionarySettingsRequest -func (c *APIClient) NewApiGetDictionarySettingsRequest() ApiGetDictionarySettingsRequest { - return ApiGetDictionarySettingsRequest{} -} - // GetDictionarySettings wraps GetDictionarySettingsWithContext using context.Background. -func (c *APIClient) GetDictionarySettings(r ApiGetDictionarySettingsRequest, opts ...Option) (*GetDictionarySettingsResponse, error) { - return c.GetDictionarySettingsWithContext(context.Background(), r, opts...) +func (c *APIClient) GetDictionarySettings(opts ...Option) (*GetDictionarySettingsResponse, error) { + return c.GetDictionarySettingsWithContext(context.Background(), opts...) } // @return GetDictionarySettingsResponse -func (c *APIClient) GetDictionarySettingsWithContext(ctx context.Context, r ApiGetDictionarySettingsRequest, opts ...Option) (*GetDictionarySettingsResponse, error) { +func (c *APIClient) GetDictionarySettingsWithContext(ctx context.Context, opts ...Option) (*GetDictionarySettingsResponse, error) { var ( postBody any returnValue *GetDictionarySettingsResponse @@ -3371,7 +3295,7 @@ func (r *ApiGetLogsRequest) UnmarshalJSON(b []byte) error { if err != nil { return err } - if v, ok := req["offset"]; ok { //offset + if v, ok := req["offset"]; ok { err = json.Unmarshal(v, &r.offset) if err != nil { err = json.Unmarshal(b, &r.offset) @@ -3380,7 +3304,7 @@ func (r *ApiGetLogsRequest) UnmarshalJSON(b []byte) error { } } } - if v, ok := req["length"]; ok { //length + if v, ok := req["length"]; ok { err = json.Unmarshal(v, &r.length) if err != nil { err = json.Unmarshal(b, &r.length) @@ -3389,7 +3313,7 @@ func (r *ApiGetLogsRequest) UnmarshalJSON(b []byte) error { } } } - if v, ok := req["indexName"]; ok { //indexName + if v, ok := req["indexName"]; ok { err = json.Unmarshal(v, &r.indexName) if err != nil { err = json.Unmarshal(b, &r.indexName) @@ -3398,7 +3322,7 @@ func (r *ApiGetLogsRequest) UnmarshalJSON(b []byte) error { } } } - if v, ok := req["type"]; ok { //type_ + if v, ok := req["type"]; ok { err = json.Unmarshal(v, &r.type_) if err != nil { err = json.Unmarshal(b, &r.type_) @@ -3563,7 +3487,7 @@ func (r *ApiGetObjectRequest) UnmarshalJSON(b []byte) error { if err != nil { return err } - if v, ok := req["indexName"]; ok { //indexName + if v, ok := req["indexName"]; ok { err = json.Unmarshal(v, &r.indexName) if err != nil { err = json.Unmarshal(b, &r.indexName) @@ -3572,7 +3496,7 @@ func (r *ApiGetObjectRequest) UnmarshalJSON(b []byte) error { } } } - if v, ok := req["objectID"]; ok { //objectID + if v, ok := req["objectID"]; ok { err = json.Unmarshal(v, &r.objectID) if err != nil { err = json.Unmarshal(b, &r.objectID) @@ -3581,7 +3505,7 @@ func (r *ApiGetObjectRequest) UnmarshalJSON(b []byte) error { } } } - if v, ok := req["attributesToRetrieve"]; ok { //attributesToRetrieve + if v, ok := req["attributesToRetrieve"]; ok { err = json.Unmarshal(v, &r.attributesToRetrieve) if err != nil { err = json.Unmarshal(b, &r.attributesToRetrieve) @@ -3722,7 +3646,7 @@ func (r *ApiGetObjectsRequest) UnmarshalJSON(b []byte) error { if err != nil { return err } - if v, ok := req["getObjectsParams"]; ok { //getObjectsParams + if v, ok := req["getObjectsParams"]; ok { err = json.Unmarshal(v, &r.getObjectsParams) if err != nil { err = json.Unmarshal(b, &r.getObjectsParams) @@ -3740,15 +3664,11 @@ func (r *ApiGetObjectsRequest) UnmarshalJSON(b []byte) error { return nil } -// The Algolia object. -func (r ApiGetObjectsRequest) WithGetObjectsParams(getObjectsParams *GetObjectsParams) ApiGetObjectsRequest { - r.getObjectsParams = getObjectsParams - return r -} - // @return ApiGetObjectsRequest -func (c *APIClient) NewApiGetObjectsRequest() ApiGetObjectsRequest { - return ApiGetObjectsRequest{} +func (c *APIClient) NewApiGetObjectsRequest(getObjectsParams *GetObjectsParams) ApiGetObjectsRequest { + return ApiGetObjectsRequest{ + getObjectsParams: getObjectsParams, + } } // GetObjects wraps GetObjectsWithContext using context.Background. @@ -3865,7 +3785,7 @@ func (r *ApiGetRuleRequest) UnmarshalJSON(b []byte) error { if err != nil { return err } - if v, ok := req["indexName"]; ok { //indexName + if v, ok := req["indexName"]; ok { err = json.Unmarshal(v, &r.indexName) if err != nil { err = json.Unmarshal(b, &r.indexName) @@ -3874,7 +3794,7 @@ func (r *ApiGetRuleRequest) UnmarshalJSON(b []byte) error { } } } - if v, ok := req["objectID"]; ok { //objectID + if v, ok := req["objectID"]; ok { err = json.Unmarshal(v, &r.objectID) if err != nil { err = json.Unmarshal(b, &r.objectID) @@ -4005,7 +3925,7 @@ func (r *ApiGetSettingsRequest) UnmarshalJSON(b []byte) error { if err != nil { return err } - if v, ok := req["indexName"]; ok { //indexName + if v, ok := req["indexName"]; ok { err = json.Unmarshal(v, &r.indexName) if err != nil { err = json.Unmarshal(b, &r.indexName) @@ -4124,31 +4044,13 @@ func (c *APIClient) GetSettingsWithContext(ctx context.Context, r ApiGetSettings return returnValue, nil } -type ApiGetSourcesRequest struct { -} - -func (r *ApiGetSourcesRequest) UnmarshalJSON(b []byte) error { - req := map[string]json.RawMessage{} - err := json.Unmarshal(b, &req) - if err != nil { - return err - } - - return nil -} - -// @return ApiGetSourcesRequest -func (c *APIClient) NewApiGetSourcesRequest() ApiGetSourcesRequest { - return ApiGetSourcesRequest{} -} - // GetSources wraps GetSourcesWithContext using context.Background. -func (c *APIClient) GetSources(r ApiGetSourcesRequest, opts ...Option) ([]Source, error) { - return c.GetSourcesWithContext(context.Background(), r, opts...) +func (c *APIClient) GetSources(opts ...Option) ([]Source, error) { + return c.GetSourcesWithContext(context.Background(), opts...) } // @return []Source -func (c *APIClient) GetSourcesWithContext(ctx context.Context, r ApiGetSourcesRequest, opts ...Option) ([]Source, error) { +func (c *APIClient) GetSourcesWithContext(ctx context.Context, opts ...Option) ([]Source, error) { var ( postBody any returnValue []Source @@ -4251,7 +4153,7 @@ func (r *ApiGetSynonymRequest) UnmarshalJSON(b []byte) error { if err != nil { return err } - if v, ok := req["indexName"]; ok { //indexName + if v, ok := req["indexName"]; ok { err = json.Unmarshal(v, &r.indexName) if err != nil { err = json.Unmarshal(b, &r.indexName) @@ -4260,7 +4162,7 @@ func (r *ApiGetSynonymRequest) UnmarshalJSON(b []byte) error { } } } - if v, ok := req["objectID"]; ok { //objectID + if v, ok := req["objectID"]; ok { err = json.Unmarshal(v, &r.objectID) if err != nil { err = json.Unmarshal(b, &r.objectID) @@ -4392,7 +4294,7 @@ func (r *ApiGetTaskRequest) UnmarshalJSON(b []byte) error { if err != nil { return err } - if v, ok := req["indexName"]; ok { //indexName + if v, ok := req["indexName"]; ok { err = json.Unmarshal(v, &r.indexName) if err != nil { err = json.Unmarshal(b, &r.indexName) @@ -4401,7 +4303,7 @@ func (r *ApiGetTaskRequest) UnmarshalJSON(b []byte) error { } } } - if v, ok := req["taskID"]; ok { //taskID + if v, ok := req["taskID"]; ok { err = json.Unmarshal(v, &r.taskID) if err != nil { err = json.Unmarshal(b, &r.taskID) @@ -4522,31 +4424,13 @@ func (c *APIClient) GetTaskWithContext(ctx context.Context, r ApiGetTaskRequest, return returnValue, nil } -type ApiGetTopUserIdsRequest struct { -} - -func (r *ApiGetTopUserIdsRequest) UnmarshalJSON(b []byte) error { - req := map[string]json.RawMessage{} - err := json.Unmarshal(b, &req) - if err != nil { - return err - } - - return nil -} - -// @return ApiGetTopUserIdsRequest -func (c *APIClient) NewApiGetTopUserIdsRequest() ApiGetTopUserIdsRequest { - return ApiGetTopUserIdsRequest{} -} - // GetTopUserIds wraps GetTopUserIdsWithContext using context.Background. -func (c *APIClient) GetTopUserIds(r ApiGetTopUserIdsRequest, opts ...Option) (*GetTopUserIdsResponse, error) { - return c.GetTopUserIdsWithContext(context.Background(), r, opts...) +func (c *APIClient) GetTopUserIds(opts ...Option) (*GetTopUserIdsResponse, error) { + return c.GetTopUserIdsWithContext(context.Background(), opts...) } // @return GetTopUserIdsResponse -func (c *APIClient) GetTopUserIdsWithContext(ctx context.Context, r ApiGetTopUserIdsRequest, opts ...Option) (*GetTopUserIdsResponse, error) { +func (c *APIClient) GetTopUserIdsWithContext(ctx context.Context, opts ...Option) (*GetTopUserIdsResponse, error) { var ( postBody any returnValue *GetTopUserIdsResponse @@ -4648,7 +4532,7 @@ func (r *ApiGetUserIdRequest) UnmarshalJSON(b []byte) error { if err != nil { return err } - if v, ok := req["userID"]; ok { //userID + if v, ok := req["userID"]; ok { err = json.Unmarshal(v, &r.userID) if err != nil { err = json.Unmarshal(b, &r.userID) @@ -4777,7 +4661,7 @@ func (r *ApiHasPendingMappingsRequest) UnmarshalJSON(b []byte) error { if err != nil { return err } - if v, ok := req["getClusters"]; ok { //getClusters + if v, ok := req["getClusters"]; ok { err = json.Unmarshal(v, &r.getClusters) if err != nil { err = json.Unmarshal(b, &r.getClusters) @@ -4903,31 +4787,13 @@ func (c *APIClient) HasPendingMappingsWithContext(ctx context.Context, r ApiHasP return returnValue, nil } -type ApiListApiKeysRequest struct { -} - -func (r *ApiListApiKeysRequest) UnmarshalJSON(b []byte) error { - req := map[string]json.RawMessage{} - err := json.Unmarshal(b, &req) - if err != nil { - return err - } - - return nil -} - -// @return ApiListApiKeysRequest -func (c *APIClient) NewApiListApiKeysRequest() ApiListApiKeysRequest { - return ApiListApiKeysRequest{} -} - // ListApiKeys wraps ListApiKeysWithContext using context.Background. -func (c *APIClient) ListApiKeys(r ApiListApiKeysRequest, opts ...Option) (*ListApiKeysResponse, error) { - return c.ListApiKeysWithContext(context.Background(), r, opts...) +func (c *APIClient) ListApiKeys(opts ...Option) (*ListApiKeysResponse, error) { + return c.ListApiKeysWithContext(context.Background(), opts...) } // @return ListApiKeysResponse -func (c *APIClient) ListApiKeysWithContext(ctx context.Context, r ApiListApiKeysRequest, opts ...Option) (*ListApiKeysResponse, error) { +func (c *APIClient) ListApiKeysWithContext(ctx context.Context, opts ...Option) (*ListApiKeysResponse, error) { var ( postBody any returnValue *ListApiKeysResponse @@ -5019,31 +4885,13 @@ func (c *APIClient) ListApiKeysWithContext(ctx context.Context, r ApiListApiKeys return returnValue, nil } -type ApiListClustersRequest struct { -} - -func (r *ApiListClustersRequest) UnmarshalJSON(b []byte) error { - req := map[string]json.RawMessage{} - err := json.Unmarshal(b, &req) - if err != nil { - return err - } - - return nil -} - -// @return ApiListClustersRequest -func (c *APIClient) NewApiListClustersRequest() ApiListClustersRequest { - return ApiListClustersRequest{} -} - // ListClusters wraps ListClustersWithContext using context.Background. -func (c *APIClient) ListClusters(r ApiListClustersRequest, opts ...Option) (*ListClustersResponse, error) { - return c.ListClustersWithContext(context.Background(), r, opts...) +func (c *APIClient) ListClusters(opts ...Option) (*ListClustersResponse, error) { + return c.ListClustersWithContext(context.Background(), opts...) } // @return ListClustersResponse -func (c *APIClient) ListClustersWithContext(ctx context.Context, r ApiListClustersRequest, opts ...Option) (*ListClustersResponse, error) { +func (c *APIClient) ListClustersWithContext(ctx context.Context, opts ...Option) (*ListClustersResponse, error) { var ( postBody any returnValue *ListClustersResponse @@ -5145,7 +4993,7 @@ func (r *ApiListIndicesRequest) UnmarshalJSON(b []byte) error { if err != nil { return err } - if v, ok := req["page"]; ok { //page + if v, ok := req["page"]; ok { err = json.Unmarshal(v, &r.page) if err != nil { err = json.Unmarshal(b, &r.page) @@ -5282,7 +5130,7 @@ func (r *ApiListUserIdsRequest) UnmarshalJSON(b []byte) error { if err != nil { return err } - if v, ok := req["page"]; ok { //page + if v, ok := req["page"]; ok { err = json.Unmarshal(v, &r.page) if err != nil { err = json.Unmarshal(b, &r.page) @@ -5291,7 +5139,7 @@ func (r *ApiListUserIdsRequest) UnmarshalJSON(b []byte) error { } } } - if v, ok := req["hitsPerPage"]; ok { //hitsPerPage + if v, ok := req["hitsPerPage"]; ok { err = json.Unmarshal(v, &r.hitsPerPage) if err != nil { err = json.Unmarshal(b, &r.hitsPerPage) @@ -5436,7 +5284,7 @@ func (r *ApiMultipleBatchRequest) UnmarshalJSON(b []byte) error { if err != nil { return err } - if v, ok := req["batchParams"]; ok { //batchParams + if v, ok := req["batchParams"]; ok { err = json.Unmarshal(v, &r.batchParams) if err != nil { err = json.Unmarshal(b, &r.batchParams) @@ -5454,14 +5302,11 @@ func (r *ApiMultipleBatchRequest) UnmarshalJSON(b []byte) error { return nil } -func (r ApiMultipleBatchRequest) WithBatchParams(batchParams *BatchParams) ApiMultipleBatchRequest { - r.batchParams = batchParams - return r -} - // @return ApiMultipleBatchRequest -func (c *APIClient) NewApiMultipleBatchRequest() ApiMultipleBatchRequest { - return ApiMultipleBatchRequest{} +func (c *APIClient) NewApiMultipleBatchRequest(batchParams *BatchParams) ApiMultipleBatchRequest { + return ApiMultipleBatchRequest{ + batchParams: batchParams, + } } // MultipleBatch wraps MultipleBatchWithContext using context.Background. @@ -5578,7 +5423,7 @@ func (r *ApiOperationIndexRequest) UnmarshalJSON(b []byte) error { if err != nil { return err } - if v, ok := req["indexName"]; ok { //indexName + if v, ok := req["indexName"]; ok { err = json.Unmarshal(v, &r.indexName) if err != nil { err = json.Unmarshal(b, &r.indexName) @@ -5587,7 +5432,7 @@ func (r *ApiOperationIndexRequest) UnmarshalJSON(b []byte) error { } } } - if v, ok := req["operationIndexParams"]; ok { //operationIndexParams + if v, ok := req["operationIndexParams"]; ok { err = json.Unmarshal(v, &r.operationIndexParams) if err != nil { err = json.Unmarshal(b, &r.operationIndexParams) @@ -5605,15 +5450,11 @@ func (r *ApiOperationIndexRequest) UnmarshalJSON(b []byte) error { return nil } -func (r ApiOperationIndexRequest) WithOperationIndexParams(operationIndexParams *OperationIndexParams) ApiOperationIndexRequest { - r.operationIndexParams = operationIndexParams - return r -} - // @return ApiOperationIndexRequest -func (c *APIClient) NewApiOperationIndexRequest(indexName string) ApiOperationIndexRequest { +func (c *APIClient) NewApiOperationIndexRequest(indexName string, operationIndexParams *OperationIndexParams) ApiOperationIndexRequest { return ApiOperationIndexRequest{ - indexName: indexName, + indexName: indexName, + operationIndexParams: operationIndexParams, } } @@ -5734,7 +5575,7 @@ func (r *ApiPartialUpdateObjectRequest) UnmarshalJSON(b []byte) error { if err != nil { return err } - if v, ok := req["indexName"]; ok { //indexName + if v, ok := req["indexName"]; ok { err = json.Unmarshal(v, &r.indexName) if err != nil { err = json.Unmarshal(b, &r.indexName) @@ -5743,7 +5584,7 @@ func (r *ApiPartialUpdateObjectRequest) UnmarshalJSON(b []byte) error { } } } - if v, ok := req["objectID"]; ok { //objectID + if v, ok := req["objectID"]; ok { err = json.Unmarshal(v, &r.objectID) if err != nil { err = json.Unmarshal(b, &r.objectID) @@ -5752,7 +5593,7 @@ func (r *ApiPartialUpdateObjectRequest) UnmarshalJSON(b []byte) error { } } } - if v, ok := req["attributesToUpdate"]; ok { //attributesToUpdate + if v, ok := req["attributesToUpdate"]; ok { err = json.Unmarshal(v, &r.attributesToUpdate) if err != nil { err = json.Unmarshal(b, &r.attributesToUpdate) @@ -5766,7 +5607,7 @@ func (r *ApiPartialUpdateObjectRequest) UnmarshalJSON(b []byte) error { return err } } - if v, ok := req["createIfNotExists"]; ok { //createIfNotExists + if v, ok := req["createIfNotExists"]; ok { err = json.Unmarshal(v, &r.createIfNotExists) if err != nil { err = json.Unmarshal(b, &r.createIfNotExists) @@ -5779,12 +5620,6 @@ func (r *ApiPartialUpdateObjectRequest) UnmarshalJSON(b []byte) error { return nil } -// Map of attribute(s) to update. -func (r ApiPartialUpdateObjectRequest) WithAttributesToUpdate(attributesToUpdate *map[string]AttributeToUpdate) ApiPartialUpdateObjectRequest { - r.attributesToUpdate = attributesToUpdate - return r -} - // Creates the record if it does not exist yet. func (r ApiPartialUpdateObjectRequest) WithCreateIfNotExists(createIfNotExists bool) ApiPartialUpdateObjectRequest { r.createIfNotExists = createIfNotExists @@ -5792,10 +5627,11 @@ func (r ApiPartialUpdateObjectRequest) WithCreateIfNotExists(createIfNotExists b } // @return ApiPartialUpdateObjectRequest -func (c *APIClient) NewApiPartialUpdateObjectRequest(indexName string, objectID string) ApiPartialUpdateObjectRequest { +func (c *APIClient) NewApiPartialUpdateObjectRequest(indexName string, objectID string, attributesToUpdate *map[string]AttributeToUpdate) ApiPartialUpdateObjectRequest { return ApiPartialUpdateObjectRequest{ - indexName: indexName, - objectID: objectID, + indexName: indexName, + objectID: objectID, + attributesToUpdate: attributesToUpdate, } } @@ -5920,7 +5756,7 @@ func (r *ApiPostRequest) UnmarshalJSON(b []byte) error { if err != nil { return err } - if v, ok := req["path"]; ok { //path + if v, ok := req["path"]; ok { err = json.Unmarshal(v, &r.path) if err != nil { err = json.Unmarshal(b, &r.path) @@ -5929,7 +5765,7 @@ func (r *ApiPostRequest) UnmarshalJSON(b []byte) error { } } } - if v, ok := req["parameters"]; ok { //parameters + if v, ok := req["parameters"]; ok { err = json.Unmarshal(v, &r.parameters) if err != nil { err = json.Unmarshal(b, &r.parameters) @@ -5938,7 +5774,7 @@ func (r *ApiPostRequest) UnmarshalJSON(b []byte) error { } } } - if v, ok := req["body"]; ok { //body + if v, ok := req["body"]; ok { err = json.Unmarshal(v, &r.body) if err != nil { err = json.Unmarshal(b, &r.body) @@ -6093,7 +5929,7 @@ func (r *ApiPutRequest) UnmarshalJSON(b []byte) error { if err != nil { return err } - if v, ok := req["path"]; ok { //path + if v, ok := req["path"]; ok { err = json.Unmarshal(v, &r.path) if err != nil { err = json.Unmarshal(b, &r.path) @@ -6102,7 +5938,7 @@ func (r *ApiPutRequest) UnmarshalJSON(b []byte) error { } } } - if v, ok := req["parameters"]; ok { //parameters + if v, ok := req["parameters"]; ok { err = json.Unmarshal(v, &r.parameters) if err != nil { err = json.Unmarshal(b, &r.parameters) @@ -6111,7 +5947,7 @@ func (r *ApiPutRequest) UnmarshalJSON(b []byte) error { } } } - if v, ok := req["body"]; ok { //body + if v, ok := req["body"]; ok { err = json.Unmarshal(v, &r.body) if err != nil { err = json.Unmarshal(b, &r.body) @@ -6264,7 +6100,7 @@ func (r *ApiRemoveUserIdRequest) UnmarshalJSON(b []byte) error { if err != nil { return err } - if v, ok := req["userID"]; ok { //userID + if v, ok := req["userID"]; ok { err = json.Unmarshal(v, &r.userID) if err != nil { err = json.Unmarshal(b, &r.userID) @@ -6393,7 +6229,7 @@ func (r *ApiReplaceSourcesRequest) UnmarshalJSON(b []byte) error { if err != nil { return err } - if v, ok := req["source"]; ok { //source + if v, ok := req["source"]; ok { err = json.Unmarshal(v, &r.source) if err != nil { err = json.Unmarshal(b, &r.source) @@ -6411,15 +6247,11 @@ func (r *ApiReplaceSourcesRequest) UnmarshalJSON(b []byte) error { return nil } -// The sources to allow. -func (r ApiReplaceSourcesRequest) WithSource(source []Source) ApiReplaceSourcesRequest { - r.source = source - return r -} - // @return ApiReplaceSourcesRequest -func (c *APIClient) NewApiReplaceSourcesRequest() ApiReplaceSourcesRequest { - return ApiReplaceSourcesRequest{} +func (c *APIClient) NewApiReplaceSourcesRequest(source []Source) ApiReplaceSourcesRequest { + return ApiReplaceSourcesRequest{ + source: source, + } } // ReplaceSources wraps ReplaceSourcesWithContext using context.Background. @@ -6535,7 +6367,7 @@ func (r *ApiRestoreApiKeyRequest) UnmarshalJSON(b []byte) error { if err != nil { return err } - if v, ok := req["key"]; ok { //key + if v, ok := req["key"]; ok { err = json.Unmarshal(v, &r.key) if err != nil { err = json.Unmarshal(b, &r.key) @@ -6665,7 +6497,7 @@ func (r *ApiSaveObjectRequest) UnmarshalJSON(b []byte) error { if err != nil { return err } - if v, ok := req["indexName"]; ok { //indexName + if v, ok := req["indexName"]; ok { err = json.Unmarshal(v, &r.indexName) if err != nil { err = json.Unmarshal(b, &r.indexName) @@ -6674,7 +6506,7 @@ func (r *ApiSaveObjectRequest) UnmarshalJSON(b []byte) error { } } } - if v, ok := req["body"]; ok { //body + if v, ok := req["body"]; ok { err = json.Unmarshal(v, &r.body) if err != nil { err = json.Unmarshal(b, &r.body) @@ -6692,16 +6524,11 @@ func (r *ApiSaveObjectRequest) UnmarshalJSON(b []byte) error { return nil } -// The Algolia record. -func (r ApiSaveObjectRequest) WithBody(body map[string]interface{}) ApiSaveObjectRequest { - r.body = body - return r -} - // @return ApiSaveObjectRequest -func (c *APIClient) NewApiSaveObjectRequest(indexName string) ApiSaveObjectRequest { +func (c *APIClient) NewApiSaveObjectRequest(indexName string, body map[string]interface{}) ApiSaveObjectRequest { return ApiSaveObjectRequest{ indexName: indexName, + body: body, } } @@ -6819,7 +6646,7 @@ func (r *ApiSaveRuleRequest) UnmarshalJSON(b []byte) error { if err != nil { return err } - if v, ok := req["indexName"]; ok { //indexName + if v, ok := req["indexName"]; ok { err = json.Unmarshal(v, &r.indexName) if err != nil { err = json.Unmarshal(b, &r.indexName) @@ -6828,7 +6655,7 @@ func (r *ApiSaveRuleRequest) UnmarshalJSON(b []byte) error { } } } - if v, ok := req["objectID"]; ok { //objectID + if v, ok := req["objectID"]; ok { err = json.Unmarshal(v, &r.objectID) if err != nil { err = json.Unmarshal(b, &r.objectID) @@ -6837,7 +6664,7 @@ func (r *ApiSaveRuleRequest) UnmarshalJSON(b []byte) error { } } } - if v, ok := req["rule"]; ok { //rule + if v, ok := req["rule"]; ok { err = json.Unmarshal(v, &r.rule) if err != nil { err = json.Unmarshal(b, &r.rule) @@ -6851,7 +6678,7 @@ func (r *ApiSaveRuleRequest) UnmarshalJSON(b []byte) error { return err } } - if v, ok := req["forwardToReplicas"]; ok { //forwardToReplicas + if v, ok := req["forwardToReplicas"]; ok { err = json.Unmarshal(v, &r.forwardToReplicas) if err != nil { err = json.Unmarshal(b, &r.forwardToReplicas) @@ -6864,11 +6691,6 @@ func (r *ApiSaveRuleRequest) UnmarshalJSON(b []byte) error { return nil } -func (r ApiSaveRuleRequest) WithRule(rule *Rule) ApiSaveRuleRequest { - r.rule = rule - return r -} - // When true, changes are also propagated to replicas of the given indexName. func (r ApiSaveRuleRequest) WithForwardToReplicas(forwardToReplicas bool) ApiSaveRuleRequest { r.forwardToReplicas = forwardToReplicas @@ -6876,10 +6698,11 @@ func (r ApiSaveRuleRequest) WithForwardToReplicas(forwardToReplicas bool) ApiSav } // @return ApiSaveRuleRequest -func (c *APIClient) NewApiSaveRuleRequest(indexName string, objectID string) ApiSaveRuleRequest { +func (c *APIClient) NewApiSaveRuleRequest(indexName string, objectID string, rule *Rule) ApiSaveRuleRequest { return ApiSaveRuleRequest{ indexName: indexName, objectID: objectID, + rule: rule, } } @@ -7005,7 +6828,7 @@ func (r *ApiSaveRulesRequest) UnmarshalJSON(b []byte) error { if err != nil { return err } - if v, ok := req["indexName"]; ok { //indexName + if v, ok := req["indexName"]; ok { err = json.Unmarshal(v, &r.indexName) if err != nil { err = json.Unmarshal(b, &r.indexName) @@ -7014,7 +6837,7 @@ func (r *ApiSaveRulesRequest) UnmarshalJSON(b []byte) error { } } } - if v, ok := req["rules"]; ok { //rules + if v, ok := req["rules"]; ok { err = json.Unmarshal(v, &r.rules) if err != nil { err = json.Unmarshal(b, &r.rules) @@ -7028,7 +6851,7 @@ func (r *ApiSaveRulesRequest) UnmarshalJSON(b []byte) error { return err } } - if v, ok := req["forwardToReplicas"]; ok { //forwardToReplicas + if v, ok := req["forwardToReplicas"]; ok { err = json.Unmarshal(v, &r.forwardToReplicas) if err != nil { err = json.Unmarshal(b, &r.forwardToReplicas) @@ -7037,7 +6860,7 @@ func (r *ApiSaveRulesRequest) UnmarshalJSON(b []byte) error { } } } - if v, ok := req["clearExistingRules"]; ok { //clearExistingRules + if v, ok := req["clearExistingRules"]; ok { err = json.Unmarshal(v, &r.clearExistingRules) if err != nil { err = json.Unmarshal(b, &r.clearExistingRules) @@ -7050,11 +6873,6 @@ func (r *ApiSaveRulesRequest) UnmarshalJSON(b []byte) error { return nil } -func (r ApiSaveRulesRequest) WithRules(rules []Rule) ApiSaveRulesRequest { - r.rules = rules - return r -} - // When true, changes are also propagated to replicas of the given indexName. func (r ApiSaveRulesRequest) WithForwardToReplicas(forwardToReplicas bool) ApiSaveRulesRequest { r.forwardToReplicas = forwardToReplicas @@ -7068,9 +6886,10 @@ func (r ApiSaveRulesRequest) WithClearExistingRules(clearExistingRules bool) Api } // @return ApiSaveRulesRequest -func (c *APIClient) NewApiSaveRulesRequest(indexName string) ApiSaveRulesRequest { +func (c *APIClient) NewApiSaveRulesRequest(indexName string, rules []Rule) ApiSaveRulesRequest { return ApiSaveRulesRequest{ indexName: indexName, + rules: rules, } } @@ -7198,7 +7017,7 @@ func (r *ApiSaveSynonymRequest) UnmarshalJSON(b []byte) error { if err != nil { return err } - if v, ok := req["indexName"]; ok { //indexName + if v, ok := req["indexName"]; ok { err = json.Unmarshal(v, &r.indexName) if err != nil { err = json.Unmarshal(b, &r.indexName) @@ -7207,7 +7026,7 @@ func (r *ApiSaveSynonymRequest) UnmarshalJSON(b []byte) error { } } } - if v, ok := req["objectID"]; ok { //objectID + if v, ok := req["objectID"]; ok { err = json.Unmarshal(v, &r.objectID) if err != nil { err = json.Unmarshal(b, &r.objectID) @@ -7216,7 +7035,7 @@ func (r *ApiSaveSynonymRequest) UnmarshalJSON(b []byte) error { } } } - if v, ok := req["synonymHit"]; ok { //synonymHit + if v, ok := req["synonymHit"]; ok { err = json.Unmarshal(v, &r.synonymHit) if err != nil { err = json.Unmarshal(b, &r.synonymHit) @@ -7230,7 +7049,7 @@ func (r *ApiSaveSynonymRequest) UnmarshalJSON(b []byte) error { return err } } - if v, ok := req["forwardToReplicas"]; ok { //forwardToReplicas + if v, ok := req["forwardToReplicas"]; ok { err = json.Unmarshal(v, &r.forwardToReplicas) if err != nil { err = json.Unmarshal(b, &r.forwardToReplicas) @@ -7243,11 +7062,6 @@ func (r *ApiSaveSynonymRequest) UnmarshalJSON(b []byte) error { return nil } -func (r ApiSaveSynonymRequest) WithSynonymHit(synonymHit *SynonymHit) ApiSaveSynonymRequest { - r.synonymHit = synonymHit - return r -} - // When true, changes are also propagated to replicas of the given indexName. func (r ApiSaveSynonymRequest) WithForwardToReplicas(forwardToReplicas bool) ApiSaveSynonymRequest { r.forwardToReplicas = forwardToReplicas @@ -7255,10 +7069,11 @@ func (r ApiSaveSynonymRequest) WithForwardToReplicas(forwardToReplicas bool) Api } // @return ApiSaveSynonymRequest -func (c *APIClient) NewApiSaveSynonymRequest(indexName string, objectID string) ApiSaveSynonymRequest { +func (c *APIClient) NewApiSaveSynonymRequest(indexName string, objectID string, synonymHit *SynonymHit) ApiSaveSynonymRequest { return ApiSaveSynonymRequest{ - indexName: indexName, - objectID: objectID, + indexName: indexName, + objectID: objectID, + synonymHit: synonymHit, } } @@ -7384,7 +7199,7 @@ func (r *ApiSaveSynonymsRequest) UnmarshalJSON(b []byte) error { if err != nil { return err } - if v, ok := req["indexName"]; ok { //indexName + if v, ok := req["indexName"]; ok { err = json.Unmarshal(v, &r.indexName) if err != nil { err = json.Unmarshal(b, &r.indexName) @@ -7393,7 +7208,7 @@ func (r *ApiSaveSynonymsRequest) UnmarshalJSON(b []byte) error { } } } - if v, ok := req["synonymHit"]; ok { //synonymHit + if v, ok := req["synonymHit"]; ok { err = json.Unmarshal(v, &r.synonymHit) if err != nil { err = json.Unmarshal(b, &r.synonymHit) @@ -7407,7 +7222,7 @@ func (r *ApiSaveSynonymsRequest) UnmarshalJSON(b []byte) error { return err } } - if v, ok := req["forwardToReplicas"]; ok { //forwardToReplicas + if v, ok := req["forwardToReplicas"]; ok { err = json.Unmarshal(v, &r.forwardToReplicas) if err != nil { err = json.Unmarshal(b, &r.forwardToReplicas) @@ -7416,7 +7231,7 @@ func (r *ApiSaveSynonymsRequest) UnmarshalJSON(b []byte) error { } } } - if v, ok := req["replaceExistingSynonyms"]; ok { //replaceExistingSynonyms + if v, ok := req["replaceExistingSynonyms"]; ok { err = json.Unmarshal(v, &r.replaceExistingSynonyms) if err != nil { err = json.Unmarshal(b, &r.replaceExistingSynonyms) @@ -7429,11 +7244,6 @@ func (r *ApiSaveSynonymsRequest) UnmarshalJSON(b []byte) error { return nil } -func (r ApiSaveSynonymsRequest) WithSynonymHit(synonymHit []SynonymHit) ApiSaveSynonymsRequest { - r.synonymHit = synonymHit - return r -} - // When true, changes are also propagated to replicas of the given indexName. func (r ApiSaveSynonymsRequest) WithForwardToReplicas(forwardToReplicas bool) ApiSaveSynonymsRequest { r.forwardToReplicas = forwardToReplicas @@ -7447,9 +7257,10 @@ func (r ApiSaveSynonymsRequest) WithReplaceExistingSynonyms(replaceExistingSynon } // @return ApiSaveSynonymsRequest -func (c *APIClient) NewApiSaveSynonymsRequest(indexName string) ApiSaveSynonymsRequest { +func (c *APIClient) NewApiSaveSynonymsRequest(indexName string, synonymHit []SynonymHit) ApiSaveSynonymsRequest { return ApiSaveSynonymsRequest{ - indexName: indexName, + indexName: indexName, + synonymHit: synonymHit, } } @@ -7574,7 +7385,7 @@ func (r *ApiSearchRequest) UnmarshalJSON(b []byte) error { if err != nil { return err } - if v, ok := req["searchMethodParams"]; ok { //searchMethodParams + if v, ok := req["searchMethodParams"]; ok { err = json.Unmarshal(v, &r.searchMethodParams) if err != nil { err = json.Unmarshal(b, &r.searchMethodParams) @@ -7592,15 +7403,11 @@ func (r *ApiSearchRequest) UnmarshalJSON(b []byte) error { return nil } -// The `search` requests and strategy. -func (r ApiSearchRequest) WithSearchMethodParams(searchMethodParams *SearchMethodParams) ApiSearchRequest { - r.searchMethodParams = searchMethodParams - return r -} - // @return ApiSearchRequest -func (c *APIClient) NewApiSearchRequest() ApiSearchRequest { - return ApiSearchRequest{} +func (c *APIClient) NewApiSearchRequest(searchMethodParams *SearchMethodParams) ApiSearchRequest { + return ApiSearchRequest{ + searchMethodParams: searchMethodParams, + } } // Search wraps SearchWithContext using context.Background. @@ -7717,7 +7524,7 @@ func (r *ApiSearchDictionaryEntriesRequest) UnmarshalJSON(b []byte) error { if err != nil { return err } - if v, ok := req["dictionaryName"]; ok { //dictionaryName + if v, ok := req["dictionaryName"]; ok { err = json.Unmarshal(v, &r.dictionaryName) if err != nil { err = json.Unmarshal(b, &r.dictionaryName) @@ -7726,7 +7533,7 @@ func (r *ApiSearchDictionaryEntriesRequest) UnmarshalJSON(b []byte) error { } } } - if v, ok := req["searchDictionaryEntriesParams"]; ok { //searchDictionaryEntriesParams + if v, ok := req["searchDictionaryEntriesParams"]; ok { err = json.Unmarshal(v, &r.searchDictionaryEntriesParams) if err != nil { err = json.Unmarshal(b, &r.searchDictionaryEntriesParams) @@ -7744,15 +7551,11 @@ func (r *ApiSearchDictionaryEntriesRequest) UnmarshalJSON(b []byte) error { return nil } -func (r ApiSearchDictionaryEntriesRequest) WithSearchDictionaryEntriesParams(searchDictionaryEntriesParams *SearchDictionaryEntriesParams) ApiSearchDictionaryEntriesRequest { - r.searchDictionaryEntriesParams = searchDictionaryEntriesParams - return r -} - // @return ApiSearchDictionaryEntriesRequest -func (c *APIClient) NewApiSearchDictionaryEntriesRequest(dictionaryName DictionaryType) ApiSearchDictionaryEntriesRequest { +func (c *APIClient) NewApiSearchDictionaryEntriesRequest(dictionaryName DictionaryType, searchDictionaryEntriesParams *SearchDictionaryEntriesParams) ApiSearchDictionaryEntriesRequest { return ApiSearchDictionaryEntriesRequest{ - dictionaryName: dictionaryName, + dictionaryName: dictionaryName, + searchDictionaryEntriesParams: searchDictionaryEntriesParams, } } @@ -7872,7 +7675,7 @@ func (r *ApiSearchForFacetValuesRequest) UnmarshalJSON(b []byte) error { if err != nil { return err } - if v, ok := req["indexName"]; ok { //indexName + if v, ok := req["indexName"]; ok { err = json.Unmarshal(v, &r.indexName) if err != nil { err = json.Unmarshal(b, &r.indexName) @@ -7881,7 +7684,7 @@ func (r *ApiSearchForFacetValuesRequest) UnmarshalJSON(b []byte) error { } } } - if v, ok := req["facetName"]; ok { //facetName + if v, ok := req["facetName"]; ok { err = json.Unmarshal(v, &r.facetName) if err != nil { err = json.Unmarshal(b, &r.facetName) @@ -7890,7 +7693,7 @@ func (r *ApiSearchForFacetValuesRequest) UnmarshalJSON(b []byte) error { } } } - if v, ok := req["searchForFacetValuesRequest"]; ok { //searchForFacetValuesRequest + if v, ok := req["searchForFacetValuesRequest"]; ok { err = json.Unmarshal(v, &r.searchForFacetValuesRequest) if err != nil { err = json.Unmarshal(b, &r.searchForFacetValuesRequest) @@ -8033,7 +7836,7 @@ func (r *ApiSearchRulesRequest) UnmarshalJSON(b []byte) error { if err != nil { return err } - if v, ok := req["indexName"]; ok { //indexName + if v, ok := req["indexName"]; ok { err = json.Unmarshal(v, &r.indexName) if err != nil { err = json.Unmarshal(b, &r.indexName) @@ -8042,7 +7845,7 @@ func (r *ApiSearchRulesRequest) UnmarshalJSON(b []byte) error { } } } - if v, ok := req["searchRulesParams"]; ok { //searchRulesParams + if v, ok := req["searchRulesParams"]; ok { err = json.Unmarshal(v, &r.searchRulesParams) if err != nil { err = json.Unmarshal(b, &r.searchRulesParams) @@ -8183,7 +7986,7 @@ func (r *ApiSearchSingleIndexRequest) UnmarshalJSON(b []byte) error { if err != nil { return err } - if v, ok := req["indexName"]; ok { //indexName + if v, ok := req["indexName"]; ok { err = json.Unmarshal(v, &r.indexName) if err != nil { err = json.Unmarshal(b, &r.indexName) @@ -8192,7 +7995,7 @@ func (r *ApiSearchSingleIndexRequest) UnmarshalJSON(b []byte) error { } } } - if v, ok := req["searchParams"]; ok { //searchParams + if v, ok := req["searchParams"]; ok { err = json.Unmarshal(v, &r.searchParams) if err != nil { err = json.Unmarshal(b, &r.searchParams) @@ -8336,7 +8139,7 @@ func (r *ApiSearchSynonymsRequest) UnmarshalJSON(b []byte) error { if err != nil { return err } - if v, ok := req["indexName"]; ok { //indexName + if v, ok := req["indexName"]; ok { err = json.Unmarshal(v, &r.indexName) if err != nil { err = json.Unmarshal(b, &r.indexName) @@ -8345,7 +8148,7 @@ func (r *ApiSearchSynonymsRequest) UnmarshalJSON(b []byte) error { } } } - if v, ok := req["type"]; ok { //type_ + if v, ok := req["type"]; ok { err = json.Unmarshal(v, &r.type_) if err != nil { err = json.Unmarshal(b, &r.type_) @@ -8354,7 +8157,7 @@ func (r *ApiSearchSynonymsRequest) UnmarshalJSON(b []byte) error { } } } - if v, ok := req["page"]; ok { //page + if v, ok := req["page"]; ok { err = json.Unmarshal(v, &r.page) if err != nil { err = json.Unmarshal(b, &r.page) @@ -8363,7 +8166,7 @@ func (r *ApiSearchSynonymsRequest) UnmarshalJSON(b []byte) error { } } } - if v, ok := req["hitsPerPage"]; ok { //hitsPerPage + if v, ok := req["hitsPerPage"]; ok { err = json.Unmarshal(v, &r.hitsPerPage) if err != nil { err = json.Unmarshal(b, &r.hitsPerPage) @@ -8372,7 +8175,7 @@ func (r *ApiSearchSynonymsRequest) UnmarshalJSON(b []byte) error { } } } - if v, ok := req["searchSynonymsParams"]; ok { //searchSynonymsParams + if v, ok := req["searchSynonymsParams"]; ok { err = json.Unmarshal(v, &r.searchSynonymsParams) if err != nil { err = json.Unmarshal(b, &r.searchSynonymsParams) @@ -8541,7 +8344,7 @@ func (r *ApiSearchUserIdsRequest) UnmarshalJSON(b []byte) error { if err != nil { return err } - if v, ok := req["searchUserIdsParams"]; ok { //searchUserIdsParams + if v, ok := req["searchUserIdsParams"]; ok { err = json.Unmarshal(v, &r.searchUserIdsParams) if err != nil { err = json.Unmarshal(b, &r.searchUserIdsParams) @@ -8559,14 +8362,11 @@ func (r *ApiSearchUserIdsRequest) UnmarshalJSON(b []byte) error { return nil } -func (r ApiSearchUserIdsRequest) WithSearchUserIdsParams(searchUserIdsParams *SearchUserIdsParams) ApiSearchUserIdsRequest { - r.searchUserIdsParams = searchUserIdsParams - return r -} - // @return ApiSearchUserIdsRequest -func (c *APIClient) NewApiSearchUserIdsRequest() ApiSearchUserIdsRequest { - return ApiSearchUserIdsRequest{} +func (c *APIClient) NewApiSearchUserIdsRequest(searchUserIdsParams *SearchUserIdsParams) ApiSearchUserIdsRequest { + return ApiSearchUserIdsRequest{ + searchUserIdsParams: searchUserIdsParams, + } } // SearchUserIds wraps SearchUserIdsWithContext using context.Background. @@ -8682,7 +8482,7 @@ func (r *ApiSetDictionarySettingsRequest) UnmarshalJSON(b []byte) error { if err != nil { return err } - if v, ok := req["dictionarySettingsParams"]; ok { //dictionarySettingsParams + if v, ok := req["dictionarySettingsParams"]; ok { err = json.Unmarshal(v, &r.dictionarySettingsParams) if err != nil { err = json.Unmarshal(b, &r.dictionarySettingsParams) @@ -8700,14 +8500,11 @@ func (r *ApiSetDictionarySettingsRequest) UnmarshalJSON(b []byte) error { return nil } -func (r ApiSetDictionarySettingsRequest) WithDictionarySettingsParams(dictionarySettingsParams *DictionarySettingsParams) ApiSetDictionarySettingsRequest { - r.dictionarySettingsParams = dictionarySettingsParams - return r -} - // @return ApiSetDictionarySettingsRequest -func (c *APIClient) NewApiSetDictionarySettingsRequest() ApiSetDictionarySettingsRequest { - return ApiSetDictionarySettingsRequest{} +func (c *APIClient) NewApiSetDictionarySettingsRequest(dictionarySettingsParams *DictionarySettingsParams) ApiSetDictionarySettingsRequest { + return ApiSetDictionarySettingsRequest{ + dictionarySettingsParams: dictionarySettingsParams, + } } // SetDictionarySettings wraps SetDictionarySettingsWithContext using context.Background. @@ -8825,7 +8622,7 @@ func (r *ApiSetSettingsRequest) UnmarshalJSON(b []byte) error { if err != nil { return err } - if v, ok := req["indexName"]; ok { //indexName + if v, ok := req["indexName"]; ok { err = json.Unmarshal(v, &r.indexName) if err != nil { err = json.Unmarshal(b, &r.indexName) @@ -8834,7 +8631,7 @@ func (r *ApiSetSettingsRequest) UnmarshalJSON(b []byte) error { } } } - if v, ok := req["indexSettings"]; ok { //indexSettings + if v, ok := req["indexSettings"]; ok { err = json.Unmarshal(v, &r.indexSettings) if err != nil { err = json.Unmarshal(b, &r.indexSettings) @@ -8848,7 +8645,7 @@ func (r *ApiSetSettingsRequest) UnmarshalJSON(b []byte) error { return err } } - if v, ok := req["forwardToReplicas"]; ok { //forwardToReplicas + if v, ok := req["forwardToReplicas"]; ok { err = json.Unmarshal(v, &r.forwardToReplicas) if err != nil { err = json.Unmarshal(b, &r.forwardToReplicas) @@ -8861,11 +8658,6 @@ func (r *ApiSetSettingsRequest) UnmarshalJSON(b []byte) error { return nil } -func (r ApiSetSettingsRequest) WithIndexSettings(indexSettings *IndexSettings) ApiSetSettingsRequest { - r.indexSettings = indexSettings - return r -} - // When true, changes are also propagated to replicas of the given indexName. func (r ApiSetSettingsRequest) WithForwardToReplicas(forwardToReplicas bool) ApiSetSettingsRequest { r.forwardToReplicas = forwardToReplicas @@ -8873,9 +8665,10 @@ func (r ApiSetSettingsRequest) WithForwardToReplicas(forwardToReplicas bool) Api } // @return ApiSetSettingsRequest -func (c *APIClient) NewApiSetSettingsRequest(indexName string) ApiSetSettingsRequest { +func (c *APIClient) NewApiSetSettingsRequest(indexName string, indexSettings *IndexSettings) ApiSetSettingsRequest { return ApiSetSettingsRequest{ - indexName: indexName, + indexName: indexName, + indexSettings: indexSettings, } } @@ -8998,7 +8791,7 @@ func (r *ApiUpdateApiKeyRequest) UnmarshalJSON(b []byte) error { if err != nil { return err } - if v, ok := req["key"]; ok { //key + if v, ok := req["key"]; ok { err = json.Unmarshal(v, &r.key) if err != nil { err = json.Unmarshal(b, &r.key) @@ -9007,7 +8800,7 @@ func (r *ApiUpdateApiKeyRequest) UnmarshalJSON(b []byte) error { } } } - if v, ok := req["apiKey"]; ok { //apiKey + if v, ok := req["apiKey"]; ok { err = json.Unmarshal(v, &r.apiKey) if err != nil { err = json.Unmarshal(b, &r.apiKey) @@ -9025,15 +8818,11 @@ func (r *ApiUpdateApiKeyRequest) UnmarshalJSON(b []byte) error { return nil } -func (r ApiUpdateApiKeyRequest) WithApiKey(apiKey *ApiKey) ApiUpdateApiKeyRequest { - r.apiKey = apiKey - return r -} - // @return ApiUpdateApiKeyRequest -func (c *APIClient) NewApiUpdateApiKeyRequest(key string) ApiUpdateApiKeyRequest { +func (c *APIClient) NewApiUpdateApiKeyRequest(key string, apiKey *ApiKey) ApiUpdateApiKeyRequest { return ApiUpdateApiKeyRequest{ - key: key, + key: key, + apiKey: apiKey, } } diff --git a/tests/output/go/tests/methods/requests/personalization_test.go b/tests/output/go/tests/methods/requests/personalization_test.go index 6bf9226dc2..110930a1c9 100644 --- a/tests/output/go/tests/methods/requests/personalization_test.go +++ b/tests/output/go/tests/methods/requests/personalization_test.go @@ -177,10 +177,7 @@ func TestPersonalization_GetPersonalizationStrategy(t *testing.T) { { name: "get getPersonalizationStrategy", testFunc: func(t *testing.T) { - parametersStr := `{}` - req := personalization.ApiGetPersonalizationStrategyRequest{} - require.NoError(t, json.Unmarshal([]byte(parametersStr), &req)) - _, err := client.GetPersonalizationStrategy(req) + _, err := client.GetPersonalizationStrategy() require.NoError(t, err) expectedPath, err := url.QueryUnescape("/1/strategies/personalization") diff --git a/tests/output/go/tests/methods/requests/predict_test.go b/tests/output/go/tests/methods/requests/predict_test.go index 88b29b4a68..f0b9ba5c17 100644 --- a/tests/output/go/tests/methods/requests/predict_test.go +++ b/tests/output/go/tests/methods/requests/predict_test.go @@ -616,10 +616,7 @@ func TestPredict_GetAvailableModelTypes(t *testing.T) { { name: "get available model types", testFunc: func(t *testing.T) { - parametersStr := `{}` - req := predict.ApiGetAvailableModelTypesRequest{} - require.NoError(t, json.Unmarshal([]byte(parametersStr), &req)) - _, err := client.GetAvailableModelTypes(req) + _, err := client.GetAvailableModelTypes() require.NoError(t, err) expectedPath, err := url.QueryUnescape("/1/predict/modeltypes") @@ -682,10 +679,7 @@ func TestPredict_GetModelInstances(t *testing.T) { { name: "get a list of model instances", testFunc: func(t *testing.T) { - parametersStr := `{}` - req := predict.ApiGetModelInstancesRequest{} - require.NoError(t, json.Unmarshal([]byte(parametersStr), &req)) - _, err := client.GetModelInstances(req) + _, err := client.GetModelInstances() require.NoError(t, err) expectedPath, err := url.QueryUnescape("/1/predict/models") diff --git a/tests/output/go/tests/methods/requests/query-suggestions_test.go b/tests/output/go/tests/methods/requests/query-suggestions_test.go index 31148b27d2..54ba4d3f97 100644 --- a/tests/output/go/tests/methods/requests/query-suggestions_test.go +++ b/tests/output/go/tests/methods/requests/query-suggestions_test.go @@ -211,10 +211,7 @@ func TestSuggestions_GetAllConfigs(t *testing.T) { { name: "getAllConfigs", testFunc: func(t *testing.T) { - parametersStr := `{}` - req := suggestions.ApiGetAllConfigsRequest{} - require.NoError(t, json.Unmarshal([]byte(parametersStr), &req)) - _, err := client.GetAllConfigs(req) + _, err := client.GetAllConfigs() require.NoError(t, err) expectedPath, err := url.QueryUnescape("/1/configs") diff --git a/tests/output/go/tests/methods/requests/search_test.go b/tests/output/go/tests/methods/requests/search_test.go index afd03bd889..0e849eb215 100644 --- a/tests/output/go/tests/methods/requests/search_test.go +++ b/tests/output/go/tests/methods/requests/search_test.go @@ -969,10 +969,7 @@ func TestSearch_GetDictionaryLanguages(t *testing.T) { { name: "get getDictionaryLanguages", testFunc: func(t *testing.T) { - parametersStr := `{}` - req := search.ApiGetDictionaryLanguagesRequest{} - require.NoError(t, json.Unmarshal([]byte(parametersStr), &req)) - _, err := client.GetDictionaryLanguages(req) + _, err := client.GetDictionaryLanguages() require.NoError(t, err) expectedPath, err := url.QueryUnescape("/1/dictionaries/*/languages") @@ -1002,10 +999,7 @@ func TestSearch_GetDictionarySettings(t *testing.T) { { name: "get getDictionarySettings results", testFunc: func(t *testing.T) { - parametersStr := `{}` - req := search.ApiGetDictionarySettingsRequest{} - require.NoError(t, json.Unmarshal([]byte(parametersStr), &req)) - _, err := client.GetDictionarySettings(req) + _, err := client.GetDictionarySettings() require.NoError(t, err) expectedPath, err := url.QueryUnescape("/1/dictionaries/*/settings") @@ -1228,10 +1222,7 @@ func TestSearch_GetSources(t *testing.T) { { name: "getSources", testFunc: func(t *testing.T) { - parametersStr := `{}` - req := search.ApiGetSourcesRequest{} - require.NoError(t, json.Unmarshal([]byte(parametersStr), &req)) - _, err := client.GetSources(req) + _, err := client.GetSources() require.NoError(t, err) expectedPath, err := url.QueryUnescape("/1/security/sources") @@ -1327,10 +1318,7 @@ func TestSearch_GetTopUserIds(t *testing.T) { { name: "getTopUserIds", testFunc: func(t *testing.T) { - parametersStr := `{}` - req := search.ApiGetTopUserIdsRequest{} - require.NoError(t, json.Unmarshal([]byte(parametersStr), &req)) - _, err := client.GetTopUserIds(req) + _, err := client.GetTopUserIds() require.NoError(t, err) expectedPath, err := url.QueryUnescape("/1/clusters/mapping/top") @@ -1448,10 +1436,7 @@ func TestSearch_ListApiKeys(t *testing.T) { { name: "listApiKeys", testFunc: func(t *testing.T) { - parametersStr := `{}` - req := search.ApiListApiKeysRequest{} - require.NoError(t, json.Unmarshal([]byte(parametersStr), &req)) - _, err := client.ListApiKeys(req) + _, err := client.ListApiKeys() require.NoError(t, err) expectedPath, err := url.QueryUnescape("/1/keys") @@ -1481,10 +1466,7 @@ func TestSearch_ListClusters(t *testing.T) { { name: "listClusters", testFunc: func(t *testing.T) { - parametersStr := `{}` - req := search.ApiListClustersRequest{} - require.NoError(t, json.Unmarshal([]byte(parametersStr), &req)) - _, err := client.ListClusters(req) + _, err := client.ListClusters() require.NoError(t, err) expectedPath, err := url.QueryUnescape("/1/clusters")