diff --git a/clients/algoliasearch-client-java-2/algoliasearch-core/com/algolia/search/SearchApi.java b/clients/algoliasearch-client-java-2/algoliasearch-core/com/algolia/search/SearchApi.java index 69c5a46d60..0059add9a8 100644 --- a/clients/algoliasearch-client-java-2/algoliasearch-core/com/algolia/search/SearchApi.java +++ b/clients/algoliasearch-client-java-2/algoliasearch-core/com/algolia/search/SearchApi.java @@ -183,13 +183,10 @@ private Call addOrUpdateObjectCall( // create path and map variables String requestPath = "/1/indexes/{indexName}/{objectID}".replaceAll( - "\\{" + "indexName" + "\\}", + "\\{indexName\\}", this.escapeString(indexName.toString()) ) - .replaceAll( - "\\{" + "objectID" + "\\}", - this.escapeString(objectID.toString()) - ); + .replaceAll("\\{objectID\\}", this.escapeString(objectID.toString())); List queryParams = new ArrayList(); Map headers = new HashMap(); @@ -527,7 +524,7 @@ private Call batchCall( // create path and map variables String requestPath = "/1/indexes/{indexName}/batch".replaceAll( - "\\{" + "indexName" + "\\}", + "\\{indexName\\}", this.escapeString(indexName.toString()) ); @@ -754,7 +751,7 @@ private Call batchDictionaryEntriesCall( // create path and map variables String requestPath = "/1/dictionaries/{dictionaryName}/batch".replaceAll( - "\\{" + "dictionaryName" + "\\}", + "\\{dictionaryName\\}", this.escapeString(dictionaryName.toString()) ); @@ -875,7 +872,7 @@ private Call batchRulesCall( // create path and map variables String requestPath = "/1/indexes/{indexName}/rules/batch".replaceAll( - "\\{" + "indexName" + "\\}", + "\\{indexName\\}", this.escapeString(indexName.toString()) ); @@ -1027,7 +1024,7 @@ private Call browseCall( // create path and map variables String requestPath = "/1/indexes/{indexName}/browse".replaceAll( - "\\{" + "indexName" + "\\}", + "\\{indexName\\}", this.escapeString(indexName.toString()) ); @@ -1137,7 +1134,7 @@ private Call clearAllSynonymsCall( // create path and map variables String requestPath = "/1/indexes/{indexName}/synonyms/clear".replaceAll( - "\\{" + "indexName" + "\\}", + "\\{indexName\\}", this.escapeString(indexName.toString()) ); @@ -1255,7 +1252,7 @@ private Call clearObjectsCall( // create path and map variables String requestPath = "/1/indexes/{indexName}/clear".replaceAll( - "\\{" + "indexName" + "\\}", + "\\{indexName\\}", this.escapeString(indexName.toString()) ); @@ -1348,7 +1345,7 @@ private Call clearRulesCall( // create path and map variables String requestPath = "/1/indexes/{indexName}/rules/clear".replaceAll( - "\\{" + "indexName" + "\\}", + "\\{indexName\\}", this.escapeString(indexName.toString()) ); @@ -1460,11 +1457,7 @@ private Call delCall( Object bodyObj = body; // create path and map variables - String requestPath = - "/1{path}".replaceAll( - "\\{" + "path" + "\\}", - this.escapeString(path.toString()) - ); + String requestPath = "/1{path}".replaceAll("\\{path\\}", path.toString()); List queryParams = new ArrayList(); Map headers = new HashMap(); @@ -1571,7 +1564,7 @@ private Call deleteApiKeyCall( // create path and map variables String requestPath = "/1/keys/{key}".replaceAll( - "\\{" + "key" + "\\}", + "\\{key\\}", this.escapeString(key.toString()) ); @@ -1663,7 +1656,7 @@ private Call deleteByCall( // create path and map variables String requestPath = "/1/indexes/{indexName}/deleteByQuery".replaceAll( - "\\{" + "indexName" + "\\}", + "\\{indexName\\}", this.escapeString(indexName.toString()) ); @@ -1769,7 +1762,7 @@ private Call deleteIndexCall( // create path and map variables String requestPath = "/1/indexes/{indexName}".replaceAll( - "\\{" + "indexName" + "\\}", + "\\{indexName\\}", this.escapeString(indexName.toString()) ); @@ -1861,13 +1854,10 @@ private Call deleteObjectCall( // create path and map variables String requestPath = "/1/indexes/{indexName}/{objectID}".replaceAll( - "\\{" + "indexName" + "\\}", + "\\{indexName\\}", this.escapeString(indexName.toString()) ) - .replaceAll( - "\\{" + "objectID" + "\\}", - this.escapeString(objectID.toString()) - ); + .replaceAll("\\{objectID\\}", this.escapeString(objectID.toString())); List queryParams = new ArrayList(); Map headers = new HashMap(); @@ -1969,13 +1959,10 @@ private Call deleteRuleCall( // create path and map variables String requestPath = "/1/indexes/{indexName}/rules/{objectID}".replaceAll( - "\\{" + "indexName" + "\\}", + "\\{indexName\\}", this.escapeString(indexName.toString()) ) - .replaceAll( - "\\{" + "objectID" + "\\}", - this.escapeString(objectID.toString()) - ); + .replaceAll("\\{objectID\\}", this.escapeString(objectID.toString())); List queryParams = new ArrayList(); Map headers = new HashMap(); @@ -2103,7 +2090,7 @@ private Call deleteSourceCall( // create path and map variables String requestPath = "/1/security/sources/{source}".replaceAll( - "\\{" + "source" + "\\}", + "\\{source\\}", this.escapeString(source.toString()) ); @@ -2196,13 +2183,10 @@ private Call deleteSynonymCall( // create path and map variables String requestPath = "/1/indexes/{indexName}/synonyms/{objectID}".replaceAll( - "\\{" + "indexName" + "\\}", + "\\{indexName\\}", this.escapeString(indexName.toString()) ) - .replaceAll( - "\\{" + "objectID" + "\\}", - this.escapeString(objectID.toString()) - ); + .replaceAll("\\{objectID\\}", this.escapeString(objectID.toString())); List queryParams = new ArrayList(); Map headers = new HashMap(); @@ -2331,11 +2315,7 @@ private Call getCall( Object bodyObj = null; // create path and map variables - String requestPath = - "/1{path}".replaceAll( - "\\{" + "path" + "\\}", - this.escapeString(path.toString()) - ); + String requestPath = "/1{path}".replaceAll("\\{path\\}", path.toString()); List queryParams = new ArrayList(); Map headers = new HashMap(); @@ -2436,7 +2416,7 @@ private Call getApiKeyCall(String key, final ApiCallback _callback) // create path and map variables String requestPath = "/1/keys/{key}".replaceAll( - "\\{" + "key" + "\\}", + "\\{key\\}", this.escapeString(key.toString()) ); @@ -2808,13 +2788,10 @@ private Call getObjectCall( // create path and map variables String requestPath = "/1/indexes/{indexName}/{objectID}".replaceAll( - "\\{" + "indexName" + "\\}", + "\\{indexName\\}", this.escapeString(indexName.toString()) ) - .replaceAll( - "\\{" + "objectID" + "\\}", - this.escapeString(objectID.toString()) - ); + .replaceAll("\\{objectID\\}", this.escapeString(objectID.toString())); List queryParams = new ArrayList(); Map headers = new HashMap(); @@ -3029,13 +3006,10 @@ private Call getRuleCall( // create path and map variables String requestPath = "/1/indexes/{indexName}/rules/{objectID}".replaceAll( - "\\{" + "indexName" + "\\}", + "\\{indexName\\}", this.escapeString(indexName.toString()) ) - .replaceAll( - "\\{" + "objectID" + "\\}", - this.escapeString(objectID.toString()) - ); + .replaceAll("\\{objectID\\}", this.escapeString(objectID.toString())); List queryParams = new ArrayList(); Map headers = new HashMap(); @@ -3133,7 +3107,7 @@ private Call getSettingsCall( // create path and map variables String requestPath = "/1/indexes/{indexName}/settings".replaceAll( - "\\{" + "indexName" + "\\}", + "\\{indexName\\}", this.escapeString(indexName.toString()) ); @@ -3295,13 +3269,10 @@ private Call getSynonymCall( // create path and map variables String requestPath = "/1/indexes/{indexName}/synonyms/{objectID}".replaceAll( - "\\{" + "indexName" + "\\}", + "\\{indexName\\}", this.escapeString(indexName.toString()) ) - .replaceAll( - "\\{" + "objectID" + "\\}", - this.escapeString(objectID.toString()) - ); + .replaceAll("\\{objectID\\}", this.escapeString(objectID.toString())); List queryParams = new ArrayList(); Map headers = new HashMap(); @@ -3400,13 +3371,10 @@ private Call getTaskCall( // create path and map variables String requestPath = "/1/indexes/{indexName}/task/{taskID}".replaceAll( - "\\{" + "indexName" + "\\}", + "\\{indexName\\}", this.escapeString(indexName.toString()) ) - .replaceAll( - "\\{" + "taskID" + "\\}", - this.escapeString(taskID.toString()) - ); + .replaceAll("\\{taskID\\}", this.escapeString(taskID.toString())); List queryParams = new ArrayList(); Map headers = new HashMap(); @@ -3584,7 +3552,7 @@ private Call getUserIdCall( // create path and map variables String requestPath = "/1/clusters/mapping/{userID}".replaceAll( - "\\{" + "userID" + "\\}", + "\\{userID\\}", this.escapeString(userID.toString()) ); @@ -4305,7 +4273,7 @@ private Call operationIndexCall( // create path and map variables String requestPath = "/1/indexes/{indexName}/operation".replaceAll( - "\\{" + "indexName" + "\\}", + "\\{indexName\\}", this.escapeString(indexName.toString()) ); @@ -4421,13 +4389,10 @@ private Call partialUpdateObjectCall( // create path and map variables String requestPath = "/1/indexes/{indexName}/{objectID}/partial".replaceAll( - "\\{" + "indexName" + "\\}", + "\\{indexName\\}", this.escapeString(indexName.toString()) ) - .replaceAll( - "\\{" + "objectID" + "\\}", - this.escapeString(objectID.toString()) - ); + .replaceAll("\\{objectID\\}", this.escapeString(objectID.toString())); List queryParams = new ArrayList(); Map headers = new HashMap(); @@ -4595,11 +4560,7 @@ private Call postCall( Object bodyObj = body; // create path and map variables - String requestPath = - "/1{path}".replaceAll( - "\\{" + "path" + "\\}", - this.escapeString(path.toString()) - ); + String requestPath = "/1{path}".replaceAll("\\{path\\}", path.toString()); List queryParams = new ArrayList(); Map headers = new HashMap(); @@ -4706,11 +4667,7 @@ private Call putCall( Object bodyObj = body; // create path and map variables - String requestPath = - "/1{path}".replaceAll( - "\\{" + "path" + "\\}", - this.escapeString(path.toString()) - ); + String requestPath = "/1{path}".replaceAll("\\{path\\}", path.toString()); List queryParams = new ArrayList(); Map headers = new HashMap(); @@ -4817,7 +4774,7 @@ private Call removeUserIdCall( // create path and map variables String requestPath = "/1/clusters/mapping/{userID}".replaceAll( - "\\{" + "userID" + "\\}", + "\\{userID\\}", this.escapeString(userID.toString()) ); @@ -4997,7 +4954,7 @@ private Call restoreApiKeyCall( // create path and map variables String requestPath = "/1/keys/{key}/restore".replaceAll( - "\\{" + "key" + "\\}", + "\\{key\\}", this.escapeString(key.toString()) ); @@ -5089,7 +5046,7 @@ private Call saveObjectCall( // create path and map variables String requestPath = "/1/indexes/{indexName}".replaceAll( - "\\{" + "indexName" + "\\}", + "\\{indexName\\}", this.escapeString(indexName.toString()) ); @@ -5192,13 +5149,10 @@ private Call saveRuleCall( // create path and map variables String requestPath = "/1/indexes/{indexName}/rules/{objectID}".replaceAll( - "\\{" + "indexName" + "\\}", + "\\{indexName\\}", this.escapeString(indexName.toString()) ) - .replaceAll( - "\\{" + "objectID" + "\\}", - this.escapeString(objectID.toString()) - ); + .replaceAll("\\{objectID\\}", this.escapeString(objectID.toString())); List queryParams = new ArrayList(); Map headers = new HashMap(); @@ -5352,13 +5306,10 @@ private Call saveSynonymCall( // create path and map variables String requestPath = "/1/indexes/{indexName}/synonyms/{objectID}".replaceAll( - "\\{" + "indexName" + "\\}", + "\\{indexName\\}", this.escapeString(indexName.toString()) ) - .replaceAll( - "\\{" + "objectID" + "\\}", - this.escapeString(objectID.toString()) - ); + .replaceAll("\\{objectID\\}", this.escapeString(objectID.toString())); List queryParams = new ArrayList(); Map headers = new HashMap(); @@ -5515,7 +5466,7 @@ private Call saveSynonymsCall( // create path and map variables String requestPath = "/1/indexes/{indexName}/synonyms/batch".replaceAll( - "\\{" + "indexName" + "\\}", + "\\{indexName\\}", this.escapeString(indexName.toString()) ); @@ -5673,7 +5624,7 @@ private Call searchCall( // create path and map variables String requestPath = "/1/indexes/{indexName}/query".replaceAll( - "\\{" + "indexName" + "\\}", + "\\{indexName\\}", this.escapeString(indexName.toString()) ); @@ -5774,7 +5725,7 @@ private Call searchDictionaryEntriesCall( // create path and map variables String requestPath = "/1/dictionaries/{dictionaryName}/search".replaceAll( - "\\{" + "dictionaryName" + "\\}", + "\\{dictionaryName\\}", this.escapeString(dictionaryName.toString()) ); @@ -5894,13 +5845,10 @@ private Call searchForFacetValuesCall( // create path and map variables String requestPath = "/1/indexes/{indexName}/facets/{facetName}/query".replaceAll( - "\\{" + "indexName" + "\\}", + "\\{indexName\\}", this.escapeString(indexName.toString()) ) - .replaceAll( - "\\{" + "facetName" + "\\}", - this.escapeString(facetName.toString()) - ); + .replaceAll("\\{facetName\\}", this.escapeString(facetName.toString())); List queryParams = new ArrayList(); Map headers = new HashMap(); @@ -6035,7 +5983,7 @@ private Call searchRulesCall( // create path and map variables String requestPath = "/1/indexes/{indexName}/rules/search".replaceAll( - "\\{" + "indexName" + "\\}", + "\\{indexName\\}", this.escapeString(indexName.toString()) ); @@ -6151,7 +6099,7 @@ private Call searchSynonymsCall( // create path and map variables String requestPath = "/1/indexes/{indexName}/synonyms/search".replaceAll( - "\\{" + "indexName" + "\\}", + "\\{indexName\\}", this.escapeString(indexName.toString()) ); @@ -6506,7 +6454,7 @@ private Call setSettingsCall( // create path and map variables String requestPath = "/1/indexes/{indexName}/settings".replaceAll( - "\\{" + "indexName" + "\\}", + "\\{indexName\\}", this.escapeString(indexName.toString()) ); @@ -6649,7 +6597,7 @@ private Call updateApiKeyCall( // create path and map variables String requestPath = "/1/keys/{key}".replaceAll( - "\\{" + "key" + "\\}", + "\\{key\\}", this.escapeString(key.toString()) ); diff --git a/clients/algoliasearch-client-javascript/packages/client-abtesting/src/abtestingApi.ts b/clients/algoliasearch-client-javascript/packages/client-abtesting/src/abtestingApi.ts index 922bd57df0..685b888d61 100644 --- a/clients/algoliasearch-client-javascript/packages/client-abtesting/src/abtestingApi.ts +++ b/clients/algoliasearch-client-javascript/packages/client-abtesting/src/abtestingApi.ts @@ -129,10 +129,7 @@ export function createAbtestingApi( { path, parameters, body }: DelProps, requestOptions?: RequestOptions ): Promise> { - const requestPath = '/1{path}'.replace( - '{path}', - encodeURIComponent(String(path)) - ); + const requestPath = '/1{path}'.replace('{path}', String(path)); const headers: Headers = {}; const queryParameters: QueryParameters = {}; @@ -211,10 +208,7 @@ export function createAbtestingApi( { path, parameters }: GetProps, requestOptions?: RequestOptions ): Promise> { - const requestPath = '/1{path}'.replace( - '{path}', - encodeURIComponent(String(path)) - ); + const requestPath = '/1{path}'.replace('{path}', String(path)); const headers: Headers = {}; const queryParameters: QueryParameters = {}; @@ -330,10 +324,7 @@ export function createAbtestingApi( { path, parameters, body }: PostProps, requestOptions?: RequestOptions ): Promise> { - const requestPath = '/1{path}'.replace( - '{path}', - encodeURIComponent(String(path)) - ); + const requestPath = '/1{path}'.replace('{path}', String(path)); const headers: Headers = {}; const queryParameters: QueryParameters = {}; @@ -374,10 +365,7 @@ export function createAbtestingApi( { path, parameters, body }: PutProps, requestOptions?: RequestOptions ): Promise> { - const requestPath = '/1{path}'.replace( - '{path}', - encodeURIComponent(String(path)) - ); + const requestPath = '/1{path}'.replace('{path}', String(path)); const headers: Headers = {}; const queryParameters: QueryParameters = {}; diff --git a/clients/algoliasearch-client-javascript/packages/client-analytics/src/analyticsApi.ts b/clients/algoliasearch-client-javascript/packages/client-analytics/src/analyticsApi.ts index 0568cfdac7..4582a1a0d3 100644 --- a/clients/algoliasearch-client-javascript/packages/client-analytics/src/analyticsApi.ts +++ b/clients/algoliasearch-client-javascript/packages/client-analytics/src/analyticsApi.ts @@ -90,10 +90,7 @@ export function createAnalyticsApi( { path, parameters, body }: DelProps, requestOptions?: RequestOptions ): Promise> { - const requestPath = '/1{path}'.replace( - '{path}', - encodeURIComponent(String(path)) - ); + const requestPath = '/1{path}'.replace('{path}', String(path)); const headers: Headers = {}; const queryParameters: QueryParameters = {}; @@ -133,10 +130,7 @@ export function createAnalyticsApi( { path, parameters }: GetProps, requestOptions?: RequestOptions ): Promise> { - const requestPath = '/1{path}'.replace( - '{path}', - encodeURIComponent(String(path)) - ); + const requestPath = '/1{path}'.replace('{path}', String(path)); const headers: Headers = {}; const queryParameters: QueryParameters = {}; @@ -1284,10 +1278,7 @@ export function createAnalyticsApi( { path, parameters, body }: PostProps, requestOptions?: RequestOptions ): Promise> { - const requestPath = '/1{path}'.replace( - '{path}', - encodeURIComponent(String(path)) - ); + const requestPath = '/1{path}'.replace('{path}', String(path)); const headers: Headers = {}; const queryParameters: QueryParameters = {}; @@ -1328,10 +1319,7 @@ export function createAnalyticsApi( { path, parameters, body }: PutProps, requestOptions?: RequestOptions ): Promise> { - const requestPath = '/1{path}'.replace( - '{path}', - encodeURIComponent(String(path)) - ); + const requestPath = '/1{path}'.replace('{path}', String(path)); const headers: Headers = {}; const queryParameters: QueryParameters = {}; diff --git a/clients/algoliasearch-client-javascript/packages/client-insights/src/insightsApi.ts b/clients/algoliasearch-client-javascript/packages/client-insights/src/insightsApi.ts index eaefa589da..ad1daf723f 100644 --- a/clients/algoliasearch-client-javascript/packages/client-insights/src/insightsApi.ts +++ b/clients/algoliasearch-client-javascript/packages/client-insights/src/insightsApi.ts @@ -75,10 +75,7 @@ export function createInsightsApi( { path, parameters, body }: DelProps, requestOptions?: RequestOptions ): Promise> { - const requestPath = '/1{path}'.replace( - '{path}', - encodeURIComponent(String(path)) - ); + const requestPath = '/1{path}'.replace('{path}', String(path)); const headers: Headers = {}; const queryParameters: QueryParameters = {}; @@ -118,10 +115,7 @@ export function createInsightsApi( { path, parameters }: GetProps, requestOptions?: RequestOptions ): Promise> { - const requestPath = '/1{path}'.replace( - '{path}', - encodeURIComponent(String(path)) - ); + const requestPath = '/1{path}'.replace('{path}', String(path)); const headers: Headers = {}; const queryParameters: QueryParameters = {}; @@ -161,10 +155,7 @@ export function createInsightsApi( { path, parameters, body }: PostProps, requestOptions?: RequestOptions ): Promise> { - const requestPath = '/1{path}'.replace( - '{path}', - encodeURIComponent(String(path)) - ); + const requestPath = '/1{path}'.replace('{path}', String(path)); const headers: Headers = {}; const queryParameters: QueryParameters = {}; @@ -247,10 +238,7 @@ export function createInsightsApi( { path, parameters, body }: PutProps, requestOptions?: RequestOptions ): Promise> { - const requestPath = '/1{path}'.replace( - '{path}', - encodeURIComponent(String(path)) - ); + const requestPath = '/1{path}'.replace('{path}', String(path)); const headers: Headers = {}; const queryParameters: QueryParameters = {}; diff --git a/clients/algoliasearch-client-javascript/packages/client-personalization/src/personalizationApi.ts b/clients/algoliasearch-client-javascript/packages/client-personalization/src/personalizationApi.ts index a535b967c8..b535874e57 100644 --- a/clients/algoliasearch-client-javascript/packages/client-personalization/src/personalizationApi.ts +++ b/clients/algoliasearch-client-javascript/packages/client-personalization/src/personalizationApi.ts @@ -75,10 +75,7 @@ export function createPersonalizationApi( { path, parameters, body }: DelProps, requestOptions?: RequestOptions ): Promise> { - const requestPath = '/1{path}'.replace( - '{path}', - encodeURIComponent(String(path)) - ); + const requestPath = '/1{path}'.replace('{path}', String(path)); const headers: Headers = {}; const queryParameters: QueryParameters = {}; @@ -157,10 +154,7 @@ export function createPersonalizationApi( { path, parameters }: GetProps, requestOptions?: RequestOptions ): Promise> { - const requestPath = '/1{path}'.replace( - '{path}', - encodeURIComponent(String(path)) - ); + const requestPath = '/1{path}'.replace('{path}', String(path)); const headers: Headers = {}; const queryParameters: QueryParameters = {}; @@ -266,10 +260,7 @@ export function createPersonalizationApi( { path, parameters, body }: PostProps, requestOptions?: RequestOptions ): Promise> { - const requestPath = '/1{path}'.replace( - '{path}', - encodeURIComponent(String(path)) - ); + const requestPath = '/1{path}'.replace('{path}', String(path)); const headers: Headers = {}; const queryParameters: QueryParameters = {}; @@ -310,10 +301,7 @@ export function createPersonalizationApi( { path, parameters, body }: PutProps, requestOptions?: RequestOptions ): Promise> { - const requestPath = '/1{path}'.replace( - '{path}', - encodeURIComponent(String(path)) - ); + const requestPath = '/1{path}'.replace('{path}', String(path)); const headers: Headers = {}; const queryParameters: QueryParameters = {}; diff --git a/clients/algoliasearch-client-javascript/packages/client-predict/src/predictApi.ts b/clients/algoliasearch-client-javascript/packages/client-predict/src/predictApi.ts index 71dcb137f8..c1e4b7f3b6 100644 --- a/clients/algoliasearch-client-javascript/packages/client-predict/src/predictApi.ts +++ b/clients/algoliasearch-client-javascript/packages/client-predict/src/predictApi.ts @@ -69,10 +69,7 @@ export function createPredictApi(options: CreateClientOptions) { { path, parameters, body }: DelProps, requestOptions?: RequestOptions ): Promise> { - const requestPath = '/1{path}'.replace( - '{path}', - encodeURIComponent(String(path)) - ); + const requestPath = '/1{path}'.replace('{path}', String(path)); const headers: Headers = {}; const queryParameters: QueryParameters = {}; @@ -159,10 +156,7 @@ export function createPredictApi(options: CreateClientOptions) { { path, parameters }: GetProps, requestOptions?: RequestOptions ): Promise> { - const requestPath = '/1{path}'.replace( - '{path}', - encodeURIComponent(String(path)) - ); + const requestPath = '/1{path}'.replace('{path}', String(path)); const headers: Headers = {}; const queryParameters: QueryParameters = {}; @@ -202,10 +196,7 @@ export function createPredictApi(options: CreateClientOptions) { { path, parameters, body }: PostProps, requestOptions?: RequestOptions ): Promise> { - const requestPath = '/1{path}'.replace( - '{path}', - encodeURIComponent(String(path)) - ); + const requestPath = '/1{path}'.replace('{path}', String(path)); const headers: Headers = {}; const queryParameters: QueryParameters = {}; @@ -246,10 +237,7 @@ export function createPredictApi(options: CreateClientOptions) { { path, parameters, body }: PutProps, requestOptions?: RequestOptions ): Promise> { - const requestPath = '/1{path}'.replace( - '{path}', - encodeURIComponent(String(path)) - ); + const requestPath = '/1{path}'.replace('{path}', String(path)); const headers: Headers = {}; const queryParameters: QueryParameters = {}; diff --git a/clients/algoliasearch-client-javascript/packages/client-query-suggestions/src/querySuggestionsApi.ts b/clients/algoliasearch-client-javascript/packages/client-query-suggestions/src/querySuggestionsApi.ts index 09e48b3713..82335a72c6 100644 --- a/clients/algoliasearch-client-javascript/packages/client-query-suggestions/src/querySuggestionsApi.ts +++ b/clients/algoliasearch-client-javascript/packages/client-query-suggestions/src/querySuggestionsApi.ts @@ -113,10 +113,7 @@ export function createQuerySuggestionsApi( { path, parameters, body }: DelProps, requestOptions?: RequestOptions ): Promise> { - const requestPath = '/1{path}'.replace( - '{path}', - encodeURIComponent(String(path)) - ); + const requestPath = '/1{path}'.replace('{path}', String(path)); const headers: Headers = {}; const queryParameters: QueryParameters = {}; @@ -195,10 +192,7 @@ export function createQuerySuggestionsApi( { path, parameters }: GetProps, requestOptions?: RequestOptions ): Promise> { - const requestPath = '/1{path}'.replace( - '{path}', - encodeURIComponent(String(path)) - ); + const requestPath = '/1{path}'.replace('{path}', String(path)); const headers: Headers = {}; const queryParameters: QueryParameters = {}; @@ -382,10 +376,7 @@ export function createQuerySuggestionsApi( { path, parameters, body }: PostProps, requestOptions?: RequestOptions ): Promise> { - const requestPath = '/1{path}'.replace( - '{path}', - encodeURIComponent(String(path)) - ); + const requestPath = '/1{path}'.replace('{path}', String(path)); const headers: Headers = {}; const queryParameters: QueryParameters = {}; @@ -426,10 +417,7 @@ export function createQuerySuggestionsApi( { path, parameters, body }: PutProps, requestOptions?: RequestOptions ): Promise> { - const requestPath = '/1{path}'.replace( - '{path}', - encodeURIComponent(String(path)) - ); + const requestPath = '/1{path}'.replace('{path}', String(path)); const headers: Headers = {}; const queryParameters: QueryParameters = {}; diff --git a/clients/algoliasearch-client-javascript/packages/client-search/src/searchApi.ts b/clients/algoliasearch-client-javascript/packages/client-search/src/searchApi.ts index f51de9b036..1ab80edd53 100644 --- a/clients/algoliasearch-client-javascript/packages/client-search/src/searchApi.ts +++ b/clients/algoliasearch-client-javascript/packages/client-search/src/searchApi.ts @@ -728,10 +728,7 @@ export function createSearchApi(options: CreateClientOptions) { { path, parameters, body }: DelProps, requestOptions?: RequestOptions ): Promise> { - const requestPath = '/1{path}'.replace( - '{path}', - encodeURIComponent(String(path)) - ); + const requestPath = '/1{path}'.replace('{path}', String(path)); const headers: Headers = {}; const queryParameters: QueryParameters = {}; @@ -1080,10 +1077,7 @@ export function createSearchApi(options: CreateClientOptions) { { path, parameters }: GetProps, requestOptions?: RequestOptions ): Promise> { - const requestPath = '/1{path}'.replace( - '{path}', - encodeURIComponent(String(path)) - ); + const requestPath = '/1{path}'.replace('{path}', String(path)); const headers: Headers = {}; const queryParameters: QueryParameters = {}; @@ -1974,10 +1968,7 @@ export function createSearchApi(options: CreateClientOptions) { { path, parameters, body }: PostProps, requestOptions?: RequestOptions ): Promise> { - const requestPath = '/1{path}'.replace( - '{path}', - encodeURIComponent(String(path)) - ); + const requestPath = '/1{path}'.replace('{path}', String(path)); const headers: Headers = {}; const queryParameters: QueryParameters = {}; @@ -2018,10 +2009,7 @@ export function createSearchApi(options: CreateClientOptions) { { path, parameters, body }: PutProps, requestOptions?: RequestOptions ): Promise> { - const requestPath = '/1{path}'.replace( - '{path}', - encodeURIComponent(String(path)) - ); + const requestPath = '/1{path}'.replace('{path}', String(path)); const headers: Headers = {}; const queryParameters: QueryParameters = {}; diff --git a/clients/algoliasearch-client-javascript/packages/client-sources/src/sourcesApi.ts b/clients/algoliasearch-client-javascript/packages/client-sources/src/sourcesApi.ts index 38bb227482..80067aac33 100644 --- a/clients/algoliasearch-client-javascript/packages/client-sources/src/sourcesApi.ts +++ b/clients/algoliasearch-client-javascript/packages/client-sources/src/sourcesApi.ts @@ -73,10 +73,7 @@ export function createSourcesApi( { path, parameters, body }: DelProps, requestOptions?: RequestOptions ): Promise> { - const requestPath = '/1{path}'.replace( - '{path}', - encodeURIComponent(String(path)) - ); + const requestPath = '/1{path}'.replace('{path}', String(path)); const headers: Headers = {}; const queryParameters: QueryParameters = {}; @@ -116,10 +113,7 @@ export function createSourcesApi( { path, parameters }: GetProps, requestOptions?: RequestOptions ): Promise> { - const requestPath = '/1{path}'.replace( - '{path}', - encodeURIComponent(String(path)) - ); + const requestPath = '/1{path}'.replace('{path}', String(path)); const headers: Headers = {}; const queryParameters: QueryParameters = {}; @@ -159,10 +153,7 @@ export function createSourcesApi( { path, parameters, body }: PostProps, requestOptions?: RequestOptions ): Promise> { - const requestPath = '/1{path}'.replace( - '{path}', - encodeURIComponent(String(path)) - ); + const requestPath = '/1{path}'.replace('{path}', String(path)); const headers: Headers = {}; const queryParameters: QueryParameters = {}; @@ -255,10 +246,7 @@ export function createSourcesApi( { path, parameters, body }: PutProps, requestOptions?: RequestOptions ): Promise> { - const requestPath = '/1{path}'.replace( - '{path}', - encodeURIComponent(String(path)) - ); + const requestPath = '/1{path}'.replace('{path}', String(path)); const headers: Headers = {}; const queryParameters: QueryParameters = {}; diff --git a/clients/algoliasearch-client-javascript/packages/recommend/src/recommendApi.ts b/clients/algoliasearch-client-javascript/packages/recommend/src/recommendApi.ts index 0b5ea555aa..3c3118a3d1 100644 --- a/clients/algoliasearch-client-javascript/packages/recommend/src/recommendApi.ts +++ b/clients/algoliasearch-client-javascript/packages/recommend/src/recommendApi.ts @@ -95,10 +95,7 @@ export function createRecommendApi(options: CreateClientOptions) { { path, parameters, body }: DelProps, requestOptions?: RequestOptions ): Promise> { - const requestPath = '/1{path}'.replace( - '{path}', - encodeURIComponent(String(path)) - ); + const requestPath = '/1{path}'.replace('{path}', String(path)); const headers: Headers = {}; const queryParameters: QueryParameters = {}; @@ -138,10 +135,7 @@ export function createRecommendApi(options: CreateClientOptions) { { path, parameters }: GetProps, requestOptions?: RequestOptions ): Promise> { - const requestPath = '/1{path}'.replace( - '{path}', - encodeURIComponent(String(path)) - ); + const requestPath = '/1{path}'.replace('{path}', String(path)); const headers: Headers = {}; const queryParameters: QueryParameters = {}; @@ -223,10 +217,7 @@ export function createRecommendApi(options: CreateClientOptions) { { path, parameters, body }: PostProps, requestOptions?: RequestOptions ): Promise> { - const requestPath = '/1{path}'.replace( - '{path}', - encodeURIComponent(String(path)) - ); + const requestPath = '/1{path}'.replace('{path}', String(path)); const headers: Headers = {}; const queryParameters: QueryParameters = {}; @@ -267,10 +258,7 @@ export function createRecommendApi(options: CreateClientOptions) { { path, parameters, body }: PutProps, requestOptions?: RequestOptions ): Promise> { - const requestPath = '/1{path}'.replace( - '{path}', - encodeURIComponent(String(path)) - ); + const requestPath = '/1{path}'.replace('{path}', String(path)); const headers: Headers = {}; const queryParameters: QueryParameters = {}; diff --git a/clients/algoliasearch-client-php/lib/Api/AbtestingApi.php b/clients/algoliasearch-client-php/lib/Api/AbtestingApi.php index bc99187651..383b36e69d 100644 --- a/clients/algoliasearch-client-php/lib/Api/AbtestingApi.php +++ b/clients/algoliasearch-client-php/lib/Api/AbtestingApi.php @@ -3,7 +3,7 @@ namespace Algolia\AlgoliaSearch\Api; use Algolia\AlgoliaSearch\Algolia; -use Algolia\AlgoliaSearch\Configuration\AbTestingConfig; +use Algolia\AlgoliaSearch\Configuration\AbtestingConfig; use Algolia\AlgoliaSearch\ObjectSerializer; use Algolia\AlgoliaSearch\RetryStrategy\ApiWrapper; use Algolia\AlgoliaSearch\RetryStrategy\ApiWrapperInterface; @@ -23,15 +23,15 @@ class AbtestingApi protected $api; /** - * @var AbTestingConfig + * @var AbtestingConfig */ protected $config; /** - * @param AbTestingConfig $config + * @param AbtestingConfig $config * @param ApiWrapperInterface $apiWrapper */ - public function __construct(ApiWrapperInterface $apiWrapper, AbTestingConfig $config) + public function __construct(ApiWrapperInterface $apiWrapper, AbtestingConfig $config) { $this->config = $config; @@ -48,7 +48,7 @@ public function __construct(ApiWrapperInterface $apiWrapper, AbTestingConfig $co public static function create($appId = null, $apiKey = null, $region = null) { $allowedRegions = explode('-', 'us-de'); - $config = AbTestingConfig::create($appId, $apiKey, $region, $allowedRegions); + $config = AbtestingConfig::create($appId, $apiKey, $region, $allowedRegions); return static::createWithConfig($config); } @@ -56,9 +56,9 @@ public static function create($appId = null, $apiKey = null, $region = null) /** * Instantiate the client with congiguration * - * @param AbTestingConfig $config Configuration + * @param AbtestingConfig $config Configuration */ - public static function createWithConfig(AbTestingConfig $config) + public static function createWithConfig(AbtestingConfig $config) { $config = clone $config; @@ -79,7 +79,7 @@ public static function createWithConfig(AbTestingConfig $config) } /** - * @return AbTestingConfig + * @return AbtestingConfig */ public function getClientConfig() { @@ -144,11 +144,12 @@ public function del($path, $parameters = null, $body = null) $queryParams['parameters'] = $parameters; } } + // path params if ($path !== null) { $resourcePath = str_replace( - '{' . 'path' . '}', - ObjectSerializer::toPathValue($path), + '{path}', + path, $resourcePath ); } @@ -179,10 +180,11 @@ public function deleteABTest($id) $resourcePath = '/2/abtests/{id}'; $queryParams = []; $httpBody = []; + // path params if ($id !== null) { $resourcePath = str_replace( - '{' . 'id' . '}', + '{id}', ObjectSerializer::toPathValue($id), $resourcePath ); @@ -221,11 +223,12 @@ public function get($path, $parameters = null) $queryParams['parameters'] = $parameters; } } + // path params if ($path !== null) { $resourcePath = str_replace( - '{' . 'path' . '}', - ObjectSerializer::toPathValue($path), + '{path}', + path, $resourcePath ); } @@ -252,10 +255,11 @@ public function getABTest($id) $resourcePath = '/2/abtests/{id}'; $queryParams = []; $httpBody = []; + // path params if ($id !== null) { $resourcePath = str_replace( - '{' . 'id' . '}', + '{id}', ObjectSerializer::toPathValue($id), $resourcePath ); @@ -332,11 +336,12 @@ public function post($path, $parameters = null, $body = null) $queryParams['parameters'] = $parameters; } } + // path params if ($path !== null) { $resourcePath = str_replace( - '{' . 'path' . '}', - ObjectSerializer::toPathValue($path), + '{path}', + path, $resourcePath ); } @@ -379,11 +384,12 @@ public function put($path, $parameters = null, $body = null) $queryParams['parameters'] = $parameters; } } + // path params if ($path !== null) { $resourcePath = str_replace( - '{' . 'path' . '}', - ObjectSerializer::toPathValue($path), + '{path}', + path, $resourcePath ); } @@ -414,10 +420,11 @@ public function stopABTest($id) $resourcePath = '/2/abtests/{id}/stop'; $queryParams = []; $httpBody = []; + // path params if ($id !== null) { $resourcePath = str_replace( - '{' . 'id' . '}', + '{id}', ObjectSerializer::toPathValue($id), $resourcePath ); diff --git a/clients/algoliasearch-client-php/lib/Api/AnalyticsApi.php b/clients/algoliasearch-client-php/lib/Api/AnalyticsApi.php index b2a6aa609e..ff1d18b2e7 100644 --- a/clients/algoliasearch-client-php/lib/Api/AnalyticsApi.php +++ b/clients/algoliasearch-client-php/lib/Api/AnalyticsApi.php @@ -117,11 +117,12 @@ public function del($path, $parameters = null, $body = null) $queryParams['parameters'] = $parameters; } } + // path params if ($path !== null) { $resourcePath = str_replace( - '{' . 'path' . '}', - ObjectSerializer::toPathValue($path), + '{path}', + path, $resourcePath ); } @@ -163,11 +164,12 @@ public function get($path, $parameters = null) $queryParams['parameters'] = $parameters; } } + // path params if ($path !== null) { $resourcePath = str_replace( - '{' . 'path' . '}', - ObjectSerializer::toPathValue($path), + '{path}', + path, $resourcePath ); } @@ -1219,10 +1221,11 @@ public function getTopFilterForAttribute($attribute, $index, $search = null, $st $queryParams['tags'] = $tags; } } + // path params if ($attribute !== null) { $resourcePath = str_replace( - '{' . 'attribute' . '}', + '{attribute}', ObjectSerializer::toPathValue($attribute), $resourcePath ); @@ -1686,11 +1689,12 @@ public function post($path, $parameters = null, $body = null) $queryParams['parameters'] = $parameters; } } + // path params if ($path !== null) { $resourcePath = str_replace( - '{' . 'path' . '}', - ObjectSerializer::toPathValue($path), + '{path}', + path, $resourcePath ); } @@ -1733,11 +1737,12 @@ public function put($path, $parameters = null, $body = null) $queryParams['parameters'] = $parameters; } } + // path params if ($path !== null) { $resourcePath = str_replace( - '{' . 'path' . '}', - ObjectSerializer::toPathValue($path), + '{path}', + path, $resourcePath ); } diff --git a/clients/algoliasearch-client-php/lib/Api/InsightsApi.php b/clients/algoliasearch-client-php/lib/Api/InsightsApi.php index a130b15d55..51298c6608 100644 --- a/clients/algoliasearch-client-php/lib/Api/InsightsApi.php +++ b/clients/algoliasearch-client-php/lib/Api/InsightsApi.php @@ -4,7 +4,6 @@ use Algolia\AlgoliaSearch\Algolia; use Algolia\AlgoliaSearch\Configuration\InsightsConfig; -use Algolia\AlgoliaSearch\ObjectSerializer; use Algolia\AlgoliaSearch\RetryStrategy\ApiWrapper; use Algolia\AlgoliaSearch\RetryStrategy\ApiWrapperInterface; use Algolia\AlgoliaSearch\RetryStrategy\ClusterHosts; @@ -117,11 +116,12 @@ public function del($path, $parameters = null, $body = null) $queryParams['parameters'] = $parameters; } } + // path params if ($path !== null) { $resourcePath = str_replace( - '{' . 'path' . '}', - ObjectSerializer::toPathValue($path), + '{path}', + path, $resourcePath ); } @@ -163,11 +163,12 @@ public function get($path, $parameters = null) $queryParams['parameters'] = $parameters; } } + // path params if ($path !== null) { $resourcePath = str_replace( - '{' . 'path' . '}', - ObjectSerializer::toPathValue($path), + '{path}', + path, $resourcePath ); } @@ -206,11 +207,12 @@ public function post($path, $parameters = null, $body = null) $queryParams['parameters'] = $parameters; } } + // path params if ($path !== null) { $resourcePath = str_replace( - '{' . 'path' . '}', - ObjectSerializer::toPathValue($path), + '{path}', + path, $resourcePath ); } @@ -280,11 +282,12 @@ public function put($path, $parameters = null, $body = null) $queryParams['parameters'] = $parameters; } } + // path params if ($path !== null) { $resourcePath = str_replace( - '{' . 'path' . '}', - ObjectSerializer::toPathValue($path), + '{path}', + path, $resourcePath ); } diff --git a/clients/algoliasearch-client-php/lib/Api/PersonalizationApi.php b/clients/algoliasearch-client-php/lib/Api/PersonalizationApi.php index c2cf951d20..8d65a5aff9 100644 --- a/clients/algoliasearch-client-php/lib/Api/PersonalizationApi.php +++ b/clients/algoliasearch-client-php/lib/Api/PersonalizationApi.php @@ -117,11 +117,12 @@ public function del($path, $parameters = null, $body = null) $queryParams['parameters'] = $parameters; } } + // path params if ($path !== null) { $resourcePath = str_replace( - '{' . 'path' . '}', - ObjectSerializer::toPathValue($path), + '{path}', + path, $resourcePath ); } @@ -152,10 +153,11 @@ public function deleteUserProfile($userToken) $resourcePath = '/1/profiles/{userToken}'; $queryParams = []; $httpBody = []; + // path params if ($userToken !== null) { $resourcePath = str_replace( - '{' . 'userToken' . '}', + '{userToken}', ObjectSerializer::toPathValue($userToken), $resourcePath ); @@ -194,11 +196,12 @@ public function get($path, $parameters = null) $queryParams['parameters'] = $parameters; } } + // path params if ($path !== null) { $resourcePath = str_replace( - '{' . 'path' . '}', - ObjectSerializer::toPathValue($path), + '{path}', + path, $resourcePath ); } @@ -240,10 +243,11 @@ public function getUserTokenProfile($userToken) $resourcePath = '/1/profiles/personalization/{userToken}'; $queryParams = []; $httpBody = []; + // path params if ($userToken !== null) { $resourcePath = str_replace( - '{' . 'userToken' . '}', + '{userToken}', ObjectSerializer::toPathValue($userToken), $resourcePath ); @@ -283,11 +287,12 @@ public function post($path, $parameters = null, $body = null) $queryParams['parameters'] = $parameters; } } + // path params if ($path !== null) { $resourcePath = str_replace( - '{' . 'path' . '}', - ObjectSerializer::toPathValue($path), + '{path}', + path, $resourcePath ); } @@ -330,11 +335,12 @@ public function put($path, $parameters = null, $body = null) $queryParams['parameters'] = $parameters; } } + // path params if ($path !== null) { $resourcePath = str_replace( - '{' . 'path' . '}', - ObjectSerializer::toPathValue($path), + '{path}', + path, $resourcePath ); } diff --git a/clients/algoliasearch-client-php/lib/Api/QuerySuggestionsApi.php b/clients/algoliasearch-client-php/lib/Api/QuerySuggestionsApi.php index 4080e10886..278cb09833 100644 --- a/clients/algoliasearch-client-php/lib/Api/QuerySuggestionsApi.php +++ b/clients/algoliasearch-client-php/lib/Api/QuerySuggestionsApi.php @@ -144,11 +144,12 @@ public function del($path, $parameters = null, $body = null) $queryParams['parameters'] = $parameters; } } + // path params if ($path !== null) { $resourcePath = str_replace( - '{' . 'path' . '}', - ObjectSerializer::toPathValue($path), + '{path}', + path, $resourcePath ); } @@ -179,10 +180,11 @@ public function deleteConfig($indexName) $resourcePath = '/1/configs/{indexName}'; $queryParams = []; $httpBody = []; + // path params if ($indexName !== null) { $resourcePath = str_replace( - '{' . 'indexName' . '}', + '{indexName}', ObjectSerializer::toPathValue($indexName), $resourcePath ); @@ -221,11 +223,12 @@ public function get($path, $parameters = null) $queryParams['parameters'] = $parameters; } } + // path params if ($path !== null) { $resourcePath = str_replace( - '{' . 'path' . '}', - ObjectSerializer::toPathValue($path), + '{path}', + path, $resourcePath ); } @@ -267,10 +270,11 @@ public function getConfig($indexName) $resourcePath = '/1/configs/{indexName}'; $queryParams = []; $httpBody = []; + // path params if ($indexName !== null) { $resourcePath = str_replace( - '{' . 'indexName' . '}', + '{indexName}', ObjectSerializer::toPathValue($indexName), $resourcePath ); @@ -298,10 +302,11 @@ public function getConfigStatus($indexName) $resourcePath = '/1/configs/{indexName}/status'; $queryParams = []; $httpBody = []; + // path params if ($indexName !== null) { $resourcePath = str_replace( - '{' . 'indexName' . '}', + '{indexName}', ObjectSerializer::toPathValue($indexName), $resourcePath ); @@ -329,10 +334,11 @@ public function getLogFile($indexName) $resourcePath = '/1/logs/{indexName}'; $queryParams = []; $httpBody = []; + // path params if ($indexName !== null) { $resourcePath = str_replace( - '{' . 'indexName' . '}', + '{indexName}', ObjectSerializer::toPathValue($indexName), $resourcePath ); @@ -372,11 +378,12 @@ public function post($path, $parameters = null, $body = null) $queryParams['parameters'] = $parameters; } } + // path params if ($path !== null) { $resourcePath = str_replace( - '{' . 'path' . '}', - ObjectSerializer::toPathValue($path), + '{path}', + path, $resourcePath ); } @@ -419,11 +426,12 @@ public function put($path, $parameters = null, $body = null) $queryParams['parameters'] = $parameters; } } + // path params if ($path !== null) { $resourcePath = str_replace( - '{' . 'path' . '}', - ObjectSerializer::toPathValue($path), + '{path}', + path, $resourcePath ); } @@ -461,10 +469,11 @@ public function updateConfig($indexName, $querySuggestionsIndexParam) $resourcePath = '/1/configs/{indexName}'; $queryParams = []; $httpBody = []; + // path params if ($indexName !== null) { $resourcePath = str_replace( - '{' . 'indexName' . '}', + '{indexName}', ObjectSerializer::toPathValue($indexName), $resourcePath ); diff --git a/clients/algoliasearch-client-php/lib/Api/RecommendApi.php b/clients/algoliasearch-client-php/lib/Api/RecommendApi.php index 05e4a5d148..31710f7d17 100644 --- a/clients/algoliasearch-client-php/lib/Api/RecommendApi.php +++ b/clients/algoliasearch-client-php/lib/Api/RecommendApi.php @@ -4,7 +4,6 @@ use Algolia\AlgoliaSearch\Algolia; use Algolia\AlgoliaSearch\Configuration\RecommendConfig; -use Algolia\AlgoliaSearch\ObjectSerializer; use Algolia\AlgoliaSearch\RetryStrategy\ApiWrapper; use Algolia\AlgoliaSearch\RetryStrategy\ApiWrapperInterface; use Algolia\AlgoliaSearch\RetryStrategy\ClusterHosts; @@ -118,11 +117,12 @@ public function del($path, $parameters = null, $body = null) $queryParams['parameters'] = $parameters; } } + // path params if ($path !== null) { $resourcePath = str_replace( - '{' . 'path' . '}', - ObjectSerializer::toPathValue($path), + '{path}', + path, $resourcePath ); } @@ -164,11 +164,12 @@ public function get($path, $parameters = null) $queryParams['parameters'] = $parameters; } } + // path params if ($path !== null) { $resourcePath = str_replace( - '{' . 'path' . '}', - ObjectSerializer::toPathValue($path), + '{path}', + path, $resourcePath ); } @@ -234,11 +235,12 @@ public function post($path, $parameters = null, $body = null) $queryParams['parameters'] = $parameters; } } + // path params if ($path !== null) { $resourcePath = str_replace( - '{' . 'path' . '}', - ObjectSerializer::toPathValue($path), + '{path}', + path, $resourcePath ); } @@ -281,11 +283,12 @@ public function put($path, $parameters = null, $body = null) $queryParams['parameters'] = $parameters; } } + // path params if ($path !== null) { $resourcePath = str_replace( - '{' . 'path' . '}', - ObjectSerializer::toPathValue($path), + '{path}', + path, $resourcePath ); } diff --git a/clients/algoliasearch-client-php/lib/Api/SearchApi.php b/clients/algoliasearch-client-php/lib/Api/SearchApi.php index 36c46c04de..29be5b6a66 100644 --- a/clients/algoliasearch-client-php/lib/Api/SearchApi.php +++ b/clients/algoliasearch-client-php/lib/Api/SearchApi.php @@ -147,18 +147,20 @@ public function addOrUpdateObject($indexName, $objectID, $body) $resourcePath = '/1/indexes/{indexName}/{objectID}'; $queryParams = []; $httpBody = []; + // path params if ($indexName !== null) { $resourcePath = str_replace( - '{' . 'indexName' . '}', + '{indexName}', ObjectSerializer::toPathValue($indexName), $resourcePath ); } + // path params if ($objectID !== null) { $resourcePath = str_replace( - '{' . 'objectID' . '}', + '{objectID}', ObjectSerializer::toPathValue($objectID), $resourcePath ); @@ -272,10 +274,11 @@ public function batch($indexName, $batchWriteParams) $resourcePath = '/1/indexes/{indexName}/batch'; $queryParams = []; $httpBody = []; + // path params if ($indexName !== null) { $resourcePath = str_replace( - '{' . 'indexName' . '}', + '{indexName}', ObjectSerializer::toPathValue($indexName), $resourcePath ); @@ -362,10 +365,11 @@ public function batchDictionaryEntries($dictionaryName, $batchDictionaryEntriesP $resourcePath = '/1/dictionaries/{dictionaryName}/batch'; $queryParams = []; $httpBody = []; + // path params if ($dictionaryName !== null) { $resourcePath = str_replace( - '{' . 'dictionaryName' . '}', + '{dictionaryName}', ObjectSerializer::toPathValue($dictionaryName), $resourcePath ); @@ -426,10 +430,11 @@ public function batchRules($indexName, $rule, $forwardToReplicas = null, $clearE $queryParams['clearExistingRules'] = $clearExistingRules; } } + // path params if ($indexName !== null) { $resourcePath = str_replace( - '{' . 'indexName' . '}', + '{indexName}', ObjectSerializer::toPathValue($indexName), $resourcePath ); @@ -462,10 +467,11 @@ public function browse($indexName, $browseRequest = null) $resourcePath = '/1/indexes/{indexName}/browse'; $queryParams = []; $httpBody = []; + // path params if ($indexName !== null) { $resourcePath = str_replace( - '{' . 'indexName' . '}', + '{indexName}', ObjectSerializer::toPathValue($indexName), $resourcePath ); @@ -508,10 +514,11 @@ public function clearAllSynonyms($indexName, $forwardToReplicas = null) $queryParams['forwardToReplicas'] = $forwardToReplicas; } } + // path params if ($indexName !== null) { $resourcePath = str_replace( - '{' . 'indexName' . '}', + '{indexName}', ObjectSerializer::toPathValue($indexName), $resourcePath ); @@ -539,10 +546,11 @@ public function clearObjects($indexName) $resourcePath = '/1/indexes/{indexName}/clear'; $queryParams = []; $httpBody = []; + // path params if ($indexName !== null) { $resourcePath = str_replace( - '{' . 'indexName' . '}', + '{indexName}', ObjectSerializer::toPathValue($indexName), $resourcePath ); @@ -581,10 +589,11 @@ public function clearRules($indexName, $forwardToReplicas = null) $queryParams['forwardToReplicas'] = $forwardToReplicas; } } + // path params if ($indexName !== null) { $resourcePath = str_replace( - '{' . 'indexName' . '}', + '{indexName}', ObjectSerializer::toPathValue($indexName), $resourcePath ); @@ -624,11 +633,12 @@ public function del($path, $parameters = null, $body = null) $queryParams['parameters'] = $parameters; } } + // path params if ($path !== null) { $resourcePath = str_replace( - '{' . 'path' . '}', - ObjectSerializer::toPathValue($path), + '{path}', + path, $resourcePath ); } @@ -659,10 +669,11 @@ public function deleteApiKey($key) $resourcePath = '/1/keys/{key}'; $queryParams = []; $httpBody = []; + // path params if ($key !== null) { $resourcePath = str_replace( - '{' . 'key' . '}', + '{key}', ObjectSerializer::toPathValue($key), $resourcePath ); @@ -697,10 +708,11 @@ public function deleteBy($indexName, $searchParams) $resourcePath = '/1/indexes/{indexName}/deleteByQuery'; $queryParams = []; $httpBody = []; + // path params if ($indexName !== null) { $resourcePath = str_replace( - '{' . 'indexName' . '}', + '{indexName}', ObjectSerializer::toPathValue($indexName), $resourcePath ); @@ -732,10 +744,11 @@ public function deleteIndex($indexName) $resourcePath = '/1/indexes/{indexName}'; $queryParams = []; $httpBody = []; + // path params if ($indexName !== null) { $resourcePath = str_replace( - '{' . 'indexName' . '}', + '{indexName}', ObjectSerializer::toPathValue($indexName), $resourcePath ); @@ -770,18 +783,20 @@ public function deleteObject($indexName, $objectID) $resourcePath = '/1/indexes/{indexName}/{objectID}'; $queryParams = []; $httpBody = []; + // path params if ($indexName !== null) { $resourcePath = str_replace( - '{' . 'indexName' . '}', + '{indexName}', ObjectSerializer::toPathValue($indexName), $resourcePath ); } + // path params if ($objectID !== null) { $resourcePath = str_replace( - '{' . 'objectID' . '}', + '{objectID}', ObjectSerializer::toPathValue($objectID), $resourcePath ); @@ -827,18 +842,20 @@ public function deleteRule($indexName, $objectID, $forwardToReplicas = null) $queryParams['forwardToReplicas'] = $forwardToReplicas; } } + // path params if ($indexName !== null) { $resourcePath = str_replace( - '{' . 'indexName' . '}', + '{indexName}', ObjectSerializer::toPathValue($indexName), $resourcePath ); } + // path params if ($objectID !== null) { $resourcePath = str_replace( - '{' . 'objectID' . '}', + '{objectID}', ObjectSerializer::toPathValue($objectID), $resourcePath ); @@ -866,10 +883,11 @@ public function deleteSource($source) $resourcePath = '/1/security/sources/{source}'; $queryParams = []; $httpBody = []; + // path params if ($source !== null) { $resourcePath = str_replace( - '{' . 'source' . '}', + '{source}', ObjectSerializer::toPathValue($source), $resourcePath ); @@ -915,18 +933,20 @@ public function deleteSynonym($indexName, $objectID, $forwardToReplicas = null) $queryParams['forwardToReplicas'] = $forwardToReplicas; } } + // path params if ($indexName !== null) { $resourcePath = str_replace( - '{' . 'indexName' . '}', + '{indexName}', ObjectSerializer::toPathValue($indexName), $resourcePath ); } + // path params if ($objectID !== null) { $resourcePath = str_replace( - '{' . 'objectID' . '}', + '{objectID}', ObjectSerializer::toPathValue($objectID), $resourcePath ); @@ -965,11 +985,12 @@ public function get($path, $parameters = null) $queryParams['parameters'] = $parameters; } } + // path params if ($path !== null) { $resourcePath = str_replace( - '{' . 'path' . '}', - ObjectSerializer::toPathValue($path), + '{path}', + path, $resourcePath ); } @@ -996,10 +1017,11 @@ public function getApiKey($key) $resourcePath = '/1/keys/{key}'; $queryParams = []; $httpBody = []; + // path params if ($key !== null) { $resourcePath = str_replace( - '{' . 'key' . '}', + '{key}', ObjectSerializer::toPathValue($key), $resourcePath ); @@ -1138,18 +1160,20 @@ public function getObject($indexName, $objectID, $attributesToRetrieve = null) $queryParams['attributesToRetrieve'] = $attributesToRetrieve; } } + // path params if ($indexName !== null) { $resourcePath = str_replace( - '{' . 'indexName' . '}', + '{indexName}', ObjectSerializer::toPathValue($indexName), $resourcePath ); } + // path params if ($objectID !== null) { $resourcePath = str_replace( - '{' . 'objectID' . '}', + '{objectID}', ObjectSerializer::toPathValue($objectID), $resourcePath ); @@ -1211,18 +1235,20 @@ public function getRule($indexName, $objectID) $resourcePath = '/1/indexes/{indexName}/rules/{objectID}'; $queryParams = []; $httpBody = []; + // path params if ($indexName !== null) { $resourcePath = str_replace( - '{' . 'indexName' . '}', + '{indexName}', ObjectSerializer::toPathValue($indexName), $resourcePath ); } + // path params if ($objectID !== null) { $resourcePath = str_replace( - '{' . 'objectID' . '}', + '{objectID}', ObjectSerializer::toPathValue($objectID), $resourcePath ); @@ -1250,10 +1276,11 @@ public function getSettings($indexName) $resourcePath = '/1/indexes/{indexName}/settings'; $queryParams = []; $httpBody = []; + // path params if ($indexName !== null) { $resourcePath = str_replace( - '{' . 'indexName' . '}', + '{indexName}', ObjectSerializer::toPathValue($indexName), $resourcePath ); @@ -1303,18 +1330,20 @@ public function getSynonym($indexName, $objectID) $resourcePath = '/1/indexes/{indexName}/synonyms/{objectID}'; $queryParams = []; $httpBody = []; + // path params if ($indexName !== null) { $resourcePath = str_replace( - '{' . 'indexName' . '}', + '{indexName}', ObjectSerializer::toPathValue($indexName), $resourcePath ); } + // path params if ($objectID !== null) { $resourcePath = str_replace( - '{' . 'objectID' . '}', + '{objectID}', ObjectSerializer::toPathValue($objectID), $resourcePath ); @@ -1349,18 +1378,20 @@ public function getTask($indexName, $taskID) $resourcePath = '/1/indexes/{indexName}/task/{taskID}'; $queryParams = []; $httpBody = []; + // path params if ($indexName !== null) { $resourcePath = str_replace( - '{' . 'indexName' . '}', + '{indexName}', ObjectSerializer::toPathValue($indexName), $resourcePath ); } + // path params if ($taskID !== null) { $resourcePath = str_replace( - '{' . 'taskID' . '}', + '{taskID}', ObjectSerializer::toPathValue($taskID), $resourcePath ); @@ -1406,10 +1437,11 @@ public function getUserId($userID) $resourcePath = '/1/clusters/mapping/{userID}'; $queryParams = []; $httpBody = []; + // path params if ($userID !== null) { $resourcePath = str_replace( - '{' . 'userID' . '}', + '{userID}', ObjectSerializer::toPathValue($userID), $resourcePath ); @@ -1617,10 +1649,11 @@ public function operationIndex($indexName, $operationIndexParams) $resourcePath = '/1/indexes/{indexName}/operation'; $queryParams = []; $httpBody = []; + // path params if ($indexName !== null) { $resourcePath = str_replace( - '{' . 'indexName' . '}', + '{indexName}', ObjectSerializer::toPathValue($indexName), $resourcePath ); @@ -1677,18 +1710,20 @@ public function partialUpdateObject($indexName, $objectID, $attributeOrBuiltInOp $queryParams['createIfNotExists'] = $createIfNotExists; } } + // path params if ($indexName !== null) { $resourcePath = str_replace( - '{' . 'indexName' . '}', + '{indexName}', ObjectSerializer::toPathValue($indexName), $resourcePath ); } + // path params if ($objectID !== null) { $resourcePath = str_replace( - '{' . 'objectID' . '}', + '{objectID}', ObjectSerializer::toPathValue($objectID), $resourcePath ); @@ -1732,11 +1767,12 @@ public function post($path, $parameters = null, $body = null) $queryParams['parameters'] = $parameters; } } + // path params if ($path !== null) { $resourcePath = str_replace( - '{' . 'path' . '}', - ObjectSerializer::toPathValue($path), + '{path}', + path, $resourcePath ); } @@ -1779,11 +1815,12 @@ public function put($path, $parameters = null, $body = null) $queryParams['parameters'] = $parameters; } } + // path params if ($path !== null) { $resourcePath = str_replace( - '{' . 'path' . '}', - ObjectSerializer::toPathValue($path), + '{path}', + path, $resourcePath ); } @@ -1817,10 +1854,11 @@ public function removeUserId($userID) $resourcePath = '/1/clusters/mapping/{userID}'; $queryParams = []; $httpBody = []; + // path params if ($userID !== null) { $resourcePath = str_replace( - '{' . 'userID' . '}', + '{userID}', ObjectSerializer::toPathValue($userID), $resourcePath ); @@ -1875,10 +1913,11 @@ public function restoreApiKey($key) $resourcePath = '/1/keys/{key}/restore'; $queryParams = []; $httpBody = []; + // path params if ($key !== null) { $resourcePath = str_replace( - '{' . 'key' . '}', + '{key}', ObjectSerializer::toPathValue($key), $resourcePath ); @@ -1913,10 +1952,11 @@ public function saveObject($indexName, $body) $resourcePath = '/1/indexes/{indexName}'; $queryParams = []; $httpBody = []; + // path params if ($indexName !== null) { $resourcePath = str_replace( - '{' . 'indexName' . '}', + '{indexName}', ObjectSerializer::toPathValue($indexName), $resourcePath ); @@ -1973,18 +2013,20 @@ public function saveRule($indexName, $objectID, $rule, $forwardToReplicas = null $queryParams['forwardToReplicas'] = $forwardToReplicas; } } + // path params if ($indexName !== null) { $resourcePath = str_replace( - '{' . 'indexName' . '}', + '{indexName}', ObjectSerializer::toPathValue($indexName), $resourcePath ); } + // path params if ($objectID !== null) { $resourcePath = str_replace( - '{' . 'objectID' . '}', + '{objectID}', ObjectSerializer::toPathValue($objectID), $resourcePath ); @@ -2041,18 +2083,20 @@ public function saveSynonym($indexName, $objectID, $synonymHit, $forwardToReplic $queryParams['forwardToReplicas'] = $forwardToReplicas; } } + // path params if ($indexName !== null) { $resourcePath = str_replace( - '{' . 'indexName' . '}', + '{indexName}', ObjectSerializer::toPathValue($indexName), $resourcePath ); } + // path params if ($objectID !== null) { $resourcePath = str_replace( - '{' . 'objectID' . '}', + '{objectID}', ObjectSerializer::toPathValue($objectID), $resourcePath ); @@ -2113,10 +2157,11 @@ public function saveSynonyms($indexName, $synonymHit, $forwardToReplicas = null, $queryParams['replaceExistingSynonyms'] = $replaceExistingSynonyms; } } + // path params if ($indexName !== null) { $resourcePath = str_replace( - '{' . 'indexName' . '}', + '{indexName}', ObjectSerializer::toPathValue($indexName), $resourcePath ); @@ -2155,10 +2200,11 @@ public function search($indexName, $searchParams) $resourcePath = '/1/indexes/{indexName}/query'; $queryParams = []; $httpBody = []; + // path params if ($indexName !== null) { $resourcePath = str_replace( - '{' . 'indexName' . '}', + '{indexName}', ObjectSerializer::toPathValue($indexName), $resourcePath ); @@ -2197,10 +2243,11 @@ public function searchDictionaryEntries($dictionaryName, $searchDictionaryEntrie $resourcePath = '/1/dictionaries/{dictionaryName}/search'; $queryParams = []; $httpBody = []; + // path params if ($dictionaryName !== null) { $resourcePath = str_replace( - '{' . 'dictionaryName' . '}', + '{dictionaryName}', ObjectSerializer::toPathValue($dictionaryName), $resourcePath ); @@ -2240,18 +2287,20 @@ public function searchForFacetValues($indexName, $facetName, $searchForFacetValu $resourcePath = '/1/indexes/{indexName}/facets/{facetName}/query'; $queryParams = []; $httpBody = []; + // path params if ($indexName !== null) { $resourcePath = str_replace( - '{' . 'indexName' . '}', + '{indexName}', ObjectSerializer::toPathValue($indexName), $resourcePath ); } + // path params if ($facetName !== null) { $resourcePath = str_replace( - '{' . 'facetName' . '}', + '{facetName}', ObjectSerializer::toPathValue($facetName), $resourcePath ); @@ -2290,10 +2339,11 @@ public function searchRules($indexName, $searchRulesParams) $resourcePath = '/1/indexes/{indexName}/rules/search'; $queryParams = []; $httpBody = []; + // path params if ($indexName !== null) { $resourcePath = str_replace( - '{' . 'indexName' . '}', + '{indexName}', ObjectSerializer::toPathValue($indexName), $resourcePath ); @@ -2369,10 +2419,11 @@ public function searchSynonyms($indexName, $query = '', $type = null, $page = 0, $queryParams['hitsPerPage'] = $hitsPerPage; } } + // path params if ($indexName !== null) { $resourcePath = str_replace( - '{' . 'indexName' . '}', + '{indexName}', ObjectSerializer::toPathValue($indexName), $resourcePath ); @@ -2472,10 +2523,11 @@ public function setSettings($indexName, $indexSettings, $forwardToReplicas = nul $queryParams['forwardToReplicas'] = $forwardToReplicas; } } + // path params if ($indexName !== null) { $resourcePath = str_replace( - '{' . 'indexName' . '}', + '{indexName}', ObjectSerializer::toPathValue($indexName), $resourcePath ); @@ -2514,10 +2566,11 @@ public function updateApiKey($key, $apiKey) $resourcePath = '/1/keys/{key}'; $queryParams = []; $httpBody = []; + // path params if ($key !== null) { $resourcePath = str_replace( - '{' . 'key' . '}', + '{key}', ObjectSerializer::toPathValue($key), $resourcePath );