Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -1340,7 +1340,7 @@ public okhttp3.Call batchRulesAsync(
* Build call for browse
*
* @param indexName The index in which to perform the request. (required)
* @param browseRequest (required)
* @param browseRequest (optional)
* @param _callback Callback for upload/download progress
* @return Call to execute
* @throws ApiException If fail to serialize the request body object
Expand Down Expand Up @@ -1413,13 +1413,6 @@ private okhttp3.Call browseValidateBeforeCall(
);
}

// verify the required parameter 'browseRequest' is set
if (browseRequest == null) {
throw new ApiException(
"Missing the required parameter 'browseRequest' when calling browse(Async)"
);
}

okhttp3.Call localVarCall = browseCall(indexName, browseRequest, _callback);
return localVarCall;
}
Expand All @@ -1434,7 +1427,7 @@ private okhttp3.Call browseValidateBeforeCall(
* has been reached, the cursor field is absent from the response.
*
* @param indexName The index in which to perform the request. (required)
* @param browseRequest (required)
* @param browseRequest (optional)
* @return BrowseResponse
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the
* response body
Expand Down Expand Up @@ -1467,7 +1460,7 @@ public BrowseResponse browse(String indexName, BrowseRequest browseRequest)
* has been reached, the cursor field is absent from the response.
*
* @param indexName The index in which to perform the request. (required)
* @param browseRequest (required)
* @param browseRequest (optional)
* @return ApiResponse<BrowseResponse>
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the
* response body
Expand Down Expand Up @@ -1505,7 +1498,7 @@ public ApiResponse<BrowseResponse> browseWithHttpInfo(
* response.
*
* @param indexName The index in which to perform the request. (required)
* @param browseRequest (required)
* @param browseRequest (optional)
* @param _callback The callback to be executed when the API call finishes
* @return The request call
* @throws ApiException If fail to process the API call, e.g. serializing the request body object
Expand Down Expand Up @@ -7426,7 +7419,7 @@ public okhttp3.Call searchDictionaryEntriesAsync(
*
* @param indexName The index in which to perform the request. (required)
* @param facetName The facet name. (required)
* @param searchForFacetValuesRequest (required)
* @param searchForFacetValuesRequest (optional)
* @param _callback Callback for upload/download progress
* @return Call to execute
* @throws ApiException If fail to serialize the request body object
Expand Down Expand Up @@ -7512,14 +7505,6 @@ private okhttp3.Call searchForFacetValuesValidateBeforeCall(
);
}

// verify the required parameter 'searchForFacetValuesRequest' is set
if (searchForFacetValuesRequest == null) {
throw new ApiException(
"Missing the required parameter 'searchForFacetValuesRequest' when calling" +
" searchForFacetValues(Async)"
);
}

okhttp3.Call localVarCall = searchForFacetValuesCall(
indexName,
facetName,
Expand All @@ -7535,7 +7520,7 @@ private okhttp3.Call searchForFacetValuesValidateBeforeCall(
*
* @param indexName The index in which to perform the request. (required)
* @param facetName The facet name. (required)
* @param searchForFacetValuesRequest (required)
* @param searchForFacetValuesRequest (optional)
* @return SearchForFacetValuesResponse
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the
* response body
Expand Down Expand Up @@ -7568,7 +7553,7 @@ public SearchForFacetValuesResponse searchForFacetValues(
*
* @param indexName The index in which to perform the request. (required)
* @param facetName The facet name. (required)
* @param searchForFacetValuesRequest (required)
* @param searchForFacetValuesRequest (optional)
* @return ApiResponse&lt;SearchForFacetValuesResponse&gt;
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the
* response body
Expand Down Expand Up @@ -7605,7 +7590,7 @@ public ApiResponse<SearchForFacetValuesResponse> searchForFacetValuesWithHttpInf
*
* @param indexName The index in which to perform the request. (required)
* @param facetName The facet name. (required)
* @param searchForFacetValuesRequest (required)
* @param searchForFacetValuesRequest (optional)
* @param _callback The callback to be executed when the API call finishes
* @return The request call
* @throws ApiException If fail to process the API call, e.g. serializing the request body object
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -443,7 +443,7 @@ export class SearchApi {
*/
browse(
indexName: string,
browseRequest: BrowseRequest
browseRequest?: BrowseRequest
): Promise<BrowseResponse> {
const path = '/1/indexes/{indexName}/browse'.replace(
'{indexName}',
Expand All @@ -458,12 +458,6 @@ export class SearchApi {
);
}

if (browseRequest === null || browseRequest === undefined) {
throw new Error(
'Required parameter browseRequest was null or undefined when calling browse.'
);
}

const request: Request = {
method: 'POST',
path,
Expand Down Expand Up @@ -1698,7 +1692,7 @@ export class SearchApi {
searchForFacetValues(
indexName: string,
facetName: string,
searchForFacetValuesRequest: SearchForFacetValuesRequest
searchForFacetValuesRequest?: SearchForFacetValuesRequest
): Promise<SearchForFacetValuesResponse> {
const path = '/1/indexes/{indexName}/facets/{facetName}/query'
.replace('{indexName}', encodeURIComponent(String(indexName)))
Expand All @@ -1718,15 +1712,6 @@ export class SearchApi {
);
}

if (
searchForFacetValuesRequest === null ||
searchForFacetValuesRequest === undefined
) {
throw new Error(
'Required parameter searchForFacetValuesRequest was null or undefined when calling searchForFacetValues.'
);
}

const request: Request = {
method: 'POST',
path,
Expand Down
1 change: 0 additions & 1 deletion specs/search/paths/search/browse.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ post:
parameters:
- $ref: '../../../common/parameters.yml#/IndexName'
requestBody:
required: true
content:
application/json:
schema:
Expand Down
1 change: 0 additions & 1 deletion specs/search/paths/search/searchForFacetValues.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ post:
schema:
type: string
requestBody:
required: true
content:
application/json:
schema:
Expand Down
188 changes: 188 additions & 0 deletions tests/CTS/clients/recommend/getRecommendations.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,188 @@
[
{
"method": "getRecommendations",
"testName": "get recommendations with minimal parameters",
"parameters": [
{
"requests": [
{
"indexName": "indexName",
"objectID": "objectID",
"model": "related-products",
"threshold": 42
}
]
}
],
"request": {
"path": "/1/indexes/*/recommendations",
"method": "POST",
"data": {
"requests": [
{
"indexName": "indexName",
"objectID": "objectID",
"model": "related-products",
"threshold": 42
}
]
}
}
},
{
"method": "getRecommendations",
"testName": "get recommendations with all parameters",
"parameters": [
{
"requests": [
{
"indexName": "indexName",
"objectID": "objectID",
"model": "related-products",
"threshold": 42,
"queryParameters": { "facetFilters": ["query"] },
"fallbackParameters": { "facetFilters": ["fallback"] }
}
]
}
],
"request": {
"path": "/1/indexes/*/recommendations",
"method": "POST",
"data": {
"requests": [
{
"indexName": "indexName",
"objectID": "objectID",
"model": "related-products",
"threshold": 42,
"queryParameters": { "facetFilters": ["query"] },
"fallbackParameters": { "facetFilters": ["fallback"] }
}
]
}
}
},
{
"method": "getRecommendations",
"testName": "get multiple recommendations with minimal parameters",
"parameters": [
{
"requests": [
{
"indexName": "indexName1",
"objectID": "objectID1",
"model": "related-products",
"threshold": 21
},
{
"indexName": "indexName2",
"objectID": "objectID2",
"model": "related-products",
"threshold": 21
}
]
}
],
"request": {
"path": "/1/indexes/*/recommendations",
"method": "POST",
"data": {
"requests": [
{
"indexName": "indexName1",
"objectID": "objectID1",
"model": "related-products",
"threshold": 21
},
{
"indexName": "indexName2",
"objectID": "objectID2",
"model": "related-products",
"threshold": 21
}
]
}
}
},
{
"method": "getRecommendations",
"testName": "get multiple recommendations with all parameters",
"parameters": [
{
"requests": [
{
"indexName": "indexName1",
"objectID": "objectID1",
"model": "related-products",
"threshold": 21,
"queryParameters": { "facetFilters": ["query1"] },
"fallbackParameters": { "facetFilters": ["fallback1"] }
},
{
"indexName": "indexName2",
"objectID": "objectID2",
"model": "related-products",
"threshold": 21,
"queryParameters": { "facetFilters": ["query2"] },
"fallbackParameters": { "facetFilters": ["fallback2"] }
}
]
}
],
"request": {
"path": "/1/indexes/*/recommendations",
"method": "POST",
"data": {
"requests": [
{
"indexName": "indexName1",
"objectID": "objectID1",
"model": "related-products",
"threshold": 21,
"queryParameters": { "facetFilters": ["query1"] },
"fallbackParameters": { "facetFilters": ["fallback1"] }
},
{
"indexName": "indexName2",
"objectID": "objectID2",
"model": "related-products",
"threshold": 21,
"queryParameters": { "facetFilters": ["query2"] },
"fallbackParameters": { "facetFilters": ["fallback2"] }
}
]
}
}
},
{
"method": "getRecommendations",
"testName": "get frequently bought together recommendations",
"parameters": [
{
"requests": [
{
"indexName": "indexName1",
"objectID": "objectID1",
"model": "bought-together",
"threshold": 42
}
]
}
],
"request": {
"path": "/1/indexes/*/recommendations",
"method": "POST",
"data": {
"requests": [
{
"indexName": "indexName1",
"objectID": "objectID1",
"model": "bought-together",
"threshold": 42
}
]
}
}
}
]
Loading